Compare commits

...

5450 Commits

Author SHA1 Message Date
Michael Mueller
2b695b2392 Merged refactored sandbox library with upstream. 2025-01-21 18:31:53 +01:00
Michael Mueller
504bc57806 Merge branch 'ealan' into genode-24 2025-01-21 18:31:08 +01:00
Michael Mueller
93595efd44 MxIP platform support package. 2025-01-21 15:31:16 +01:00
Michael Mueller
52d5a3d19e Compile nic_router with -O3. 2025-01-21 15:28:06 +01:00
Michael Mueller
65f6af0415 Added method to determine wether a cell is a brick or not. 2025-01-21 15:26:30 +01:00
Michael Mueller
ce1dea524b Increased buffer size for uplink session. 2025-01-21 15:25:34 +01:00
Michael Mueller
c1fe8673e2 Applied fix from discord forum to fix AHCI reset bug to make AHCI drives visible to the system. 2025-01-21 15:24:53 +01:00
Michael Mueller
afce79da8a Allow test-ahci-atapi to write to device in block test scenario. 2025-01-21 15:23:31 +01:00
Michael Mueller
fd4aea9def Added support for bricks, i.e. static resource containers. 2025-01-21 15:22:24 +01:00
Michael Mueller
991dd5e6c5 Added experimental lock-free MPMC queue as packet queue implementation. 2025-01-21 15:20:57 +01:00
Michael Mueller
7535440e79 Avoid argument parser in blinktree server for now. 2025-01-21 15:19:32 +01:00
Michael Mueller
dd41406bcd Use MxIP for blinktree server. 2025-01-21 15:19:02 +01:00
Michael Mueller
0eacac72e5 Made volatile cell component compilable again. 2025-01-21 15:16:28 +01:00
Michael Mueller
9979d7596e Rewrote raw_nic to use lwIP. 2025-01-21 15:15:58 +01:00
Michael Mueller
d632954bbf Reset channel usage prediction when resuming MxTasking. 2025-01-21 15:15:19 +01:00
Michael Mueller
d776f038b2 Updated scenario for VSCode dry-run. 2025-01-21 15:14:34 +01:00
Michael Mueller
cabb9b13c4 Start drivers as sub-components of Hoitaja. 2025-01-21 15:13:29 +01:00
Michael Mueller
8310cf0530 Increased font size in VSCode. 2025-01-21 15:12:32 +01:00
Michael Mueller
e999d08c12 Introducing MxIP as a lwIP-based library for user-space networking. 2025-01-21 15:12:03 +01:00
Michael Mueller
0daf335dc2 Changed lwIP parameters to improve performance. 2025-01-21 15:09:40 +01:00
Michael Mueller
911f29bcf2 Increased RAM for drivers and added TOPO service to config. 2025-01-21 15:09:02 +01:00
Michael Mueller
e0eabd9d7c Changed serial port number for log output. 2025-01-21 15:08:24 +01:00
Michael Mueller
fb20e83fc4 Updated hashes. 2025-01-21 15:07:58 +01:00
Michael Mueller
a271e98cfb Removed debug output. 2025-01-21 15:06:12 +01:00
Michael Müller
9c51d3aefc Merge branch 'genodelabs:master' into master 2025-01-21 15:00:29 +01:00
Christian Helmuth
cd6701c483 depot: update recipe hashes 2024-12-11 08:35:22 +01:00
Norman Feske
60d009e6c6 nitpicker: notify clients on any panorama change
Nitpicker used to notify GUI clients about an updated GUI info only when
the total panorama size changed. However, in situations where two
capture clients are swapped, the total size may stay the same whereas
the relation of displays to different parts of the panorama is no longer the
same. Such changes are interesting to some clients like the window layouter,
which needs to update the assignement of screens to displays.

This patch changes nitpicker so that each panorama change is reflected
to GUI clients as a mode-info update.

Issue #5390
2024-12-10 14:12:24 +01:00
Alexander Boettcher
d0522706ba nova: avoid false pager assertion
Fixes #5399
2024-12-10 14:12:24 +01:00
Christian Helmuth
7f8db06284 Complete removal of tool/sdk approach
The SDK approach introduced in #2948 was superseded by Goa.

Issue #4446
2024-12-10 14:12:24 +01:00
Norman Feske
0749f8cbdf wm: free content view IDs if decorator disappears
This patch fixes the following error message printed by the wm upon the
restart of a decorator.

  Error: freeing non-empty slab block"
  Error: ID space not empty at destruction time

Fortunately, the error is not critical as the backing store is released
along with the session.
2024-12-10 14:12:24 +01:00
Norman Feske
1ddbb3444c sculpt/nitpicker: use label for matching decorator
The 'label_suffix=" -> decorator"' rule is weaker than the
more generic 'label_prefix="runtime -> wm"' rule, to the effect that the
decorator is assigned to the "desktop" domain instead of the "decorator"
domain. Replace the 'label_prefix' by the decorator's concrete label
to resolve this ambiguity.
2024-12-10 14:12:24 +01:00
Alexander Boettcher
4da68e11b6 tool: support to set menuentry of GRUB
manually to self chosen value, by overwritting the tcl procedure
grub_menuentry, e.g.:

proc grub_menuentry { } { return "'My OS' --option_of_your_choice " }

Fix #5398
2024-12-10 14:12:24 +01:00
Christian Helmuth
5665e8059a Optional session label in audio_in/out connection 2024-12-10 14:12:24 +01:00
Norman Feske
3067a2c51d nitpicker: prevent the pointer from going nowhere
The 'size_changed' handling remained without effect when the (last)
display re-appears (e.g., back from screen blank) because
'Capture_root::bounding_box()' delivered the '_fallback_bounding_box'
in the intermediate phase where no display was present. Unfortunately,
'Capture_root::visible()' failed to apply the same logic. This patch
makes 'visible()' consistent with 'bounding_box()'. It has the
welcome effect that nitpicker remembers the pointer position during
the dark phase.

Fixes #5397
2024-12-10 14:12:24 +01:00
Christian Helmuth
1d73cf2003 Prevent false warnings in memcpy (GCC 12)
GCC 12 tree-loop-distribute-patterns generates false warnings of
-Warray-bounds, -Wstringop-overflow, or -Wstringop-overread in memcpy()
and memcpy_cpu() in static/inline cases for code that obviously prevents
its execution by invariant checking. On -O3, even more warnings are
produced.
2024-12-10 14:12:24 +01:00
Norman Feske
010847b69c decorator: fix sync-handling corner case
This patch fixes the corner case where a call of 'trigger_gui_sync'
unexpectedly did not result in the execution of '_handle_gui_sync'.
When sporadically called (w/o having installed a period sync handler)
in a time window shortly after a previous '_handle_gui_sync' that just
switched back to sporadic mode, the situation was considered as !idle.
So the 'local_submit' was skipped.

The patch fixes the issue by always issuing a 'local_submit' except when
operating in period mode. The '_gui_sync_enabled' state is now driven
only by '_handle_gui_sync' to make the intent more clear.

Fixes #5396
2024-12-10 14:12:24 +01:00
Josef Söntgen
96d9f5d317 usb: consider alternate setting in endpoint select
When constructing an Usb::Interface and implicitly corresponding
Usb::Endpoint instances only select endpoints relevant for the
given alternate setting.

The libusb has to be changed to delegate the correct alternate
setting to the constructor too.

Fix genodelabs/genode#5394
2024-12-10 14:12:24 +01:00
Alexander Boettcher
97e638a2ac intel/display: avoid mode detection in irq task
On hotplug, the C++ side of the driver now gets just notified,
without any further detection.

On the C++ side, now specific actions are scheduled explicitly, which will be
executed step by step. New appearing actions will be queued and are
not eligible to run before the former actions of the list are processed.

Fixe #5392
2024-12-10 14:12:24 +01:00
Alexander Boettcher
ba013af1a3 sculpt_manager: handle manual fb config w/o mirror
config node gracefully. If no mirror is set, ever claim one entry
as the mirrored one. Without this change, the current effect is that
the UI does not allow to merge one of the discrete modes.

Issue #5392
2024-12-10 14:11:57 +01:00
Alexander Boettcher
e520dbbb7e nova: avoid assertion during SC cleanup
Regression introduced in Issue #5314

Fixes #5391
2024-12-10 14:11:57 +01:00
Norman Feske
7928597249 doc: remove docs covered by the Genode books
Foster the Genode books as a single point of reference for Genode's
documentation. E.g., the Getting-Started section of the "Genode
Foundations" book has long obsoleted doc/getting_started.txt. This
patch also remove long orphaned texts like gsoc_2012.txt. The approach
described in the porting guide has now been replaced by the Goa SDK.

The Genode books can be downloaded at the genode.org website. Like
Genode, they are open source. All text is licensed as CC-BY-SA and
can be found at https://github.com/nfeske/genode-manual

Fixes #5393
2024-12-10 14:11:57 +01:00
Norman Feske
979aaed52b doc: merge coding_style.txt into conventions.txt
Issue #5393
2024-12-10 14:11:57 +01:00
Christian Helmuth
f2c25383af acpi_event: prevent misleading warning about PRESS_RELEASE 2024-12-10 14:11:57 +01:00
Alice Domage
e384381942 tool/run/image/uboot: provide dtb for FIT images
Our new U-BOOT for the imx8mp_iot_gate complains about the size
of the device tree being zero bytes. This is because it no longer
provides the kernel boot arguments via ATAGS, but passes them via
by injecting them in the flattened device tree..

This commit adds a minimal dtb file to the FIT image to satisfy U-BOOT.

Issue  #5354
2024-12-10 14:11:57 +01:00
Stefan Kalkowski
b529b1eac6 qemu-usb: prevent assertion by eager URB processing
Instead of directly process URBs whenever a USBPacket arrives from
the Qemu ported XHCI layer, send a local signal to the I/O handler,
which will process the requests after leaving certain sensible
code pathes like usb_packet_complete. Otherwise, it might happen
that a packet, which was still marked as being queued gets already
completed, which leads to an assertion and hang of the library.

Fix genodelabs/genode#5389
2024-12-10 14:11:57 +01:00
Benjamin Lamowski
b21c8729ea base: provide core_ram_allocator via platform_add_local_services()
This is a prerequisite to rework the allocation of core data structures
for VM sessions in hw.

Issue #5221
2024-12-10 14:11:57 +01:00
Norman Feske
d5f3cc6ec2 terminal: ignore input without valid GUI mode
This prevents the potential corner case where the terminal receives input
at a time when the window has no valid size and _text_screen_surface is
not constructed.
2024-11-27 13:37:34 +01:00
Stefan Kalkowski
4730312c1e hw: register state and backtrace when core faults
If one of core's threads is causing an MMU fault, dump the
register state and stack backtrace of the faulting stack to
aid debugging.

Fix genodelabs/genode#5387
2024-11-27 13:33:24 +01:00
Stefan Kalkowski
cc2bcee417 tool/run: create debug files for backtrace of core
When building ELF binaries of core and bootstrap for a run scenario,
also create the *.core.debug file to be able to use the tool/backtrace
utility.

Ref genodelabs/genode#5387
2024-11-27 13:33:24 +01:00
Johannes Schlatow
2c2fb6b70e tool/run: add intel_hwp config to boot_dir/hw
Fixes #5388
2024-11-27 13:33:24 +01:00
Alexander Boettcher
b50bbef303 tool: support meshcmd as AMT alternative tool
which may be used as alternative for

- AMT log grabbing, default: amtterm
- AMT power cycling, default: wsman, alternative: amttool

https://www.meshcommander.com
https://github.com/Ylianst/MeshCommander
https://www.intel.com/content/www/us/en/developer/articles/news/meshcmd-new-intel-amt-command-line-tool.html
2024-11-26 18:17:41 +01:00
Christian Prochaska
35a679d861 libc: pthread cond/rwlock improvements
- add a check to detect if a different thread has
  initialized the internal object in the meantime
- remove ENOMEM error since the 'Libc::Allocator'
  is not supposed to throw exceptions
- remove init mutex from 'pthread_condattr_init()'
  since there is no implicit initialization which
  could happen in parallel like with mutex/cond/rwlock

Issue #5386
2024-11-26 01:08:19 +01:00
Christian Prochaska
37842757ac libc: synchronize implicit pthread mutex initialization
Fixes #5386
2024-11-26 01:08:15 +01:00
Norman Feske
fa9473ce58 doc/release_notes/24-11.txt: minor style fixes 2024-11-22 18:17:24 +01:00
Christian Helmuth
873386f8a1 version: 24.11 2024-11-22 13:37:12 +01:00
Norman Feske
2b18913782 News item for version 24.11 2024-11-22 13:34:49 +01:00
Norman Feske
fb7fa915c6 Release notes for version 24.11 2024-11-22 13:34:49 +01:00
Christian Helmuth
011b44c282 depot: update recipe hashes 2024-11-20 08:58:39 +01:00
Norman Feske
a3193b919c terminal: survive malformed dynamic re-config 2024-11-20 08:58:39 +01:00
Norman Feske
798b49fcc3 vfs server: survive malformed dynamic re-config
The VFS server used to respond to any invalid config by exiting.
By disregarding such configurations instead, this patch makes the VFS
server robust against temporary malconfiguration.
2024-11-20 08:58:39 +01:00
Roman Iten
d095945d6c fs_rom: clear dataspace if lookup failed
Issue #3897
2024-11-20 08:58:39 +01:00
Norman Feske
9e4b27a829 fs_rom: use dataspace bounds for clearing
Avoid potential risk of exceeding the dataspace bounds should the stored
file size be larger than the current ds size.

Issue #3897
2024-11-20 08:58:39 +01:00
Norman Feske
4d7a5b6829 base: add Attached_dataspace::clear()
This alleviates the need (and risk) of manually parametrizing 'memset'
whenever the entire dataspace shall be cleared.

Issue #3897
2024-11-20 08:58:39 +01:00
Norman Feske
7019b795a6 tool/run: tolerate absence of load_spawn_id
Avoid backtrace in error message if load/fastboot fails at the
boot-loader stage.
2024-11-20 08:58:39 +01:00
Norman Feske
3bb894370a tool/run/load/fastboot: detect fastboot driver
Replace the unconditional sleep "until the board comes up" by the
detection of the fastboot-driver message. This shortens the total boot
time and reveals U-boots initial output, e.g., messages reporting
trouble with bringing up the fastboot driver.
2024-11-20 08:58:39 +01:00
Norman Feske
9e5e648073 tool/run/load/fastboot: case-insensitive match
The success messages of different versions of the fastboot tool
are printed in different upper/lower case. Tolerate both.

The patch also removes a few superfluous semicolons.
2024-11-20 08:58:39 +01:00
Norman Feske
14e3339ce6 base-hw: remove outdated comment 2024-11-20 08:58:39 +01:00
Benjamin Lamowski
b05b7f17f3 sculpt_manager: bump editor default quota for large fonts and 4k
When trying to open a file in the Files view with font size set to
Large on 4k screens, the editor's / `text_area`'s `view` child fails to
bump its RAM quota when the editor's default quota is too small.

To mitigate the issue, bump the editor's default quota to 80MiB.
The long-term fix would be for the editor to request more RAM from the
runtime to satisfy the `view` RAM request.

Issue #5356
Issue #5383
2024-11-20 08:58:39 +01:00
Benjamin Lamowski
f6a1956a30 sculpt_manager: bump quota boost limit for runtime_view
When using the Files view with font size set to Large, the boosted
runtime_view limit of 64MiB is still not enough for 4k screens.

Double the RAM boost limit to 128MiB.

Issue #5356
2024-11-20 08:58:39 +01:00
Josef Söntgen
59d951ed6a sculpt_manager: start fb on second CPU on Pocket
With this commit the fb driver is started on the second CPU on the
MNT Pocket Reform to decouple it from the other components started
on the first CPU during the system's boot-up and mitigates bring-up
issues with this driver that result in an often non-working display.

Issue #5378.
2024-11-20 08:58:39 +01:00
Josef Söntgen
fe008e0884 sculpt_manager: allow decoupling fb from first cpu
This commit allows for expressing the intent to start the fb driver
on a different CPU.

Issue #5378.
2024-11-20 08:58:39 +01:00
Josef Söntgen
f72fdf77ed sculpt_manager: set affinity for child
With this commit it is possible to specify the affinity for components
directly managed by Sculpt, like drivers.
2024-11-20 08:58:39 +01:00
Josef Söntgen
0f70cbd704 sculpt_manager: query affinity-space immediately 2024-11-20 08:58:39 +01:00
Norman Feske
6e2a7e979e tool/run/log/serial: be quiet by default
As the initial output of picocom is hardly ever needed, disable it by
default to reduce the log noise. Whenever needed, the output can still
be enabled by specifying the run tool's --log-serial-cmd.
2024-11-20 08:58:39 +01:00
Norman Feske
0eefe2d872 gems/vfs_font: improve glyph bb sanity check
Issue #5374
2024-11-20 08:58:39 +01:00
Norman Feske
052dd903a4 base-hw: rm C++ exception from syscall dispatcher
This patch removes the only residual C++ exception from the kernel part
of core, eliminating the risk of the kernel thread trying to enter the
kernel itself via the C++ exception-handling path. When throwing an
exception, __cxa_allocate_exception invokes the cxx_heap, which
synchronizes accesses via a Genode::Mutex. In the contention case,
the blocking of the mutex issues a syscall to pause the caller.
The patch fixes the problem by replacing the exception with a return
value.

Fixes #5382
Issue #5245
2024-11-20 08:58:39 +01:00
Stefan Kalkowski
591aadea54 lx_emul: take usb device lock before resetting it
Fix genodelabs/genode#5381
2024-11-20 08:58:39 +01:00
Alexander Boettcher
28542e66ab nova: support resume on AVX CPUs
Issue #5314
2024-11-20 08:58:39 +01:00
Stefan Kalkowski
ed2d9fef47 hw: do not flush core/kernel's page-tables
Fix genodelabs/genode#5380
2024-11-20 08:58:39 +01:00
Stefan Kalkowski
7dbc9129db hw: detach UTCB from core PD in thread destruction
Ref genodelabs/genode#5380
2024-11-20 08:58:39 +01:00
Stefan Kalkowski
9a7fe5e775 hw: implement Core_region_map::detach
Ref genodelabs/genode#5380
2024-11-20 08:56:48 +01:00
Josef Söntgen
79ab0cf98e ports: remove sub-init from vbox6 pkgs
Using a sub-init is no longer necessary and simplifies the runtime
configuration.
2024-11-20 08:56:48 +01:00
Norman Feske
dfd373fa0c depot/build: check bin against src if REBUILD=
When using the depot/build tool with the 'REBUILD=' argument as done by
the run tool's --depot-auto-update feature, the depot/build tool now
checks that an existing bin archive was indeed created via the src and
api archives present in the depot for the given version. This addresses
consistency issues when switching between different git branches that
refer to the same depot versions but with different content.

Fixes #5379
2024-11-20 08:55:49 +01:00
Norman Feske
b510394a6d depot/build_bin_archive: keep hash of ingredients
This patch records the content hashes of the src and api ingredients
used for creating a bin archive. This information allows for the
detection of possible inconsistencies between a bin archive and its
corresponding src archive within the depot.

Issue #5379
2024-11-20 08:55:49 +01:00
Norman Feske
4a5f80ddbf tool/depot/extract: annotate version with src hash
When extracting depot archives from the source tree, retain the content
hash of the extracted information along the archive in <version>.hash
file. The .hash files of src and api archives become thereby usable for
checking the consistency of bin archives with their ingredients.

Issue #5379
2024-11-20 08:55:49 +01:00
Norman Feske
7fb702a0d9 tool/run: exit gracefully if depot/create failed
With --depot-auto-update enabled, the run tool calls the depot/create
tool, which in principle may fail. In this case, print a diagnostic info
instead of a backtrace.

Issue #5379
2024-11-20 08:55:49 +01:00
Josef Söntgen
1f225b4b6f gpu/intel: use fixed aperture size for GPU service
This commit adapts the aperture splitting between the GPU multiplexer
and the display driver where the former now always tries to reserve
32 MiB of aperture space for itself instead of limiting the space
for the display driver. In case the aperture is not large enough
the display driver takes precedence and the GPU service has to make
do with remaining space. In the worst case that renders the GPU
service unusable.

Issue #5377.
2024-11-20 08:55:49 +01:00
Christian Helmuth
d104ca0561 intel/display: adapt README to current implementation 2024-11-20 08:55:49 +01:00
Alexander Boettcher
728ea95857 intel/display: improve mirror/discrete reporting
Don't try to decide based on the hardware state, in which mode a
connector is used. If a previous configuration failed, e.g. -ENOSPC,
the detection whether the mirrored framebuffer is in use may fail
and the connectors are reported wrongly as discrete.

During modeset traversal take the appropriate lock to synchronize irq and
user task, which may be de-scheduled by Linux code when invoking contrib
code.

Issue #5377
2024-11-20 08:55:49 +01:00
Michael Müller
5551f96c2d Merge branch 'genodelabs:master' into master 2024-11-18 12:17:16 +01:00
Michael Mueller
d2aaffbd4e Simple example for using CiAO/IP as userspace IP stack. 2024-11-14 15:13:01 +01:00
Michael Mueller
17c728308d Add target triple for CiAO/IP. 2024-11-12 15:33:44 +01:00
Michael Mueller
c038af6729 Port file and hash for CiAO/IP. 2024-11-12 15:17:38 +01:00
Alexander Boettcher
188080e15f intel/display: add i915_gem_evict_for_node
When the aperture is close to full or such fragmented, this unimplemented
function may be invoked.

Fixes #5377
2024-11-08 16:45:51 +01:00
Alexander Boettcher
6f5bcd4446 intel/display: check for mappable framebuffer
The driver code may allocate framebuffers which do not fit in the aperture.
Trying to use such framebuffer may lead to only partial visible content
on the screen and the rest either black or garbage.

Instead check for this circumstance and deny to use such framebuffers and
release them, since the user would get an unusable/hard to interpret state.
Additionally, release the vma mappings earlier in order to reduce the likelihood
of such un-mappable framebuffers.

Issue #5377
2024-11-08 16:45:48 +01:00
Josef Söntgen
7fe7ca1968 driver/wifi: provide best practices in README 2024-11-08 16:11:03 +01:00
Norman Feske
dffa32a72c menu_view: don't skip frames after idle
When updating a dialog after a prolonged idle time with no active
animatons, the next _handle_gui_sync would wrongly fast-forward
animations for all the frames passed since the last _handle_gui_sync. On
the PinePhone, this effect is clearly visible when switching between the
main section. The GUI jumps from one state to another instead of
transitioning. This patch solves the issue be resetting '_previous_sync'
when waking up from idle.

Related to issue #5347
2024-11-07 16:11:10 +01:00
Stefan Kalkowski
f886acdcc6 qemu-usb: limit control transfer to 1 sec timeout
Fix genodelabs/genode#5376
2024-11-05 14:39:10 +01:00
Christian Helmuth
0794d99eff depot: update recipe hashes 2024-11-05 13:41:07 +01:00
Norman Feske
fdd2b4edb0 sculpt: restart depot_rom on use/unuse
Large deployments (e.g., using the Falkon browser) can significantly
inflate the RAM quota of depot_rom. When switching the Sculpt storage
target (using the "Use" buttons), depot_rom is restarted. Right now,
however, it retains its (inflated) quota. It is better to reset the
quota to its initial value to free up RAM that thereby becomes usable
for a different deployment. Otherwise, the depot_rom's resources can be
deflated only by rebooting.
2024-11-05 12:03:17 +01:00
Norman Feske
8d50d320e2 nitpicker: drop superfluous abs motion events
This patch fixes focus-follows-mouse problem reported for Sculpt 24.10
when using no (operational) backdrop.

In the absence of a background, nitpicker wrongly delivered absolute
motion events to the most recently hovered client even after leaving the
client's area to a area occupied by no client. These motion events, in
turn, confused the internal consistency of the window managers
enter/leave tracking.

Fixes #5375
2024-11-05 12:03:17 +01:00
Norman Feske
ec1316e1cb gems/vfs_font: sanity-check glyph against font bb
When using the fonts_fs, the geometry of individual glyphs can change
potentially at any time, after having obtained font-global constraints
once. In particular, a glyph can exceed the bounding box of the font
cell. The VFS font utility must take safety precautions against such
violations.

Fixes #5374
2024-11-05 12:03:17 +01:00
Norman Feske
cb5eb740c0 tool/create_builddir: prepend board-specific repos
Board-specific repositories must appear before generic repositories
(i.e., gems) in 'REPOSITORIES' to select board-specific sculpt/
configuration snippets over the defaults provided by gems. When listing
the board-specific repositories last, Sculpt images for the PinePhone or
MNT Reform may wrongly include launchers and presets of the PC version.
2024-10-30 15:07:55 +01:00
Norman Feske
05fd121975 News item for Sculpt 24.10
Issue #5356
2024-10-30 14:35:00 +01:00
Christian Helmuth
30f3ef25ad depot: update recipe hashes 2024-10-30 14:02:44 +01:00
Alexander Boettcher
e9fb2d89fb sculpt: use 96M for display aperture to support 4k
Swapping a 4k monitor between discrete and mirror mode will consume
temporarily at least 32M * 2 (3840 * 2160 * 4 Bytes), so that the
default value of 64M for the aperture is insufficient in addition to
interal display on a notebook. The commit mitigates that the
i915_gem_evict_for_node unimplemented error does not trigger immediately.

Issue #5356
2024-10-30 13:43:19 +01:00
Norman Feske
7f1a6e55f3 sculpt: update README for version 24.10
Issue #5356
2024-10-30 13:43:19 +01:00
Stefan Kalkowski
cf84787c09 sculpt_image: add MNT Pocket as target board
Issue genodelabs/genode#5360.
2024-10-30 08:14:56 +01:00
Norman Feske
324245d029 sculpt: restrict un-merging of fb connectors
In setups with 3 or more displays, allow the un-merging of connectors
only for the last mirrored connector. Otherwise, the operation would
implicitely change the order of connectors because the new discrete
connector needs appear after all merged connectors.

Issue #5286
2024-10-30 08:14:56 +01:00
Josef Söntgen
2d3170124d phone_manager: ignore AP list hovered temporarily
The access-point-list hovered state prevents preseting the available
scan results, which currently can happen unintentionally. This commit
hot-wires the hover handling and thus will always show and update the
list.  New scan results are received every few seconds and it could
happen that the list changes while the user selects a network (that's
what the original implementation guards against).

Issue #5369.
2024-10-30 08:14:56 +01:00
Norman Feske
aafd03ee74 nitpicker: validate pointer pos after reconfig
Since the panorama depends on the config, nitpicker needs to re-evaluate
the validity of the pointer position after each reconfiguration. If the
pointer position is no longer visible, pick a new visible one.

Issue #5352
2024-10-30 08:14:56 +01:00
Norman Feske
baedd79f62 sculpt_manager: fb unplug, sanitize conn. model
This patch explicitly handles the unplugging of displays, avoiding the
use of stale connectors for defining the panorama. It also makes the
import of the connectors model robust against intermediate states
reported by the driver (a connector reported as connector but without
any mode), and discards the use of any information of non-present
connectors as merge info.

Issue #5286
2024-10-30 08:14:56 +01:00
Christian Prochaska
e1909da501 qt: apply a label to the QGenodeScreen Gui session
Fixes #5372
2024-10-30 08:14:56 +01:00
Norman Feske
1660dc0635 sculpt: use icons for fb swap and merge/unmerge
Issue #5286
2024-10-30 08:14:56 +01:00
Norman Feske
c9015d6076 sculpt: prevent disabling the hovered display
Issue #5370
2024-10-30 08:14:56 +01:00
Norman Feske
da6124c087 nitpicker: allow pointer move along screen edges
Issue #5352
2024-10-30 08:14:56 +01:00
Norman Feske
732f310b26 menu_view: update dialog when min w/h changes
The minimum width/height of a dialog is not specified in the dialog ROM
but in the menu_view configuration. So the regular dialog-ROM update
handling fails to captures dynamic changes of the minimum w/h. In
Sculpt, the panel would not always adjust immediately to a new screen
size.

This patch triggers a dialog update when detecting such configuration
changes (min w/h, opaqueness, background color).

Issue #5370
2024-10-30 08:14:56 +01:00
Norman Feske
9ad7111634 sculpt: let leitzentrale follow the pointer
This patch places the leitzentrale GUI always at the pointer-at display
instead of filling the entire panorama. This ensures that the complete
leitzentrale GUI is always visible.

Fixes #5370
2024-10-30 08:14:56 +01:00
Norman Feske
71a3e228ae nitpicker: report pointer pos in hover report
Issue #5370
2024-10-30 08:14:55 +01:00
Norman Feske
01c96cf537 sculpt: generate panorama config
If the fb driver is configured to use discrete displays, sculpt now
automatically generates a panorama configuration for nitpicker that
shows all displays side by side. The effective nitpicker config is
now located at config/managed/nitpicker.

The automatism takes effect only when nitpicker's <capture> node
in config/nitpicker is empty. Hence, the managed panorama can be
overridden by a manually managed panorama.

Issue #5286
2024-10-30 08:14:55 +01:00
Norman Feske
8ed87dae71 gui_fb: deliver initial mode signal if pending
This patch handles the case where a mode change happens in-between
session creation and the registration of the mode-signal handler,
which can result in a sporadic loss of response to mode changes.

Noticed while working on issue #5286.
2024-10-30 08:14:55 +01:00
Christian Helmuth
f94e0a3464 vbox6: restore initial window size of 1024x768 2024-10-30 08:14:55 +01:00
Norman Feske
45fc49b4f1 sculpt/fb/default: remove examples
With "sculpt_manager: interactive framebuffer settings", examples can be
taken from config/managed/fb instead.

Fixes #5286
2024-10-30 08:14:55 +01:00
Norman Feske
8c43f8aa33 sculpt_manager: interactive framebuffer settings
This patch add a configuration dialog in the intel_fb node of the
component graph. The dialog displays a list of present displays labeled
after their respecive connectors. A mode can be selected for each
connector when clicking on the connector entry.

In-between the entries there are two buttons. The connect button is
toggle that defines whether the two adjacent entries are mirrored.
It is enabled by default so that all new connectors participate in
the mirroring. By untoggling the last enabled connect button, the
entry below the button becomes a discrete (non-mirrored) display.

A swap button allows for changing the order of the list, which has
to effects. First, the resolution of the very first entry defines
the size for mirrored display. So be changing the order of mirrored
displays, one can pick the preferred screen size. Second, the order
of discrete displays defines the layout of the panorama from left to
right. (the panorama config is not part of this commit though)

Note that there is currently no safety net against locking oneself
out of all displays. E.g., one can make Sculpt unusable by manually
disabling each display, or by selecting modes not properly handled by
the connected monitor. In the future, we may add a confirm button with
a timeout to roll back such unfortunate settings.

Fixes #5286
2024-10-30 08:14:55 +01:00
Josef Söntgen
8d76eebf93 sculpt: add MNT Pocket Reform
Fix genodelabs/genode#5360.
2024-10-30 08:14:55 +01:00
Christian Helmuth
fa267ecbb3 vbox6: robust tracking of mouse events in VMMDev
In VirtualBox 7 and recent 6.1 versions, the VMMDev is used to report
all mouse events if guest additions are used. Therefore, the
implementation aggregates these events, notifies the guest. and passes
the state on guest request. Unfortunately, the protocol does not support
to report consecutive button press and release events that may happen
between two guest requests, which results in events getting lost.

This commit patches the contrib sources to track pending mouse-button
events and notifies the guest if further state changes are pending after
updates are delivered.

Also, mouse-wheel events (dw, dz) are now accumulated between two guest
updates.

Fixes #5333
2024-10-30 08:14:55 +01:00
Norman Feske
3ab9173b20 gui_session: window-closed state as attribute
With the change of "gui_session: provide mode info as XML", the
client-side window-close handling became dysfunct because the
window-close state got wrongly interpreted as initial window state, to
the effect that a client's initial-window size policy got applied
instead of closing the window.

This patch makes the inital state of running a windowed application
(when no window size is defined yet) clearly distiguishable from the
state after which the user closed the window. Prior this patch, both
conditions were reflected by an empty <capture/> node in the panorama.
Now, the latter condition is reported as <capture closed="yes"/>, which
alleviates the need to track the life cycle of a window at the client
size.

Issue #5353
2024-10-30 08:14:55 +01:00
Benjamin Lamowski
515bd3263f sculpt/depot: add depot user atopia
Issue #5356
2024-10-30 08:14:55 +01:00
Christian Helmuth
c609e76cec sculpt: update touchpad for 24.10
Issue #5356
2024-10-30 08:14:55 +01:00
Norman Feske
845dc80df9 sculpt/depot/falkon_web_browser: version for 24.10
Issue #5356
2024-10-30 08:14:55 +01:00
Sebastian Sumpf
b48ae5550a test/framebuffer: add 15px marker at 0x0 2024-10-30 08:14:55 +01:00
Sebastian Sumpf
db02e04d0c libdrm: move Gpu::Vram into separate namespace
Because the implemantations for Lima and Vivante are linked into a
single library we cannot have two Gpu::Vram classes in the same
namespace. In case this happens any methods using the same signature are
weak symbols and the first one found by ld will be used = undefined
behavior.

issue #5356
issue #5369
2024-10-30 08:14:55 +01:00
Norman Feske
08bf219b28 nitpicker: apply domain constraints to GUI info
If a <domain> is constrained by 'width' or 'height' attributes, clip
the capture rects of the panorama info reported to the client. So the
client observes the constraint as window size.

Issue #5356
2024-10-30 08:14:55 +01:00
Norman Feske
5e3b6ee08f terminal: fix tiling artifacts in shrinked window
When shriking the terminal window, the view must be shrinked before
shriking the pixel buffer. Otherwise, when the buffer becomes smaller
than the view, nitpicker fills the excess view area with tiled content
of the buffer, which looks funny.

Related to issue #5350
2024-10-30 08:14:54 +01:00
Christian Prochaska
8985d8200e mesa: add 'u_format_unpack_neon.c'
Issue #5356
2024-10-30 08:14:54 +01:00
Benjamin Lamowski
6715f074ff sculpt_manager: fix quota boost limit for runtime_view
Commit 75e1f1797d increased runtime_view's initial RAM quota from 4MiB
to 52MiB, but failed to adjust the boost limit. Therefore, when
addtional RAM was requested, the limit would actually be degreased to
32MiB.

Adjust the RAM boost limit to 64MiB to make the runtime_view work on 4k
screens.

Issue #5356
2024-10-30 08:14:54 +01:00
Norman Feske
f30bbb1472 nitpicker: restore Capture::Session::screen_size
Since #5352, the 'screen_size' RPC function returns a rectangle clipped
against the client's bounding box, which unfortunately prevents
screen-capturing applications from determining the actual screen size.
This patch restores the original behavior by clipping the panorama
against client-specific constraints w/o clipping against the client's
buffer size.

Fixes #5365
2024-10-30 08:14:54 +01:00
Benjamin Lamowski
7e9c1ca3ca sticks_blue_backdrop: adjust RAM quota to work in 4k
Thie sticks_blue_backdrop needs more RAM to work on a 4k display.

Adjust the RAM quota to make it work on 4k.

Issue #5356
2024-10-30 08:14:54 +01:00
Benjamin Lamowski
a25d19169b system_shell: adjust terminal RAM quota to work in 4k
A system shell that works in a small window stops working when maximized
on a 4k screen, because the terminal component runs out of RAM.

With the adjusted RAM quotas the system shell works on 4k displays.

Issue #5356
2024-10-30 08:14:54 +01:00
Benjamin Lamowski
5c75f1efa7 sculpt: adjust decorator capability quota in Leitzentrale
Following the rework of the graphics stack, the decorator inside
Leitzentrale needs more capabilities. This manifests in a log message:
```
[leitzentrale] child "decorator" requests resources: cap_quota=18
```
and the Leitzentrale contents execpt for the log window disappearing
from the display. The Leitzentrale layer can still be toggled using F12.

Increasing the decorator's capability quota appears to solve the issue.

Issue #5356
2024-10-30 08:14:54 +01:00
Norman Feske
73991e62ec nitpicker: clear capture buffer on policy change
This patch resets the pixel buffer shared with the capture client
whenever the capture policy is modified and reports the whole buffer as
affected rectangle on the next client call of 'capture_at'. It also
clips the dirty rectangles tracked via 'mark_as_dirty' against the
bounding box of the capture session to avoid the interference of
out-of-view parts of the panorama with a capture client.

Fixes #5368
2024-10-30 08:14:54 +01:00
Norman Feske
13e8013334 sculpt.run: increase nitpicker quota for resize
Increase the RAM quota of the top-level nitpicker instance to support
the flicker-free resizing of large buffers, e.g., when changing screen
resolutions. Otherwise, nitpicker warns as follows:

[init -> nitpicker] Warning: Gui (runtime -> wm -> wm -> decorator)
                    not enough RAM to preserve buffer content during resize

Issue #5356
2024-10-30 08:14:54 +01:00
Christian Helmuth
679d68d470 nitpicker: rename 'displays' report to 'panorama'
... and enable report in Sculpt's report_fs.

Issue #5352
2024-10-30 08:14:54 +01:00
Norman Feske
2d7cd1c736 nitpicker: fix stale pixels on view removal
Sometimes when removing the popup window in Sculpt's Leitzentrale, a few
residual pixels remained. This is caused by the too strict coupling of
drawing and sync handling, effectively executing the fb-sync handler
repeatedly via 'Main::mark_as_damaged' during 'refresh_view' calls.
This tight coupling has two unwelcome effects. First, the sync handling
is executed more often than needed. Second, the sync handling (and fb
flushing) happens at intermediate states when view-stack changes are
applied (like changing a view geometry).

This patch uses a local signal handler to defer the execution of the
sync code until all drawing has finished.

Issue #5347
Issue #5356
2024-10-30 08:14:54 +01:00
Norman Feske
5f4e1db576 nitpicker: fix stale pixels in request-fb mode
When nitpicker is used as nitpicker client as is the case for Sculpt's
Leitzentrale, the time to sleep was tracked wrongly. The fb sync stays
alive only if a refresh operation is actually issued.

Issue #5347
Issue #5356
2024-10-30 08:14:54 +01:00
Norman Feske
135a866ec0 sculpt_manager: avoid runtime_view cap request
This commit removes the initial dignostic message from the log. The
message is harmless because the sculpt manager upgrades the quota on
demand but its best to avoid the noise.

  child "runtime_view" requests resources: cap_quota=4

Issue #5356
2024-10-30 08:14:54 +01:00
Norman Feske
e1be17b56d init: prevent double session-upgrade forwarding
Fixes #5367
2024-10-30 08:14:54 +01:00
Christian Helmuth
986bec20a9 usb_webcam: adapt to changes in capture/GUI
Issue #5356
2024-10-30 08:14:54 +01:00
Christian Helmuth
6d78712454 tiled_wm: build test/tiled_wm in run script 2024-10-30 08:14:54 +01:00
Christian Helmuth
7961ff50a2 tiled_wm: fix dependency to util.h 2024-10-30 08:14:53 +01:00
Alexander Boettcher
5497829608 nitpicker: return OUT_OF_CAPS instead throwing
it as exception.

Issue #5242
Fix #5366
2024-10-30 08:14:53 +01:00
Josef Söntgen
b908999def sculpt/wifi/default: comment invalid network node
Provide the default wifi config in an annotated fashion. Specifying
an invalid '<network>' node leads to diagnostic messages.

Issue #5356.
2024-10-30 08:14:53 +01:00
Josef Söntgen
fe93df27d1 driver/wifi: fix invalid network check
This commit alignes the implementation to the intention of dismissing
invalid '<network>' entries. We only accept entries when they contain
a valid SSID and additionally a valid PSK if the network is protected.

Issue #5356.
2024-10-30 08:14:53 +01:00
Stefan Kalkowski
8094b1ee01 sculpt/index: refer to recent audio mixer
Instead of publishing the old audio mixer, refer to the recent
record_play_mixer providing the audio API that is used by almost
all components now.

Ref genodelabs/genode#5356
2024-10-30 08:14:53 +01:00
Christian Helmuth
8ec2d6a36b intel/display: don't report unknown state as connected
The changes "intel/display: report connectors w/o modes as off" still
need improvements to detect mode-less connectors in intermediate states.
Until then, don't report connector_status_unknown as connected with
modes.
2024-10-30 08:14:53 +01:00
Alexander Boettcher
77471cc10e intel/display: report connectors w/o modes as off
in the XML report
2024-10-30 08:14:53 +01:00
Alexander Boettcher
f3b94a3b21 intel/display: reconstruct merge capture session
also when the name in the config changes.

Issue #5356
Issue #5345
2024-10-30 08:14:53 +01:00
Alexander Boettcher
44c23ca472 intel/display: adjust width_mm/height_mm usage
On capture creation for discrete usage, use the connector values
if display mode does not provide values. For mirror capture ever
report no width_mm/height_mm.
2024-10-30 08:14:53 +01:00
Alexander Boettcher
f7689a473c intel/display: adjust reported/set xml nodes
'<connector mode_id=3 ...' becomes '<connector mode="3" ...'

'<mode mode_id="2" ... ' becomes '<mode id="2" ...'

'<mode unavailable="true" ...' becomes '<mode usable="false" ...'
2024-10-30 08:14:53 +01:00
Alexander Boettcher
71f3e5f82a intel/display: improve disrete/mirror swap support
Issue #5345
2024-10-30 08:14:53 +01:00
Alexander Boettcher
1a5f3a2210 intel/display: mirror unconfigured connectors
by default.

Issue #5356
2024-10-30 08:14:53 +01:00
Alexander Boettcher
6c2c830f66 intel/display: improve sleep/wakeup handling
Check for capture updates ever in the linux update task when it got
woken, otherwise we may miss screen updates.

Issue #5356
2024-10-30 08:14:53 +01:00
Alexander Boettcher
6a5473b478 intel/gpu: sanitize report for intel/display
Instead of forwarding the whole devices ROM of the platform driver to the
display driver, report only Intel devices and additionally adjust the
reported IOMEM size to the reduced aperture size.

Related #5207
Issue #5345
Issue #5356
2024-10-30 08:14:52 +01:00
Christian Helmuth
a0ef5b5a36 sculpt: keep runtime capture session labels
Nitpicker may use session labels for panorama configuration in capture
policies.

Issue #5352
Issue #5356
2024-10-30 08:05:33 +01:00
Johannes Schlatow
d87a235abb nic_router: fix DHCP deallocation on domain update
Commit ac42ade introduced a regression that triggered an assertion in
`Dhcp_server::free_ip()` because the DHCP allocation was not properly
removed during a domain update. The underlying issue was that
`with_dhcp_server()` silently landed in the `no_dhcp_server_fn`.

Fixes #5364
2024-10-30 08:05:33 +01:00
Stefan Kalkowski
4f084d1f9e lx_emul: unify NIC uplink binding
Fix genodelabs/genode#5361
2024-10-30 08:05:33 +01:00
Sebastian Sumpf
77d53f13ca lx_emul: handle pin controller irqs
Register Global_irq_controller as Device so interrupts get forwarded to
irqchip.c code. Otherwise, pin-controller interrupts will get lost.

Fixed #5363
Related #5356
2024-10-30 08:05:33 +01:00
Michael Mueller
23c0069588 Updated recipe for mxtasking to include new header files. 2024-10-28 13:42:24 +01:00
Michael Mueller
0fb4f00a8b Microbenchmark creating synthetic work to measure impact of CPU core allocator on application performance. 2024-10-24 14:35:10 +02:00
Michael Mueller
8904022415 Scenario with blinktree getting interference from antagonist. 2024-10-24 14:33:16 +02:00
Michael Mueller
4d0acbf4e5 Baseline scenario for B-link tree server. 2024-10-24 14:31:30 +02:00
Michael Mueller
c87c607003 Mutlithreaded netty server. 2024-10-24 14:30:38 +02:00
Michael Mueller
92f5d52134 More hash updates. 2024-10-24 14:29:30 +02:00
Michael Mueller
20da017b17 Allow use of aligned new in MxTasking. 2024-10-24 14:28:52 +02:00
Michael Mueller
7ffafddee7 Updated hash for NOVA. 2024-10-24 14:28:23 +02:00
Michael Mueller
4f364c4548 Added antagonist to create synthetic interference on caches, CPU and memory controllers. 2024-10-24 14:28:01 +02:00
Michael Mueller
15f7092285 Revised blinktree to include core allocation times in measurements. 2024-10-24 14:26:41 +02:00
Michael Mueller
d3377454d6 Changed compilation flags for blinktree. 2024-10-24 14:25:25 +02:00
Michael Mueller
635d1a637c Networked version of B-link tree benchmark. 2024-10-24 14:24:36 +02:00
Michael Mueller
ee5502ed34 Updated hashes. 2024-10-24 14:22:47 +02:00
Michael Mueller
0f51994e54 Removed log output from sandbox. 2024-10-24 14:22:02 +02:00
Michael Mueller
b2283a69e0 Fixed use after free in ram_file_system. 2024-10-24 14:20:57 +02:00
Stefan Kalkowski
a148dc5cb4 genode_c_api/usb: no policy check in session create
Fix genodelabs/genode#5357
2024-10-15 14:20:22 +02:00
Alexander Boettcher
700b248749 libc: silent warning for sigaltstack
Issue #5305
2024-10-15 14:00:25 +02:00
Christian Helmuth
225adf3681 nitpicker: document 'displays' report in README
Issue #5352
2024-10-15 13:54:30 +02:00
Josef Söntgen
4084df6360 vbox6: enable RDRAND hardware instruction support
Issue #5314
2024-10-15 09:20:43 +02:00
Josef Söntgen
be70fddbb8 nic/pc: disable IRQ coalescing in R8169 driver
This commit patches the DDE Linux contrib code to remove IRQ coalescing
from the R8169 driver that for reason not yet known leads to interrupts
occurring irregularly.

Issue #5356.
2024-10-15 08:42:03 +02:00
Christian Prochaska
7cf39188ef libports: update qt6-host download URL
Issue #5325
2024-10-14 15:15:34 +02:00
Johannes Schlatow
3142554343 mesa_gears: adjust RAM quota (required for x260)
genodelabs/genode#5356
2024-10-14 15:04:19 +02:00
Christian Prochaska
56199240ec qt: destroy view to hide window
Fixes #5359
2024-10-14 14:39:44 +02:00
Christian Prochaska
7b23227e7f qt: generate expose event on resize
Fixes #5358
2024-10-14 14:39:44 +02:00
Johannes Schlatow
d68977fa12 sculpt: update goa_testbed preset
genodelabs/genode#5356
2024-10-14 14:39:44 +02:00
Josef Söntgen
bc8932e46a terminal: use initial mode for undefined size 2024-10-14 14:39:44 +02:00
Sebastian Sumpf
12fb925555 terminal: adjust cap quota to GUI stack changes 2024-10-14 14:39:44 +02:00
Josef Söntgen
686c5ac007 raw/window_layouter: add 'release_grab' action
This commit adds the 'release_grab' action to the KEY_SCREEN handling
as it is required to ungrab clients using the exclusive input mode.
2024-10-14 14:39:44 +02:00
Josef Söntgen
7760116478 linux-firmware: add QCA9377 FW (MNT Pocket Reform)
Issue #5360.
2024-10-11 14:48:01 +02:00
Josef Söntgen
95c439e758 driver/wifi: fix firmware pointer check
Issue #5360.
2024-10-11 14:47:48 +02:00
Stefan Kalkowski
5d33ea7242 driver/platform: allow access to platform info
Within the i.MX 8MP specific platform driver access to the
board name within the platform info XML is needed.

Ref issue#5360
2024-10-11 14:46:23 +02:00
Stefan Kalkowski
e344fa8c23 base-hw: export board name in platform info
We need to differentiate the board within the SoC generic
platform driver. Therefore, export its name within the
platform info ROM.

Ref issue#5360
2024-10-11 14:46:23 +02:00
Josef Söntgen
e0874baa8f driver/wifi: remove auto_connect attribute
This commit does away with controlling the join-intent via an attribute
but couples it to the existence of a '<network>' node. With this change
all '<network>' nodes within the configuration are always
unconditionally considered for joining.

Issue #5356.
2024-10-08 14:21:20 +02:00
Josef Söntgen
e4d2a4df42 driver/wifi: split hidden network scanning
This commit splits the intent to scan for a hidden network and the
actual configuration of a network itself by introducing
'<explicit_scan>' nodes. Like the '<network>' node these also feature
a 'ssid' attribute and each node is incorporated into the SCAN request
if its SSID is valid.

For more information please consult 'repos/src/driver/wifi/README'.

Issue #5356.
2024-10-08 14:20:56 +02:00
Josef Söntgen
40f2b58098 pc_wifi: use wifi_config.inc helper
Introduce helper that does away with the redundant config generation
snippets.

Issue #5356.
2024-10-08 14:20:22 +02:00
Josef Söntgen
31f9d414a3 sculpt_manager: remove invalid network node
With the recent Wifi::Manager changes setting an invalid SSID will
lead to a diagnostic warning. Since disconnecting is handled by
removing the existent '<network>' there is no reason to generate
an invalid node in the first place.

Issue #5356.
2024-10-08 14:20:21 +02:00
Josef Söntgen
0b9d3c3dcc sculpt_manager: increase wifi driver caps
This remedies the initial session upgrade on certain systems (Alder
Lake).

Issue #5356.
2024-10-08 14:20:20 +02:00
Christian Helmuth
61c9706353 depot: update recipe hashes 2024-10-08 11:30:26 +02:00
Norman Feske
c296795089 nitpicker: trigger info ds change on config update
Inform all GUI clients of a new version of the mode information whenever
the nitpicker configuration is modified. This is needed because changed
capture policies influence the panorama observable by the GUI clients.

Issue #5352
2024-10-08 09:09:25 +02:00
Christian Prochaska
57b10b9611 qt: adapt to 'Gui::Connection' interface changes
Issue #5353
2024-10-08 09:09:24 +02:00
Christian Helmuth
4a6c506f37 nitpicker: deliver press events to global key receiver
Fixes the following misbehavior: If a global key is pressed (e.g., Caps
Lock in Sculpt) and the mouse is clicked before release, the global-keys
handler receives the global-key press but no further events of the
sequence, especially *no Caps-Lock release*.

A more reasonable fix may address the "else branch" that deletes the
_input_receiver in case of mouse events without a hovered client too,
which is beyond the narrow scope of this fix.
2024-10-08 09:09:24 +02:00
Norman Feske
ca47280ce9 wm/layouter: pointer grabbing/ungrabbing
This patch implements the following policy for applications requesting
exclusive input (relative motion): The pointer is grabbed as soon as the
user clicks inside the application window. It is forcibly ungrabbed on
any window-focus change or when tapping the KEY_SCREEN. An application
can always enable (transient) exclusive input during a key sequence,
e.g., when dragging the mouse while holding the mouse button. Transient
exclusive input is revoked when releasing the last button/key.

Fixes #5355
2024-10-08 09:09:24 +02:00
Norman Feske
92227df624 nitpicker: handle Input::Session::exclusive
While the focused client has enabled exclusive input, nitpicker does
not translate relative motion to absolute motion but routes relative
motion directly to the client. Additionally, the pointer origin is
forcibly moved to a position outside the screen boundaries, making the
pointer invisible.

Issue #5355
2024-10-08 09:09:24 +02:00
Norman Feske
996d9b300c menu_view: restore horizontal cursor positioning
This is a follow-up fix for "Make util/geometry.h C++20 friendly".

Fixes #5239
Issue #5356
2024-10-08 09:09:24 +02:00
Norman Feske
75b04b38f6 Adjust RAM and cap quotas
The recent changes of the GUI stack (proper accounting of cap and RAM
resources by the window manager and nitpicker, output buffered at the
server side) require quota adjustments at various GUI-related places.

Issue #5356
2024-10-08 09:09:24 +02:00
Norman Feske
03a23ad987 gui_fb: reset input sigh when closing the session
This patch mirrors the logic already in place for the framebuffer
session.
2024-10-08 09:09:24 +02:00
Norman Feske
4dd5c6ff8a test/fb_bench: make fb mode consistent with ds
Otherwise, the fb mode may refer to a new mode when the framebuffer is
resized between the call of 'dataspace' and 'mode'.
2024-10-08 09:09:24 +02:00
Norman Feske
b1d5a5f7b8 sculpt: version 24.10 2024-10-08 09:09:24 +02:00
Norman Feske
d7830a0ce6 Add Input::Session::exclusive() interface
This interface allows a GUI client to express the intent to exclusively
observe relative motion events while locking the absolute pointer
position. This patch merely extends the interface without implementing
it.

As this change touches os/include/input/component.h, it moves the
manage/dissolve operations into the class, ensuring the call of
dissolve at destruction time.

Issue #5355
2024-10-08 09:09:24 +02:00
Norman Feske
318d641266 gui_session: provide mode info as XML
In multi-monitor scenarios, the mode is no longer a single rectangular
area but a panorama with potentially many captured rectangles. This
patch replaces the former 'mode' and 'mode_sigh' RPC by a new 'info'
ROM accessor.

Issue #5353
2024-10-08 09:09:24 +02:00
Norman Feske
d29cb0a15d Gui::Connection::buffer: fix upgrade loop
Once set to true, the 'retry' flag would never be reset to false.

Issue #5242
2024-10-08 09:09:24 +02:00
Christian Helmuth
bfce470690 app/usb_webcam: initialize libc environment
Restores debugging with LIBUSB_DEBUG=<level>.
2024-10-08 09:09:24 +02:00
Norman Feske
f324aa902b nitpicker: configurable capture policies
Capture clients used to always capture the view stack at the origin of
the coordinate system. So each capture client obtained a mirror of the
same picture. This patch allows for the placement of capture clients on
larger panorama using Genode's usual label-based policy-selection
approach. Thereby, each monitor in multi-monitor scenario can display a
different portion of the panorama.

The patch takes special care to always keep the pointer in a visible
position. The pointer cannot be moved to any area that is not captured.
Should the only capture client displaying the pointer disappear, the
pointer is warped to the center of (any) remaining capture client.

Fixes #5352
2024-10-08 09:09:24 +02:00
Norman Feske
88dc4c878f util/geometry.h: test (in)equality of rectangles
The operators == and != make the 'Rect' consistent with 'Point' and
'Area'. The patch also adds the 'Rect::clamp' method, which is generally
useful for sanitizing input.

Issue #5352
2024-10-08 09:09:24 +02:00
Christian Prochaska
7579fe5749 qt: adapt to 'Gui::Connection' interface changes
Issue #5351
2024-10-08 09:09:24 +02:00
Christian Prochaska
e528ebc374 qt: increase caps in run scripts
Issue #5340
2024-10-08 09:09:24 +02:00
Alexander Boettcher
458458b65f intel/display: support stop/wakeup protocol
Issue #5344
2024-10-08 09:09:24 +02:00
Alexander Boettcher
50cc52a091 intel/display: use one capture session per display
Fixes #5345
2024-10-08 09:09:24 +02:00
Norman Feske
e69c01aad3 framebuffer_session: add sync_source selection
The new Framebuffer::Session::sync_source RPC function allows for the
selection of a specific source of sync signals in the presence of
multiple capture clients at the GUI server.

This patch contains only the extension of the interface. The information
is not evaluated by the GUI server yet.

Issue #5347
2024-10-08 09:09:24 +02:00
Norman Feske
5b4e1915d8 framebuffer_session: accessors for buffer surfaces
This patch adds central and safe utilities for accessing the distinct
parts of the virtual framebuffer to relieve clients from pointer
calculations.

Issue #5351
2024-10-08 09:09:24 +02:00
Norman Feske
388218a3f9 os/surface.h: support windowed surface access
This patch eases the vertical organization of multiple surfaces within
one larger surface, which is the case when keeping front/back buffers
within one compounding GUI buffer.

Issue #5351
2024-10-08 09:09:23 +02:00
Norman Feske
bf064874db util/string.h: Byte_range_ptr::with_skipped_bytes
The new method provides a safe way to narrow the byte range to a
given offset.

Issue #5351
2024-10-08 09:09:23 +02:00
Norman Feske
5c20de212a base: Attached_dataspace::bytes accessor
The new bytes() accessor returns a Byte_range_pointer as an alternative
to the 'local_addr' for accessing the content of the dataspace. This
facilitates the safe practice of passing (and validating) the buffer
bounds along with the pointer.

Issue #5351
2024-10-08 09:09:23 +02:00
Norman Feske
e738162bde framebuffer_session: alpha as Mode attribute
Propagate the want of an alpha channel as attribute of Framebuffer::Mode
instead of passing this property as a separate bool argument.

This clears the way for adding useful accessors for pixel/alpha/input
surfaces to the Mode type as a subsequent step.

Issue #5351
2024-10-08 09:09:23 +02:00
Norman Feske
336d481726 os: Pixel_input8 type for input-mask access
Issue #5351
2024-10-08 09:09:23 +02:00
Norman Feske
b303fe1098 demo.run: increase nitlog RAM quota 2024-10-08 09:09:23 +02:00
Norman Feske
6522158caa gems/gui_buffer.h: atomic back-to-front blitting
This patch updates menu_view, themed_decorator, and rom_osci to use the
new frame-buffer blit operation, mitigating tearing artifacts

Issue #5350
2024-10-08 09:09:23 +02:00
Norman Feske
4565cd0143 demo/scout: use atomic panning and blitting
Issue #5350
2024-10-08 09:09:23 +02:00
Norman Feske
db2f1e542c decorator: double-buffered output
This patch ensures that the displayed pixel buffer is always consistent
by applying intermediate drawing steps on an invisible back buffer,
which is blitted to the front buffer by the GUI server.

Note that the addition of the back buffer increases the decorator's RAM
demand by 4*w*h (4 bytes per pixel) whereas w and h are the screen size.

Issue #5350
2024-10-08 09:09:23 +02:00
Norman Feske
8082aa980e framebuffer_session: atomic blitting and panning
By enhancing the Framebuffer::Session interface by the new RPC functions
'blit' and 'panning', GUI clients become able to attain tearing-free
output. Two modes of operations are supported.

1. Atomic back-to-front blitting

   GUI clients that partially update their user interface like regular
   application dialogs, can now implement double buffering by placing
   both the back buffer and front buffer within the GUI session's
   framebuffer and configuring a view that shows only the front buffer.
   The 'blit' operation allows the client to atomically flush pixels
   from the back buffer to the front buffer.

2. Atomic buffer flipping

   GUI clients that always update all pixels like a media player or
   a game can now use the 'panning' feature to atomically redirect the
   displayed pixels to a different portion of the GUI session's virtual
   frame buffer. The virtual framebuffer always contains two frames,
   the displayed one and the next one. Once the next frame is complete,
   the client changes the panning position to the portion containing
   the next frame.

Issue #5350
2024-10-08 09:09:23 +02:00
Norman Feske
0e33830d1f framebuffer_session: use Rect as refresh argument
This patch replaces basic-type arguments x, y, w, h by the 'Rect' type,
and imports the Genode namespace into the Framebuffer namespace.

Issue #5350
2024-10-08 09:09:23 +02:00
Norman Feske
e1b24d1ebd nano3d.run: increase caps for backdrop
Issue #5340
2024-10-08 09:09:23 +02:00
Norman Feske
b3ac8c5bd8 dialog: increase caps for sandboxed_runtime
With the reworked accounting of GUI-session resources, the default
of 100 caps for menu_view does not suffice.

Issue #5340
2024-10-08 09:09:23 +02:00
Sebastian Sumpf
4d559c2907 sculpt: name change imx8mq_usb_host -> imx8m_usb_host
issue #5264
2024-10-08 09:09:23 +02:00
Sebastian Sumpf
c27e25b5ca lx_emul: shmem_file.h adapt to folio changes
Everything related to compound pages is gradually removed and replaced
with folios.

issue #5264
2024-10-08 09:09:23 +02:00
Sebastian Sumpf
8530aa7540 lx_emul/start: move lx_emul_setup_arch behind kmem_cache_init
Call lx_emul_setup arch after kmem_cache_init, because
unflatten_device_tree requires 'memblock_alloc' which  does not work
when using native slub.c/memblock.c on ARM platforms.

issue #5264
2024-10-08 09:09:23 +02:00
Stefan Kalkowski
c0a0c0ae71 genode_c_api/usb: prevent invalid pointer deref
Limit the use of Reg_list::for_each that caches a next pointer
of its items to allow destruction of items in its lambda body.
Instead provide an Reg_list::apply function in addition, which
takes a condition lambda to find the matching item, and a lambda
processed on it. In most use-cases where for_each was used, only
one item was searched for. Here we can use apply now., without
the need for a cached pointer, nor too many iterations.

Fixes genodelabs/genode#5349
2024-10-08 09:09:23 +02:00
Josef Söntgen
a16ca36eb6 bsd_audio: remove unnecessary RM requirement
The explicit usage of the Rm session became obsolete with the
removal of the internal slab (see memory consumption commit).

Fixes #5348.
2024-10-08 09:09:23 +02:00
Benjamin Lamowski
66689fa799 usb_webcam: remove unneeded requirement on RM
The usb_webcam's runtime requires a Region Manager session even though
it is not needed by the application, remove it.

Fixes #5346
2024-10-08 09:09:23 +02:00
Norman Feske
fc4b026b62 nitpicker: remove periodic mode of operation
Unless nitpicker is used in 'request_framebuffer' mode, it no longer
depends on a periodic timer but merely acts as a broker between capture
clients and GUI clients. Sync signals as delivered to GUI clients are
now wired to Capture::Session::capture_at calls. So the display driver
defines the occurrence of those signals.

Note that sync signals are only delivered while a driver actively calls
'capture_at'. If a driver stops capturing, GUI clients no longer receive
any sync signal. This is a change from the previous situation where GUI
clients could depend on the periodicity of sync signals.

Issue #5347
2024-10-08 09:09:23 +02:00
Norman Feske
e69ade5299 decorator: use timer for animation timing
This patch changes the precision of the configuration's motion attribute
to a multiple of 10 ms (centi-seconds). The previous version used steps
of 20 ms. Hence, one needs to adjust existing configurations by doubling
the motion attribute values of the themed decorator.

Issue #5347
2024-10-08 09:09:23 +02:00
Norman Feske
58d20c7751 menu_view: use timer for animation timing
This patch removes the use of sync signals as time source. The animation
phase is now timed using a timer connection as tick source while sync
signals are used for scheduling the redraws.

Issue #5347
2024-10-08 09:09:23 +02:00
Norman Feske
ffcd08b5c7 backdrop,pdf_view: remove sync handling
The sync handling makes the code more complicated without a benefit.

Issue #5347
2024-10-08 09:09:22 +02:00
Norman Feske
0e55119b36 liquid_framebuffer: reset signal handlers
Apply the same rationale as commit "gui_fb: reset signal handlers when
closing fb" to the liquid framebuffer.
2024-10-08 09:09:22 +02:00
Alexander Boettcher
4554ec42da nova: make write-combined unit test more robust
- touch all memory before time measurements, to reduce lazy paging jitter
- diff of 100us between 2 memset runs are now considered a failure (before 10us)
- add refrence measurements of same region size which is not write-combined
- make the output easier parse able of write-combined test

Fixes #5342
2024-10-08 09:09:22 +02:00
Norman Feske
09461c51bd capture_session: capture stop/wakeup protocol
With this change, a client (i.e., display driver) can register
a wakeup signal handler to be notified on the arrival of new data to
capture. The signal is delivered only when the client has stopped
capturing. The client propagates this condition to the server using
the new 'capture_stopped' RPC call.

This change in principle enables a display driver to suspend its
periodic mode of operation after a few frames without capturing any
new data. As the first driver, the fb_sdl driver has been adapted to
the new protocol. This change not only eliminates the driver's CPU
load when idle, it also reduces the latency of sporadic output
because the response to such GUI updates is no longer bound by a
fixed periodic interval.

Issue #5344
2024-10-08 09:09:22 +02:00
Norman Feske
c527a4e0e4 util/dirty_rect.h: accessor for empty state
Provide an easy way to check for the absence of any dirty pixels.

Issue #5344
2024-10-08 09:09:22 +02:00
Norman Feske
2d3c2fc258 fb_sdl: move SDL event loop to dedicated thread
This patch is a preparatory step for relaxing the strictly periodic
operation of fb_sdl. With the new design, the SDL event loop can block
for events while Genode's main entrypoint stays receptive for I/O.
The main entrypoint can interact with the SDL thread by injecting
SDL user events.

The patch also replaces the full-screen clearing and update of the
SDL window by an update of the captured bounding box only. This reduces
the CPU load of fb_sdl when idle. When updating a small part of the
screen (e.g., when moving the mouse only), the load is still rather
heavy though.

Issue #5344
2024-10-08 09:09:22 +02:00
Norman Feske
3f1759a4d1 capture_session: detection of idle capture server
This patch enhances the Capture::Connection::Screen such that the
bounding box of the affected pixels can be tracked by the caller,
which can use this information to adjust its behavior to the
activity/inactivity of the capture server.

Issue #5344
2024-10-08 09:09:22 +02:00
Norman Feske
6d68d3297d capture_session: propagate physical size in mm
This patch adds the physical screen size as argument to the
Capture::Session::buffer RPC function, which allows drivers to
propagate DPI information to the GUI server. While changing the
the interface, the patch replaces the former use of C++ exceptions
by a result type. The 'Buffer_result' is handled transparently by the
Capture::Connection. The client.h code is now integrated in
connection.h.

Issue #5344
2024-10-08 09:09:22 +02:00
Josef Söntgen
6d79a44c46 sculpt_manager: adapt to Wifi::Manager changes
Issue #5341.
2024-10-08 09:09:22 +02:00
Josef Söntgen
d4e4b8bf60 driver/wifi: rework CTRL interface manager
This commit streamlines the interaction between the Wifi::Manager
and the wpa_supplicant's CTRL interface.

As user-facing changes it alters some default settings and introduces
new features:

* Every configured network now needs to explicitly have its
  'auto_connect' (to be considered an option for joining) attribute
  set to 'true' whereas this was previously the default value if the
  attribute was not set at all.

* The 'log_level' attribute is added and configures the supplicant's
  verbosity. Valid values correspond to levels used by the supplicant
  and are as follows 'excessive', 'msgdump', 'debug', 'info', 'warning'
  and 'error'. The default value is 'error' and configures the least
  amount of verbosity.

* The 'bgscan' attribute may be used to configure the way the
  supplicant performs background-scanning to steer or rather optimize
  roaming decision within the same network. The default value is set
  to 'simple:30:-70:600'. It can be disabled by specifying an empty
  value, e.g. 'bgscan=""'.

* The 'verbose_state' attribute was removed alltogether and similar
  functionality is now coverted by 'verbose' attribute.

Implementation-wise the internals changed significantly and are
outlined in the following paragraphs.

Formerly the interaction between the manager and the supplicant
was handled in an apparent way where the internal state of each
interaction was in plain sight. This made the flow cumbersome to
follow and therefor each interaction is now confined to its own
'Action' object that encapsulates the ping-pong of commands and
responses between the manager and the supplicant. All actions are
processed in an sequential way and thus there is no longer any
need to defer pending actions depending on the interal state of
the current interaction. Configuration changes as well as events
issued by the supplicant where new actions can be created are
handled in this fashion. Of note are both signal-handlers,
'_handle_cmds' and '_handle_events' respectively.

The state report, which provides the information about the current
state of connectivity to a given wireless network, was dealt with
in the same vein and its handling was spread across the manager
implementation. Again, to make it easier to follow, the generation
of the state report is now purely driven by the 'Join_state' object.
This object encapsulates the state of connectivity and is normally
updated by events issued from the supplicant (see '_handle_events').
It is also incorporated when handling command responses (see
'_handle_cmds').

Handling of timed-actions, like scan and signal quality
update requests, was done by setting a timeout at the Timer session
directly and thus only one timed-action could be pending at any time.
This excluded dealing with timed-actions like connected-scanning
and signal quality polling concurrently. This was changed and now
a One_shot_timeout is used to programm each concurrent timed-action.

For implementing the communication channel for the CTRL interface the
manager and supplicant use a shared memory buffer, the Msg_buffer.
Since the CTRL interface for Genode was implemented using C, some
shenanigans were performed to access the memory buffer. Now the
CTRL interface implementation uses C++ and only exports the functions
required by the supplicant as C. This simplifies the usage of the
Msg_buffer and allows for removing the global functions needed for
synchronizing the Msg_buffer access as those are now part of the
object itself via the 'Notify_interface'.

Fixes #5341.
2024-10-08 09:09:22 +02:00
Josef Söntgen
6b474e059c wpa_supplicant: update to version 2.11
Issue #5341.
2024-10-07 15:54:59 +02:00
Josef Söntgen
42dae6e570 lib/wifi: make errno conversion function public
The 'convert_errno_from_linux' function was already used internally to
convert the Linux errno values to the matching FreeBSD libc ones when
calling socket functions.

It will now also be used to convert the error values included in
netlink messages as those, naturally, also correspond to the Linux
ones.

Issue #5341.
2024-10-07 15:54:59 +02:00
Alexander Boettcher
e5df8da1bd vbox6: enable AES hardware instruction support
Issue #5314
2024-10-07 15:54:59 +02:00
Norman Feske
d565598489 wm: avoid initial flickering of child views
When starting testnit with the wm, the child views briefly appear at a
position relative to the top-left corner of the screen until the
top-level view has been positioned by the layouter. This patch keeps
child views invisible until their respective parent views are
positioned.
2024-10-07 15:54:59 +02:00
Alexander Boettcher
75266e467d vbox6: enable AVX support
Issue #5314
2024-10-07 15:54:59 +02:00
Alexander Boettcher
a07b5937d9 nova: handle invalid FPU guest state
Makes the kernel robust against invalid guest FPU state provided by a VMM,
e.g. our port of Vbox6.

Issue #5314
2024-10-07 15:54:59 +02:00
Alexander Boettcher
ff506b0375 vm/x86: support extended fpu state transfer
Extend Genode's vCPU FPU state and adjust all users to copy
at most FPU data they actually support.

Issue #5314
2024-10-07 15:54:59 +02:00
Norman Feske
5993fa9c7f wm: keep child views in front of their parent
When restacking a top-level view, execute the top-level restacking
before updating the child views. Otherwise, child views may wrongly
refer to the old stacking position of the top-level view.

Issue #5242
2024-10-07 15:54:59 +02:00
Norman Feske
e5437563e2 test/nitpicker: add missing refresh call
Issue #5242
2024-10-07 15:54:59 +02:00
Alexander Boettcher
b4ff720ea4 tool/run: support ipxe via UEFI boot on foc & sel4 2024-10-07 15:54:59 +02:00
Norman Feske
9cd87a8495 wm: update coding style
Use Genode namespace, indicate 'Main' members as being private,
use Session_object, remove unused '_focus_request_reporter',
use Id_space for Window_registry, replace lookup by with pattern.
2024-10-07 15:54:59 +02:00
Norman Feske
e83ace4242 decorator: fix window-stacking glitch
This is a follow-up commit to "gui_session: manage view ID at the client
side", which missed to invalidate the neighbor view of a window but
instead wrongly assigned the (now always valid) view ID 0 as neighbor.
In situations where a window disappears and re-appears (e.g., repeatedly
launching testnit in the wm.run scenario), the new window could not
always be topped.

Issue #5242
2024-10-07 15:54:59 +02:00
Alexander Boettcher
f147a1220e intel/display: make effective use of PSR
- only mark framebuffer dirty if necessary
  -> gives the hardware chance to save longer power
- remove extra timer connection on Genode component side
  -> use Linux time primitives

Issue #5339
2024-10-07 15:54:59 +02:00
Alexander Boettcher
0414e4929f intel/display: enable panel self refresh support
Fixes #5339
2024-10-07 15:54:59 +02:00
Norman Feske
3ba8ddc85c gui_session: mark RPC client methods as nodiscard
Issue #5340
2024-10-07 15:54:59 +02:00
Norman Feske
ec50c008bb wm: account session resources
With this patch, the wm accounts RAM and caps consumed on behalf of its
clients to the respective client's session quota instead of paying out
of its own pocket. This should make the wm resilient against resource
exhaustion and lowers the quota requirements.

Issue #5340
2024-10-07 15:54:59 +02:00
Norman Feske
cf507a0b86 wm: replace Rpc_object by Session_object
This will ease the tracking of session resources.

Issue #5340
2024-10-07 14:44:31 +02:00
Norman Feske
a9b2d9bdc6 gui_session: adjust session quota for wm scenarios
The current default session RAM quota of 36 KiB reflects the needs of
the nitpicker GUI server. However, in most commonly used scenarios, a
GUI client connects to nitpicker indirectly via the wm. The low value
worked so far because the wm did not account RAM and cap usage per
client so far but paid out of its own pocket and faithfully forwarded
all resource upgrades to nitpicker.

When adding resource accounting to the wm, the old default value has the
effect that a new client has to repeatedly attempt the session creation -
each time offering sligthly more session quota - until both nitpicker and
the wm are satisfied.

By roughly doubling the default to 80 KiB, a wm client immediately
succeeds with opening a GUI session without repeated attempts.
By specifying a custom 'cap_quota' amount to the 'Genode::Connection',
the Gui::Connection now donates enough caps for both the wm and
nitpicker.

Issue #5340
2024-10-07 14:44:31 +02:00
Norman Feske
034de3b1b1 base/connection.h: allow customized cap-quota arg
By default, a 'Connection' donates an amount of caps as declared in
SESSION_TYPE::CAP_QUOTA to the server at session-creation time.

In some situations, however, a client may deliberately want to donate a
larger amount. For example, when opening a GUI session at the wm, the
total amount of needed caps is the sum of those consumed by the wm plus
those consumed by nitpicker. Using this knowledge, the Gui::Connection
may specify a sufficient amount to avoid iterative session-creation
retries. The new 'Connection' constructor accommodates this use case by
accepting an explicit 'cap_quota' argument.

Issue #5340
2024-10-07 14:44:31 +02:00
Norman Feske
240b631512 nitpicker: alloc initial slab block in session
This patch saves two sliced-heap allocations per session.

Issue #5340
2024-10-07 14:44:30 +02:00
Norman Feske
e8e499ae9e nitpicker: account input and framebuffer caps
This patch deduces the caps needed for the framebuffer and input RPC
objects from the resources accounted locally within the session. It also
takes precautions for the situation where a client offers too little
resources, prompting the mid-way cancelling of the 'Session_component'
creation. With the patch, the 'ep.manage' operations are rolled back
by the corresponding 'ep.dissolve' operations.

Issue #5340
2024-10-07 14:44:30 +02:00
Norman Feske
e4af726056 nitpicker: alloc view caps only when needed
This patch moves the eager allocation of view capabilities from the
'view' and 'child_view' RPC functions to the 'view_capability' RPC
function, reducing the consumption of capabilities in all scenarios
where views don't need to be shared between GUI sessions.

Issue #5340
2024-10-07 14:44:30 +02:00
Norman Feske
61c0be82f9 mupdf.run: add missing libm 2024-10-07 14:44:30 +02:00
Alexander Boettcher
eb7aea82b8 hw/x86: prefer acpi rsdp v2 of multiboot2
over rsdp v1. The multiboot2 provided rsdp_v1 version may not contain the
xsdt pointer, but may have the very same acpi revision as the acpi rsdp v2
version of multiboot2.

Fixes #5332
2024-10-07 14:44:30 +02:00
Benjamin Lamowski
cdc45e15f1 libc: implement kqueue(2)
Fixes #5301
2024-10-07 14:44:30 +02:00
Christian Helmuth
45cee6e951 libc: support asynchronous monitor jobs
Issue #5302
2024-10-07 14:44:30 +02:00
Christian Helmuth
899893cd17 libc: remove dynamic alloc from pthread_once
Fixes #5336
2024-10-07 14:44:30 +02:00
Michael Mueller
46fc5f748a Updated VSCode config. 2024-09-15 19:51:03 +02:00
Michael Mueller
3019ed2688 Rewrote some microbenchmarks. 2024-09-15 19:50:32 +02:00
Michael Mueller
7408bd2cd5 Updated more hashes. 2024-09-15 19:49:04 +02:00
Michael Mueller
809b54e524 Implemened stub for NUMA-aware try_alloc. 2024-09-15 19:48:13 +02:00
Michael Mueller
e7181adc88 Adapted blinktree application to changes in MxTasking. 2024-09-15 19:47:21 +02:00
Michael Mueller
7aaffa7f20 Enable debugging flag for MxTasking. 2024-09-15 19:46:28 +02:00
Michael Mueller
a71cc4fd0d Remove SSE3 from compile flags for NOVA as this caused a bootloop on some machines. 2024-09-15 19:45:55 +02:00
Michael Mueller
62f033ddaf Removed console log due to occassional livelocks. 2024-09-15 19:45:19 +02:00
Michael Mueller
e69d5847f2 Reduced time quantum for NOVA. 2024-09-15 19:44:43 +02:00
Michael Mueller
6e6c4411ce Added TOPO as provided service and increase RAM quota. 2024-09-15 19:44:18 +02:00
Michael Mueller
00c9932d5c Updated hashes. 2024-09-15 19:42:10 +02:00
Michael Mueller
0d9f359ec9 Increased number of caps available to core. 2024-09-15 19:40:48 +02:00
Michael Mueller
220d159b7c Updaded to version 24.08. 2024-09-14 23:35:10 +02:00
Christian Helmuth
131f8015f1 test-pthread: pthread_once stress test
Issue #5336
2024-09-06 10:38:45 +02:00
Christian Helmuth
505cd5e338 test-pthread: prevent compiler warnings
.../repos/libports/src/test/pthread/main.cc:539:76: warning: ‘++’ expression of ‘volatile’-qualified type is deprecated [-Wvolatile]
.../repos/libports/src/test/pthread/main.cc:1104:32: warning: ‘test’ may be used uninitialized [-Wmaybe-uninitialized]
2024-09-06 10:38:45 +02:00
Norman Feske
ce4f0cdd18 gui_fb: update coding style
Avoid Genode:: prefix, indicate 'Main' members as being private.
2024-09-06 10:38:45 +02:00
Norman Feske
f650f2e91b gui_fb: reset signal handlers when closing fb
The gui_fb client may have installed a custom sync_sigh and mode_sigh.
Reset those signal handlers at the GUI server should the client
disappear. Otherwise, the GUI server (nitpicker) continues to attempt
transmitting sync signals to the no-longer existing component, spamming
the log with "Warning: invalid signal-context capability" messages.
2024-09-06 10:38:45 +02:00
Norman Feske
dd13a976af wm: alloc real view IDs locally
Don't use client-provided view IDs as IDs for the wrapped nitpicker
views. There is no 1:1 relation of IDs and physical views. So if a wm
client re-uses an ID, the physical view is expected to stay in tact.
If the corresponding view object within the wm is not destroyed, however,
its ID remains allocated, which may then conflict the ID of a new view
if the ID is reused by the client. This scenario resulted in the
following error:

  Error: Uncaught exception of type 'Genode::Id_space<Gui::View_ref>::Conflicting_id'

This patch handles the situation by keeping the allocator of physical
views (_real_view) decoupled from the client's ID allocator.

Issue #5242
2024-09-06 10:38:45 +02:00
Josef Söntgen
cc2b628d1c pc_wifi: use '___ratelimit' dummy
The generated dummy triggers sometimes on base-foc.
2024-09-06 10:38:45 +02:00
Alexander Boettcher
e2dd009256 netperf: retire signal patches and setitimer
emulation. Issue #5337 adds the required support to the libc.
2024-09-06 10:38:45 +02:00
Norman Feske
fc3bd14da0 libc: rudimentary support for SIGALRM
This patch enables basic use cases of the POSIX 'alarm' function, which
schedules the delivery of a SIGALRM signal after a specified amount of
seconds.

Issue #5337
2024-09-06 10:38:45 +02:00
Johannes Schlatow
0a178dc625 fs_query: replace Avl_tree by Dictonary
This allows checking for duplicate directory entries. This occurs when
there are overlayed file systems.

Fixes #5334
2024-09-06 10:37:41 +02:00
Christian Helmuth
30e57b9f24 depot_autopilot: let sel4 chew on 22 tests per boot 2024-09-06 10:37:40 +02:00
Josef Söntgen
9cf24c9f78 pci_decode: remove HDAUDIO quirk
With the updated driver the quirk for certain devices is no longer
necessary.

Issue #5331.
2024-09-06 10:37:40 +02:00
Josef Söntgen
3e82422d17 dde_bsd: update audio driver to OpenBSD -current (2024-08-16)
This update uses a -current (that will become 7.6 later this year)
snapshot from 2024-08-16 that includes fixes for MSI support on
AMD systems.

Fixes #5331.
2024-09-06 10:37:40 +02:00
Josef Söntgen
8b06d7ff42 dde_bsd: update audio driver to OpenBSD 7.5
The update is mostly cosmetic in nature and amongst others adds PCIIDs
for Alder Lake-N devices.

Issue #5331.
2024-09-06 10:37:40 +02:00
Josef Söntgen
b8292124b9 audio_out.run: adapt for newer systems
Increase the RAM quota of the 'acpi' driver, add priorities and
configure the 'record_play_mixer' as is necessary on some newer
systems.

Issue #5331.
2024-09-06 10:37:40 +02:00
Josef Söntgen
d7724e9d6a ports: remove vbox5_genode_usb_hid_raw run-script
Issue #5330.
2024-08-30 07:56:29 +02:00
Josef Söntgen
975b550432 ports: add vbox6 USB HID raw test
This commit replaces the current vbox5 based USB HID raw test, which
runs a Genode guest to test USB passthrough with a USB human interface
device, with one using vbox6.

Fixes #5330.
2024-08-30 07:56:19 +02:00
Josef Söntgen
e199d937e2 libc/termios: satisfy vbox6 serial-port
This commit adds support for TIOCSETA and TIOCFLUSH in a dummy fashion
that is enough to allow vbox6's serial-port implementation to print
lines to the log.

Issue #5330.
2024-08-30 07:55:46 +02:00
Johannes Schlatow
2e584f2f86 depot: add vfs tools to pkg/goa
Fixed #5335
2024-08-30 07:48:15 +02:00
Christian Prochaska
996ebbcbe8 qt5: filter out base-$(KERNEL) include path
Issue #5325
2024-08-29 15:26:07 +02:00
Christian Prochaska
d00117e7aa qt6: filter out base-$(KERNEL) include path
Issue #5325
2024-08-29 15:26:03 +02:00
Christian Helmuth
0b55d9fa88 version: 24.08 2024-08-29 14:47:42 +02:00
Norman Feske
90a4922592 News item for version 24.08 2024-08-29 14:46:52 +02:00
Norman Feske
02c8d6ab48 Release notes for version 24.08 2024-08-29 14:22:24 +02:00
Christian Helmuth
26002a5482 depot: update recipe hashes 2024-08-29 12:32:25 +02:00
Norman Feske
395c3d901c README: link to genode.discourse.group 2024-08-29 11:28:12 +02:00
Norman Feske
dd1da81898 doc: update components.txt 2024-08-28 16:14:44 +02:00
Alexander Boettcher
6dfe05b5bf intel_fb.run: start usb driver for USB-C support
Makes the driver unit testing more reliable on USB-C supported notebooks.
It may be disabled easily, if it is not required.

Issue #5313
2024-08-28 15:07:52 +02:00
Christian Prochaska
f7a4d92c2f fixup "qt5: avoid build of qt libs as target dep" (lib/mk -> src/qt5)
Issue #5325
2024-08-28 13:47:27 +02:00
Christian Prochaska
c426929979 fixup "libports: add Qt6" (lib/mk -> src/qt6)
Issue #5325
2024-08-28 13:47:04 +02:00
Christian Prochaska
7f52089eae qt5: avoid build of qt libs as target dep
Issue #5325
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
1446da8aec lx_emul: add 'wake_q_add_safe' implementation
Enable 'wake_q_add_safe' for 6.6 based Linux versions and remove it from
generated_dummies.c of affected drivers.

issue #5264
2024-08-27 15:33:32 +02:00
Alexander Boettcher
61e2c630b1 intel/display: report more connector/display info
- Physical width/height of connected display in mm
- Current mode per connector

Issue #5264
2024-08-27 15:33:32 +02:00
Josef Söntgen
0ca2fdb2de extract: replace exceptions
This commit removes the usage of exceptions and replaces them with the
Attempt utility.

Issue #5326.
2024-08-27 15:33:32 +02:00
Josef Söntgen
1e933cc490 extract: add options to operate batch-processing
This commit allows for suppressing failed extract operations by
setting the 'ignore_failures' attribute in the 'config' node.
It is intended for operating the component in batch-mode where
multiple archives need to be extracted but failing to extract
some of them can by ignored. The default value of this option
is 'false'.

It also adds the 'stop_on_failure' attribute that instructs
the component to stop processing any following archives after
it already has failed to do so. The default value of this
option is 'true' to preserve the current behavior.

Issue #5326.
2024-08-27 15:33:32 +02:00
Josef Söntgen
9b01ca3086 extract: add README
Issue #5326.
2024-08-27 15:33:32 +02:00
Alexander Boettcher
d1f1a16e89 intel/display: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Josef Söntgen
e363af476b pc_wifi: update to Linux 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
19bb265539 pc_usb_host: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Christian Helmuth
44ec8ec7db pc_nic: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
dd0140f82e pc: use linux 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
653dfed0c5 wireguard: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
189fb008b3 test/driver_time: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
056c755708 usb_net: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
dbb51786fc usb_hid: update to 6.6.47
Issue #5264
2024-08-27 15:33:31 +02:00
Sebastian Sumpf
2014046f77 lxip: update to 6.6.47
Now, we schedule before unblocking the rx_task. This is done in order to
execute a potentially ready ksoftirqd before unblocking the rx_task,
which in turn may execute soft-interrupt handlers through bottom half
code leading to double lock attempts of the socket spinlock.

Issue #5264
2024-08-27 15:33:31 +02:00
Sebastian Sumpf
92b34837cb lx_emul: adjust to Linux 6.6.47
Issue #5264
2024-08-27 15:33:31 +02:00
Sebastian Sumpf
bb214af3eb virt_linux: update to 6.6.47
Issue #5264
2024-08-27 15:33:31 +02:00
Sebastian Sumpf
40009986ee dde_linux: Linux 6.6.47 port
Issue #5264
2024-08-27 15:33:31 +02:00
Sebastian Sumpf
4a7a4cfac5 dde_linux: move linux.port to legacy_linux.port
This is prerequisite for the Linux update. All dependencies relying on
the 'linux' have been adjusted to use 'legacy_linux'.

Issue #5264
2024-08-27 15:33:31 +02:00
Johannes Schlatow
3211a10573 depot: rename src/rump -> src/vfs_rump
For consistency, let's all archives of VFS plugins are prefixed with
"vfs_".

Fixed #5327
2024-08-27 15:33:31 +02:00
Johannes Schlatow
995208585b sculpt: move goa_testbed preset into pc repo
Since the preset contains mesa_gpu-intel, it is specific to the pc
platform. Other platform-specific repos (such as allwinner) may contain
their own preset with the same name. To prevent that Sculpt images use
the wrong preset due to the particular order in the build.conf, we move
the preset into the pc repo.

Fixes #5322
2024-08-27 15:33:31 +02:00
Christian Prochaska
18869199ca libports: add Qt6
Fixes #5325
2024-08-27 15:33:31 +02:00
Christian Prochaska
451ea47dd8 stdcxx: add symbols needed by Qt6 to symbol file
Fixes #5324
2024-08-27 15:29:38 +02:00
Christian Prochaska
b3bf9fc9ab libc: add _sigaction to symbol file
Fixes #5323
2024-08-27 15:29:38 +02:00
Christian Prochaska
d86d8b542f mesa: add 'lib/mk/mesa.mk' in depot recipe
Fixes #5321
2024-08-27 15:29:38 +02:00
Christian Prochaska
95d7e57d62 qt5: adapt to 'Gui::Session' interface changes
Issue #5242
2024-08-27 15:29:38 +02:00
Alexander Boettcher
b443375cde timer_accuracy: disable nova on qemu 2024-08-27 15:29:38 +02:00
Alexander Boettcher
15a69113fa run/gdb: increase RAM quota to 42M
Investigated in #5305
2024-08-27 15:29:38 +02:00
Alexander Boettcher
5537a26c25 gdb: patch sigaltstack
Avoid double allocation of alternative stack. Genode's sigaltstack variant
allocates the stack with alloc_secondary_stack. Disable the warning of
sigaltstack by using explicitly the nullptr in ss_sp.

Issue #5305
2024-08-27 15:29:38 +02:00
Christian Prochaska
730f9ea437 gdb: remove gdbserver_genode.patch
Issue #5305
2024-08-27 15:29:38 +02:00
Norman Feske
7e95d5701f os: remove os/handle_registry.h
This utility is superseded by the Id_space.

Issue #5242
Fixes #5317
2024-08-27 15:29:38 +02:00
Norman Feske
d762da8659 gui_session: allow return of View_capbility_error
This interface change gives GUI servers the freedom to allocate view
capabilities at the time of request instead of the creation time of the
view. This is useful because view capabilities are rarely needed.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
faf90f259c gui_session: rename 'view_id' to 'associate'
The view ID is specified as first argument to be consistent with 'view'
and 'child_view'.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
f98c356efd gui_session: manage view ID at the client side
This patch moves the management of view IDs from the server to the
client side. The former 'create_view' and 'create_child_view'
operations do no longer return a view ID but take a view ID as
argument. While changing those operations, this patch takes the
opportunity to allow for initial view attributes. Combined, those
changes simplify the window manager while accommodating typical
client use cases with less code.

To ease the client-side ID management, the Gui::Connection hosts
a 'view_ids' ID space for optional use. E.g., the new 'Top_level_view'
class uses this ID space for ID allocation. This class accommodates the
most typical use case of opening a single window.

The 'alloc_view_id' RPC function is no longer needed.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
805e3552fd gui_session: definition of Gui::Title
This commit allows all GUI clients and servers to talk about the same
type.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
24378ac873 gui_session: rename View_handle to View_id
The former Gui::Session::View_handle is not called Gui::View_id.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
d02a3d25d0 gui_session: replace Handle_registry by Id_space
This patch reworks the view-ID handling within the nitpicker GUI server
and the window manager. The namespace of view handles are now represented
as an Id_space. In constrast to the former "handles", which could be
invalid, IDs cannot be semantically overloaded with anything other than
an actual view reference. There is no notion of an invalid handle.
IDs are like C++ references (which cannot be a nullptr).

This change requires the code to be more explicit. E.g., the stacking of
a few at the front-most position can no longer be expressed by passing
an invalid handle as neighbor.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
4e711d4738 gui_session: split alloc_view_handle, view_handle
Express the allocation of a new view handle by a dedicated RPC function
instead of passing an invalid view handle to the existing 'view_handle'
function.

This eliminates the notion of invalid view handles at the GUI session
interface, clearing the way for managing view handles via an Id_space.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
f274ed549e gui_session: distinguish view-stacking operations
This patch eliminates the use of invalid view handles as special
Session::Command arguments. The TO_FRONT and TO_BACK operations
interpreted as invalid neighbor as top-most or back-most position.
Those corner cases are now expressed via dedicated commands. The
new stacking commands are FRONT, BACK, FRONT_OF, and BEHIND_OF.

While changing the command interface, the patch removes the OP_
prefix from the opcode values.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
b0803eabdb gui_session: simplify input/framebuffer aggregate
- Rename framebuffer_session to framebuffer and
  input_session to input as those RPC interfaces are no longer
  meant to be used as stand-alone sessions.

- Host Connection::input and Connection::framebuffer as public
  members, thereby removing the use of pointers. This simplifies
  the client-sized code. E.g., '_gui.input()->pending()' becomes
  '_gui.input.pending()'.

Issue #5242
2024-08-27 15:29:37 +02:00
Norman Feske
9823b7dbd0 gui_session: remove C++ exceptions
To maintain ease of use at the client side, the OUT_OF_RAM and
OUT_OF_CAPS results are handled at the 'Gui::Connection' now.

Gui::Connection does not inherit the Gui::Session interface any longer,
which allows for the use of different result types.

Issue #5242
Issue #5245
2024-08-27 15:29:37 +02:00
Norman Feske
1c148c7984 gui_session.h: distinguish child-view creation
This patch replaces the optional parent argument of the create_view
RPC function by a dedicated create_child_view RPC function. This
is a preparatory step of removing the notion of an invalid handle
as a special case.

Issue #5242
2024-08-27 15:29:37 +02:00
Josef Söntgen
83ddc41d63 lighttpd: prevent invalid fdarray access
The fd event handling uses the fd to directly access the array slot and
expects the fds to be contiguous and capped.

Since the returned fds from our libc were much larger than expected,
because the libc itself consumes multiple fds when managing sockets,
using the fd in this manner leads to memory corruption.

This commit limits the maxfds to 63 and always allocates 1024 slots
in the fd-array.

Fixes #5320.
2024-08-27 15:29:37 +02:00
Norman Feske
3b5ea97e8f News item about new Discourse forum 2024-08-27 15:29:37 +02:00
Christian Helmuth
f3217f6ab3 qemu-usb: improve isochronous error message 2024-08-27 15:29:37 +02:00
Johannes Schlatow
32b7a91c19 vfs_tap: prevent unnoticed link state changes
Swap order of link_state() and link_state_sigh() calls in order to not
miss any link state changes.

Fixes #5316
2024-08-27 15:29:37 +02:00
Alexander Boettcher
2e92b7ae32 nova: enable FPU AVX support
Add extended FPU state detection and handling (via xsave and friends) to the
kernel, which has to store/load more FPU state (~512 -> 2k++) during context
switching of threads. Additional the referenced nova branch contains various
optimization during VM destruction and cross core IPC resource caching.

This FPU work is based upon upstream NOVA kernel and Hedron commits.

Issue #5314
Fixes #3914
2024-08-27 15:29:37 +02:00
Alexander Boettcher
79506e4494 vbox5: disable xsave
some more adjustments are needed for xsave support, but this port is scheduled
to be removed. Just disable xsave for the time being to make nightly test
happy.

Issue #5314
2024-08-27 15:29:37 +02:00
Christian Helmuth
666a66e327 pc_wifi.run: spend 2M RAM for platform driver
Issue #5264
2024-08-27 15:29:37 +02:00
Josef Söntgen
2b3a2b875b wifi: fix double free during FW loading
The commit that added firmware loading via the VFS (see #4861)
introduces a double-free bug where the memory that contains the
image is freed twice, once from the callback and once from the
work function.

As alle examined drivers call 'release_firmware' from the callback
function themselves, remove the erroneous 'kfree' call from the
work function.

Issue #5264.
2024-08-27 15:29:37 +02:00
Josef Söntgen
572d406d66 sculpt_manager: remove inactive use_11n attribute
This is a follow-up commit to #4506 where the inactive 'use_11n'
attribute was already removed.

Issue #5262.
2024-08-27 15:29:37 +02:00
Josef Söntgen
978e82e893 sculpt_manager: enable updating of wifi quality
The 'update_quality_interval' instructs the wifi driver to update
the approximated link quality to the currently connected AP every
30 seconds.

Issue #5262.
2024-08-27 15:29:37 +02:00
Josef Söntgen
bc64d53a77 driver/wifi: update the connected signal quality
This commit introduces support for querying and updating the signal
quality of the established connection to the current accesspoint.

By setting the 'update_quality_interval' to a non-zero value specified
in seconds the 'state' report will be updated to incorporate the
current signal quality. It uses the same approximation as is already
in use by the scan results.

Fixes #5262.
2024-08-27 15:29:37 +02:00
Stefan Kalkowski
672179c3b8 usb: correct order of index, value in Alt_setting
Fix genodelabs/genode#5315
2024-08-27 15:29:37 +02:00
Norman Feske
89446084f3 test/nitpicker: fix interaction in non-alpha mode
Commit "gui_session,nitpicker,testnit: update coding style" broke the
user-input handling of the test when configured w/o alpha.
2024-08-27 15:29:37 +02:00
Christian Helmuth
d40f9b712e genode_c_api: do not match HID in AUDIO devices
Now, USB audio class devices become available in Sculpt, e.g., for vbox
passthrough, and are not automatically grabbed by the usb_hid class=3
policy. In the future, interface/endpoint level policies will enable
driving the HID interface only from usb_hid while a usb_audio driver
controls the rest of the device.
2024-08-27 15:29:37 +02:00
Spencer
91e81591fe Update documentation for hello_tutorial
Bring the docs up to date with the current run definition at
https://github.com/genodelabs/genode/blob/master/repos/hello_tutorial/run/hello.run
as well as changes to the imports of
https://github.com/genodelabs/genode/blob/master/repos/hello_tutorial/src/hello/server/main.cc

Fix #5291
Fix #5292
2024-08-27 15:29:37 +02:00
Christian Helmuth
e64b07d7a4 internet_checksum.run: don't use bad trafgen seeds 2024-08-27 15:29:37 +02:00
Stefan Kalkowski
e5c0d5247e simplify interactive USB HID test metric
To circumvent recurring false-positives whenever things
in the USB drivers or its environment changes, limit
the checks to the event listener itself.
2024-08-27 15:29:36 +02:00
Norman Feske
f283c2e7b2 news.txt: Genode at FrOScon 2024 2024-08-27 15:29:36 +02:00
Martin Stein
af78376627 tresor: add readme file
Fix #5311
2024-08-27 15:29:36 +02:00
Stefan Kalkowski
a7b4add27c hw: move cpu kernel object into cpu local area
Fix genodelabs/genode#5310
2024-08-27 15:29:36 +02:00
Stefan Kalkowski
9258004cc7 hw: move stack into cpu local mem area
Ref genodelabs/genode#5310
2024-08-27 15:29:36 +02:00
Stefan Kalkowski
6afe4f79a2 base: tie quota_lim_downscale template to size_t
* Always use size_t instead of template type
* Thereby we can remove 128-bit type from all architectures in base-hw

Ref genodelabs/genode#5310
2024-08-27 15:26:51 +02:00
Stefan Kalkowski
7770285aed hw: remove duplicated definition of x86 local APIC
Ref genodelabs/genode#5310
2024-08-27 15:26:51 +02:00
Josef Söntgen
6889959f59 linux-firmware: add AX200, 9560 and T430/T530
This commit adds the firmware image for the AX200 device as found
in the Tuxedo Pulse 15 Gen1, the 9560 as found in the Starlite and
the for devices found in the T430/T530.

Fixes #5282.
2024-08-27 15:26:51 +02:00
Alexander Boettcher
99667de35b nova: limit assertions during early boot
Turn some of the current assertions into warnings/error messages and
continue boot. Print the messages as soon as core_log is initialized,
so that on live/release systems (Sculpt OS) it may be inspected later on.

Related to issue #5307
2024-08-27 15:26:51 +02:00
Alexander Boettcher
eaadc6aad6 nova: support to run on e-core only SOCs
The code to group together SMT threads of one CPU and to move P-Core to
the beginning of Genode's affinity-space, did not consider to run on
SOCs with only E-Core CPUs.

Re-structure the code to support e-Core only SOCs.

Additionally, provide a fallback mapping in case of CPU id reordering problems.
Track faulty re-mapping and delay the reporting until core_log is initialized,
so that the warnings is visible to consumers, e.g. on Sculpt OS.

Related to discussion of #5304

Fixes #5307
2024-08-27 15:26:51 +02:00
Christian Helmuth
044d8bca44 dde_linux: improve handling of IRQ masking and ack
Unmasking of a pending interrupt did not lead to immediate IRQ handler
execution in all cases.

This commit also addresses some style concerns risen during the issue
discussion.

- Replace multi-boolean IRQ state by state enum
- EOI and ACK should be same in DDE context
- Unify x86 and ARM irqchip.c
- Remove Pending_irq type
- Remove dde_irq_set_wake()

Fixes #5164
2024-08-27 15:26:51 +02:00
Alexander Boettcher
56ee01bc8c vbox6: clear screen on guest triggered blanking
An invalid bitmap is exactly once set during blanking, use this as hint
to clear the GUI content. Same as done in vbox5.

Fixes #5263
2024-08-27 15:26:51 +02:00
Sebastian Sumpf
f552b26fb9 vfs_lwip: check _pcb for null in write_ready
_pcb may be zero due to shutdown or error in Tcp_socket_dir
2024-08-27 15:26:51 +02:00
Christian Helmuth
a441bdf59a lx_emul: enable SLUB allocator (pc, virt)
The use of the Linux-internal SLUB allocator is supported by lx_emul and
drivers may now decide between the Linux implementation or our emulation
of kmem_cache. Drivers for pc and virt already use SLUB, while other
drivers still use the emulation and may be adapted step-by-step incl.
the testing on the devices.

Fixes #5236
2024-08-27 15:26:51 +02:00
Alexander Boettcher
a798f70284 libc: add limited sigaltstack support
Allocate a Genode known stack via alloc_secondary_stack and register it
as alternative stack via Signal:use_alternative_stack().

The original semantic of Posix, where the caller may choose arbitary stack
pointers is currently not possible. Warn about the fact.

Issue #5305
2024-08-27 15:26:51 +02:00
Alexander Boettcher
0c5df0036c libc: support to execute signal on separate stack
With the commit LibC signals will be executed on a separate stack and
not anymore on the kernel or user stack.

Fixes #5305
2024-08-27 15:24:20 +02:00
Christian Helmuth
992b412be2 lx_emul: silently drop KEY_FN in evdev
The Fn key on keyboards should never be reported as real scancode event,
as it is just a hardware switch that changes the reported scancodes of
other keys. The behavior of Linux hid-apple.c is wrong as it on one hand
reports different scancodes for the same hard key depending on the Fn
state but sends the Fn press and release events too. Thus from now on,
we just drop KEY_FN events for all drivers as otherwise, scancodes
generated generated by Fn+key combinations would never be single-key
events on upper layers, for example KEY_FN + KEY_F12 on the Matias Apple
keyboard clone in the fixed issue.

Fixes #5288
2024-08-27 15:24:20 +02:00
Roman Iten
110a24f650 run/sntp_client: adjust run_genode_until condition
By calling run_genode_until twice, we take into account that the boot
time on some boards might long than on others, while still verifying
that the second "set_rtc" is reported within about 1min (+10s).

Fixes #5306
2024-08-27 15:24:20 +02:00
Johannes Schlatow
86848d2868 sculpt: add debug monitor to goa testbed
This also adds policies and domains to the nic router config for gdb and
vnc.

Fixes #5293
2024-08-27 15:24:20 +02:00
Christian Helmuth
62061c5596 wg_fetchurl.run: create data file early (fix linux) 2024-08-27 15:24:20 +02:00
Christian Helmuth
c0f6d9ba7e lx_emul: cache_line_size and cpufeature on arm64
Issue #5236
2024-08-27 15:24:20 +02:00
Christian Prochaska
ae8eb37ca2 qt5: QPA plugin improvements
Fixes #5285
2024-08-27 15:24:20 +02:00
Christian Prochaska
6acfe8a41e wm: forward mode change signal to viewless clients
Fixes #5284
2024-08-27 15:24:20 +02:00
Johannes Schlatow
8ef88ae084 monitor: skip wait for terminal connection
Waiting for the terminal connection (e.g. if routed to a tcp_terminal)
can cause the monitor to get stuck in the '_handle_config' method.

Fixes #5275
2024-08-27 15:24:20 +02:00
Johannes Schlatow
5bc6c9f2d0 tcp_terminal: fix destruction of Open_socket
The socket API close() must be called within a libc context. Moreover,
the socket for listening needs to be closed as well.

Fixes #5270
2024-08-27 15:24:20 +02:00
Johannes Schlatow
7b8a2e77e4 socket_fs: invalidate fd on context destruction
This prevents accesses to `Socket_fs::Context::_fd_ready_ready()` that
caused a "__cxa_pure_virtual called" error.

Fixes #5265
2024-08-27 15:24:20 +02:00
Pirmin Duss
96ef527436 Gpio::Connection accept a session label
This allows a component to access GPIOs from different banks of
an SOC.

Issue genodelabs#5273
2024-08-27 15:24:20 +02:00
Johannes Schlatow
09c40688e1 platform/pc: remove translations after Out_of_ram
Since page tables might need to be allocated during
insert_translation(), Out_of_ram or Out_of_caps exceptions might occur.
Entries that have already been added by insert_translation() must thus be
removed once one of those exceptions occurred.

Fixes #5254
2024-08-27 15:24:20 +02:00
Norman Feske
a83d7d515d doc/challenges.txt: an overdue update 2024-08-27 15:24:20 +02:00
Norman Feske
33bcd7c02e doc/tool_chain.txt: change download URL to GitHub
Also make the description more concise, and present the download
information before the extraction step.
2024-07-02 12:00:11 +02:00
Sebastian Sumpf
190d49527c rump: add reproducible option to newvers.sh
issue #5255
2024-07-02 12:00:11 +02:00
Sebastian Sumpf
eb656bf40c libcrypto: add support for SOURCE_DATE_EPOCH
Use SOURCE_DATE_EPOCH for build date if present.

issue #5255
2024-07-02 12:00:11 +02:00
Sebastian Sumpf
cfe27e07de themed_decorator: use TAR_OPT for archive
This commit produces a consistent tar archive.

issue #5255
2024-07-02 12:00:11 +02:00
Sebastian Sumpf
458cb25d6c qt5: use TAR_OPT for archives
This commit produces consistent tar archives.

issue #5255
2024-07-02 12:00:11 +02:00
Sebastian Sumpf
ddcfe51ef5 base/global.mk: TAR_OPT
Add TAR_OPT to global.mk that defaults to user and group 1, while
setting mtime to 0 for tar archives. This can be used in components to
produce consistent (reproducible) tar archives.

issue #5255
2024-07-02 12:00:11 +02:00
Norman Feske
943dfa10e7 base/child.h: remove exceptions from process init
This patch replaces the former Child::Process and
Child::Process::Loaded_executable classes by static functions that
return failure conditions as return values.

Issue #5245
2024-07-02 12:00:11 +02:00
Norman Feske
0288cffaee Remove exceptions from 'Parent' interface
Issue #5245
2024-07-02 12:00:11 +02:00
Norman Feske
19c13877ca Replace use of 'typedef' by 'using'
Issue #5227
2024-07-02 12:00:11 +02:00
Norman Feske
361557e1f0 base-*: omit () for lambas w/o argument
Issue #5227
2024-07-02 12:00:11 +02:00
Norman Feske
a2b0553c51 base-*: use C++20 function template syntax
Issue #5227
2024-07-02 12:00:11 +02:00
Johannes Schlatow
b5c9107465 use /depot as depot directory in debug info
By using GCC's --debug-prefix-map argument, we can make sure that debug
archives always refer to source files at /depot. With this change, GDB
can be pointed to the correct source-file location by using the `set
substitute-path /depot /path/to/local/depot`.

Fixes #5260
2024-07-02 12:00:10 +02:00
Norman Feske
d44ec53cd3 core: tie Platform_thread to Platform_pd
This patch tightens the coupling of the 'Platform_thread' objects
with their corresponding 'Platform_pd' objects by specifying the
'Platform_pd' as constructor argument, keeping the relationship
as a reference (instead of a pointer), and constraining the
lifetime of 'Platform_pd' objects to the lifetime of the PD.

It thereby clears the way to simplify the thread creation since all
PD-related information (like quota budgets) are now known at the
construction time of the 'Platform_thread'.

The return value of 'Platform_thread::start' has been removed because it
is not evaluated by 'Cpu_thread_component'.

Related to #5256
2024-07-02 11:59:16 +02:00
Alexander Boettcher
c18f7c7594 timer: remove old timer infrastructure
Fixes #5138
2024-07-02 11:59:16 +02:00
Alexander Boettcher
462718bcf0 epit: move timer to imx repository
Issue #5138
2024-07-02 11:59:16 +02:00
Stefan Kalkowski
969a0583ee qemu-usb: handle smaller isochronous packets
Fix the wrong assumption about isochronous packets being always send
with maximum EP's packet size. Instead the isochronous cache now contains
a sizes array to deal with arbitrary packet sizes.

Fix genodelabs/genode#5257
2024-07-02 11:59:16 +02:00
Stefan Kalkowski
f1f2d759af libusb: re-enable timeout setting for control urbs
Fix genodelabs/genode#5259
2024-07-02 11:59:16 +02:00
Stefan Kalkowski
73b65084e2 pin_session: add missing header
Fix genodelabs/genode#5258
2024-07-02 11:59:16 +02:00
Christian Prochaska
37e0d20bf2 qt5: adaptation to 'Genode::Region_map' changes
Issue #5245
2024-07-02 11:59:16 +02:00
Norman Feske
5a6c4d6ff2 base-hw: handle cap-slab exhaust in Thread::start
This interim solution for issue #5256 solves the problem for the
thread.run script.

Issue #5256
2024-07-02 11:59:16 +02:00
Stefan Kalkowski
d9d2a7584e base-hw: remove cortex spec directories
For consistency reasons, remove the cortex_a8, cortex_a9, and cortex_a15
spec directories. Such SPEC variables do not exist since a while.
Also rename remaining translation_table.h header to page_table.h to
stay consistent with the class names inside.

Fix genodelabs/genode#5253
2024-07-02 11:59:16 +02:00
Norman Feske
0105494223 Rework Region_map interface
- Remove exceptions
- Use 'Attr' struct for attach arguments
- Let 'attach' return 'Range' instead of 'Local_addr'
- Renamed 'Region_map::State' to 'Region_map::Fault'

Issue #5245
Fixes #5070
2024-07-02 11:59:16 +02:00
Norman Feske
d866b6b053 Remove exceptions from Cpu_session interface
The 'Thread_creation_failed' error is now reflected as
'Thread::Start_result' return value. This change also removes the
use of 'Invalid_thread' within core as this exception is an alias
of Cpu_session::Thread_creation_failed.

Issue #5245
2024-07-02 11:59:16 +02:00
Martin Stein
e7f564cd3b nic_router: use C++20 function template syntax
Fix #4534
2024-06-20 13:51:26 +02:00
Martin Stein
7d576b4f15 nic_router: re-use ARP waiters for same IP address
For each packet that got stuck with an ARP-cache miss, the router used to send
one ARP request and create one ARP waiter. However, in situations where many
packets target the same IP at one destination domain and during a short period
of time, this causes unnecessary session-quota consumption and network traffic.
This issue becomes especially pressing when taking malicious source peers,
absent destination peers, and packet batching into account.

Therefore, with this commit, the router can accumulate multiple source packets
with the same destination IP at one ARP waiter. This means, that only the first
packet with an ARP-cache for a certain IP sends an ARP request and creates an
ARP waiter. For situations where the ARP request is not answered, this
essentially rate-limits ARP requests for one IP at one destination domain
according to the lifetime of ARP waiters (default: 10s)

Ref #4534
2024-06-20 13:50:55 +02:00
Martin Stein
31a438edf6 nic_router: prevent ARP request without ARP waiter
The router used to send an ARP request for a packet before allocating the
corresponding ARP waiter. If the ARP waiter could not be allocated due to
resource exhaustion plus emergency free failed, the packet got dropped and the
router had produced unnecessary network traffic. The commit fixes this by
sending only after successful allocation.

Ref #4534
2024-06-20 13:49:53 +02:00
Martin Stein
682dedb2e1 nic_router: lower packet-batch count to 50
The previous default packet-batch count of 150 (<config
max_packets_per_signal>) was choosen with the only goal of preventing
starvation by huge amounts of packets from one session.

However, there is something else to keep in mind. A packet that is found to
require ARP sends an ARP request and becomes blocked after having consumed
resources. This means, that, in the worst case, the router used to send 150 ARP
requests and consume resources 150 times before making it even possible for the
outer world to react and cause resources to be freed.

With this additional scenario in mind, the default batch size should be
significantly lower.

Ref #4534
2024-06-20 13:49:24 +02:00
Stefan Kalkowski
e93f5fe8e0 base-hw: move imx53-specifics to imx repository
Ref genodelabs/genode#5252
2024-06-20 13:25:06 +02:00
Stefan Kalkowski
0c8abf9b50 os: move imx sd_card driver to imx repository
Ref genodelabs/genode#5252
2024-06-20 13:24:44 +02:00
Stefan Kalkowski
d1123ebe4c os: move imx8q_evk's i2c driver to imx repo
Ref genodelabs/genode#5252
2024-06-20 13:24:44 +02:00
Stefan Kalkowski
86386548c0 os: move synaptics_dsx touch driver to imx repo
Ref genodelabs/genode#5252
2024-06-20 13:24:44 +02:00
Stefan Kalkowski
6162eae9e0 os: move tz_vmm example to imx repository
Ref genodelabs/genode#5252
2024-06-20 13:24:44 +02:00
Stefan Kalkowski
5a8d149fe3 hw: move all imx7d specifics to imx repository
Ref genodelabs/genode#5252
2024-06-20 13:24:41 +02:00
Alexander Boettcher
ed522d51c8 linux: use new timer scheme
Issue #5138
2024-06-20 13:19:43 +02:00
Alexander Boettcher
32c5ef32e9 foc: use new timer scheme
Issue #5138
2024-06-20 13:19:43 +02:00
Norman Feske
299951ced5 depot: update recipe hashes 2024-06-20 12:59:00 +02:00
Christian Helmuth
65957e024d Transfer 2x16 MiB in wg_fetchurl test 2024-06-20 12:56:20 +02:00
Stefan Kalkowski
f0e9ce7422 stdcxx: add missing symbol for std::basic_fstream 2024-06-20 12:56:20 +02:00
Benjamin Lamowski
e153f44ce8 libc: handle invalid file descriptors in poll()
poll(2) needs to handle invalid file descriptors in the pollfd struct,
specifically -1 as it may be used to disable entries in the fds[] array.

Fix a possible nullptr dereference by checking the File_descriptor
pointer returned by find_by_libc_fd() for validity and skip processing
of any unresolved FDs, effectively implementing standard POSIX
semantics.

Fixes #5249
2024-06-20 12:56:20 +02:00
Christian Helmuth
9d42890fbf fetchurl: remove Genode:: prefixing 2024-06-20 12:56:20 +02:00
Christian Helmuth
258c06df03 virt/lx_emul: init boot_cpu_data on x86
Values are used by arch/x86/lib/delay.c and slub allocator.

Issue #5236
2024-06-20 12:56:20 +02:00
Norman Feske
14d3c4cb5e Remove Cpu_session::State_access_failed exception
This patch removes the exception formerly thrown by 'Cpu_thread::state'
and turns the 'Thread_state' structure into a plain compound type w/o a
constructor.

Issue #5245
Fixes #5250
2024-06-20 12:56:20 +02:00
Johannes Schlatow
16b863fc6e tool/run: use xmlcatalog for xsd file paths
With libxml2 >= 2.13, the `-path` argument can no longer be used for
setting search paths for xsd files. Instead, we use an XML catalog to
replace genode:// URIs with absolute paths.

Fixes #5248
2024-06-20 12:56:20 +02:00
Norman Feske
5181d08d05 Remove exceptions from Rm_session interface
Issue #5245
2024-06-20 12:56:20 +02:00
Norman Feske
0d7d60a1f4 Remove exceptions from Pd_session interface
This patch replaces exceptions of the PD session RPC interface with
result types.
The change of the quota-transfer RPC functions required the adaptation
of base/quota_transfer.h and base/child.h.
The 'alloc_signal_source' method has been renamed to 'signal_source'
to avoid an exceedingly long name of the corresponding result type.
The Pd_session::map function takes a 'Virt_range' instead of basic-type
arguments.
The 'Signal_source_capability' alias for 'Capability<Signal_source>' has
been removed.

Issue #5245
2024-06-20 12:56:19 +02:00
Alexander Boettcher
08066269ba fiasco: update to new timer scheme
Issue #5138
2024-06-20 12:56:19 +02:00
Martin Stein
a450110b97 run/nic_router_uplinks: use test component
So far, this test used dynamic_rom for the re-configuration of the nic router
and tested for the expected ping results by inspecting the log with the run
tool. However, this approach had two issues:

* Timing differs significantly on different targets and so the dynamic_rom had
  the difficult task of compensating with heuristics without bloating the test
  duration too much.

* In case of a failing test, it was difficult to determine the cause as the
  test kept running and produced output for quite some time and there was also
  no specific error message but only a generic timeout.

These two issues are now fixed by introducing a test component that listens to
the ping-result report and manages the nic router configuration. The new
component exits early on failure and provides information on the error
circumstances. Furthermore, the component advances to the next test step only
after having seen the expected result of the active test step and thereby
removes the need for heuristics about target timing.

Fixes #5192
2024-06-20 12:56:19 +02:00
Martin Stein
a935a733ab ping: support reporting results
This feature simplifies automated testing. It was added to enable the creation
of the test/nic_router_uplink component.

Ref #5192
2024-06-20 12:56:19 +02:00
Norman Feske
24342db476 base/signal.h: remove pointers from API
This patch updates the signal API to avoid raw pointers, and
replaces the Context_already_in_use and Context_not_associated
exceptions by diagnostic messages.

Fixes #5247
2024-06-20 12:56:19 +02:00
Norman Feske
dcddeccccc app/acpi_event: update coding style
Remove exceptions, replace pointer lookup by with_ pattern,
use Xml_node::attribute_value, constness, naming of signal handlers

Issue #5245
2024-06-20 12:56:19 +02:00
Norman Feske
8a0689d832 Remove Pd_session::Invalid_signal_source exception
While changing 'Pd_session::alloc_context', this patch also tightens the
type of the imprint argument.

Issue #5245
2024-06-20 12:56:19 +02:00
Norman Feske
a52c2ce141 Remove exceptions from TRACE session interface
- Use attempt pattern for error handling
- Replace lookup of pointers by with_ pattern
- Remove virtual Trace::Session methods
- Merge client.h into connection.h
- Update coding style of test/trace

Issue #5245
2024-06-20 12:56:19 +02:00
Norman Feske
7de2f57ef2 Remove Xml_node::attribute accessors
This patch removes the two 'Xml_node::attribute' accessors along with
the 'Nonexistent_attribute' exception.

Issue #5245
Fixes #5246
2024-06-20 12:56:19 +02:00
Martin Stein
84bbde2879 nic_router: fix interface-local quota reporting
The router used to ignore the value of the <report quota=".."/> attribute when
it came to determining whether an interface's report is empty or not.
Therefore, merely configuring <report quota="yes"/> didn't cause interfaces
(and their quota) to show up in the report. Instead, interface quota was
reported as side effect of <report stats="yes"/>. The commit fixes this
inconsistency with the README.
2024-06-20 12:56:19 +02:00
Martin Stein
09b3fa389d nic_router: destroy timed out ARP waiters
The only object that is dynamically allocated by a network interface and that
was not equipped with a self-destruct timeout was the ARP waiter. This commit
closes this gap by adding a timeout to each ARP waiter that is set to 10
seconds by default but can be configured via the new <config> attribute
'arp_request_timeout_sec'.

Ref #4729
2024-06-20 12:56:19 +02:00
Martin Stein
20371d0445 nic_router: drop closed tcp links immediately
RFCs recommend to keep TCP connections for a certain time even after they
finished a close handshake, AFAIK, in order to be able to recognize astray
packets when they arrive later. This seems overambitious especially when in
the context of the router where session quota is pretty limited. Therefore,
this commit drops this final timeout and drops closed connections immediately.

Ref #4729
2024-06-20 12:56:19 +02:00
Martin Stein
58726a6707 nic_router: lower non-open tcp timeout to 30 sec
The previous value of 60 seconds was never observed in real-time scenarios and
UDP, for instance always used a timeout of 30 seconds without causing issues.
Note that this applies only to TCP connections in a state other than
ESTABLISHED, i.e., while it is still safe to early-drop the connection.

Ref #4729
2024-06-20 12:56:19 +02:00
Martin Stein
0a33168733 nic_router: mark tcp open only with full handshake
The TCP connection state "ESTABLISHED" (in the router "OPEN") is a privileged
one for peers because it lasts very long without any peer interaction (in the
NIC router it's only 10 minutes, but RFCs recommend not less than 2 hours and
4 minutes). Furthermore, TCP connections in this state are normally not
available for early-drop on resource exhaustion. This means that this state
binds resources to a connection potentially for a long time without the option
of regaining them under stress. Therefore, this state should be entered with
care.

Up to now, the router marked a TCP connection with this state as soon as it had
seen one matching packet in both directions, which is rather quick. However,
implementing a very precise tracking of the exact TCP states of both peers and
only marking the connection "ESTABLISHED" when both peers are "ESTABLISHED" is
a difficult task with lots of corner cases.

That said, this commit implements a compromise. The router now has two flags
for each peer of a TCP connection - FIN sent and FIN acked - and sets them
according to the observed TCP flags. The "ESTABLISHED" state is entered only
when FIN acked is set for both peers (without having observed an RST or FIN
flag meanwhile).

Ref #4729
2024-06-20 12:56:19 +02:00
Martin Stein
93c3f6371b nic_router: remove reference utilities
The Reference and Const_reference utility were introduced in order to express
that something is a reference (no null value) but can be changed dynamically
(not possible with built-in C++ references). However, the idea of preventing
every possibility for null pointer faults, with which the router was built
initially, has not prevailed and using pointers instead of the utility saves
logic and makes the code more readable to other C++ developers.

Ref #4729
2024-06-20 12:55:47 +02:00
Martin Stein
f7f171e457 nic_router: fix leak on domain deinit
The deinitialization method of Domain used to rely on Domain::with_dhcp_server
in order to dissolve and destroy a present DHCP server. However, this method
skipped calling its functor argument also when there was a DHCP server but an
invalid one. This commt replaces the with_dhcp_server with a pointer null-check
in order to fix the leak.

Ref #4729
2024-06-20 12:54:31 +02:00
Martin Stein
c96150bc70 nic_router: smarter emergency free on exhaustion
Re-implements an emergency freeing of resources on exhaustion of session quota.
In contrast to the past one, the new algorithm is executed directly where the
exhaustion occurs. Instead of interupting the packet handling and restart it
from the beginning after the freeing action, packet handling is now continued
at the point of exhaustion (if enough resources could be freed). Furthermore,
the new algorithm frees only 100 objects (instead of 1024) at a max as we found
this to better match real-life observations. And finally, the router now drops
ICMP first, then UDP, then TCP - as this better reflects priorities - and
refrains from dropping TCP connections in the ESTABLISHED state. If the router
cannot free a sufficient amount of resources, the packet that caused the
exhaustion is dropped with a warning (verbose_packet_drop="yes").

Ref #4729
2024-06-20 12:54:31 +02:00
Martin Stein
ac42ade48c nic_router: remove use of exception handling
Remove the use of C++ exception as much as possible from the router as C++
exception handling can be resource intensive and can make code hard to
understand.

This also removes the garbage collection that the router used to do when a
session ran out of quota. This is motivated by the fact that the garbage
collection was rather simple and removed connection states regardless of their
current state, thereby causing broken connections. The change is part of this
commit as the approach to integrating garbage collection relied strongly on
exception handling.

The user story behind removing garbage collection: The router emergency-dropped
an established TCP connection (with NAPT) and on the next matching packet
re-created it with a different NAPT port, thereby breaking the connection. With
this commit, existing connections are prioritized over new ones during resource
exhaustion and the packets that attempt to create a new connection in such a
state are dropped with a warning in the log (verbose_packet_drop="yes").

Note that the state resolves itself with time as existing connections time out
or are closed by peers.

Ref #4729
2024-06-20 12:54:31 +02:00
Martin Stein
0faec6afaa net/port.h: default constructor
Adds default constructor to Net::Port that initializes the value to 0. This
allows for using Net::Port with the Genode::Attempt utility.

Ref #4729
2024-06-20 12:54:30 +02:00
Alexander Boettcher
25717df15f lib/format: support asterisk with format specifier
used by some libraries, e.g:

printf("%*.s", 5, "Sun");     -> '  Sun'
printf("%.*s", 2, "Sun");     -> 'Su'
printf("%*.*s", 5, 2, "Sun"); -> '   Su'
printf("%.*d", 3, 10);        -> ' 10'

Issue #5234
2024-06-20 12:54:30 +02:00
Johannes Schlatow
0aafec038d platform: pass reserved memory update to IOMMU
Only add default mappings on IOMMU construction and on reserved-memory
updates.

Issue #5232
2024-06-20 12:54:30 +02:00
Johannes Schlatow
6912dd62fa platform: handle reserved memory on devices update
Reserved memory regions must be excluded from the corresponding DMA
allocators irrespective of whether the device is in use. Otherwise, an
early allocation of DMA buffers may use the reserved memory regions of a
late acquired device.

Fixes #5232
2024-06-20 12:54:30 +02:00
Alexander Boettcher
ba473134da acpica: avoid special mmio address request
Add special handling for root bridge access for

12th Gen Framework laptop and Thinkpad X1 Nano Gen2

to avoid bogus MMIO memory accesses as seen in #5234 and #4643.

Fixes #5234
2024-06-20 12:54:30 +02:00
Alexander Boettcher
a12ff58674 base-nova: remove special acpica/iomem region
Based on not emulated and therby wrong values, acpica calculates a
physical address which points to somewhere. Remove this hack from core and
try to emulate accesses inside acpica where necessary.

Issue #4643
Issue #5234
2024-06-20 12:54:30 +02:00
Norman Feske
0062a3e784 sculpt: version 24.06 2024-06-20 12:54:30 +02:00
Norman Feske
ef385696f6 base/child.h: remove Nonexistent_id_space exception
This exception got introduced as a mere convenience for implementers of
'Child_policy' but required a special case in the base library.
Following the goal of eliminating exceptions from the base system,
this patch removes it by making a server_id_space mandatory.

Issue #5245
2024-06-20 12:54:30 +02:00
Alexander Boettcher
8b0a16d750 driver/platform: re-configure bridges on resume
Fixes #5241
2024-06-20 12:54:30 +02:00
Alexander Boettcher
3216733a05 driver/platform: remember bridge configuration
by evaluating the pci decode's 'devices' ROM and storing the information in
the pci config list model representation.

Issue #5241
2024-06-20 12:54:30 +02:00
Alexander Boettcher
0c97c13562 pci_decode: report pci bridge configuration
as setup by firmware after boot. The information will/can be used by the
platform driver to re-program bridges after a system suspend/resume cycle.

Issue #5241
2024-06-20 12:54:30 +02:00
Alexander Boettcher
7f152ea9ba acpi_suspend: add wifi support
Serves as resume testcase for device behind a pci bridge.

Issue #5241
2024-06-20 12:54:30 +02:00
Norman Feske
dd4b19cda7 base: Remove use of Id_space::Unknown_id exception
Issue #5244
2024-06-20 12:54:30 +02:00
Norman Feske
7c91596922 Exception-less overload of 'Id_space::apply'
This patch allows the use of the 'Id_space' utility without catching
'Unknown_id' exceptions. Instead, the new 'apply' overload takes a
second functor 'missing_fn' as argument, which is called whenever the
lookup fails.

Issue #5244
2024-06-20 12:54:30 +02:00
Christian Helmuth
73d18261dc Fix calculation in timer_ticks_to_us()
Added missing factoring of the upper-half division remainder into the
lower-half calculation.

Fixes #5243
2024-06-20 12:54:30 +02:00
Norman Feske
a70354cb18 Remove gems/wrapped_gui_session.h
This utility is no longer used.
2024-06-20 12:54:30 +02:00
Norman Feske
b9594c2ae8 gui_session,nitpicker,testnit: update coding style
- Replace 'typedef' by 'using'
- Avoid plain pointers
- Import Genode namespace into Gui::
- Use enum class
- Use Attr struct for passing multiple attributes
- Turn testnit into proper Genode::Component
  - Use distinct types for top-level and child views
  - Remove dependency from timer
  - Use util/geometry.h
2024-06-20 12:54:30 +02:00
Christian Prochaska
06d098052f qt5: adapt to C++20 API changes
Issue #5227
Issue #5239
2024-06-20 12:54:30 +02:00
Norman Feske
4969c7cdb0 Reduce code duplication by using Point::from_xml 2024-06-20 12:54:30 +02:00
Norman Feske
b11116088a cpu_load_display: enable strict conversions
Besides raising the warning level, the patch updates the coding style
('with_' pattern, using, type safety, constness).
2024-06-20 12:54:30 +02:00
Norman Feske
c629c54153 Make util/geometry.h C++20 friendly
- Move header to base/include to make it applicable for base types
  like 'Affinity' down the road.
- Represent 'Rect' as typle of point and area, which is the most
  common form of initialization, creates in valid 'Rect' by default.
- Turn Point, Area, and Rect into compound types, making x, y, w, h, at,
  area accessible without a method call
- 'Rect::Compound' function for constructing a 'Rect' from two points,
  replacing a former constructor
- Use result type 'Rect::Cut_remainder' instead of out parameters.

Fixes #5239
2024-06-20 12:54:30 +02:00
Norman Feske
bb06d879aa os: make 'Genode::Color' C++20 friendly
This patch turns 'Color' from a class to a POD type by replacing
the constructors by the named create functions 'rgb', 'clamped_rgb',
and 'clamped_rgba'. It thereby enables the initialization of Color
values using { .r = ... } syntax and makes the type usable in const
expressions.

It also narrows the type for color components and alpha values to
uint8_t. So possible integer overflows of computed values are detected
by -Wconversion.

As 'Color::rgb(0, 0, 0)' is repeatedly used as a default value, the
patch adds the 'Color::black()' function.

Fixes #5238
2024-06-20 12:54:30 +02:00
Christian Helmuth
791dd38160 wireguard: clean up build order/structure
- Move C++ sources from lib/wireguard to app/wireguard, which require
  Genode include paths (that conflict with linux)
- Rename lib/wireguard_lx_inc_dirs to lib/wireguard, which builds linux
  sources with linux include paths
2024-06-20 12:54:30 +02:00
Christian Helmuth
2580045a83 musl_tm: prevent compilter warning
warning: dangling pointer ‘is_leap’ to an unnamed temporary may be used [-Wdangling-pointer=]
2024-06-20 12:54:30 +02:00
Sebastian Sumpf
ac4aaa208f libdrm/iris: check for more than 1 sync object
In '_generic_syncobj_wait' check if sync-objetcs exist, return error
otherwise. Do not wait because the execution model is synchroneous,
meaning no batch buffers are in execution when this function is called
(_drm_mutex).

issue #5224
2024-06-20 12:54:30 +02:00
Sebastian Sumpf
c85e53cb2a mesa/libdrm: move fd's out of libc's range
Move hard coded fd's out of the libc range in order to avoid possible
hard to find conflicts.

issue #5224
2024-06-20 12:54:30 +02:00
Sebastian Sumpf
7c32af9d99 libdrm: use pthread_mutex instead of Genode's mutex
Use pthread_mutex because the EP can block while the thread executing a
batch buffer and waiting for a completion signal in the VFS-GPU plugin
can still make progress.

Also return to coarser locking until we support Sync-Object Wait
semantics.

issue #5224
2024-06-20 12:54:30 +02:00
Sebastian Sumpf
af8b13e88c mesa: zero buffer objects upon release
Freshly allocated BOs from libdrm have to be zeroed. Since the libdrm/iris
caches VRAM allocations, we don't want to attach/detach parts of dataspaces at
every allocation. Some objects are used long (through caching in the iris
Gallium driver). Therefore, zero object on release where the region might
already be mapped.

issue #5224
2024-06-20 12:54:30 +02:00
Sebastian Sumpf
138f5fe61a mesa: update to version 24.0.8
issue #5224
2024-06-20 12:54:30 +02:00
Johannes Schlatow
102baab7d7 sculpt: adapt Gpu-route in goa_testbed preset
Fixes #5237
2024-06-20 12:54:30 +02:00
Christian Helmuth
09ef478838 wireguard: cleanup jiffies symbol (alias to jiffies_64)
Issue #5236
2024-06-20 12:54:30 +02:00
Christian Helmuth
193b19fb78 lx_emul: support compound pages
Issue #5236
2024-06-20 12:54:30 +02:00
Christian Helmuth
3bd04d1253 Check nping permissions in nic_router_ipv4_fragm.run 2024-06-20 12:54:30 +02:00
Norman Feske
fe613fa9a3 Rename src/drivers to src/driver
Issue genodelabs/genode#4420
2024-06-20 12:54:30 +02:00
Josef Söntgen
7c19e2bc38 lx_emul: initialize auxiliary bus
This commit adds a weak dummy implementation to a compilation unit
that is referenced by all DDE Linux based driver components to
prevent adding a dummy to every driver.
2024-06-20 12:54:30 +02:00
Josef Söntgen
9eeeb4e36c lx_emul: align __alloc_pages_bulk implementation
The upstream implementation is used to allocate order-0 pages in
a batch and users, e.g. page-pool allocator, may rely on that
behaviour and thus it is implemented with this commit.
2024-06-20 12:54:30 +02:00
Josef Söntgen
191306531c dde_linux: generate proper KBUILD_MODNAME
This commit remedies the somewhat lazy attempt to address unique names
for drivers where the name is directly derived from KBUILD_MODNAME,
e.g. rtlwifi, and also modifies the name accordingly to the rules
of Linux' build-system. The last part becomes necessary as driver
matching tables may rely on that as has already happend with the
ti-sn65dsi86 driver.
2024-06-20 12:54:30 +02:00
Norman Feske
8943a3e949 Remove '_drv' suffix
Issue #4420
2024-06-20 12:54:30 +02:00
Norman Feske
cb88c2c3e2 Fixup "nova: rename test/platform to test/nova" (platform.run -> nova.run) 2024-06-20 12:54:29 +02:00
Norman Feske
0a181240c8 nova: rename test/platform to test/nova
This is a preparation for renaming platform_drv.run to platform.run.

Issue #4420
2024-06-20 12:54:29 +02:00
Norman Feske
940a1912fa os: replace pkg/pc_nic by pkg/nic_uplink
This enables the combination of the nic_uplink component with any driver
pkg featuring a runtime file. This is already the case of the pc_nic
driver.

This is a preparatory step for issue #4420.
2024-06-20 12:54:29 +02:00
Christian Helmuth
6ba0574950 fiasco: move source code to genode.org
Complete migration from Sourceforge to GitHub.
2024-06-20 12:54:29 +02:00
Norman Feske
00844efd2f test/terminal_expect_send: warn on excess chars
This patch adds a warning on the occurrence of overly long lines and
drops characters in this case.

Fixes #5108
2024-06-20 12:54:29 +02:00
Christian Helmuth
996b2fe79f base: log invalid address value in heap 2024-06-20 12:54:29 +02:00
Johannes Schlatow
a5c7b20196 sculpt: support incomplete pkg-archive paths
This adds support for supplying launcher and preset files with pkg-attributes
of the form '<user>/pkg/<name>'.

Fixes genodelabs/genode#5223
2024-06-20 12:54:29 +02:00
Norman Feske
eca864175c Remove Gui::Session::session_control
This functionality has long been superseded by the window
manager/layouter.

Fixes #5160
2024-06-20 12:54:29 +02:00
Alexander Boettcher
a3a84b25e8 image: support shim usage for uefi and disk
Fixes #5230
2024-06-20 12:54:29 +02:00
Johannes Schlatow
78a6d2bd0c os: fix multiplication wrap-around in Area::count
When having a maximized terminal window, a suspend was causing an
invalid mode change at nitpicker. This triggered a huge resource request
in nitpicker because the RAM-quota check was rendered ineffective by a
wrap-around during unsigned multiplication.

Issue genodelabs/genode#5180
Fixes genodelabs/genode#5201
2024-06-20 12:54:29 +02:00
Timo Nicolai
dc5990ce4a black_hole: add missing report to config.xsd
Should have been added by 14d0b72f52.

Issue #5233
2024-06-20 12:54:29 +02:00
Ivan Loskutov
649653eb1c Fix getting pubkey_id from depot user pubkey
On systems with the option `use-keyboxd` enabled in config, option
`--no-keyring` in gpg command line doesn't work. The result of the
pubkey_id function will be the first key in the keybox keyring instead
of the id of pubkey from the depot user.

Fixes genodelabs/genode#5235
genodelabs/goa#92
2024-05-30 14:07:16 +02:00
Norman Feske
86895d6a5c doc/release_notes/24-05.txt: minor style tweaks 2024-05-30 12:38:05 +02:00
Christian Helmuth
c1297e15d1 version: 24.05 2024-05-30 12:03:45 +02:00
Norman Feske
d5f7c3ab49 News item for version 24.05 2024-05-30 12:02:06 +02:00
Norman Feske
5c91504b49 Release notes for version 24.05 2024-05-30 12:01:58 +02:00
Christian Helmuth
4b9f4d8c38 depot: update recipe hashes 2024-05-30 08:20:21 +02:00
Johannes Schlatow
7c0d8acd8f bsd_audio_drv: increase cap quota for base-hw
Fixes genodelabs/genode#5231
2024-05-29 09:18:49 +02:00
Christian Helmuth
b6aa021d76 internet_checksum.run: restrict tshark protocols
Restrict checksum checking in output.pcap to ip,tcp,udp,icmp.

Issue #4636
2024-05-29 09:18:49 +02:00
Christian Helmuth
95a7e7a840 internet_checksum.run: log values on error
Issue #4636
2024-05-29 09:18:49 +02:00
Johannes Schlatow
20a7918b41 libdrm/iris: implement dummy for caching uapi
For Intel HD Graphics 500, mesa calls the DRM_I915_GEM_SET_CACHING
ioctl.

genodelabs/genode#5224
2024-05-29 09:18:49 +02:00
Christian Prochaska
8610eecb2b qt5: adapt to C++20 function template syntax
Issue #5227
2024-05-29 09:18:49 +02:00
Norman Feske
98ecde5b7b test/platform_drv: stabilize final state
The test reverts the platform drivers' config at the end of the test
to an empty state. However, this state should still contain a default
policy (analogyously to the initial state). Otherwise, the platform
session of the test program will (sometimes) become invalid just before
successfully finishing the test.
2024-05-29 09:18:49 +02:00
Martin Stein
99c9909508 file_vault: update README 2024-05-29 09:18:49 +02:00
Martin Stein
4ac5fde7c2 file_vault_gui: add a README 2024-05-29 09:18:49 +02:00
Norman Feske
4801cbf47c drivers_interactive-pc: ram for event_filter
Slightly balance the ram quota of the drivers subsystem in favor of the
event_filter for letting demo.run test succeeed on sel4.
2024-05-29 09:18:48 +02:00
Norman Feske
f171bc5050 Remove loader and qpluginwidget
The original use cases of the loader have long been covered by the
dynamic init. The only substantial client of the loader remained to be
the qpluginwidget. However, the qpluginwidget was supported only by the
Arora web browser. But the blending of plugins with websites ultimately
remained a tech demo, and Arora has been replaced by Falkon.

Fixes #5229
2024-05-29 09:18:12 +02:00
Sebastian Sumpf
179b3eb7e4 libdrm/iris: make locking more fine grained
When more than one thread are accessing the DRM interface it is not wise
to use global locking, especially when a pthread is executing a batch
buffer and waits for a completion signal in the VFS-plugin. In case the
EP gets stuck in the global lock, no progress is made. Therefore:

* use _drm_mutex only where strictly necessary
* use special _exec_mutex to protect buffer execution (per context)
* print warning when two threads try to execute a buffer in the same
  context

isse #5224
2024-05-29 09:18:12 +02:00
Norman Feske
f79ff59619 sel4: reduce cache_invalidate_data warnings
Warn only once about the missing 'cache_invalidate_data'
implementation to prevent the fec nic driver from spamming the
log.
2024-05-29 09:18:12 +02:00
Christian Helmuth
16e088a34e vbox6: adapt to C++20 function template syntax
GCC's -std=gnu++17 is required for VirtualBox 6 but, fortunately,
support the "auto template" syntax with -fconcepts.

Issue #5227
2024-05-29 09:18:12 +02:00
Alexander Boettcher
65ca9ee906 platform/pc: don't support poweroff
Fixes #5216
2024-05-29 09:18:12 +02:00
Norman Feske
889f1f5488 demo: update tutorial text
Remove references to the demo CD. Update links to https.
2024-05-29 09:18:12 +02:00
Christian Helmuth
e90f6988d8 pci_decode: disable MSI/MSI-X capabilities
Default disabled initialization prevents follow-up errors if one
capability is already enabled on boot, but platform_drv decides to
enable the other one. The PCI spec explicitly states that "Behavior is
undefined if both MSI and MSI-X are enabled simultaneously".

Fixes #5228
2024-05-29 09:18:12 +02:00
Johannes Schlatow
b793802333 sculpt: fix presence of unconfigured children
A launched child only becomes present in the runtime when it has been
configured. This must be considered when checking for missing servers.

Fixes genodelabs/genode#5226
2024-05-29 09:18:12 +02:00
Norman Feske
cfd013a01a os/include: use C++20 function template syntax
Issue #5227
2024-05-29 09:18:12 +02:00
Norman Feske
5e862b2cd3 base/include: use C++20 function template syntax
Issue #5227
2024-05-29 09:18:12 +02:00
Alexander Boettcher
48d6f0220c nova: avoid static smp code reservation
Using a segment to reserve the AP (application processor) code page does not
work if the region overlaps with other non-memory types, e.g. bender checks
for the overlapping and denies to boot on such machines.

Without bender, the system boots up fine. So, partially remove the nova commit
"Add segment to reserve AP startup page" and instead apply the idea of
Cyberus's version. Place the AP boot code later during boot and save and
restore the memory before/after SMP bootstrap.
2024-05-29 09:18:11 +02:00
Christian Helmuth
3c24715d16 Add pc_linux.run for driver tests on pc
Inspired by the excellent imx_linux.run script.
2024-05-29 09:18:11 +02:00
Sebastian Sumpf
d71b6ca305 mesa: update to version 24.0.1
Supported Gallium drivers are iris (Intel), lima (PinePhone), etnaviv
(i.MX8).

issue #5224
2024-05-29 09:18:11 +02:00
Sebastian Sumpf
dca3b12109 libdrm: update to version 2.4.120
Prerequisites for Mesa 24.0.1

* generic:
  * add patch to retrieve PCI/Platform information from Genode side of the DRM
    interface (in drmGetDevice2)
  * add generated 'fourcc' file

* iris:
  * report back-end (currently 'i915', 'xe' is unsupported)
  * add various I915_CONTEXT_PARAM* and I915_PARAM*
  * allocate 'Buffer's starting with ID 1 (0 is invalid)
  * enforce 48-bit-address limit on unmap also
  * disable I915_EXEC_FENCE_ARRAY array check, because we do not support
    sync objects right now and rendering in synchronous

* etnaviv:
  * create 'Fenceobj' only *once* for each GPU context

issue #5224
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
b83b53d3b2 hw: abstract nested paging on x86
The initial SVM implementation (correctly) just used another standard
x86_64 page table for nested paging. The EPT implementation is for Intel
VMX only. Since we don't know the underlying virtualization technology
at compile time, we need to pick the correct page table implementation
at runtime.

Add add a AMD-compatible HPT page table implementation using the same
base implementation and (more importantly) allocator as the EPT
implementation. Add a Vm_page_table implementation that determines the
used virtualization technology at runtime and internally defers insert
and remove operations to the correct page table implementation.

Issue #5218
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
221d0c6c48 hw: implement EPT page table
Implement a nested page table to use with x86 virtualization.

Fixes #5218
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
4fc94deccb base: x86: page table base: make parameters compatible
To make the x86 page table base implementation compatible with the
function signatures used in hw, make the Intel IOMMU specific arguments
optional:

- Make the `flush` parameter default to false.
- Make the `supported_sizes` parameter default to 1GB + 2MB + 4k.

Issue #5217
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
30b39d5fa3 base: generalize the page table allocator and move it to base
The Intel IOMMU page table implementation in the pc platform driver uses
a page table allocator that is adapted from the implementation in the hw
kernel.

Move the allocator to base as a first step to consolidate
implementations, fix an Array constructor and re-add the Allocator
constructor working on addresses instead of tables.

Issue #5217
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
58e9856eb8 base: move page flags interface to base
On hw, `Page_flags` is used throughout architectures. At the same time,
it is used by the Intel IOMMU page table implementation in the pc
platform driver.

Consolidate the definition in base so it is available for all users.

Issue #5217
2024-05-29 09:18:11 +02:00
Johannes Schlatow
c31adb77e7 base: add shared page-table code for x86_64
Issue #5217
2024-05-29 09:18:11 +02:00
Alexander Boettcher
97544ed7a9 nova: support iommu enabling per intel/amd
separately.  The "iommu" option is now split up into "iommu_intel" and
"iommu_amd" and thereby can be disabled easily if required for one of the CPU
vendors.

Fixes #5206
2024-05-29 09:18:11 +02:00
Alexander Boettcher
b33afb24d7 nova: adjust to cmdline changes of kernel
- no need to explicitly switch off vga anymore
- use vPID for VMs which improves TLB usage if multiple vCPUs on same
  pCPU is used, which happens to happen on Sculpt.
- support for mwait by nova kernel, which is off by default

Issue #5206
2024-05-29 09:18:11 +02:00
Alexander Boettcher
d9086833ed netperf: run timer most preferred in tests 2024-05-29 08:37:08 +02:00
Alexander Boettcher
801fe272ca pit: new timer implementation
Issue #5138
2024-05-29 08:37:08 +02:00
Stefan Kalkowski
32bc1b14d4 dde_linux: add busybox port
Fix genodelabs/genode#5214
2024-05-29 08:37:08 +02:00
Benjamin Lamowski
aad80e81da hw: add support for VMX
Add support for Intel's Virtual Machine Extensions with nested paging.

Fixes #5128
2024-05-29 08:37:08 +02:00
Stefan Kalkowski
f0ec1adcd3 base: add check_tool utility to build system
Fix genodelabs/genode#5213
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
dbd070b815 hw: add kernel panic function to x86_64
Add a kernel panic function to x86_64 that mirrors the functionality
available for ARM.

Issue #5128
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
5049f03f5b hw: generic interface for x86 virtualization
Create a generic interface for x86 virtualization.
Split the VMCB data structure in `Vmcb_buf` to represent the physical
VMCB page and `VMCB` as a control interface.

Issue #5113
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
b4fe9154b9 hw: access VMCB State Save Area via Mmio framework
So far, the VMCB data structure was generated from it's parts (most
prominently VMCB Control Area and VMCB State Save Area) with the VMCB Control
Area accessed via the Mmio framework, while the VMCB State Save Area
struct used directly defined members.

Unify the VMCB structure and uniformly use the Mmio framework to access
the VMCB. Separate the controlling structure from the VMCB page.

Issue #5113
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
0d1716b07d hw: prepare SVM implementation for generic virtualization support
The SVM implementation did not lend itself to a runtime selection of the
x86 virtualization technology.

Encapsulate functionality in the VMCB class to facilitate adding support
for Intel's VMX.

Issue #5113
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
3a88d133ed hw: generalize virtualization memory
The initial vCPU memory was written for AMD's SVM.

Make the vCPU memory provider virtualization technology agnostic.

Issue #5113
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
e82859444e hw: clean up Intel TSC frequency deduction
The initial algorithm ported to hw seems to be correct in principle,
however it does not work with nested virtualization.

Clean up the code to make the different methods of obtaining the TSC
frequencies more clear, and add warnings if a particular
method has failed although it should be available.

Fixes #5210
2024-05-13 15:52:22 +02:00
Alexander Boettcher
59c42ffb46 lib-qemu: support to use qemu-usb w/o webcam
for other VMMs beside Virtualbox, e.g. Seoul or potentially arm/vmm. The
webcam model depends on libyuv, which uses stdcxx + full libc, which is not
desired or required for all VMM implementations.

Fixes #5208
2024-05-13 14:06:54 +02:00
Sebastian Sumpf
6c9d3326ec ldso: add support for R_<arch>_NONE relocations
We discovered this relocation, which does nothing, in pre-compiled
libraries. It is easy to implement because it has the same
relocation-type number (0) for all supported ABIs.

Also adjust error message from "Unsupported PLT relocation" to
"Unsupported translation table address format" to not confuse the
relocation type with the translation table type.

Fixes #5209
2024-05-08 08:23:39 +02:00
Christian Prochaska
a59f73f7d3 libc: remove 'Symlink_resolve_error' exception
Issue #5198
2024-05-08 00:38:45 +02:00
Alexander Boettcher
bfddf08f75 ahci: make robuster during resume
During resume the waiting for Cmd::St takes ~2s on a T460p with Intel
AHCI SSD attached. According to the Serial ATA AHCI Spec. wakeup can take
seconds, e.g. chapter 8.2 Power State Mappings of the Serial ATA AHCI spec
(1.3.1).

Issue #5203
2024-05-07 16:46:34 +02:00
Alexander Boettcher
dc4dad4608 sculpt_manager: add ahci to monitored used devices
for suspend/resume

Issue #5203
2024-05-07 16:46:21 +02:00
Christian Helmuth
79e391ba8d vbox6: diagnostic message on Region_conflict
Catch and log Vm_session::Region_conflict, but continue operation.
2024-05-07 15:21:48 +02:00
Alexander Boettcher
f0f66f8ccc nova: avoid ipi timeouts
Fixes #5204
2024-05-07 15:09:32 +02:00
Alice Domage
4bda9d9136 pc_intel_fb_drv: enforce operation on Intel's devices
This commit enforces the driver to only wait for devices with Intel's
vendors ID to be ready.

genodelabs/genode#5207
2024-05-07 14:20:44 +02:00
Christian Helmuth
8a019c9bb9 nitpicker: always update "displays" report
Restore the reporting in situations where all capture sessions are gone.
This fixes the webcam package that disables the USB webcam driver when
nitpicker report no active displays.

Issue #5187
2024-05-03 09:12:49 +02:00
Christian Prochaska
25b918052b qt5: improve tooltip visibility
Fixes #5205
2024-05-03 08:31:23 +02:00
Christian Helmuth
4b9d02fe31 depot: update recipe hashes 2024-05-02 11:19:50 +02:00
Norman Feske
101e9f5733 vfs/oss/README: oss_next -> oss
Issue #5167
2024-05-02 11:19:50 +02:00
Norman Feske
50b87957db sculpt: improve GUI smoothness on PinePhone
- Avoid geometry animation at boot time
- Assign CPU quantum to higher prioritized GUI components
- Defer touch_keyboard start to reduce boot time

Issue #5174
2024-05-02 11:19:50 +02:00
Norman Feske
b1df5d890e sculpt: update graph abbreviations to 24.04
Issue #5174
2024-05-02 11:19:49 +02:00
Stefan Kalkowski
18511770bc sculpt: add support for more than one mmc card
Instead of using one default policy when creating an mmc driver's
configuration, produce some more static policy items to support
boards with more than one card per driver (mnt_reform2).
2024-05-02 11:19:49 +02:00
Christian Helmuth
6710092bb4 sculpt_distribution: add vfs_oss 2024-05-02 11:19:49 +02:00
Christian Helmuth
c25841691f ports: build vim/vim-minial with --enable-multibyte
A first step to complete UTF-8 support in the terminal (e.g.,
system_shell).
2024-05-02 11:19:49 +02:00
Florian Delizy
1146f27c59 sculpt: add menu name for Bepo keyboard layout
issue #5202
2024-05-02 11:19:49 +02:00
Florian Delizy
593a9aefca sculpt: add fr_bepo reference into default build
issue #5202
2024-05-02 11:19:49 +02:00
Florian Delizy
b2eca7cea2 event_filter: reduce bepo chargen to 486ln
issue #5202
2024-05-02 11:19:49 +02:00
Florian Delizy
1534ba21ce event_filter: add fr_bepo chargen file
issue #5202
2024-05-02 11:19:49 +02:00
Alexander Boettcher
72bb960c2a dde_linux: update jiffies in cpu_relax on x86/pc 2024-05-02 11:19:49 +02:00
Martin Stein
e350dc27e9 internet_checksum.run: test net checksum alorithms
See repos/os/src/test/internet_checksum/README for more detail.

Ref #4636
2024-05-02 11:19:49 +02:00
Christian Helmuth
3a0ded3bdd window_layouter: calculate weighted dimension in double
The change prevents integer overflows with reasonable large values.

Thanks Peter for reporting.
2024-04-29 16:08:56 +02:00
Christian Helmuth
fc27469b97 sculpt: remap KEY_SYSRQ to KEY_PRINT
Both keys are physically the same on available keyboards (with varying
labeling). Unfortunately, PS/2 scancode sets and USB HID spec seem to
differ slightly in their interpretation. Therefore, we keep the
driver-level reporting as is but report both as KEY_PRINT in Sculpt,
which allows to use the key(s) for screenshoter rules most prominently.

Also, unify sculpt/event_filter/pc with sculpt_manager.
2024-04-29 15:31:20 +02:00
Christian Helmuth
00c776c3dd sculpt_distribution: add rom_osci and record_rom 2024-04-29 09:54:02 +02:00
Renato Carvalho
8c7e90f7f2 tool/run: fix corner case in exit override
The run tool overrides the 'exit'-procedure to make sure that a loaded
run_power_off procedure is always executed. However, a failing
run_power_off lead to false-positives: 'make run/...' exited with 0 even
tough the run script was not even executed because of a failed
power-on/off cycle. In this case, if the run_power_off is the exit code
producer, the new exit definition does not finish as intended. As a
result, the first exit code is re-written, and errors are not propagated
accordingly.

The solution is to catch possible errors from power-off within the exit
procedure.

Fixes genodelabs#5102
2024-04-29 08:00:30 +02:00
Christian Helmuth
e31273a410 depot: add libiconv pkg/goa 2024-04-26 15:22:37 +02:00
Christian Helmuth
59b85cc672 depot: update recipe hashes 2024-04-26 09:59:36 +02:00
Norman Feske
f6aa053737 News item for Sculpt 24.04
Issue #5174
2024-04-26 09:59:19 +02:00
Benjamin Lamowski
820a144f6d sculpt: adjust RAM for inspect window
With the current RAM setting, opening the inspect window fails on a
display with 4K resolution.
Adjust the inspect window's RAM quota to make it work.

Issue #5174
2024-04-26 07:39:25 +02:00
Norman Feske
88f050963e sculpt: update README for version 24.04
Issue #5174
2024-04-26 07:39:25 +02:00
Johannes Schlatow
c5acfd027b depot: add goa_testbed requirements to pkg/goa
genodelabs/genode#5174
2024-04-25 15:43:03 +02:00
Stefan Kalkowski
d9420c618c hw: take over ACPI hardware from SMI
Fix #5196
2024-04-25 15:43:03 +02:00
Stefan Kalkowski
68de550090 hw: ignore stale data in fresh signal
When a new signal arrives, which means a formerly non-pending one,
we should ignore old signal numbers of that context, but only
evaluate newly received data by the last kernel-call.

Fix #5193
2024-04-25 15:43:03 +02:00
Christian Helmuth
6dd87a6ce0 sculpt: integrate preliminary touchpad support
Issue #5195
Issue #5174
2024-04-25 15:43:03 +02:00
Christian Helmuth
54cf1334e1 Permit shared access to Intel PCH GPIO device
The ported i2c_hid driver contains driver code for the "Intel
Tigerlake/Alderlake PCH pinctrl/GPIO" device. Unfortunately, acpica
driver also accesses the same device on Lid open/close via ACPI AML code
of the DSDT table to read out the state of a GPIO pin connected to the
notebook lid. This would fail as I/O memory is handed out only once and
cannot be shared. The workaround disables the region check for the
specified GPIO I/O memory regions and provides both drivers shared
access to the regions.

This is a preliminary workaround. A general solution should separate the
GPIO driver into a component (e.g., platform driver) that regulates
accesses by i2c_hid and acpica.

Issue #5195
2024-04-25 15:43:02 +02:00
Christian Helmuth
c4b5f11a38 pci_decode: report Intel PCH GPIO device
Discovered on Tigerlake (Fujitsu U7411) and Alderlake (Framework Gen12)
notebook devices.

Issue #5195
2024-04-25 15:43:02 +02:00
Christian Helmuth
10f8da4a13 pci_decode: fixup Intel LPSS (I2C) PCI BARs
Discovered on Tigerlake (Fujitsu U7411) and Alderlake (Framework Gen12)
notebook devices.

Issue #5195
2024-04-25 15:43:02 +02:00
Christian Helmuth
b085550a0c sculpt: fix menu-level check in popup dialog
Issue #5174
2024-04-25 15:43:02 +02:00
Alexander Boettcher
f9e9835449 sculpt: move nitpicker to leitzentrale affinity
During audio and video playback at a high rate by a VMM, nitpicker on the
boot CPU may interfere with the mixer clients, letting them not finish the
schedule RPC at the mixer in time. Moving nitpicker to the same CPU as
leitzentral mitigates the effect at moment.

Issue genodelabs/genode#5174
2024-04-25 15:43:02 +02:00
Martin Stein
48a5c12526 nic_router_uplinks.run: raise timeouts
At least on x86_64/x86_64/pc/hw|nova, the test used to fail because the net
setup sometimes required more than the 3 seconds that the test was giving each
step. This commit raises the step timeout to 5 seconds and the test timeout
from 70 to 90 seconds in order to be on the safe side.

Ref #5192
2024-04-25 15:43:02 +02:00
Josef Söntgen
ac3202e554 sculpt: raise volume in audio launcher
The default mixer launcher limits the volume to 50%, so raise the
driver's volume to the max to be audible on certain systems where
otherwise audio is barely recognizable.

While there, fix the wrong reporting attribute as well.

Issue #5174.
2024-04-25 15:43:02 +02:00
Norman Feske
1379661a85 sculpt/event_filter: rename touch -> touchpad
This eases the integration of a custom touchpad driver component
provided as launcher.

Issue #5174
2024-04-25 15:43:02 +02:00
Martin Stein
50fc5c6d42 file_vault: further reduce typical quota needs
Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
d5e3f73884 file_vault: do not consider ui_config version
The version in ui_report and ui_config were merely used for making test output
more readable. However, there are other ways to achieve this goal.

Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
2bcc85b5f5 file_vault: fix locking issue
The File Vault used to sporadically fail to complete Extend or Rekey operations
when it was locked during the operation. The cause was an insufficient state
model that has been fixed with this commit.

Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
969469edef file_vault: clean up
Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
a7ef2319f6 file_vault: remove need for state file
The state file is a legacy from the early days of the file vault and not really
needed anymore.

Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
483fe18c4d file_vault_gui: dialog-based file_vault front end
* adds rekeying and resizing controls to config+report api of file vault
* moves common types of file vault to file_vault/include/file_vault/types.h
  to be included by other components
* fixes wrong type of nr_of_clients fields in file_vault
* introduces the file_vault_gui component that is a minimal graphical front end
  for the file vault based on the dialog lib and that uses the
  config+report api of the file vault as back end

Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
9d78356885 text_area: remove unused min_width, min_height 2024-04-25 15:43:02 +02:00
Norman Feske
b75b40049d sculpt: rename suspend -> standby
Issue #5174
2024-04-25 15:43:01 +02:00
Norman Feske
d3d1e701a4 sculpt: refine scrolling boundaries
This patch addresses corner cases not considered so far. In particular,
it avoids placing the Add/Options tabs of an unscrollable popup under
the panel. This could happen in the presence of many options. The patch
includes the panel height into the calculation to rule out such
situations. It also tightens the scrolling boundaries to the visible
content.

Issue #5183
2024-04-25 15:43:01 +02:00
Josef Söntgen
a029b85d62 pc_wifi: provide generic LED related dummies
The generated dummies triggered when using a Atheros AR9462 device.

Fixes #5191.
2024-04-25 15:43:01 +02:00
Johannes Schlatow
60d97fab7e sculpt: update goa_testbed preset
genodelabs/genode#5174
2024-04-25 15:43:01 +02:00
Norman Feske
b939358c36 window_layouter: protect against mode 1 x 1
This patch handles intermediate situations where the screen mode may
become 1 x 1 (absence of any capture clients). In this case, the
decoration of a maximized window would legitimately exceed the screen
boundary.

Thanks Johannes for the investigation.

Issue #5187
Issue #5180
2024-04-25 15:43:01 +02:00
Johannes Schlatow
0f0fa5b2a2 sculpt: correct ROM names in event_filter/pc
The chargen files have been moved/renamed a while ago in the scope
of #4055.

genodelabs/genode#5174
2024-04-25 15:43:01 +02:00
Alexander Boettcher
f925680035 sculpt_manager: avoid restarting intel_gpu
during resume, which otherwise will restart all GPU clients.

Issue #5180
2024-04-25 15:43:01 +02:00
Alexander Boettcher
274a733e1a sculpt: support blanking system state
The blanking state is evaluated by the intel_fb driver, which will switch
off all connectors. When done, the intel_fb driver will exit and the
sculpt_manager will continue with the next step, stopping all drivers.

Issue #5180
2024-04-25 15:43:01 +02:00
Alexander Boettcher
9337c178c1 intel/gpu: support blanking system ROM state
Keep device resources alive, for "" and "blanking" state, so that
intel/display driver can try to switch off the connectors.

Issue #5180
2024-04-25 15:43:01 +02:00
Alexander Boettcher
2a4502b0de intel/display: support system state evaluation
When the system state "blanking" is determined, all connectors are switched
off and a parent exit is invoked.

Issue #5180
2024-04-25 15:43:01 +02:00
Stefan Kalkowski
5f67073aad sculpt: add missing pieces to support MNT reform
This commit adds missing routes to I2c for the framebuffer driver of the
MNT Reform. If build for this concrete board the Board_info::Soc variable
within the sculpt_manager is initialized according to the properties of
this device. The `update_soc` routine is called in the initialization of
the sculpt_manager, otherwise it won't be called at all, if no PCI devices
changes are detected. Missing driver binaries and device-tree-binaries are
add to the run-script.

Issue #5174
2024-04-25 15:43:01 +02:00
Stefan Kalkowski
3b83292205 sculpt: refine condition of nic support
A network card can be provided by PCI, and the SoC as well. Therefore,
add an additional state variable in the Board_info::Soc, and check it
appropriatedly.

Issue #5174
2024-04-25 15:43:01 +02:00
Christian Prochaska
47c1e45f28 ports: increase GDB resource quota limits on Sculpt
Fixes #5188
2024-04-25 15:43:01 +02:00
Norman Feske
39ccd5ab79 sculpt: refine condition of acpi features
Commit "sculpt: safeguard the offering of suspend/resume" was too lax
about the detection of acpi support. In situations where acpi support
is selected but not yet installed, the menu would offer the features
already. This patch restricts the condition such that acpi support must
be running, not merely selected.

Issue #5174
2024-04-25 15:43:01 +02:00
Norman Feske
ad722f1450 nitpicker: avoid mode switches on driver restarts
This patch retains the buffer size of the last capture client as mode as
long as no capture client exists. This avoids intermediate mode changes
in situations like suspend/resume where the display driver is restarted.

Issue #5187
2024-04-25 15:43:00 +02:00
Alexander Boettcher
02efe59cdd sculpt_manager: adjust system model state
s3_prepare should be ACPI_SUSPENDING instead of ACPI_RESUMING

Issue #5180
2024-04-25 15:43:00 +02:00
Alexander Boettcher
766060ece6 acpi_suspend: adjust to changes of #5180
Issue #5180
2024-04-25 15:43:00 +02:00
Alexander Boettcher
53230d39f4 intel/display: delay until graphic device is ready
Issue #5180
2024-04-19 13:54:16 +02:00
Alexander Boettcher
0b3cc37258 intel/gpu: provide platform device if hw resumed
If the gpu driver is resumed, delay new Device acquisition of the platform
client (intel_fb), until the gpu driver is in a working state.

Issue #5180
2024-04-19 13:54:16 +02:00
Josef Söntgen
10d7427490 sculpt: consider SoC board info for fb selection
In contrast to platforms, like the PC, where the fb driver selection
is a dynamic decision depending on the available hardware, on current
ARM-based SoC machines this configuration is part of the static board
information.

Issue #5174.
2024-04-19 13:44:36 +02:00
Norman Feske
084a14b114 record_play_mixer: make warning rate configurable
This patch disables latency warnings by default. The warnings can be
enabled by setting the 'warning_rate_ms` value to the desired
maximum rate.

Fixes #5186
Issue #5174
2024-04-19 13:42:05 +02:00
Christian Helmuth
85c99c238d depot: update recipe hashes 2024-04-19 08:54:22 +02:00
Norman Feske
e3d4f202c4 sculpt/nitpicker: assign KEY_PRINT -> screenshot
Issue #5174
2024-04-19 08:54:22 +02:00
Christian Helmuth
d90ec3775b pkg/terminal: limit initial dimension to 900x600 2024-04-19 08:54:22 +02:00
Norman Feske
9e69c7301a sculpt: safeguard the offering of suspend/resume
The USB host controller gets restarted during the suspend-resume cycle.
Hence, don't offer suspend while any USB storage device is in use, in
particular when deploying Sculpt from a USB stick.

Suspend/resume is not supposed to work with any framebuffer driver other
than intel_fb. Therefore, offer the suspend feature only when using intel_fb.

Issue #5174
2024-04-19 08:54:22 +02:00
Josef Söntgen
f2b921f380 pc_wifi: add iommu_device_unuse_default_domain dummy
Issue #5185.
2024-04-19 08:54:22 +02:00
Christian Helmuth
87ea807136 test-signal: print signals per activation in stress test 2024-04-19 08:54:22 +02:00
Alexander Boettcher
7e23b704f0 sculpt: disable serial output when LOG!=core
Issue #5180
2024-04-19 08:54:22 +02:00
Norman Feske
0a5e174d78 sculpt/usb/default: add device-assignment example
Issue #5174
2024-04-19 08:54:21 +02:00
Norman Feske
c6aa50ec56 dialog: don't scroll beyond text bounds
Issue #5174
2024-04-19 08:54:21 +02:00
Christian Helmuth
f8c420a78b file_vault_client.run: epit timer requires IO_MEM 2024-04-19 08:54:21 +02:00
Norman Feske
4a6ab846e5 sculpt: restore heartbeat watchdog for intel_fb
The automatic restart of intel_fb got lost during the transition from
the driver manager. This commit restores the heartbeat monitoring of
this driver.

Issue #5174
2024-04-19 08:54:21 +02:00
Norman Feske
f34bf0d19e sculpt: power options (suspend, reset, power off)
This patch enhances the sculpt manager to drive the system state
and manage the lifecycle of driver components during suspend-
resume cycles.

The new Power options can be found in the System menu. The suspend
and power-off controls are presented only when the acpi-support
option is activated.

Note that the USB controller is hard restarted when resuming from
suspend. Hence, all components that depend on USB are restarted
implicitely.

Issue #5180
Issue #5174
2024-04-19 08:54:21 +02:00
Johannes Schlatow
29e21bff7f platform/pc: implement IOMMU suspend/resume
genodelabs/genode#5180
2024-04-19 08:54:21 +02:00
Johannes Schlatow
7441aba6d5 platform: add suspend/resume interface to Io_mmu
genodelabs/genode#5180
2024-04-19 08:54:21 +02:00
Christian Helmuth
8cd206a050 sculpt: don't pre-populate /report/runtime/wifi_drv
Issue #5174
2024-04-19 08:54:21 +02:00
Christian Helmuth
def630c3db sculpt_manager: remove obsolete "storage" node
Issue #5174
2024-04-19 08:54:21 +02:00
Alexander Boettcher
b97e549dc4 intel/gpu: reset framebuffer part of ggtt
on display client close (intel_fb). The former code constructed a
temporary object on the stack, which sets up the scratch pages for the
closed client. However, the scratch page backing store (dma_buffer) gets
freed on destruction of the temporary stack object, which leads to DMA faults
with visual noise on the screen. Instead, use the already in use ggtt object
and add the scratch pages explicitly.

Issue #5180
2024-04-19 08:54:21 +02:00
Alexander Boettcher
d52af2ac94 os: avoid state names in system ROM
for ahci/gpu/nvme. Instead conclude from empty and non empty system state
to resume or stop driver.

Issue #5180
2024-04-19 08:54:21 +02:00
Norman Feske
7c7c4e80e1 sculpt: attach nic and wifi to hardware node
This makes the grouping of these two drivers consistent with the
other drivers.

Issue #5174
2024-04-19 08:54:21 +02:00
Norman Feske
dcd4578585 run: rename hw boot/image.elf -> boot/image-hw.elf
This disambiguates the boot images installed for base-hw from those
installed for base-nova.

Note that the image.elf file for other kernels (i.e., NOVA) is not
named image-<kernel>.elf at this point because this would prevent the
update from a pre-24.04 Sculpt system to a later one as the grub.cfg
is not touched by the old update mechanism. So after a system update,
grub would keep loading the last installed image.elf.

Issue #5182
2024-04-19 08:54:21 +02:00
Josef Söntgen
e1ebcd8019 record_play_mixer: report Play and Record sessions
The state-report now contains all active Play and Record sessions
and will get updated whenever a session is created or destroyed.

Issue #5174.
2024-04-19 08:54:21 +02:00
Josef Söntgen
e0f5a2ddc5 record_play_mixer: report set version in state
Give the version in the state-report only if it is set.

Issue #5174.
2024-04-19 08:54:21 +02:00
Josef Söntgen
c822dc0f18 sculpt: default rules in audio and mixer launchers
Issue #5174.
2024-04-19 08:54:21 +02:00
Christian Prochaska
08ecddf5ca libc: limit repeating 'fcntl' error messages
Issue #5174
2024-04-19 08:54:21 +02:00
Christian Helmuth
f86bba3059 ps2: probe for working i8042
If no working controller is detected the driver just enters sleep
forever.

Issue #5174
2024-04-19 08:54:21 +02:00
Josef Söntgen
2be57e4156 fetchurl: add 'verbose' config option
This commit introduces a config option to enable verbose operations.
This can be used to ease debugging.

Issue #5184.
2024-04-19 08:54:21 +02:00
Josef Söntgen
344831ec06 curl: update to version 8.7.1
This commits updates the contrib sources to version 8.7.1.

This version requires more random entropy as it queries OpenSSL
about the current random state and will bail if it is not sufficient.
Doubling the content of the '<inline>' VFS plugin as used in static
configurations seems satisfactory.

Furthermore DNS resolving needs a configured '<pipe>' plugin to work
properly.

Fixes #5184.
2024-04-19 08:54:21 +02:00
Stefan Kalkowski
1bdff41544 genode_c_api usb: always return valid capability
Instead of returning an invalid capability whenever an interface is
requested that does not exist, create a disconnected interface component.
It is also possible that a client requests an interface that got removed
at the same time. When an invalid capability gets returned, a client
can stumble about invoking it.
Moreover, this commit marks either invalid interface or device components
as disconnected objects to optimize their handling.

Ref genodelabs/genode#5021
2024-04-19 08:54:21 +02:00
Norman Feske
fe144a6c5f sculpt: increase text-edit quota
This is an intermediate solution for accommodating overly long
text lines that can appear in report/runtime/usb/devices in the
presence of long product strings.

Issue #5174
2024-04-19 08:54:21 +02:00
Stefan Kalkowski
aefbc47c56 hw: preserve slack time, favor activated jobs
In the scheduler's implementation preserve the consumed slack-time
over periods of activation/deactivation, but instead of appending
activated jobs to the end of the slack queue, insert it as new head.
Thereby, the extreme discrimination of threads with short execution
times and frequent blocking behaviour against long running computations
gets avoided.

Fix genodelabs/genode#4796
2024-04-19 08:54:21 +02:00
Norman Feske
4e78e91bc2 sculpt: sanitize keyboard-layout choice
The check handles the case when the user clicks right of the
radio-button text, yielding an invalid "matching" id. This should not
result in any action.

Issue #5174
2024-04-19 08:54:20 +02:00
Norman Feske
e1ab69491c sculpt: fix focus between inspect and file edit
Issue #5174
2024-04-19 08:54:20 +02:00
Norman Feske
8319f047d2 sculpt: launcher for recall_fs
Issue #5174
2024-04-19 08:54:20 +02:00
Norman Feske
49f3eca476 os: recipe and launcher for pkg/waveform_player 2024-04-19 08:54:20 +02:00
Alexander Boettcher
14b3a0c794 platform/pc: support poweroff
If the support for S5 is announced via the sleep_state report, the
pc_platform_drv now issues the S5 (poweroff) via Pd::system_control.

Issue #5180
2024-04-19 08:54:20 +02:00
Alexander Boettcher
4c79f948ab platform/pc: support to suspend via system_control
When the "system" ROM state turns to "suspend",
the S3 state information of the sleep_states ROM are determined and
are used to invoke the privileged Pd::system_control call.

Issue #5180
2024-04-19 08:54:20 +02:00
Alexander Boettcher
94b3e30f90 acpica: report last completed action
triggered by the "system" ROM change. With this information the consumers
of the sleep_states report can determine, when the operation is finished.

Issue #5180
2024-04-19 08:54:20 +02:00
Alexander Boettcher
3471fce672 sculpt: add acpi_support launcher
Issue #5180
2024-04-19 08:54:20 +02:00
Josef Söntgen
75e1f1797d sculpt_manager: raise runtime_view RAM quota
Issue #5174.
2024-04-19 08:54:20 +02:00
Josef Söntgen
d858a600f7 sculpt: raise max supported display resolution
This commit raise various quota to accommodate using a display
resolution of up to '3840x2160' in the static parts, e.g. the
leitzentrale, of Sculpt.

Issue #5174.
2024-04-19 08:54:20 +02:00
Josef Söntgen
5dce61563e pc_intel_fb: configure max framebuffer memory
This commit introduces the means to configure the framebuffer memory
used by the driver for sizing its buffers.

Originally the avail memory was derived from the avail ram in the PD
session, which roughly corresponds to configured RAM quota.
However, since it is only used in a virtual capacity, we can decouple
it from the actual memory and set to a value that accommodates larger
framebuffer resolutions like 3840x2160. If the configured RAM quota
is not enough to satisfy an allocation request the client will issue
a resource request.

Issue #5174.
2024-04-19 08:54:20 +02:00
Norman Feske
b086996438 sculpt: update falkon_web_browser pkg
Issue #5174
2024-04-19 08:54:20 +02:00
Norman Feske
694eb3f40d sculpt: launcher for system clock
Issue #5174
2024-04-19 08:52:41 +02:00
Norman Feske
4c4adec5ad sculpt: reset routing dialog after add-component
Issue #5174
2024-04-19 08:52:41 +02:00
Norman Feske
22f0ab926b sculpt: adjust leitzentrale priorities 2024-04-19 08:52:05 +02:00
Norman Feske
29960db32c sculpt: provide empty usb default policy
This avoids service-denied errors of USB clients like VBox at
integration time when client-specific policy exists yet.

Issue #5174
2024-04-15 16:39:16 +02:00
Norman Feske
22a731b671 sculpt: make popup dialog scrollable
This patch complements "sculpt: make component graph scrollable" with
the ability to scroll the popup dialog, which is sometimes needed in the
presence of many services as routing options.

Fixes #5183
2024-04-12 17:44:19 +02:00
Norman Feske
7df19173af sculpt: make component graph scrollable
This patch allows the user to vertically scroll the component graph
either via the scroll wheel or via the page up/down keys.

Issue #5183
2024-04-12 17:10:55 +02:00
Christian Helmuth
c4f75f49e5 depot_autopilot: skip test-read_only_rom on linux
Fixes #3414
2024-04-12 16:48:37 +02:00
Norman Feske
a5dcb8494e sculpt: include grub.cfg in system update
Issue #5182
2024-04-12 16:26:32 +02:00
Alexander Boettcher
3af3773c60 record_play_mixer: avoid warning on halted session
Issue #5175
2024-04-12 16:14:52 +02:00
Christian Prochaska
c551b4dfb3 qt5: build qmake projects with debug infos
Fixes #5181
2024-04-12 15:51:31 +02:00
Christian Prochaska
dcf5b5052a qt5: add '.qmake.conf' to example recipes
Fixes #5179
2024-04-12 15:51:30 +02:00
Josef Söntgen
0ad6faeeaa wifi: fix using out-dated scan timer
Commit 'wifi_drv: re-arm scan timer when enabled again' allowed for
re-arming the scan timer but still uses the old timer value the first
time around. If the timer was disabled, by setting the interval to 0,
it was not enabled again.

We now check if the interval has changed beforehand and potentially
arm the scan timer afterwards.

Fixes #5178.
2024-04-12 15:48:52 +02:00
Christian Helmuth
dc0e78cdf8 depot: update recipe hashes 2024-04-12 15:08:01 +02:00
Christian Prochaska
7fca026b48 sculpt_manager: check devices ROM before fb driver start
Issue #5174
2024-04-12 15:08:01 +02:00
Josef Söntgen
24d0c18193 libc: print unknown fcntl command in hex
This skimps the manual conversion step and eases diagnostic
operations.

Issue #5167.
2024-04-12 15:08:01 +02:00
Josef Söntgen
49548fea07 libc: allow sample rate change via SNDCTL
Allow the current VFS OSS plugin to requested different sample rates.

Issue #5167.
2024-04-12 15:08:01 +02:00
Josef Söntgen
d0aa8362db vfs/oss: support different sample rates
This commit introduces support for different samples rates. For now
the range is capped to 8kHz up to 48kHz.

Issue #5167.
2024-04-12 15:08:01 +02:00
Josef Söntgen
33735d0af8 Add plugin version to VFS OSS plugins
To differentiate between the legacy and the current VFS OSS plugin both
plugins will feature a 'plugin_version' field in its info file. This
is used for enabling features provide by the current version that are
not supported in the legacy one.

Issue #5167.
2024-04-12 15:08:01 +02:00
Josef Söntgen
4a9e6a001f sculpt: add audio and mixer launcher
The audio launcher configures the 'bsd_audio_drv' component for normal
use where the micrphone selection should work on most Thinkpads.

The mixer launcher configures the 'record_play_mixer' component for
use with the 'audio' launcher and provides also examplary rules for
vbox6 launchers.
2024-04-12 15:08:01 +02:00
Josef Söntgen
798087c5ad dde_bsd: use 'mic_' prefix for Play sessions
This commit prefixes the Play sessions of the audio driver so that
these can be matched differently in the 'record_play_mixer' config.

The same could be archived with re-labling but naming the sessions
differently at the source prevents accidental mis-configuration.

Issue #5167.
2024-04-12 15:08:01 +02:00
Josef Söntgen
e27fad7c9a sculpt_distribution: replace mixer pkg
The pkg is superseded by the 'record_play_mixer'.

Issue #5167.
2024-04-12 15:08:01 +02:00
Johannes Schlatow
76176a196d Enable Intel HD Graphics 500 (found in ZimaBlade)
The IHD500 is almost a gen9 (skylake) GPU with subtle differences. Linux
maintains a separate feature set `GEN9_LP_FEATURES` for this GPU.
However, foisting the GPU as skylake on the GPU drivers seems to work
quite fine.

genodelabs/genode#5177
2024-04-12 15:08:01 +02:00
Johannes Schlatow
8b43554a27 gpu/intel: do not clflush on MMIO but on ppgtt
Executing a clflush operation on MMIO memory freezes embedded
platforms such as the Celeron N3450 used on the ZimaBlade. Looking into
the current linux code confirms that clflush is only used for ppgtt
entries and not on MMIO memory.

Fixes #5176
2024-04-12 15:08:01 +02:00
Johannes Schlatow
7a042925fc platform: catch denied IO_MEM-session
In case core denies an IO_MEM session, the platform driver should
survive and hand out an invalid capability instead.

genodelabs/genode#5174
2024-04-12 15:08:01 +02:00
Norman Feske
edaff9fb96 sculpt: adjust leitzentrale priority
Since "sculpt: adjust nitpicker priority", the nitpicker GUI server no
longer runs at the highest priority, yet the runtime_view of the
leitzentrale UI continued to operate at the highest priority.
On slower machines, this results in a visible interference of the CPU-
heavy rendering of the runtime_view with the (now) lower-prioritized
nitpicker, in particular laggy pointer movements.

This commit subordinates the leitzentrale components below the priority
of nitpicker to prevent this interference.

It also simplifies the priority scheme at the static system init: The
timer has the highest priority whereas all other components use the
priority band -1.

Issue #5174
2024-04-12 15:08:01 +02:00
Norman Feske
a1e3f9a73e sculpt: allow RAM fs to grow up to 2 GiB
The hard resource limit introduced by "sculpt: upper limit for automatic
quota upgrading" is too conservative for typical use cases of the RAM
fs. This commit makes the limit adjustable per managed component and
relaxes the limit for the RAM fs and depot_rom from 256 MiB to 2 GiB.

Issue #5174
2024-04-12 15:08:01 +02:00
Sebastian Sumpf
5d56340568 vfs_lxip: return WRITE_ERR_WOULD_BLOCK on EAGAIN
Because all operations in lxip are non-blocking, return
WRITE_ERR_WOULD_BLOCK for data writes as done by read.

Note: This was not the case in the old plugin because 'write' was blocking
operation there.

issue #5165
2024-04-12 15:08:01 +02:00
Sebastian Sumpf
309a281b14 depot_autopilot.run: adjust TEST_MODULES to build_artifacts 2024-04-12 15:08:01 +02:00
Johannes Schlatow
536048592b hw: propagate write combining to page flags
Fixes #4799
2024-04-12 15:08:01 +02:00
Christian Prochaska
039a851003 gdb: prevent use of host libgmp in configure test
Fixes #5173
2024-04-12 15:08:01 +02:00
Josef Söntgen
fd60e5a8b2 pc_wifi: provide iwlwifi LED related dummies
These generated dummies slipped in when the commit
'pc_linux: enable gpio, audio' got merged and mainly concern old devices
from the 6xxx series.

The functions are normally guarded via 'CONFIG_IWLWIFI_LEDS' but due to
the olddefconfig step when generating our pc_linux config using
LX_DISABLE has no effect.

Issue #5066.
2024-04-12 15:08:01 +02:00
Christian Helmuth
f83487869d tool/xkb2ifcfg: adapt to current Genode version
Thanks Florian for the nudge.
2024-04-12 15:08:01 +02:00
Alexander Boettcher
f59883427f sculpt_manager: provide platform_info for boot_fb
Issue #5174
2024-04-12 15:08:00 +02:00
Norman Feske
8875e3b879 dialog: allow out-of-view cursor when scrolling
This patch relaxes the counter-intuitive enforcement of keeping the
text cursor always in view when using the scroll wheel.

Issue #5174
2024-04-12 15:08:00 +02:00
Norman Feske
e04336d087 sculpt: driver-policy tweaks
Allow tweaking the driver selection using the manager config:

- The new attribute 'ps2="no"' suppresses the selection of the PS/2 driver.
- The new attribute 'intel_gpu="no"'suppresses the selection of the
  Intel GPU and fb drivers, letting Sculpt fall back to VESA or boot-fb.

Note that the dynamic change of those attributes is handled in principle
but not advisable. E.g., disabling the intel driver after startup leaves
the hardware in a state that the VESA driver cannot cope with. However,
when statically defining the attributes in sculpt/manager/default, it is
now possible to build an image that uses VESA on an intel machine.

Issue #5174
2024-04-12 15:08:00 +02:00
Christian Helmuth
fd5f8c0ee1 fb_sdl: filter key-repeat events (fixes #5172) 2024-04-12 15:08:00 +02:00
Norman Feske
3f66bf25aa sculpt: restore wifi and nic restart option
Issue #5174
2024-04-12 15:08:00 +02:00
Norman Feske
594da536c7 sculpt/default-pc: add trace_logger launcher
Issue #5174
2024-04-12 15:08:00 +02:00
Martin Stein
e5fce868fb file_vault_client.run: raise lock timeout and caps
The nightly Qemu tests that don't use KVM require more time for completing the
unlock-and-access phase of the test. If the lock phase starts to early, the
file access is interrupted and the output isn't as expected.

Furthermore, on FOC, the cap quota was insufficient.

Ref #5148
2024-04-12 15:08:00 +02:00
Norman Feske
cc41a06c89 sculpt: version 24.04
Issue #5174
2024-04-12 15:08:00 +02:00
Norman Feske
1f24eb2401 wm: avoid eager reuse of window IDs
The existing allocation scheme of window IDs has the unwelcome effect
that a re-appearing window would not always result in a visible change
of the window list. In such cases, the layouter and decorator would not
be prompted to do their job. This effect could be observered with the
multi-dialog version of menu view in Sculpt OS when manually enforcing
the restart of the runtime_view. Sometimes the panel would not re-appear
after the restart.

This patch changes the allocation of window ID such that new windows get
fresh IDs instead of reusing an ID of a recently disappeared window.

Issue #5170
2024-04-12 15:08:00 +02:00
Stefan Kalkowski
4775dad26c usb_hid_raw.run: eliminate race in test metric
Rarely. it might happen that events got received shortly before the complete
set of relevant USB devices got recognized. Filter more output in test metric
to stay robust.
2024-04-12 15:08:00 +02:00
Martin Stein
047f130005 tresor_tester.run: clean up
Ref #5148
2024-04-12 15:08:00 +02:00
Martin Stein
b7049b5321 tresor_tester.run: slim down tests
This substantially slims down the test in order to reduce the number nightly
tests that fail due to timeouts. Now, the extended test steps (maximum trees
and benchmarks) are only run on Linux. The synchronous access, snapshot
management, rekeying, and resizing tests were removed.

Ref #5148
2024-04-12 15:08:00 +02:00
Martin Stein
0404cc6907 file_vault/file_vault_client: recalibrate quota
Recalibrates RAM and CAP quota in app and test in order for the
file_vault_client test to succeed on qemu/x86_64/sel4 and qemu/pbxa9/foc.

Ref #5148
2024-04-12 15:08:00 +02:00
Norman Feske
ac2d708205 sculpt: use one menu_view for all dialogs
This patch replaces the former use of one menu-view component per dialog
by a single menu view presenting all dialogs. This change reduces the
runtime config by about 20%, improves the boot time, and lowers RAM and
CPU usage at runtime.

Issue #5170
2024-04-12 15:08:00 +02:00
Norman Feske
9ce7c72c7c dialog: use one menu_view for multiple dialogs
Issue #5170
2024-04-12 15:08:00 +02:00
Norman Feske
d6cb9cf854 menu_view: make font-style updates more robust
The font pointers cached in labels can become dangling when the style
database is updated, as happens when changing the font size dynamically.
This patch orderly updates the cached pointers before removing
out-of-date font entries from the style database.

Related to issue #5170
2024-04-12 15:08:00 +02:00
Norman Feske
550dea7279 menu_view: support multiple dialogs
This patch equips the menu-view component with the ability to present
more than one dialog at a time. The dialogs must be declared in the
<config> node as follows.

  <config>
    ...
    <dialog name="settings"/>
  </config

For each dialog, menu view requests a dedicated ROM session labeled after
the dialog name. The corresponding GUI session is also labeled as such.
Note that only one hover report is generated responding to all dialogs.
The hover report can be correlated with the hovered dialog by inspecting
the the 'name' attribute of the hover report's <dialog> sub node.

The former global config attributes 'xpos', 'ypos', 'width', 'height',
'opaque', and 'background' have become attributes of the <dialog> node.

Fixes #5170
2024-04-12 15:08:00 +02:00
Johannes Schlatow
881f443bbe sculpt: only add log_kernel if used with nova
Fixes genodelabs/genode#5171
2024-04-12 15:08:00 +02:00
Norman Feske
96acb3412f gems: add missing import to dialog.run 2024-04-12 15:08:00 +02:00
Norman Feske
a3f04d2b4d sculpt: remove GPU routes to outside the runtime
GPU drivers always reside in the runtime subsystem now.
This patch eliminates the risk of requesting a GPU session at the
drivers subsystem, which never gets established.

Issue #5150
2024-04-12 15:08:00 +02:00
Josef Söntgen
b2a68211a4 black_hole: add Play and Record session
This commit introduces support for the Play and Record session to
the black hole component in the most minimal way possible.

Fixes #5157.
2024-04-12 15:08:00 +02:00
Josef Söntgen
bda86b8f15 vbox6: switch pkgs to new VFS OSS plugin
Issue genodelabs/genode#5167.
2024-04-12 15:08:00 +02:00
Josef Söntgen
5f88562263 gems: VFS OSS plugin for Record/Play session
The new VFS OSS plugin utilizes the Record and Play session. For the
time being it is a drop-in replacement for the old plugin and shares
its limitations.

In contrast to the old plugin it is possible to force a client to
use a configured fragment size. Some clients work best with larger
fragments, e.g. VBox, where raising the minimal fragment size is
beneficial.

Please look at the README file for more information.

Issue genodelabs/genode#5167.
2024-04-12 15:08:00 +02:00
Josef Söntgen
e61b804252 libports: add test/oss recipes
Add recipes that allow for using the OSS-based test component
on Sculpt.

Issue genodelabs/genode#5167.
2024-04-12 15:07:19 +02:00
Josef Söntgen
c9d70552a4 Rename vfs_oss to vfs_legacy_oss
Rename the old VFS OSS plugin using Audio_out and Audio_in sessions
and adapt users accordingly.

Issue genodelabs/genode#5167.
2024-04-12 15:05:47 +02:00
Josef Söntgen
600e5424a5 os: add pkg for record_player_mixer
Issue genodelabs/genode#5167.
2024-04-12 15:05:47 +02:00
Josef Söntgen
489d87c4b0 sculpt: add Play and Record session
Issue genodelabs/genode#5167.
2024-04-12 15:05:46 +02:00
Josef Söntgen
b9c8c8c2a5 sculpt: adjust nitpicker priority
Move nitpicker to the driver priority in the runtime to lessen
interference with high-priority runtime components.

Issue genodelabs/genode#5167.
2024-04-12 15:05:46 +02:00
Josef Söntgen
a6b8d382a9 dde_bsd: remove diagnostic depletion message
Issue genodelabs/genode#5167.
2024-04-12 15:05:46 +02:00
Josef Söntgen
22281c18ec gems: add rom_osci pkg recipe
Issue genodelabs/genode#5167.
2024-04-12 15:05:46 +02:00
Josef Söntgen
2da94bb702 os: add record_rom pkg recipe
Issue genodelabs/genode#5167.
2024-04-12 15:05:46 +02:00
Norman Feske
268a77add1 sculpt: redesigned popup dialog
The new popup dialog mirrors the concept of the software add and option
dialogs of the phone version.

Fixes #5168
2024-04-12 15:05:46 +02:00
Norman Feske
9ea99a896a sculpt: add launcher/black_hole 2024-04-12 15:05:46 +02:00
Martin Stein
fbec6ae030 file_vault_client.run: raise access timeout
On some platforms like qemu/x86_64/sel4, accessing the file system is so
slow that it used to hit the timeout of this phase in the run script.

Ref #5148
2024-04-12 15:05:46 +02:00
Martin Stein
a7ff30d5a4 file_vault_client.run: disable for riscv
Ref #5148
2024-04-12 15:05:46 +02:00
Martin Stein
0ef92baf9d tresor_tester.run: raise block_io_fs caps
On platform imx6q_sabrelite/arm_v7a/imx6q_sabrelite/sel4, the test used to
fail because of a resource request.

Ref #5148
2024-04-12 15:05:46 +02:00
Martin Stein
5cb5610906 tresor_tester.run: raise test timeout
Some platforms (especially the qemu-based ones) used to time out on
nightly tests although they would have succeeded with more time.

Ref #5148
2024-04-12 15:05:46 +02:00
Norman Feske
4a1a29b3d0 sculpt: make storage target configurable
This patch lays the selection of the used storage target into the hands
of the config/manager file. By default, Sculpt selects the target by its
built-in heuristics, probing for a Sculpt partition. However, by
specifying a <target> node, one can explicitly select a storage target.

E.g., for using the 2nd partition of the SATA disk connected to port 1
of the AHCI controller, one can now specify:

  <target driver="ahci" port="1" partition="2"/>

For selecting the ram_fs as target:

  <target driver="ram_fs"/>

The latter case is particularly useful for custom Sculpt scenarios
deployed entirely from RAM. For such scenarios, add two lines to
your .sculpt file:

  ram_fs:  depot
  manager: use_ram_fs

The first line configures the ram_fs such that the depot is mounted
as a tar archive. The second line configures the sculpt manager to
select the ram_fs as storage target. You can find this feature
exemplified in default-linux.sculpt scenario.

  build/x86_64$ make run/sculpt_test KERNEL=linux BOARD=linux

It is worth noting that the configuration can be changed at runtime.
This allows for switching between different storage targets on the fly.

Issue #5166
2024-04-12 15:05:46 +02:00
Norman Feske
508e0bdfbf sculpt: introduce config/manager
The new 'manager' config allows for the passing of configuration data the
sculpt manager without the need to modify the config/leitzentrale subsystem.

Issue #5166
2024-04-12 15:05:14 +02:00
Stefan Kalkowski
2f0fe562ec os: packet_allocator needs size for free
Unlike the previous return value of
`Genode::Packet_allocator::need_size_for_free()` indicated, it does need
the size of the object it has to free to work properly.
2024-04-12 15:05:14 +02:00
Martin Stein
84285881f3 vfs_rump: fix missing create arg in open
The plugin used to call open with the create flag set at rump without file
permissions for create leading to undefined behavior regarding the file
permissions.

Ref #5148
2024-04-12 15:05:14 +02:00
Sebastian Sumpf
65dfd2f9a8 lxip: add ECONNRESET errno
The ECONNRESET/GENODE_ECONNRESET errno was not handled in lxip.

issue #5165
related #5161
2024-04-12 15:02:45 +02:00
Sebastian Sumpf
1056c759fd vfs_lxip: propagate data file write error
All errors (as in the legacy version) are now propagated as WRITE_ERR_IO
(see Lxip_vfs_file_handle::write), which ultimately will lead to EPIPE
in libc's socket_fs. This also counts for EAGAIN leading to the fact
that partial writes are not supported for blocking sockets in libc, also
libc will not try a second time in case not all data has been written.

issue #5165
2024-04-12 15:02:45 +02:00
Sebastian Sumpf
b30bacf86e lxip: shadow asm-generic/access_ok.h
The IP stack checks "user" pointer access, for example, for iov's using
'access_ok' which in turn calls '__access_ok'. The function checks if the
pointer is below TASK_SIZE_MAX, which is usually a big value on 64 bit
systems, but 3GB on 32 bit systems. Because the IP stack is mostly used with
Genode's libc, where pointers on some kernels (base-linux) can be >3GB and we
don't want to make an additional copy of each buffer/iov interacting with the
IP stack, we short circuit the function

issue #5165
2024-04-12 15:02:45 +02:00
Norman Feske
b78b2c7ac9 sculpt_manager: use Rom_handler
This patch replaces the dynamic use of Attached_rom_dataspace by a
new Rom_handler utility, which implicitly covers the initial import of
content (safely using 'local_submit'), the registration of the signal
handler, passes the Xml_node to the handler function (no need to
manually call 'update'), and provides scoped access to the content via a
'with_xml' method. The latter reinforces a programming style that does
not need to copy Xml_node objects.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
f96cea8151 sculpt: remove notion of system 'block_devices'
This patch removes the remains of the original block-device discovery as
done by the former driver manager. Block sessions are now always
provided by components hosted in the runtime subsytem. The storage node
of the graph is no more.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
0cf12c6778 gems: use C++20 function template syntax 2024-04-12 15:02:45 +02:00
Norman Feske
4dc1014bfb gems: coding style (avoid superfluous '()' pairs) 2024-04-12 15:02:45 +02:00
Norman Feske
6cabc85ac8 sculpt: group driver management in 'Drivers' class
This patch harmonizes the driver management between the sculpt manager
and the phone manager by hosting the individual drivers in a new
'Drivers' class with a narrow interface towards 'Sculpt::Main'. The
patch also introduces a clean separation of the 'Board_info' between
features detected at runtime (on PC hardware), statically
known/managed features (phone hardware), and options that can be
toggled at runtime.

With common patterns for managing drivers in place now, this commit
also moves the former runtime/wifi_drv.cc and runtime/nic_drv.cc
code to driver/wifi.h and driver/nic.h. The _drv suffix of the wifi
and nic driver components have been dropped.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
b7bbf8f7e4 sculpt.run: remove outdated session routes
The move of block, USB, and input drivers from the drivers subsystem to
the runtime alleviates the need for routing those sessions between the
subsystems.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
d8acc3a9f4 sculpt: host MMC driver in runtime
Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
d13b8e1937 sculpt: host soc touch and fb drivers in runtime
This patch moves SoC-specific framebuffer and touchscreen drivers
(PinePhone) to the runtime subsystem. They are enabled for the
phone_manager.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
85e020b8e1 gems: remove driver_manager
The former pkg/drivers_managed-pc has been replaced by the
pkg/sculpt_drivers-pc, which is merely a collection of archives.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
99da68183f sculpt: abbreviate .part_block suffix to .part
This slightly reduces the horizontal space of the component graph.
2024-04-12 15:02:45 +02:00
Norman Feske
fe596f2219 sculpt: host NVMe driver in runtime
As the NVMe driver was the last remaining driver controlled by the
driver manager, this patch removes the 'drivers -> dynamic' subsystem
along with the driver manager from sculpt/drivers/pc.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
206bf856bb sculpt: host AHCI driver in runtime
This patch moves the AHCI driver from the 'drivers -> dynamic'
subsystem to the runtime, managed by the sculpt_manager. One
implication of this change is the new need to supplement a device
port number to the 'Storage_target', in addition to the existing
label and partition. Previously, each block device was addressed by
merely a label specified for a parent session. The meanings of the
'Storage_target' elements are now as follows.

- The label corresponds to the driver component providing the storage.
- The port is used as block-session label when opening the session
  at the driver.
- The partition(s) denote the partition information contained in
  the block session.

Components operating as clients of the AHCI driver (e.g., a file system)
refer to their storage target as <label>-<port>.<partition> when a port
is defined (for AHCI). For drivers w/o ports, like USB storage where
each USB-block driver correponds to only one device, the storage target
is denoted as <label>.<partition>. When no partition table is present,
the '.<partition>' part is omitted.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
e3803fb861 sculpt: host PS/2 driver in runtime
Issue #5150
2024-04-12 15:02:44 +02:00
Norman Feske
556a7b8b17 sculpt: host PC USB driver in runtime
This commit moves the USB and USB HID driver from the drivers subsystem
into the runtime. The former special USB node of the graph corresponds
now to the USB host-controller driver (named "usb"). The management
options for USB storage devices are available inside this component
node now.

Issue #5150
2024-04-12 15:02:44 +02:00
Norman Feske
3580bb6e17 sculpt: move event_filter to static system
By moving the event_filter and the numlock_remap_rom from the drivers
subsystem to the static system, the filtering can be applied to drivers
hosted in the runtime and drivers hosted in the drivers subsystem.

This is a preparatory step for moving the USB host and HID drivers to
the runtime.

Issue #5150
2024-04-12 15:02:44 +02:00
Norman Feske
06c4b0248b sculpt: upper limit for automatic quota upgrading 2024-04-12 15:02:44 +02:00
Martin Stein
e53b00aafb run/file_vault_client: remove troublesome § char
Ref #5148
2024-04-12 15:02:44 +02:00
Martin Stein
5907307af6 file_vault: re-enable support for 32-bit platforms
Ref #5148
2024-04-12 15:00:46 +02:00
Christian Helmuth
f3610dc3a8 sel4: prevent stdout/stderr truncation in cmake
Remove the "excellent" idea to re-open /dev/stdout etc. for redirection as
cmake uses open(O_TRUNC) and, thus, truncates log output of outer
redirections.
2024-04-12 15:00:46 +02:00
Johannes Schlatow
9971f41f8c platform/pc: fix IOMMU fault reporting
When the kernel does interrupt remapping, we cannot get a non-remapped MSI
for fault event interrupts. We therefore let the kernel do the fault
reporting in this case.

genodelabs/genode#5066
2024-04-12 15:00:46 +02:00
Christian Helmuth
c54e8ec3e2 lx_emul: init pci_dev::error_state
pci_channel_offline() checks if this member is set to
pci_channel_io_normal (which is 1). The former value of 0 is invalid.

This change fixes pc_nic_drv link down-up in cases that require an e1000
reset.
2024-04-12 15:00:46 +02:00
Christian Helmuth
e691af4e97 pc_nic_drv: basic rtnetlink for lock/unlock and netdev_run_todo() 2024-04-12 15:00:46 +02:00
Christian Helmuth
38d2b8d46a lx_emul: function to generate trace messages
lx_emul_trace_msg() uses Genode::trace() as message function for
lightweight trace points, but also supports Linux format-string
attributes by using vsnprintf().
2024-04-12 15:00:46 +02:00
Christian Helmuth
66286d6f17 dde_linux: remove custom *printf implementation
The DDE uses Linux-internal formatted printk for a while now, thus
remove the unused code.
2024-04-12 15:00:46 +02:00
Christian Helmuth
5ff1ef82d1 lx_kit: preserve priority order in scheduler 2024-04-12 15:00:46 +02:00
Christian Helmuth
68925a6d33 pc/lx_emul: enable HIGH_RES_TIMERS
Only with high-resolution timers enabled timouts can fire between two
jiffies. The option is enabled on all relevant platforms but
unfortunately disabled by tinyconfig.

This option also permits the use of CONFIG_SND_HRTIMER.
2024-04-12 15:00:46 +02:00
Martin Stein
b903ddeea7 tresor: fix and test handling of minimal trees
* add testing of trees with minimal and maximal dimensions to tresor_tester.run
* replace tresor_init-local configuration type with simpler and more conformant
  configuration type in tresor/types.h that does also XML-parsing and
  XML-generation of configurations
* raise min degree to 2 because a degree of 1 is not practical und would
  require additional logic
* fix overflow with num_blocks=0 in Superblock_control::Read|Write_vbas
* fix off-by-one bug regarding the number of levels in Vbd_initializer
* improve sanity checks in Tree_configuration constructors
* document level indices in tresor_init/README
* fix size of some arrays in order to be able to handle the maximum number of
  tree levels

Ref #5077
2024-04-12 15:00:46 +02:00
Martin Stein
067a8a35cd tresor: fix faults on failed free-tree requests
* fixes two places, where the free tree module used to continue to process a
  request after actually having determined that the request fails
* moves the functionality of checking the hash of a read block and decoding it
  to a dedicated method in order to improve readability

Ref #5077
2024-04-12 15:00:46 +02:00
Martin Stein
81b17ba1e4 tresor_tester: check uninitialized vba data
Adds a new command attribute "uninitialized_data" to the Tresor Tester
configuration. If a <request op="read"> command has this attribute set to "yes"
it assumes the read blocks to be uninitialized and therefore contain only 0's.
Note, that a command that has "uninitialized_data" set to "yes" cannot have the
attribute "salt".

Ref #5077
2024-04-12 15:00:46 +02:00
Martin Stein
4a68f6bf75 tresor: discard snapshots only when writing the sb
Snapshots must only be removed when securing the superblock. Otherwise, the
last secured superblock might get corrupted. The Free Tree allocation algorithm
would not consider the deleted snapshots anymore although they are still active
in the secured superblock and re-use their blocks. This would render the tresor
container unusable if the superblock with the deleted snapshots is not secured
in the end (driver crash, power down, ...).

Ref #5077
2024-04-12 15:00:46 +02:00
Martin Stein
518c32e1af tresor: don't decode superblock before hash check
Superblock_control::Initialize used to decode a read superblock before checking
its hash. This is not necessary but may cause the operation to end up in a
decoding error on a superblock that is not the desired one anyway.

Ref #5077
2024-04-12 15:00:45 +02:00
Martin Stein
016a769605 tresor: check only the last secured superblock
Instead of iterating over all superblocks and checking each valid one,
check only the one whose hash matches the hash stored in the trust anchor.
I.e., the last one that was secured to the trust anchor. We must assume that
the other superblocks were corrupted in the meantime by operating the Tresor
container and, anyway, these Superblocks are not used anymore.

Ref #5077
2024-04-12 15:00:45 +02:00
Martin Stein
d2af024349 tresor: don't halt on extension beyond limits
The request of extending a tree used to halt when it found that
it could not add more levels to the tree because the maximum level index was
reached. Now, the library simply marks the request as failed, leaving it to
the user to handle the error condition.

Ref #5077
2024-04-12 15:00:45 +02:00
Martin Stein
b4c4681733 tresor: streamline design further
* differentiates request types that where merged formerly per module;
  e.g. instead of type Superblock_control::Request, there are now types
  * Superblock_control::Read_vbas
  * Superblock_control::Write_vbas
  * Superblock_control::Rekey
  * Superblock_control::Initialize
  * ...
  each holding only the state and functionality that is required for exactly
  that request

* removes all classes of the Tresor module framework and adapts all
  Tresor- and File-Vault- related libs, apps, and tests accordingly
  * the former "channel" state is merged into the new request types, meaning, a
    request manages no longer only the "call" to a functionality but
    also the execution of that functionality; every request has a lifetime
    equal to the "call" and an execute method to be driven forward
  * state that is used by a request but has a longer lifetime (e.g. VFS file
    handles in Tresor::Crypto) is managed by the top level
    of the user and handed over via the execute arguments; however, the
    synchronization of multiple requests on this state is done by the module
    (e.g. Tresor::Crypto)
  * requests are now driven explicitly as first argument of the (overloaded)
    execute method of their module; the module can, however, stall a request
    by returning false without doing anything (used for synchronization on
    resources)

* introduces Request_helper, Generated_request and Generatable_request in the
  Tresor namespace in order to avoid the redundancy of sub-request generation
  and execution

* moves access to Client-Data pointers up to Tresor::Virtual_block_device in
  order to simplify Tresor::Block_io and Tresor::Crypto

* removes Tresor::Client_data and introduces pure interface
  Client_data_interface in order to remove  Tresor::Client_data and
  move management of Client Data to the top level of a Tresor user

* introduces pure interface Crypto_files_interface in order to move management
  of Crypto files to the top level of a Tresor user

* moves management of Block-IO and Trust-Anchor files to the top level of a
  Tresor user

* adapts all execute methods, so, that they return the progress state
  instead of modifying a reference argument

* removes Tresor::Request_and Tresor:Request and instead implements
  scheduling at the top level of the Tresor user
  * the Tresor Tester uses a list as schedule that holds Command objects; this
    list ensures, that commands are started in the order of configuration
    the Command type is a merge of the state of all possible commands that can
    be configured at the Tresor Tester; the actual Tresor requests (if any) are
    then allocated on-demand only
  * the Tresor VFS plugin does not use a dynamic data structure for scheduling;
    the plugin has 5 members that each reflect a distinct type of operation:
    * initialize operation
    * deinitialize operation
    * data operation
    * extend operation
    * rekey operation
    consequently, of each type, there can be only one operation in-flight at a
    time; at the user front-end each operation (except "initialize") can be
    controlled through a dedicated VFS file; for each of these files, the VFS
    expects only one handle to be open at a time and only one file operation
    (read, write, sync) active at a time; once an operation gets started it is
    finished without preemtion (except of the interleaving at rekey and
    extend); when multiple operations are waiting to be started the plugin
    follows a static priority scheme:

      init op > deinit op > data op > extend op > rekey op

    there are some operation-specific details
    * the initialize operation is started only by the plugin itself on startup
      and will be driven as side effect by subsequent user calls to file
      operations
    * the data file is the only contiguous file in the front end and the file
      operations work as on usual data files
    * the other 3 files are transactional files and the user is expected to
      follow this scheme when operating on them
      1) stat (to determine file size)
      2) seek to offset 0
      3) read entire file once (this will be queued until there is no operation
         of this type pending anymore and return the last result:
         "none" | "failed" | "succeeded"; used primarily for synchronization)
      4) write operation parameters (this returns immediately and marks the
         operation as "requested")
      5) read entire file once (the same as above but this time in order to
         determine the operation result)
    * the rekey op and deinitialize op are requested by writing "true"
    * the extend op is requested by writing "tree=[TREE], blocks=[BLOCKS]"
      where TREE is either "vbd" or "ft" and BLOCKS is the number of physical
      4K blocks by which the physical range of the tresor container expands
      (the physical range always starts at block address 0 and is always
      expanded upwards)

* replaces the former <trust-anchor op="initialize"> command at the Tresor
  Tester with <initialize-trust-achor> as there are no other trust anchor
  operations that can be requested through the Tester config anyway

* removes the "sync" attribute from all commands at the Tresor Tester except
  from <request op="rekey">, <request "extend_ft">, <request op="extend_vbd">;
  as the Tester controls scheduling now, requests are generally synchronous;
  at the rekeying and extension commands, the "sync" attribute determines
  wether subsequent commands are interleaved with the execution of these
  commands (if possible)

* removes "debug" config attribute from Tresor VFS plugin and reworks "verbose"
  attribute to generate more sensible output

* removes NONCOPYABLE macro and instead uses Genode::Noncopyable and in-place
  Constructors deletion

* introduces types Attr and Execute_attr where a constructor or execute method
  have many arguments in order to raise readability

* renames the "hashsum" file that is provided by the Tresor Trust-Anchor VFS
  plugin to "hash" in order to become conformant with the wording in the Tresor
  lib

* makes the VFS Tresor test an automated test by merging in the functionality
  of vfs_tresor_init.run and removing the interactive front end; removes
  vfs_tresor_init.run as it is not needed anymore; adds consideration for
  autopilot file structure in the Test and adds it to autopilot.list

* removes all snapshot controls and the progress files for rekeying and
  extending from the Tresor VFS plugin; both functionalities were tested
  only rudimentary by the VFS Tresor test and are not supported with the only
  real user, the File Vault

* use /* .. */ instead of // ..
* use (..) instead of { .. } in init lists

Ref #5148
2024-04-12 15:00:45 +02:00
Martin Stein
14f4aa6e05 tresor_utils.run: use [build_artifacts]
Ref #5148
2024-04-12 15:00:45 +02:00
Martin Stein
ef0c3f9d2c tresor_tester.run: fix asynchronous rekeying test
The virtual block device module used to hand over the wrong VBA as
parameter "rekeying VBA" to the Free Tree when allocating PBAs for data
access during rekeying. In certain constellations, this caused the Free
Tree to alloc PBAs that were still in use. The Free Tree PBA selection
algorithm, however, is just fine. When fixing the call parameter, it works
as desired. This re-enables the async rekeying test.

Ref #5075
2024-04-12 15:00:45 +02:00
Martin Stein
02ef158748 gems: add autopilot test 'file_vault_client'
The script tests the use of an encrypted file system that is created and
provided via the File Vault.

Furthermore the script can be used for test-driving existing File-Vault
containers (created with potentially older File-Vault versions) under the
current File-Vault version. This is done via the "LX_FS_DIR_TEMPLATE"
env variable.

Ref #5062
2024-04-12 15:00:45 +02:00
Martin Stein
fb2d153c92 tresor: check hash of all read vba data
During one of the many re-factorization steps that were applied to the Tresor
library and its predecessor, the CBE library, one of the main features of the
project, the integrity check, accidentally received a grave regression. The
most recent version of the Tresor still used to check all hashes of meta-data
blocks but ignored the hashes of the actual data blocks.

With this commit, the hashes of all but yet uninitialized data blocks get
checked. The reason for ignoring uninitialized blocks is that they are not
actually read from disc but simply generated as an all-zeros block in the
driver in order to prevent having to initialize them all to zero in
Tresor-Init. That said, the integrity of these blocks cannot be compomised.
The according hashes in the meta data remain unset until the data block gets
written for the first time.

Ref #5062
2024-04-12 15:00:45 +02:00
Martin Stein
cf72499919 tresor: unused args at "R/W client data" at blk IO
The request classes Block_io::Read_client_data and Block_io::Write_client_data
used to receive a block reference for no reason. This commit removes these
args.

Ref #5062
2024-04-12 15:00:45 +02:00
Martin Stein
bcd82b7e75 tresor: revive and test app/tresor_check
The tresor_check tool became outdated back when the Tresor project was created
by re-writing its predecessor, the CBE, in C++. At this time, the check tool
was merely renamed but not updated. As there was also no autopilot test for the
tool, the tool remained outdated.

This commit rewrites the tool for the most recent Tresor version and adds an
autopilot test.

Ref #5062
2024-04-12 15:00:45 +02:00
Martin Stein
d8a71e5978 tresor: improved module framework and clean-up
* Make command pool a proper module
  * The command pool used to be kind of a module but it was driven via custom
    tresor-tester specific code. Now, it becomes a proper module that
    is driven by the module framework instead.
  * Move the code for creating and handling the module-execution progress flag
    into Module_composition::execute_modules as the function is always used with
    this code surrounding it.

* Reorganize files, remove deprecated files

* A new class Module_channel is introduced in the module framework and all
  channel classes inherit from it. With that class in place, the formerly
  module-specific implementations of the following methods are replaced by
  new generic implementations in the Module framework:

  * ready_to_submit_request
  * submit_request
  * _peek_completed_request
  * _drop_completed_request
  * _peek_generated_request
  * _drop_generated_request
  * generated_request_complete

* Module requests are now held for the duration of their lifetime at the
  module they originate from and not, like before, at their target module. As
  a result, modules can generate new requests inline (without having to wait
  for the target module), making code much simpler to read, reducing the amount
  of channel state, and allowing for non-copyable request types.

* Introduce a sub-state-machine for securing a superblock in the
  superblock_control module in order to reduce redundancy.

* Some modules, like free_tree, were completely re-designed in order to make
  them more readable.

* Replace all conditional exceptions by using the macros in
  tresor/assertion.h .

* Move methods that are used in multiple modules but that were implemented
  redundantly in each module to tresor/types.h.

* Remove verbosity node and all that was related to it from tresor tester
  config as the targeted verbosity can be achieved with the
  VERBOSE_MODULE_COMMUNICATION flag in tresor/verbosity.h .

* Extract the aspect of translating the byte-granular I/O-requests to
  tresor-block requests from the tresor VFS-plugin and move it to a new module
  called splitter.

* Rename the files and interface of the hashing back-end to not reflect the used
  hashing algorithm/config anymore, while at the same time making the hashing
  interface strict regarding the used types.

* Introduce the NONCOPYABLE macro that makes marking a class noncopyable short
  and clear.

* Replace the former tresor/vfs_utilities.h/.cc with a new tresor/file.h
  that contains the classes Read_write_file and Write_only_file. These classes
  significantly simplify the modules crypto, block_io, and trust_anchor by
  moving the details of file access to a sub-state machine.

* The former, rather trivial block allocator module is replaced by a normal
  object of type Pba_allocator that must be provided by the client of the
  Sb_initializer (reference in the Sb_initializer_request).

Ref #5062

tresor: read uninitialized vbas as all zeroes

Virtual addresses in a Tresor container that were not yet written by the user
should always return a data block that is all-zeroes. This was the concept
right from the beginning of the project. However, somehow this aspect either
never got implement or got lost along the way.

Some context for understanding the commit: The Tresor doesn't initialize the
payload data blocks of a container when creating a new container as this would
be rather expensive. Instead, it marks the leaf metadata nodes of the
virtual-block-device tree (those that reference the payload data blocks in
physical address space) with generation 0.

Now, this commit ensures that, whenever the virtual-block-device module reads
such a generation-0 leaf, instead of asking the block_io and crypto to deliver
data from disc, it directly provides the user with 4K of zeroes.

Ref #5062
2024-04-12 15:00:45 +02:00
Martin Stein
82388f4389 tresor_tester.run: fix free tree exhaustion
The order of execution inside the Tresor lib slightly changed compared to the
previous CBE lib. AFAICT, this is nothing to worry about and related to the
now cleaner structuring. However, it can produce higher peak requirements
regarding the allocation pool in the Free Tree. Therefor, this commit extends
the dimensions of the Free Tree used in the test.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
801a779a88 tresor: support and test snapshot management
* Implement requests "create snapshot" and "discard snapshot" in tresor lib.
* Adapt tresor tester in order to test the new feature.
  * Remove temporary code from tresor tester that skipped such requests with
    the hint that they were not supported yet.
  * Add mandatory "id" attribute to <request op="create_snapshot"/> and
    <request op="discard_snapshot"/> tag. A "discard snapshot" command always
    refers to the snapshot created by the "create snapshot" command with the
    same "id" value.
  * Clean-up command pool a bit.

Fix #4971
2024-04-12 15:00:45 +02:00
Martin Stein
417fb4e108 tresor: fix bad hash update during rekeying in vbd
The re-keying state machine in the VBD module would use block data of the wrong
block for the hash update of an inner node in a certain circumstance.

On re-keying, the VBD iterates for a given VBA over all snapshots, beginning
with the newest and re-keys the VBA in each of the snapshots. At each snapshot
it therefore loads the branch of the VBA top-down, and then updates the branch
bottom-up. However, if loading a certain level of the branch of a certain
snapshot runs into the same physical block as with the last snapshot on this
level, the algorithm turns around and updates the branch from this point
upwards instead of going further down the whole way to the leaf. This is
because everything below this point has already been re-keyed in the course of
a newer snapshot.

The case where this turning around is not right above the leaf (i.e., the first
shared physical block is a metadata block) that's were the bug was located. In
this situation, we have to re-encode the highest shared metadata block into a
buffer again before starting to update. The update code acts as if the
mentioned block was just written back (which is true when going down all the
way to the leaf before updating) and consequently is present in the encoded
buffer.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
f8332ce587 tresor: fix <initialize> config constraints
Until now, it was possible to use bad Free-Tree/VBD configurations with the
<initialize/> command. The tresor tester didn't complaining about it but the
tresor lib crashed or, worse, corrupted the tresor container. Now, the tresor
tester checks things, like for instance, that "nr_of_children" must be a power
of 2.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
b44ffc9361 tresor: snap garbage collection on each request
The Superblock Control module now issues a snapshot garbage collection on each
incoming request. In return for that, the commit removes all calls to the
garbage collection from other modules.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
3eb5302ab0 tresor: no local impl. of snap garbage collection
Move the implementation of the snapshots garbage collection to the Snapshots
class and remove module-local duplicates.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
9605a60eac tresor: no local copy of snapshots in vbd module
The Virtual Block Device module used to create a local copy of the Snapshots
array respectively Snapshot root it received with an incoming request. After
finishing the VBD operation on the copy, the source module of the request
used to back-copy the resulting Snapshot array resp. Snapshot root. This is
not only less efficient than referencing but also allowed a bug to sneak into
the new C++ implementation.

In contrast to the old Ada/SPARK implementation (CBE), the new design doesn't
allow for global objects that can be accessed by any module without receiving a
reference in a module request. Therefore, the Free Tree module has to receive a
reference to a Snapshots array with each request in order to be able to use it.
In our case, these requests are allocations for a "Write" operation from the
VBD. However, the VBD itself receives only the one Snapshot required for
writing and therefore causes the Free Tree to make bad decisions on whether or
not a block can be re-allocated or not.

With this commit, the VBD always receive a reference to the whole Snapshots
array and also propagates it this way to the Free Tree.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
b49f052051 tresor: improve verbosity modes
* make array classes printable
* pba filter for block io verbosity
* streamline read/write/rekey verbosity

Ref #4971
2024-04-12 15:00:45 +02:00
Christian Prochaska
a187f15d8c sculpt: add gdb_x86 to distribution and index
Issue #5076
2024-04-12 15:00:45 +02:00
Christian Prochaska
7248c5cc23 sculpt: add terminal to index
Issue #5076
2024-04-12 15:00:45 +02:00
Christian Prochaska
90239c0787 ports: add 'gdb_support'
Fixes #5163
2024-04-12 15:00:44 +02:00
Christian Prochaska
2eae70d3cd os/vfs.h: add support for symlink creation
Fixes #5162
2024-04-12 15:00:44 +02:00
Pirmin Duss
7f1adbea46 lxip: provide dummy for send_sig
This is function gets called by some libssh applications using vms_lxip.

For the dummy implementation I looked at the old port.

Issue genodelabs#5161
Issue gapfruit#1976
2024-04-12 15:00:44 +02:00
Christian Helmuth
e0fe046ad3 Update tiled_wm test for tiled-console scenario
- always assign apps/overlay to targets (visible=true/false) to
  prevent 0x0 geometry, which is interpreted as close
- add QMenu as exampel to panel button
- use usb-tablet on Qemu
2024-04-12 15:00:44 +02:00
Christian Helmuth
c27d04e338 window_layouter: "visible" assign-node attribute
Per default, windows assigned to targets are visible, which can be
changed with the new boolean "visible" attribute. Thus, window can be
hidden without changing their geometry.
2024-04-12 15:00:44 +02:00
Christian Helmuth
960670b16c decorator: fix handling of back-most window
Before, the current back-most window was not restacked if it was part of
the already, which lead to partially inconsistent view of the window
stack between decorator and nitpicker.
2024-04-12 15:00:44 +02:00
Christian Prochaska
219eecf8d7 qt5: stop signal proxy thread on exit
Fixes #5158
2024-04-12 15:00:44 +02:00
Christian Helmuth
6b50f993bc qt5_common: increase RAM of pointer to 2M 2024-04-12 15:00:44 +02:00
Norman Feske
1866520d6c dde_linux: build initcall_table.c after objects
The added hook 'OBJ_POSTPROC_SRC' gives us a way to post-process object
files for generating supplemental code. By using this hook, the
initcall_table.c generated by import-lx_emul_common.inc gets reliably
executed after all object files are built.

Fixes #5159
2024-04-12 15:00:44 +02:00
Christian Prochaska
bc44104522 qt5: fix use-after-free on exit
Fixes #5156
2024-04-12 15:00:44 +02:00
Norman Feske
891f933863 import-lx_emul_common.inc: don't use 'nm -U'
The option is used during the generation of initcall_table.c.
However, it happens to strip the first argument following the option.
The long option --defined-only works as expected.

Issue #5155
2024-04-12 15:00:44 +02:00
Christian Prochaska
d813a12f20 tool chain: GDB fixes
Fixes #5154
2024-04-12 15:00:44 +02:00
Christian Prochaska
b439924bf9 tool chain: fix GCC internal compiler error
Fixes #5153
2024-04-12 15:00:44 +02:00
Josef Söntgen
ff728eb6ce usb_block: fix 'Request_sense_repsonse' MMIO size
Due to a bug in the original implementation, the size of the MMIO
range covering the 'Request_sense_response' data was set too large
during the MMIO boundary change. This rendered devices that were not
yet ready and required an 'Request_sense' command unusable.

The commit also adapts all other commands where the MMIO size does
not match the expected one.

Fixes #5133.
2024-04-12 15:00:44 +02:00
Christian Helmuth
229f01b153 vbox6-capture: enable Windows BSOD logging
Issue #5099
2024-04-12 15:00:44 +02:00
Alexander Boettcher
5e5fe7291a nic/ipxe: add throttle RX interrupt support
The commit adds support to throttle the rate of the RX IRQs to a specified
value. The effect is, that no RX IRQs below the time threshold will fire and
therefore the CPU load gets reduced on the host. Trade-off gaming between
cpu load, throughput, overload.

Modular Sculpt 23.10 on S938 as testcase. In brackets the CPU affinity is
denoted.

ipxe (0,0) -> nic_router (1,0) -> Debian VM vbox6 (3,0) and (3,1)

VM: iperf -C X.X.X.X -t 60 -R

iperf server X.X.X.X is outside Sculpt and sends data due to '-R' to VM

Non representative measure points:

cpu load   - ipxe  - nic_router - iperf throughput
--------------------------------------------------
w/o  patch -  ~80% -       ~50% - ~706 MBit/s - 0    -> throttling off by default on S938
patch 651  -  ~20% -       ~35% - ~763 MBit/s - 651  -> 0.166ms throttle RX IRQ
patch 5580 -  ~15% -       ~25% - ~650 MBit/s - 5580 -> 1.4ms   throttle RX IRQ

Issue #5149
2024-04-12 15:00:44 +02:00
Alexander Boettcher
31e8b50b7c nic/ipxe: batch TX requests
A bunch of transmit requests received by the Uplink server (nic_router)
are currently added one by one to the ring buffer and every time the hardware
is notified to process each single request.

Instead, add as many as possible transmit requests in the ring buffer of
the hardware and when done trigger the hardware to process the ring.

Additionally, don't receive an "processed" TX IRQ for each element in the
ring, which causes high CPU load.

With this commit the TX IRQs in the ipxe driver for a

iperf -c X.X.X.X -t 60

from within a VM to the outside iperf server is reduced from about
~2'600'000 IRQs to about ~200'000. The overall CPU load for the driver
(when executed alone on CPU 0) is reduced from ~85 percent load to ~45 percent
load.

Issue #5149
2024-04-12 15:00:43 +02:00
Alexander Boettcher
feba5a138e nic/ipxe: batch packets on receive path
Use batching feature of Uplink client base header.

Issue #5149
2024-04-12 15:00:43 +02:00
Alexander Boettcher
d0d9cb6a73 uplink: support batching in client base header
Add support for Uplink drivers to batch requests.

Fixes #5149
2024-04-12 15:00:43 +02:00
Alexander Boettcher
23078154cd vbox: avoid blocking nic_ep thread
during receive the nic_ep may block as long as the guest does not provide
another receive network descriptor. In the meantime, all Genode signals
regarding the network interface, e.g. tx, will be postponed, which may
effect the throughput.

Instead use the nic_ep for rx packets unblocking. Add an notification mechanism
to the e1000 vbox network model, to notify us as soon as the guest added new
receive descriptors in the model.

Issue #5146
2024-04-12 12:57:30 +02:00
Alexander Boettcher
e1e87657c7 vbox: batch network packets
Fixes #5146
2024-04-12 12:57:30 +02:00
Norman Feske
b36a49dfc2 sculpt: host PC framebuffer drivers in runtime
Issue #5150
2024-04-12 12:57:30 +02:00
Norman Feske
27e0500452 sculpt_manager: Pci_info -> Board_info
This is a preparatory commit for issue #5150. Board_info is designated
for the selection of device drivers. It is not specific to PCI devices.
2024-04-12 12:57:30 +02:00
Johannes Schlatow
b67df08c9d intel_fb: add dummy for ZimaBlade support
When booting Sculpt OS on the ZimaBlade, `i915_vm_free_pt_stash` is
called. Providing an empty dummy implementation fixes the issue.

Fixes #5145
2024-04-12 12:57:30 +02:00
Christian Helmuth
609a065503 Static IP config in lighttpd.run on base-linux 2024-04-12 12:57:30 +02:00
Norman Feske
a452390f0b pkg/test-tcp_bulk_lwip: adjust quota for foc/pbxa9
For pbxa9, Qemu is started with only 256 MiB for foc but with 768 MiB
for base-hw. By reducing the RAM quota for all start nodes within the
remote scenario, each component gets enough RAM quota to breathe.
2024-04-12 12:57:30 +02:00
Norman Feske
72a575a5f9 depot_autopilot.run: error message on empty tar
When wrongly invoking the run script by specifying a skipped test
as its only TEST_PKGS argument, the run script fails due to a wrong
tar argument order. Let's better reflect this condition to the user
ahead of invoking tar.
2024-04-12 12:57:30 +02:00
Benjamin Lamowski
1b313df419 linux: force stack area mapping at requested address
With `MAP_FIXED` absent from the mmap(3p) flags, "the implementation uses
addr in an implementation-defined manner to arrive at pa", which may
lead to a mapping at an address diffent to the requested `addr`.

Add `MAP_FIXED` to the mmmap flags to force mapping to the specified
address.

Fixes #5147
2024-04-12 12:57:30 +02:00
Norman Feske
6315a09369 pkg/test-libc_fifo_pipe: ignore Ipc_error messages
Such messages can occur by chance when killing 'echo' while the program
blocks in an IPC call. It gets killed nevertheless. So the message does
not hint at a failure of the test.
2024-04-12 12:57:30 +02:00
Norman Feske
598dfff601 pkg/test-tcp_bulk_lxip: adjust quota for sel4 2024-04-12 12:57:30 +02:00
Norman Feske
5b4e1d22d9 test/timer: adjust min timer period to 250 us
In the context of #5138, the timer drivers for NOVA and base-hw had been
changed to support timeouts at a precision of 250 us (from formerly 1 ms).
Adjust the test to the new expected lower bound.
2024-04-12 12:57:30 +02:00
Norman Feske
956ec2f84c pkg/test-read_only_rom: adjust quota for sel4 2024-04-12 12:57:30 +02:00
Norman Feske
3052260249 Adjust terminal_crosslink RAM quota for seL4
The dynamic buffer allocation increases the RAM demand slightly beyond
1M on seL4. Use 2M, as is already the default in pkg/terminal_crosslink.

Issue #5135
2024-04-12 12:57:30 +02:00
Christian Helmuth
2f1520b4c1 base-hw: fix EPIT duration calculation on roll-over
If Ocif was not reset between two calls to _duration(), the returned
value exceeded _max_value().
2024-04-12 12:57:30 +02:00
Christian Helmuth
abb2045e17 Remove exec_static_constructors from dde_linux drivers
This is a follow-up commit to "lx_emul: generate initcalls during build".

Issue #5096
2024-04-12 12:57:30 +02:00
Stefan Kalkowski
7ec08af6d9 usb: session renewal & new client API
Replace the USB session API by one that provides a devices ROM only,
which contains information about all USB devices available for this client,
as well as methods to acquire and release a single device.

The acquisition of an USB device returns the capability to a device session
that includes a packet stream buffer to communicate control transfers
in between the client and the USB host controller driver. Moreover,
additional methods to acquire and release an USB interface can be used.

The acquisition of an USB interface returns the capability to an interface
session that includes a packet stream buffer to communicate either
bulk, interrupt, or isochronous transfers in between the client and the
USB host controller driver.

This commit implements the API changes in behalf of the Genode C API's
USB server and client side. Addtionally, it provides Usb::Device,
Usb::Interface, and Usb::Endpoint utilities that can be used by native
C++ clients to use the new API and hide the sophisticated packet stream API.

The adaptations necessary target the following areas:

* lx_emul layer for USB host and client side
* Linux USB host controller driver port for PC
* Linux USB client ports: usb_hid_drv and usb_net_drv, additionally
  reduce the Linux tasks used inside these drivers
* Native usb_block_drv
* black_hole component
* Port of libusb, including smartcard and usb_webcam driver depending on it
* Port of Qemu XHCI model library, including vbox5 & vbox6 depending on it
* Adapt all run-scripts and drivers_interactive recipes to work
  with the new policy rules of the USB host controller driver

Fix genodelabs/genode#5021
2024-04-12 12:57:30 +02:00
Christian Prochaska
6e437674f7 gems: add dbg_download
Fixes #5143
2024-04-12 12:57:28 +02:00
Norman Feske
f3313b6603 base-hw: new timer implementation
Issue #5138
2024-04-12 12:57:28 +02:00
Norman Feske
5a79cb9150 waveform_player.run: define CPU resources
This is needed for the priority-based scheduling on base-hw.
2024-04-12 12:57:28 +02:00
Josef Söntgen
dea6609612 import-openssl.mk: provide file named after api
For now this import file is solely there to satisfy the mechansim
in Goa that collects and incorporates import files for used APIs.

Issue genodelabs/goa#81.
2024-04-12 12:57:28 +02:00
Christian Prochaska
33d4134f49 qt5: detect contrib code changes
Fixes #5141
2024-04-12 12:57:28 +02:00
Norman Feske
a0290f8c51 base-hw: preserve usec accuracy in us_to_ticks
The kernel timer used to truncated timeouts to the next lower
millisecond, which not only limits the wakeup accuracy but also results
in situations where a user-level timeout is triggered earlier than
expected. The latter effect results in the observation of a spurious
timeouts and the subsequent programming of another timeout.

The patch solves the problem by preserving the sub-milliseconds bits
in the 'us_to_ticks' implementation(s).

Issue #5142
2024-04-12 12:57:28 +02:00
Christian Prochaska
7ae7b8481a monitor: send a notification when an inferior vanished
Fixes #5139
2024-04-12 12:57:28 +02:00
Norman Feske
913196e2dc record_play_mixer: smoothen time-window allocation
This patch modifies the mixer's time window allocation by modelling the
drift of the period length over time. This yields a much better
stability of the detected sample rates in the presence of jitter.

Issue #5132
2024-04-12 12:57:28 +02:00
Norman Feske
6407f8667f rump: prevent sleep times of less than 1 sec
This patch caps the busyness of the rump kernel, which normally calls
sleep with timeouts between 0 and 10 ms even when idle. On Sculpt
running on a x250 laptop, this patch saves 0.4% CPU load, which is
almost the half of the idle load.

Issue #5140
2024-04-12 12:57:28 +02:00
Norman Feske
bc0b6be6a9 nova: new timer implementation
Issue #5138
2024-04-12 12:57:28 +02:00
Norman Feske
44e0d7003a base: Alarm_registry data structure
This data structure uses an AVL tree to maintain a time-sorted set of
alarm objects. It supports the use of circular clocks of an bit width.

Issue #5138
2024-04-12 12:57:28 +02:00
Norman Feske
3e46cf5664 base: add Xoroshiro PRNG utility to base/internal 2024-04-12 12:57:28 +02:00
Christian Prochaska
3dbe398252 test-monitor: increase buffer size
Issue #5137
2024-04-12 12:57:28 +02:00
Christian Prochaska
d1a750c528 monitor: make maximum GDB response size configurable
Fixes #5137
2024-04-12 12:57:28 +02:00
Christian Prochaska
011a521968 os: make 'terminal_crosslink' buffer size configurable
Fixes #5135
2024-04-12 12:57:27 +02:00
Alexander Boettcher
32cb245cb8 ahci: enable conversion error checking
Fixes #5134
2024-04-12 12:55:39 +02:00
Alexander Boettcher
34674ac49f register_set: avoid conversion warnings
for Bitset_2 and Bitset_3 as used by ahci driver

Issue #5134
2024-04-12 12:55:39 +02:00
Christian Prochaska
62b3f24d1c libc: select() based on poll()
Fixes #5131
2024-04-12 12:55:39 +02:00
Pirmin Duss
40fd3d8c62 acpica: add format library to used_api
The format library is required, otherwise the binary isn't build. This
regression was introduced in

  acpica: provide verbose config (issue #5083)

Fixes genodelabs#5136
2024-04-12 12:55:39 +02:00
Christian Helmuth
b99d91b96e lighttpd: pkg recipe for easy runtime instantiation
The package depends on two resources.

- A Nic session should be routed to the nic_router "http" domain make
  the HTTP server available from the outside on forwarded port 80.

- A File_system session labeled "webroot" can be routed to any server
  by relabeling the session, e.g., to "report" or "config" in parent.

Sculpt deploy exmaple exporting report_fs via HTTP.

  <start name="lighttpd" pkg="lighttpd">
    <route>
      <service name="Nic">
        <child name="nic_router" label="http"/>
      </service>
      <service name="File_system" label="webroot">
        <parent label="report"/>
      </service>
    </route>
  </start>
2024-04-12 12:55:38 +02:00
Michael Mueller
8120c5b47d mxtasking: Always use branch yritys. 2024-03-12 12:50:38 +01:00
Michael Mueller
060c9f44b1 hoitaja: Fixed compile error. 2024-03-12 11:13:41 +01:00
Michael Mueller
a788e80fee base-nova: Enable SSE3 2024-03-11 14:49:12 +01:00
Michael Mueller
0a0263c70a Added microbenchmark to evaluate the overhead for core allocation and withdrawal. 2024-03-11 14:45:51 +01:00
Michael Mueller
48b2d725a8 hoitija: Removed old TASKING service. 2024-03-11 14:44:11 +01:00
Michael Mueller
13c22bc404 base-nova: Added new hypercalls for reserving a specific CPU, creating a habitat and querying the physical CPU ID. 2024-03-11 14:34:59 +01:00
Michael Mueller
0dbbca2af4 hoitaja: Use global affinity space for filtering affinities. 2024-03-11 14:31:54 +01:00
Michael Mueller
b38f6ee39a hoitaja: Create habitat on startup. 2024-03-11 14:30:52 +01:00
Michael Mueller
cafee5c615 hoitaja: Print affinity of newly created cell to log. 2024-03-11 14:30:09 +01:00
Michael Mueller
d11ff63b6d Simple component to create background noise for benchmarking. 2024-03-11 14:29:26 +01:00
Michael Mueller
77cf5143ea mxtasking: Added missing includes in target.mk. 2024-03-11 14:27:39 +01:00
Michael Mueller
f5ed9c1e43 base: Print label of component that has exceeded its quota. 2024-03-11 14:25:12 +01:00
Michael Mueller
6609ad03e6 Added new RPCs to query global affinity space and physical CPU IDs from TOPO session. 2024-03-11 14:24:17 +01:00
Christian Helmuth
83afc6e438 lighttpd: restore omission of O_NONBLOCK
Remove O_NONBLOCK from flags for regular files as libc cannot tell apart
regular files from others behind file-system sessions. Otherwise, reads
always "fail" with EAGAIN.

genodelabs/genode#5093
2024-03-05 11:56:19 +01:00
Christian Helmuth
706e341d3a trace_logger: read 'buffer' as Number_of_bytes 2024-03-04 15:50:03 +01:00
Josef Söntgen
449a72d8a2 trace_recorder: get session arguments from config
This commit adds support for setting the TRACE session parameters via
the configuration.

Fixes #5123.
2024-03-04 11:49:26 +01:00
Norman Feske
4025ca8ae1 doc/release_notes/24-02.txt: fix reference
Paragraphs cannot be used as references. So refer to the compounding
section instead.
2024-02-29 14:40:59 +01:00
Christian Helmuth
36a52c6886 version: 24.02 2024-02-29 11:35:41 +01:00
Norman Feske
95affade5d News item for version 24.02 2024-02-29 11:35:23 +01:00
Norman Feske
54a07dd3d6 Release notes for version 24.02 2024-02-29 11:35:23 +01:00
Norman Feske
1e8c36f682 doc/components.txt: record/play infrastructure 2024-02-29 11:35:22 +01:00
Christian Helmuth
9c7a303caf depot: update recipe hashes 2024-02-29 11:08:28 +01:00
Stefan Kalkowski
0d1e4bf8d5 Remove orphaned usb_terminal (fix #5130) 2024-02-28 16:32:23 +01:00
Stefan Kalkowski
88c347ee00 usb_hid_reconnect.run: use distinct device-ids
Newer Qemu variants quit with an error about already existing devices
if the same device-id is add and removed in a loop fast. To circumvent
this strange behaviour, simply use consecutive device id numbers.

Ref genodelabs/genode#5021
2024-02-28 16:32:23 +01:00
Christian Prochaska
32e7ec7b9b core: implement 'Vm_session_component::reserve_and_flush()'
Issue #5069
2024-02-28 16:32:23 +01:00
Sebastian Sumpf
9a65e4f607 mesa: generalize binder memory management
This patch was back ported from upstream Mesa and generalizes the memory
management of buffer objects used by the binder. Before this patch the
binder was treated as a special case where buffer objects were allocated
with a simple "next block or wrap" allocator. With this commit the
binder now uses the vm_heap allocators as done by all other buffer
allocations which leads to issues with reference counting and object
destruction being resolved.

Original commit message:

We're moving towards a path where all contexts share the same virtual
memory - because this will make implementing vm_bind much easier - ,
and to achieve that we need to rework the binder memzone. As it is,
different contexts will choose overlapping addresses. So in this patch
we adjust the Binder to be 1GB - per Ken's suggestion - and use a real
vma_heap for it. As a bonus the code gets simpler since it just reuses
the same pattern we already have for the other memzones.
2024-02-28 16:32:23 +01:00
Norman Feske
b370591e64 Mobile version of Sculpt OS
This patch contains the mobile variant of Sculpt OS, which evolved
at the genode-allwinner repository until now. In consists of the
following parts:

- gems/src/app/phone_manager  plays the role of the sculpt manager
- sculpt/phone-linux          allows for test driving the mobile
                              variant on base-linux
- gems/src/app/dummy_modem    mockup of a modem's behavior, used for
                              GUI development and testing

The parts targeting a specific device (PinePhone) remain local to
the genode-allwinner repository.

To give it a try:

  make run/sculpt_test KERNEL=linux BOARD=linux \
                       SCULPT=phone LOG=core DEPOT=tar

Fixes #5125
2024-02-28 16:31:46 +01:00
Christian Prochaska
ea51f1ffda monitor: limit the 'm' command response size
Fixes #5119
2024-02-28 16:31:46 +01:00
Christian Prochaska
aa6f99b0a4 monitor: report all stopped threads on '?' command
Fixes #5120
2024-02-28 16:31:46 +01:00
Alexander Boettcher
12df9bf450 gpu/intel: make aperture configurable
Fixes #5124
2024-02-28 16:31:46 +01:00
Alexander Boettcher
77f5ef3bcd nvme: release device before suspend
- monitor system ROM changes
- stop processing of new Jobs before suspend
- destruct platform device before suspend, but keep platform DMA buffers
- re-construct platform device and reinit resources (mmio, irq) on resume
- re-start block job scheduling on resume

Fixes #5101
2024-02-28 16:31:46 +01:00
Alexander Boettcher
9d15735bc6 ahci: release device before suspend
- monitor system ROM changes
- stop processing of new Jobs before suspend
- destruct platform device before suspend, but keep platform DMA buffers
- re-construct platform device and reinit resources (mmio, irq) on resume
- re-start block job scheduling on resume

Issue #5101
2024-02-28 16:31:46 +01:00
Alexander Boettcher
cde4d4aee0 ahci: refactor code for suspend/resume
This commit is a preparation commit for suspend/resume. The commit
refactors the code in order to consolidate all Platform resources into one
instance. All users within the driver should access the resources with
with_* functions, which checks whether the device resource is usable. The
callers are not allowed to store any references to the provided resources.

Issue #5101
2024-02-28 16:31:46 +01:00
Alexander Boettcher
8b3a339817 acpi_suspend: add nvme & ahci tests
- update documentation
- add nvme und ahci + test case
- fix minor configuration issues of GPU test case

Issue #5101 #5081
2024-02-28 16:31:45 +01:00
Alexander Boettcher
bf6c484c13 gpu/intel: use with(fn, fn_error) pattern
Issue #5081
2024-02-28 16:31:45 +01:00
Alexander Boettcher
0684101ff0 gpu/intel: release device before suspend
- monitor system ROM changes
- stop processing of new Jobs before suspend
- destruct platform device before suspend, but keep platform DMA buffers
- re-construct platform device and reinit resources (mmio, irq) on resume
- re-start GPU job scheduling on resume

Fixes #5081
2024-02-28 16:31:45 +01:00
Christian Prochaska
4ce4d4120a qt5: define BUILD_ARTIFACTS
Fixes #5122
2024-02-28 16:31:45 +01:00
Josef Söntgen
35638568c5 qemu-usb: access I/O buffers directly
This commit replaces the mapping of DMA buffers and gets rid of the
bounce-buffer handling, which was introduced to prevent data
corruption noticed when utilizing USB storage with Windows 10 guests,
with accessing the buffers directly.

Due to the way Windows 10 at times manages its DMA memory (many small
pieces instead of few larger ones) the unbounded registry becomes a
problem when containing stale entries.

Changing the 'qemu-usb' implementation allows for using 'read_dma'
and 'write_dma' directly.

Fixes #5121.
2024-02-28 16:31:45 +01:00
Christian Prochaska
cda48b4a49 sculpt: add base binary archive path to build_info ROM
Fixes #5118
2024-02-28 16:31:45 +01:00
Norman Feske
5073cba536 dde_bsd: support record and play session interface
This patch enhances the audio driver with the option to operate as a
client of the record and play services instead of providing the audio-in
and audio-out services. The record/play mode can be enabled by setting
the 'record_play="yes"' config attribute.

The audio_in.run and audio_out.run scripts support the selection of the
mode via the 'use_record_play_sessions' hook function.

Issue #5097
2024-02-28 16:31:45 +01:00
Norman Feske
18c4393106 dde_bsd: coding style
Remove superflouous Genode:: prefixes, name Main members as private,
change signal "dispatcher" to "handler".
2024-02-28 16:31:45 +01:00
Sebastian Sumpf
ff1e4b1bfb vfs_lxip: return error in case peek read returns EAGAIN
A read with MSG_PEEK returns -1 and EGAIN/EWOULDBLOCK in case the socket
is connected. Zero is only returned if the socket is disconnected.

isuee #5104
2024-02-28 16:31:45 +01:00
Sebastian Sumpf
7cbce1f47c libc: socket_fs_plugin handle MSG_PEEK reads
In case the socket is non-blocking, a read with the MSG_PEEK flag set
has to return -1 and EWOULDBLOCK/EAGAIN in case no data is availble and
the socket is connected. Returning zero implies the socket is in
non-connected state. Therefore, check the connection state in this
situation and return accordingly.

issue #5104
2024-02-28 16:31:45 +01:00
Christian Helmuth
0b63bb91b6 run/nova: cleanup hypervisor binary handling
With the following changes, the hypervisor binary from bin/ as well as
from depot archives is taken as is and not unnecessarily turned inside
out.

- Remove objcopy -O elf32-i386 as our grub boots 64-bit binaries
  very well
- Remove strip as bin/hypervisor is already stripped
2024-02-28 16:31:45 +01:00
Norman Feske
07669ac991 os: record-and-play session interfaces and mixer
- New session interfaces:
  - os/include/play_session   (for audio playing   / mic-input driver)
  - os/include/record_session (for audio recording / audio-output driver)
- Mixer at os/src/record_play_mixer providing both play and record services
- Simple waveform player at os/src/app/waveform_player
- Simple audio-signal capturing component at os/src/app/record_rom
- Simple oscilloscpe at gems/src/app/rom_osci (using record_rom)
- Simple test-audio_play for playing raw stereo f32 data

The _gems/run/waveform_player.run_ script illustrates the use of the new
components and interfaces.

Issue #5097
2024-02-28 16:31:45 +01:00
Josef Söntgen
914508bf7a lighttpd: streamline Genode specific patches
Issue #5093.
2024-02-26 08:59:10 +01:00
Christian Prochaska
080d3b6b63 vfs: support watch handlers on application signal level
Fixes #4092
2024-02-26 08:59:10 +01:00
Christian Helmuth
a529fffb7b Update jitterentropy to version 3.4.1
Fixes #5112
2024-02-26 08:59:10 +01:00
Christian Prochaska
fb2e0b50c8 os: 'Path_base::strip_double_dot_dirs()' improvements
Issue #5106
2024-02-26 08:59:10 +01:00
Christian Prochaska
7651c94bf5 os: add test for 'Genode::Path'
Issue #5106
2024-02-26 08:59:10 +01:00
Christian Prochaska
edba179497 qt5: fix debug link creation
Fixes #5116
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
394801c998 hw: re-name scheduler files according to class
Fix genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
79167d8f5c hw: re-organize scheduler internals & API
* Move Kernel::Cpu_scheduler to Kernel::Scheduler
  (we only have that one scheduler)
* Move Kernel::Cpu_share to Kernel::Scheduler::Context
* Move Kernel::Cpu_priority to Kernel::Scheduler::Priority
* Rename all functions and variables refereing to `claims` to
  `prioritzed`, because claims is not that common
* Rename occurrences of `fill(s)` to `slack` to name the time portions
  outside of the prioritized quantum
* Get rid of some two-liner sub-functions with only one occurrence
  (like `_quota_introduction`, `_quota_revokation`,...)

Ref genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
c8380c1447 hw: remove Cpu_scheduler::_trim_consumption
This private, internal function is used only in one scope,
and therefore not neccessary. But it has nasty side-effects as
it takes the parameter `duration` as reference and changes its
value. Just remove it completely.

Ref genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
1c4078f23a hw: merge booleans in scheduler into one state
Instead of having `_yield` and `_need_to_schedule` booleans, use one
consistent state variable.

Ref genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
9d72c21894 hw: rename head in scheduler to current
The name head is already extensively used in the context of the lists
managed by the scheduler. This terminology duplications does not simplify
reading the code. Instead we keep head for the first item in the list,
but use `current` in the variable name and API of the `Cpu_scheduler`
class to refer to the current scheduled share.

Moreover, the `_head_quota` is now `_current_time_left`, because it does
not denote quota but time left for the current schedule. The boolean
variable `_head_claims` gets removed at all. It duplicated the state of
whether a current share ist set, and whether it has so-called claim time
left.

Ref genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
2f727fb5c6 hw: rename Cpu_scheduler variables
Give certain scheduler class wide variables and functions clear names:

* quota => super_period_length
* residual => super_period_left

Ref genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
8e2c95e5e4 hw: replace double_list implementation
Replace double linked list by normal Genode::List with an additional
pointer to last list member to efficiently handle the scheduler share lists.
Moreover, move it into the private part of the Cpu_scheduler class,
the only scope where it is used anymore.

Ref genodelabs/genode#5115
2024-02-26 08:59:09 +01:00
Stefan Kalkowski
0055438257 hw: improve readability of scheduler
Minor changes that should not change any semantics:

* Remove `_next_fill()` its short and only used in one context,
  in which it is good to know what that code actually does
* Turn boolean values into actual boolean values
* Remove some brackets around one-liner pathes

Ref genodelabs/genode#5115
2024-02-26 08:59:09 +01:00
Stefan Kalkowski
776c2a6046 hw: avoid state & code duplication in scheduler
The `_head_was_removed` variable got introduced in solving #4710, but it
reflects only whether `_head` is a valid pointer or not, thereby it
duplicates state.

Ref genodelabs/genode#5115
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
ecd7b0568b lx_emul: adjust import to lx_kit remove
'src/include/spec/x86' does no longer exist

issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
c12224ffd3 api/pc_linux: adjust to legacy lx_kit removal
With the removal of legacy lx_kit 'src/include/spec/x86' does not longer
exist in dde_linux.

issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
97f8179f90 dde_linux: remove legacy lx_kit and lx_emul
All good things must come to an end.

issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
8aa3967201 dde_linux: remove legacy_lxip
Because legacy_lxlip is the last entry in dde_linux.port, remove the
port as well.

issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
8755993123 dde_linux: remove vfs_legacy_lxip
issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
b6baf3fe1e dde_linux: remove 'import-usb_arch_include.mk'
This seems to be an artifact left over from the legacy USB drivers.

issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
f86cd6899c ahci: add port count vs. ports implemented check
Check if controllers port count matches number of ports found in the
port implemented register. In case counts don't match print a diagnostic
message for debugging purposes.

issue #4081
2024-02-26 08:59:09 +01:00
Christian Helmuth
4a1a162c09 usb_hid: enable magic trackpad support
Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
1dcc6fda6b lx_emul: improve motion-device handling in evdev
The key element of the improvement is differentiated processing of
events of the following device types.

  Mouse:       relative motion
  Pointer:     absolute motion (Qemu usb-tablet and IP-KVM devices)
  Touchpad:    relative motion via absolute touchpad coordinates
  Touchtool:   absolute motion (e.g., stylus)
  Touchscreen: absolute motion and finger (multi-) touch

Processing is done in two stages for one "input packet". First, all
events of the packet are recorded into the current evdev state with
device-type specific operations. Then, appropriate Genode input events
are generated from the accumulated evdev state in the submission stage
(again by device-type specific functions).

A simple version of tap-to-click was added to the touchpad support.

Fixes #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
a0e0000108 genode_c_api/event: absolute-motion events
Absolute motion events are generated by "tablet" devices, e.g., Qemu
usb-tablet and IP-KVM appliances like PiKVM.

Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
5f2691a65b event_filter: transformation of motion coordinates
The <transform> filter configurably transforms touch and absolute-motion event
coordinates by a sequence of translation (move), scaling, rotation, and flipping
primitives in sub-nodes.

Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
7304a019e7 event_filter: <log motion="true"> attribute
Per default, only key presses and releases are logged. The optional
'motion' attribute (boolean) enables logging of motion and touch events.

Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
17724c5f1c virt_linux: enable magic mouse/trackpad HID
Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
ca9b5e3f56 virt_lx_emul: update initcalls
- SMSC95xx usb net
- HID multitouch / magicmouse
- no SMP / timer broadcast on arm_v7
- no IPv6

Issue #5105
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
fccf025d2f usb_hid: enable driver level multi-touch support
This commit enables generic Linux multi-touch support as well as support
for the Wacom Intuos/Graphire tablets as found in the previous version
of the USB HID driver. Events are not properly propagated through
Genode's Event C-API, yet, which will be a follow up.

Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
c57b841556 Fix link of jitterentropy port
The current port of jitterentropy is version 1.2.0 from pre-2017, whose
sources were recently moved to

  http://www.chronox.de/jent/releases/historic/jitterentropy-1.2.0.tar.xz

Note the *historic* label.

Issue #5112
2024-02-26 08:59:09 +01:00
Christian Prochaska
a1b5ebeb09 depot_query: add support for bin and dbg archives
Fixes #5110
2024-02-26 08:59:09 +01:00
Christian Prochaska
0bc2e240bf monitor: always respond to qXfer:memory-map:read
Fixes #5109
2024-02-26 08:59:08 +01:00
Johannes Schlatow
d23e1a87dd vfs_import: truncate files before writing
genodelabs/genode#5107
2024-02-26 08:59:08 +01:00
Christian Helmuth
6a94b8d153 Remove obsolete lx_kit_setjmp library
Issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
37736016fb usb_hid: adjust to arm_v7 UP and RCU tiny
Adjust source.list and dummies

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
5f1b0a5945 usb_net: adjust to arm_v7 UP and RCU tiny
Adjust source.list and dummies

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
a5f72ec095 lxip: adjust to arm_v7 UP and RCU tiny
Adjust source.list and dummies

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
7e8661f8bf virt_linux: disable SMP for arm_v7 and change to tiny rcu
When SMP is enabled multicore specific instructions (e.g., pldw) are
generated. These are not supported and lead to invalid instruction
faults on uni-processor systems (like Cortex-A8). Therefore, we disable
SMP for arm_v7 in Linux code. This requires also a switch from the RCU
tree implementation to RCU tiny, which we shadow and dummy implemented.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
651eb9d4f2 lx_emul/random: do not use jitterentropy in case initialization failed
Until now, in case 'jent_entropy_init' failed an error has been produced
and the following jitterentropy functions (i.e.,
'jent_entropy_collector_alloc') where called nevertheless. In case we
received a bad time source error, for example because the performance
counters are not working on the platform, the entropy collector did not return (endless
loop).

Therefore, this commit treats the failed jitterentropy initialization
not as an error but prints a warning about poor randomness quality and
stops using the jitterentropy library from this point on. The
'Jitterentropy::gen_random_u64' will in this case return the address of
a stack variable * some counter.

This is only a interim solution to make platforms work where performance
counters or TSC values do not exist/work.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
8c9b23ef56 test-libc_connect: use black hole as Uplink for lxip
For connection timeout test, create uplink domain via the 'black_hole'
that is only reachable through the nic_router.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
05283ac247 test/libc_connect: use IP outside of domain for timeout
The IP for the connect timeout test should be in another nic_router
domain, so ARP request are only processed be the nic_router and no other
IP stacks.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
240819b708 black_hole: add support for Uplink client
The uplink client simply drops and acknowledges packets it receives.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
61115c3776 depot_autopilot: adjust RAM quotas for lxip
Adjust the autopilot tests that use lxip to the lower RAM requiremnts of
lxip (old and new).

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
fb4ac714b2 recipes: adjust runtime quotas to lxip
lxip (old and new) requires less RAM now.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
561a9e7a72 vfs_lxip: adapt to 'genode_socket' C-API
Adjust the plugin to use the socket C-API found under
dde_linux/src/lib/lxip/include/genode_c_api/socket.h'.

This is the first minor step in generalizing the plugin.

isse #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
93b3e7d12f libc: socket_fs_plugin add monitor call
Add monitor call for '_fd_read_ready' because this maps to 'poll' in
'vfs_lxip' which should be executed by the EP.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
701856b06a dde_linux: copy vfs_lxip -> vfs_legacy_lxip
Make a copy of vfs_lxip so it can be revived easily. The plugin can now
be used like

! <legacy_lxip dhcp="yes"/>

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
27b1017fe9 test/lxip_raw: test using Genode socket C-API directly
The lxip_raw.run script will spawn a client/server scenario that tests
Genode C-API calls. The scenario can be used standalone, meaning no
actual network card is required.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
42d9640443 lxip: update to Linux 6.1.20
This commit updates lxip from version 4.4.3 to 6.1.20. It uses the
current lx_kit approach and is a shared library again. The stack has
been tested for x86_32/x86_64/arm_v6/arm_v7/arm_8.

The C-interface of the IP stack can be found under
lxip/include/genode_c_api/socket.h.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
c2080ecc03 linux.port: lxip_ip_config.patch
The patch makes it possible to re-configure the IP settings via DHCP or
static.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
bcb4b231af linux.port: lxip_checksum_32.patch
CONFIG_X86_USE_PPRO_CHECKSUM is a 'def_bool y' and gets re-enabled by
'make olddefconfig'. The PPRO version contains text relocations which we cannot
have in binaries (e.g., 'lea 45f(%ebx ...).').

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
364e58097d lx_emul: prevent division by zero
Check if ceil is <= 1 to prevent division by zero in
'__get_random_u32_below'.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
a0840d7a06 lx_emul/shadow: uaccess_32/64
Expand shadow header with '__copy_from_user_inatomic_nocache' and/or
'__copy_from_user_flushcache'.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
1006e9d987 lx_emul/x86_32: atomic64 set and cmpxchg
64-Bit versions for 32-Bit architecture.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
8c26a142c6 lx_emul: spinlock add bh_enable/disable
add bottom half enable/disable to functions with suffix "_bh" were
missing, because some functions release the bottom half separately
(__neigh_event_send).

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
c2a2ed67bb lx_kit/lx_emul: support explicit init call
Add the possibility to execute a module-init call by name using
'lx_emul_init_call', this is used, for example, by lxip to configure and
re-configure the IP address through 'ip_auto_config'.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
7abe07e2cf lx_emul/virt: remove stop from 'rcu_barrier' dummy
issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
df459c46ef usb_net: adjust to virt_linux config changes
* remove dummies for '__alloc_pages' and friends

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
5dc4ee6524 wireguard: adjust to virt_linux config changes
* remove dummies for '__alloc_pages'
* adjust arm_64 -> arm_v8
* remove IPv6 dummies (disabled in virt_linux)

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
7395f24423 virt_lx_emul: add shadow 'page_alloc.c'
Add suspport for '__alloc_pages' in virt_linux

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
7d62b891f8 virt_linux api: adjust to lx_kit split of arm_v(6|7|8)
Adjust API path.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
e21e32a793 virt_linux: disable IPv6
Will be re-enabled with IPv6 support of lxip.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
c2650cd1e7 virt_linux_generated: sort dep.list
sort 'dep.list' using LC_ALL=C.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
360d38c36d dde_linux: move lxip -> legacy_lxip
move lxip stack to 'legacy_lxip' so it can be revived easily.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
f19cd8416e lx_kit: split includes and setjmp into arm_v(6|7|8)
Move 'arch_execute.h' headers and 'setjmp/longjmp' implementation from
arm/arm_64 to arm_v(6|7|8).

issue #5104
2024-02-26 08:59:07 +01:00
Martin Stein
1336b0a751 mmio: upper-bounds checks
The classes Genode::Mmio, Genode::Register_set, Genode::Attached_mmio, and
Platform::Device::Mmio now receive a template parameter 'size_t SIZE'. In each
type that derives from one of these classes, it is now statically checked that
the range of each Genode::Register::Register- and
Genode::Register_set::Register_array-deriving sub-type is within [0..SIZE).

That said, SIZE is the minimum size of the memory region provided to the above
mentioned Mmio classes in order to avoid page faults or memory corruption when
accessing the registers and register arrays declared inside.

Note, that the range end of a register array is not the end of the last item
but the end of integer access that is used for accessing the last bit in the
last item.

The constructors of Genode::Mmio, Genode::Attached_mmio, and
Platform::Device::Mmio now receive an argument 'Byte_range_ptr range' that is
expected to be the range of the backing memory region. In each type that derives
from on of these classes, it is now dynamically checked that 'range.num_bytes
>= SIZE', thereby implementing the above mention protection against page faults
and memory corruption.

The rest of the commit adapts the code throughout the Genode Labs repositories
regarding the changes. Note that for that code inside Core, the commits mostly
uses a simplified approach by constructing MMIO objects with range
[base..base+SIZE) and not with a mapping- or specification-related range size.
This should be fixed in the future.

Furthermore, there are types that derive from an MMIO class but don't declare
any registers or register arrays (especially with Platform::Device::Mmio). In
this case SIZE is set to 0. This way, the parameters must be actively corrected
by someone who later wants to add registers or register arrays, plus the places
can be easily found by grep'ing for Mmio<0>.

Fix #4081
2024-02-26 08:59:07 +01:00
Martin Stein
ee6f5f3b1b base: remove deprecated driver files
As far as I can tell, these file are not used anymore.

Ref #4081
2024-02-26 08:31:06 +01:00
Sebastian Sumpf
7ea020d471 usb_hid: add 'usb_clear_halt'
This function is called by 'hid_reset' when the HID_CLEAR_HALT bit set,
as it happens to be on the Rasbarry Pi 1.

issue #4958
2024-02-26 08:31:06 +01:00
Sebastian Sumpf
d191c376f7 dde_linux: add libnl for arm_v6
This was covered before by SPEC 'arm'.
2024-02-26 08:31:06 +01:00
Christian Prochaska
7bfc8f2fde tool: add backtrace
Fixes #5103
2024-02-26 08:31:05 +01:00
Pirmin Duss
55007f5bd9 i2c: bus speed configuration node
I2C EEPROMs of the type at24xxx are really slow (ca. 10 kHZ).

This adds the `bus_speed_khz` attribute to the config of the driver and
adapts the i.MX8 driver to support the feature.

Issue gapfruit#1996
Fixes genodelabs#5090
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
40c8e76f49 dde_linux: adjust test/driver_time to virt_linux
Adjust test to current virt_linux configuration.

issue #5095
2024-02-26 08:31:05 +01:00
Benjamin Lamowski
8540b4c9d1 hw: rename Vm_data to Vcpu_data
Rename Vm_data to Vcpu_data to make it clear that the allocated data is
per vCPU, not per VM.

Issue #5100
2024-02-26 08:31:05 +01:00
Benjamin Lamowski
69b76ba9ed hw: move physical VMCB address out of the VMCB
The physical address of the memory used for the guest VMCB is already
present in Vcpu_data. Use the information there instead of storing the
physical address in the host data area, thereby freeing up 8 bytes for
a bigger Mmio class.

Issue #4081
2024-02-26 08:31:05 +01:00
Benjamin Lamowski
cec7847502 vbox6: add support for Windows BSOD logging
Hitting a BOSD in a Windows guest in Virtualbox 6 leads to calling
 `DBGFR3ReportBugCheck`, which leads to the following error since it is
 unimplemented in our port:

```
 Error: DBGFR3ReportBugCheck: DBGFR3ReportBugCheck called, not implemented, eip=0x1a5c4e4
```

Including the actual method from Virtualbox 6 enables logging
diagnostics for the Windows Blue Screen of Death (BSOD).
To see Blue Screen logging output, enable "dbgf" and "gim" logging
via the `VBOX_LOG` following environment variable in the vbox6 runtime
config.
When manually triggering a BSOD in the Windows guest, this should
produce the following logging diagnostics:

```
GIM: HyperV: Guest indicates a fatal condition! P0=0xe2 P1=0x0 P2=0x0 P3=0x0 P4=0x0
GIMHv: BugCheck e2 {0, 0, 0, 0}
MANUALLY_INITIATED_CRASH
```

Fixes #5099
2024-02-26 08:31:05 +01:00
Norman Feske
de6048f517 libc: consistency of tv_sec when tv_nsec wraps
The libc's internal calculation of the tv_sec and tv_nsec fields must be
based on the same ms value. Otherwise, tv_sec is not always immediately
incremented whenever tv_nsec wraps. For applications, this inconsistency
can result in observed jumps in time.

Fixes #5098
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
684de7a57b lib/wifi: remove static constructors
Remove static constructors from 'socket_call.cc'

issue #5096
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
491ab232bf wifi: remove 'Component::construct'
Init calls are not static constructors anymore, so 'Lx_kit::Env' is not
required to be initialzed before static constructors are called.

issue #5096
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
1b4f7ae0d3 lx_emul: generate initcalls during build
Functions registered with 'module_init' (i.e., '__define_initcalls'),
'OF_DECLARE', and 'DECLARE_PCI_FIXUP_CLASS_FINAL' used to be static
constructors and had be explicitly registered using
'exec_static_constructors' before executing any Linux code.

With this commit we remove the constructor attributes from these
functions and create a global function pointer in the form of

__initptr_<name>_<id>_<counter>_<line number of macro>

'import-lx_emul_common.inc' will collect these '__initptr' symbols after
the compile step and generate a 'lx_emul_register_initcalls' function
that executes the functions pointed to. This step is now automatically
performed in 'lx_emul_start_kernel'. This way a call to
'exec_static_constructors' can be omitted in case there are no other
constructors in place.

issue #5096
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
f9bff3bc7c dde_linux: remove library mk for usb_host_include
This library does not exist anymore.

issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
dea712ab72 usb_hid: add support for arm_v6
Also split into spec 'arm_v(6|7|8)'

issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
8851b64825 usb_net: add SMSC95xx driver for arm_v6
issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
b73765cf9b usb_net: add support for arm_v6
Also split into spec 'arm_v(6|7|8)'

issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
01369546d2 dde_linux: adjust wireguard and test to arm_v8
spec 'arm_64' has been moved to 'arm_v8'

issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
a67bc59686 virt_linux: add arm_v6
also split into arm_v(6|7|8)

issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
bb06e8451a dde_linux: split lib/mk into arm_v6/7/8
Split 'arm' and 'arm_64' into 'arm_v(6|7|8)'

issue #5095
2024-02-26 08:31:05 +01:00
Christian Prochaska
6aba9b1b9a tool/run/depot.inc: allow depot user in used_apis
Issue #5092
2024-02-26 08:31:05 +01:00
Christian Helmuth
94ebdc9269 qt5: add missing header to qpa_init.h
Thanks to Andreas for the hint.
2024-02-26 08:31:05 +01:00
Norman Feske
0d34988929 test.run: remove obsolete boot-module heuristic
The ROMs of built executables and shared objects are now covered by the
[build_artifacts].

Issue #4860
2024-02-26 08:31:04 +01:00
Alexander Boettcher
443008777b vbox_share: provide .vbox file
The vbox file is missing to run the test scenario

Related to issue #4860
2024-02-26 08:31:04 +01:00
Christian Helmuth
6855b27553 openssl: update to version 1.1.1w 2024-02-26 08:31:04 +01:00
Christian Helmuth
e440ab40ef virt/lx_emul: check for NULL urb in usb_submit_urb()
The Linux implementation also includes this check. NULL urb submission
happened with Wacom touch devices.
2024-02-26 08:31:04 +01:00
Christian Helmuth
2584c104e0 usb_hid: use lib/kfifo.c
Required by Wacom touch drivers.
2024-02-26 08:31:04 +01:00
Christian Helmuth
092e4a001f usb_hid: mode led handling to shadow input-leds.c
The former implementation relied on input drvdata always pointing to
struct hid_device, which is not true for Wacom touch devices (at least).
Now, we implement the input handler for devices providing LEDs
(evbit[EV_LED] set) only and use input_inject_event() to set the LED
states.
2024-02-26 08:31:04 +01:00
Norman Feske
d6d1b8e025 Road map for 2024 2024-02-26 08:31:04 +01:00
Pirmin Duss
4535a27dfc libc.run: add missing library libm
Issue genodelabs/genode#5094
2024-02-26 08:31:04 +01:00
Josef Söntgen
00d3f61961 libdrm/etnaviv: align implementation with lima
This commit brings the etnaviv back end implementation in line
with the one from lima. Since the etnaviv driver itself handles
different contexts implicitly rather explicitly like lima and
iris for the moment only a main-context is used for all operations.

Issue genodelabs/genode-imx#8.
2024-02-26 08:31:04 +01:00
Johannes Schlatow
43274fbf5f depot: add tcp_terminal recipe
required for goa_testbed

genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Johannes Schlatow
fb58e46672 lighttpd: omit O_NONBLOCK
Uploading large files via HTTP PUT failed when the file system was
accessed via a file system session because lighttpd opened the
destination file with O_NONBLOCK and the write operation stalled
at some point.

genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Josef Söntgen
840bb5f90d lighttpd: enable mod_webdav module
genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Josef Söntgen
8a94dd2cb1 lighttpd.run: add mod_webdav
- using <inline> for random is not gonna fly when getentropy is called
  multiple times (and eventually fails due to EOF)

genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Josef Söntgen
ac790cd6fb ports: update lighttpd to 1.4.73
genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Josef Söntgen
b19d8a50d5 lighttpd.run: fix libc rtc setting
genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Johannes Schlatow
83e3178e9b Add FindXxx.cmake files to api archives
The FindXxx.cmake files are used by Goa's cmake support.

genodelabs/genode#5087
2024-02-26 08:31:04 +01:00
Christian Prochaska
f3cf4a7d7b qt5: adapt QtWebEngine for host GCC 13
Fixes #5091
2024-02-26 08:31:03 +01:00
Norman Feske
96ea73c3fe sculpt: preset for goa_testbed
Issue #5092
2024-02-26 08:31:03 +01:00
Norman Feske
7c76ec897c sculpt: add "http" and "telnet" nic_router domains
These domains allow for the hosting of plain http and telnet servers
reachable from the outside. The change is designated for the goa
testbed.

Issue #5092
2024-02-26 08:31:03 +01:00
Alexander Boettcher
c2cd4102d8 gpu/intel: prepare GPU structures for resume
The commit is a preparation commit for suspend/resume. It prepares the GPU
structures relying on gmadr.cap() (MMIO) to be re-constructible by applying
the with* pattern to context, ring_buffer and ggtt mmio map. It removes
the managed dataspace handling of gmadr subsets to make the with_* pattern
possible.

Issue #5081
2024-02-26 08:31:03 +01:00
Alexander Boettcher
d02f4866ea gpu/intel: make platform resources reconstructible
This commit is a preparation commit for suspend/resume. The commit
refactors the code in order to consolidate all Platform resources into one
instance. All users within the GPU driver should access the resources with
with_* functions, which checks whether the device resource is usable. The
callers are not allowed to store any references to the provided resources.

With this change, it will be possible in follow up commits, to release
the platform device and to re-acquire it and its resources, e.g. mmio, irq,
gmadr.

Issue #5081
2024-02-26 08:31:03 +01:00
Alexander Boettcher
c5a1e3daa3 acpi_suspend: extend test scenario
- add PS/2 input drivers
- add GPU client test case - glmark2
- remove display driver before suspend
- route log output via terminal on display to gather information, since in
  most cases serial/AMT is not available after ACPI resume

Issue #5081
2024-02-26 08:31:03 +01:00
Christian Prochaska
3062b7d780 lx_emul: add kvfree_call_rcu
Fixes #5089
2024-02-26 08:31:03 +01:00
Alexander Boettcher
27c9825bf0 intel/display: support larger resolutions
- fix detection to re-allocate framebuffer
- free up resources on framebuffer switching

Thanks Peter for reporting and fixing.
2024-02-26 08:31:03 +01:00
Benjamin Lamowski
25c7204b2a hw: clear RAM dataspaces in chunks
Clearing very large RAM dataspaces could fill up core's page table,
because the dataspaces are locally mapped to clear them.
This would manifest in a loop where exhausting the local page table
leads to its flushing (which does not work for core) and a retry that
again fills up the page table and so on.

To prevent this, flush RAM dataspaces in chunks of at most 128MiB.

Fixes #5086
2024-02-26 08:31:03 +01:00
Norman Feske
41731a2439 Make Session_object::warning const
This allows the use of the label-prefixed log utilities from a const
method of a derived class.
2024-02-26 08:31:03 +01:00
Benjamin Lamowski
8b5aa538e7 virtualbox6: fix runscript broken by refactoring
Add the `test.iso` and `virtualbox6.vbox` to `boot_modules`
that were omitted during the refactoring in #4860.

Fixes #5085
2024-02-26 08:31:03 +01:00
Stefan Kalkowski
fc15a164ce tool/dde_linux/create_dummies: preserve env
Instead of resetting the whole environment only remove the TARGET
variable to make GNU Make 4.4 happy.

Fix genodelabs/genode#5084
2024-02-26 08:31:03 +01:00
Christian Helmuth
c2e1013ad4 acpica: improve faked RSDP
More sane table values fix broken output on verbose.

Issue #5083
2024-02-26 08:31:03 +01:00
Christian Helmuth
980793970d acpica: detach MMIO region before re-attaching
This is a follow-up commit for the changes in #5069.

Fixes #5083
2024-02-26 08:31:03 +01:00
Christian Helmuth
30e37d90dd acpica: provide verbose config
If "verbose" is set to true in the config, AcpiOsPrintf etc. are enabled
to log to a dedicated LOG session using the Format:Console utility.

Issue #5083
2024-02-26 08:31:03 +01:00
Christian Helmuth
a6b30d58df lib/format: parse precision and lalign
Prevent errors if precision and left alignment are part of the string.
String precision is applied to limit access to the configured number of
characters but ignored for other types.

Issue #5083
2024-02-26 08:31:03 +01:00
Christian Helmuth
a5b8090e14 acpica: remove static constructor from lib
Issue #5083
2024-02-26 08:31:03 +01:00
Norman Feske
87993a864c input/event.h: axis ids LX, LY, LT, RX, RY, and RT
The axis IDs correspond to 2x analog sticks with 2 axes and 2x triggers.
While being at it, the commit changes the Axis_id type to Axis::Id.

Fixes #3669
2024-02-26 08:31:03 +01:00
Josef Söntgen
d9e4d32374 libdrm/lima: propagate allocation failure
Failed allocations were still denoted with a successful return value
to the caller. This situation was triggered by artificial testing and
has not been observed yet in practice. In case the 'LIMA_GEM_CREATE'
I/O control fails Mesa will dereference invalid pointers anyway.

Issue genodelabs/genode-allwinner#27.
2024-02-26 08:31:03 +01:00
Christian Prochaska
602f9b5670 monitor: remove 'flush_thread()' error message
Fixes #5082
2024-02-26 08:31:03 +01:00
Alexander Boettcher
c167e86d87 display/intel: translate ENOSPC into text message 2024-02-26 08:31:02 +01:00
Christian Helmuth
4a2319a4d6 os: limit backtrace to stack of current thread
The frame-pointer-based backtrace does not work without enabling
-fno-omit-frame-pointer explicitly and in most cases leads to page
faults because non-pointer stack values are dereferenced during the
walk. The best we can do is to limit the backtrace walk to the stack of
the current thread to prevent page faults unrelated to the system state
without the use of the backtrace utility.

This commit introduces a printable Backtrace class usable in
Genode::log(), Genode::trace(), etc. The class is based on the new
function for_each_return_address(auto const &fn) that walks the stack in
its limits and calls fn() for each discovered return address on the
stack in the new os/include/os/backtrace.h. Archtecture-specific
stack-pointer retrieval and walk loops are implemented in dedicated
os/include/spec/<arch>/os/for_each_return_address.h files. Also, the
well-known Genode::backtrace() function (which logs the return-address
values) is provided for backwards compatibility.

Fixes #5078
2024-02-26 08:31:02 +01:00
Michael Mueller
79bdea2977 hoitaja: Upon starting a new child component, create a cell for it at the hypervisor. 2024-01-30 18:08:17 +01:00
Michael Mueller
90fd2368d0 base-nova: Changed mapping of cores so that for each cores x and y, it is guaranteed that if x is greater than y, the NUMA ID of x is always greater than or equal to that of y. 2024-01-30 18:04:29 +01:00
Michael Mueller
20be3b397f base: Changed API for cell management. 2024-01-30 18:00:14 +01:00
Michael Mueller
5ddeb09107 base-nova: Changed hypercall interface for cell management to reflect the change of API in the hypervisor. 2024-01-30 17:58:42 +01:00
Michael Mueller
e7d6363362 base-nova: Synchronize output to serial console with the hypervisor. 2024-01-30 17:56:51 +01:00
Michael Mueller
1fd735989f base-nova: Adapted PD session to the change of NOVA's API for cell management. 2024-01-30 17:55:25 +01:00
Michael Mueller
c455e9266e base: Added operatiors for comparing affinities. 2024-01-30 17:53:41 +01:00
Michael Mueller
a2a03fafd2 Hoitaja: Update core allocation range in kernel when affinity is changed due to growing or shrinking a cell. 2024-01-18 18:55:35 +01:00
Michael Mueller
d1e7654652 Hoitaja: A Hoitaja cell now creates a kernel object for the cell. This way the core affinity of a cell, that was calculated by Hoitaja, is communicated to the kernel's core allocator. 2024-01-18 18:54:37 +01:00
Michael Mueller
5cbac9f128 base: New RPCs to allow to associate a PD with a Cell and growing and shrinking a cell's core allocation. 2024-01-18 18:51:49 +01:00
Michael Mueller
fe4c8e1dfe NOVA: Added new hypercalls for Cell management. 2024-01-18 18:49:49 +01:00
Michael Mueller
3c133b459e NOVA: Added new hypercalls for cell management and CPU core allocation. 2023-12-15 14:35:04 +01:00
Michael Mueller
705f262eb9 Always use branch tukija for NOVA. 2023-12-15 14:27:57 +01:00
Christian Helmuth
d5188161f5 util/string.h: add Const_byte_range_ptr::contains()
Issue #5078
2023-12-15 14:11:56 +01:00
Sebastian Sumpf
36ea3cc5a4 netperf: decrease RAM quota from 32 to 14MB
issue #2181
2023-12-13 20:01:47 +01:00
Sebastian Sumpf
68ac1347b9 lxip: configure thash/uhash entries to 2048
The number of hash entries for TCP/UDP corresponds to the number of
sockets managed by the stack. In case there are more sockets than
entries available, buckets will be created to compensate for the lack of
space. The default values for TCP (524288) and UDP (65536) are meant for
the in kernel that manages all sockets of the user land and leads
to very large hash table allocations (>20MB) during initialization.

Since on Genode a component has its own instance of the IP stack or uses
the VFS server, we do not need these kind of large default settings.

issue #2181
2023-12-13 19:54:50 +01:00
Norman Feske
c4679e7af6 depot: update recipe hashes 2023-12-13 12:33:05 +01:00
Josef Söntgen
89270f69e0 sculpt_image: copy uboot.env file for PinePhone
Issue genodelabs/genode-allwinner#26.
2023-12-13 12:33:05 +01:00
Martin Stein
32d1e5b4a7 gems: remove unused import-sha256_4k.mk
Ref #5062
2023-12-13 12:33:05 +01:00
Norman Feske
77b0e10e88 vfs/ram_file_system: deferred unlink
This patch changes the unlink operation of the ram fs to defer the
destruction of a file until it is no longer referenced by any VFS handle.
When unlinked, the file no longer appears in the directory. But it can
still be opened and accessed.

With this change, a parent process of a Unix-like subsystem becomes able
to pass the content of an unlinked file to a forked child process. This
mechanism is required when using the 'exec' command in Tcl scripts.

Another use case is the 'tmpfile()' function.

Fixes #3577
2023-12-13 12:33:05 +01:00
Norman Feske
cb74956d06 os/run/test.run: build libs listed in <content> 2023-12-13 12:33:05 +01:00
Christian Helmuth
54c5b7d712 depot_autopilot: disable test-rm_nested on pistachio 2023-12-13 12:33:05 +01:00
Norman Feske
713659cea5 test-trace: adjust rate of top passing tracepoints
The traced top instance was configured to be active every two seconds
whereas the trace test uses a grace time of only 1.5 seconds before
raising the FOREIGN state of a trace subject as an error.

The state of a trace subject can change only whenever the traced thread
passes a trace point. Hence, with the original configuration, the
release of top as trace subject can take up to two seconds. The patch
reduces the rate to 0.5 seconds to satisfy the expectation of
test-trace.
2023-12-13 12:33:05 +01:00
Norman Feske
3aa2119290 core: use 'release' in Trace::Subject destructor
This avoids having two different code paths for destruction and release.
2023-12-13 12:33:05 +01:00
Johannes Schlatow
63dd5efa72 libc: fix post-2100 infinite-loop on 32-bit
The call of `mktime`/`timegm` with a broken down time after year 2100
led to an infinite-loop on 32bit.

genodelabs/genode#3707
2023-12-13 12:33:05 +01:00
Alice Domage
74abf8132e tool/port: add .sparse-git install rule
Following Github support removal for svn [1], dde_rump port fails to
prepare. This commit introduces a new install rule for ports,
'.sparse-git'. It performs a sparse-checkout on the port repository, only
fetching required files.

[1] https://github.blog/2023-01-20-sunsetting-subversion-support/

Co-authored-by: Benjamin Lamowski <benjamin.lamowski@genode-labs.com>

Issue genodelabs#5072
Issue genodelabs/goa#28
2023-12-13 12:33:05 +01:00
Christian Helmuth
636f5dda29 nic_router: specify ICMP Destination (host) unreachable
According to RFC 1812 ICMP Destination unreachable (Network unreachable)
does not quite our case of clients directly behind the router.

  If a packet is to be forwarded to a host on a network that is directly
  connected to the router (i.e., the router is the last-hop router) and
  the router has ascertained that there is no path to the destination
  host then the router MUST generate a Destination Unreachable, Code 1
  (Host Unreachable) ICMP message.

Issue #4729
2023-12-13 12:33:05 +01:00
Christian Helmuth
ad92d799cd netperf_lxip_wifi: run on foc_x86_32 too 2023-12-13 12:33:05 +01:00
Christian Helmuth
8f9056d738 netperf_lwip_wifi: run on foc_x86_32 too 2023-12-13 12:33:05 +01:00
Johannes Schlatow
c1bc9f8557 libc: use timegm instead of mktime
By using `mktime()`, which assumes local time, we render the `TZ`
environment variable ineffective. Instead, `timegm()` should be used to
set the real-time clock to UTC.

genodelabs/genode#5074
2023-12-13 12:33:05 +01:00
Christian Helmuth
b80fd10a70 wireguard: don't shadow lx_emul memory backend
Issue #4809
2023-12-13 12:33:05 +01:00
Christian Helmuth
1e7116fcc1 lx_emul: manage page structs per buffer range
The management of Linux page structs is now tied to the life time of DMA
buffers. Thus, page structs are created when a buffer is allocated and
deallocated only when a buffer is freed - not on lx_emul_mem_free()
because DMA buffers are cached. Page struct refcounting was entirely
reworked in lx_emul/shadow/mm/page_alloc.c.

Fixes #4809
2023-12-13 12:33:05 +01:00
Christian Helmuth
73bf682b62 lx_emul: add lx_emul_heap_alloc/free
Allocator for not-DMA-capable meta data buffers.

Issue #4809
2023-12-13 12:32:52 +01:00
Christian Helmuth
dec1869e2c pc_wifi.run: improve debugability 2023-12-13 12:32:19 +01:00
Alexander Boettcher
ce66e12699 vbox: improve network tx throughput
When multiple threads (EMT-0..X + nic_ep) enter the very same
critical section, the use of RTCritSectTryEnter may reflect the contention
case to the Network Model (E1000). Since no one notifies the model, when the
critical section is free again, solely the next packet/event triggered by the
guest will resume the former operation. This may lead to long delays until
packets are sent actually.

Instead of using the RTCritSectTryEnter use RTCritSecEnter to avoid the
situation. All of our network code is non blocking, so the network backend
will only be contented a short time.

Follow up commit to

Issue #5045
2023-12-13 12:32:19 +01:00
Stefan Kalkowski
342e48115e lx_emul: replace USB devio API usage
The devio API in the Linux kernel promised to be a stable layer for our
USB host controller drivers, but the additional bookkeeping and dynamic
allocations increase CPU overhead in a way that we do not accept further.
Therefore, we go a step back and process DMA transactions directly in and
out of the packet stream from the clients.

Fix genodelabs/genode#5071
2023-12-13 12:32:19 +01:00
Christian Helmuth
58dba227ce base: number of CPU components per slab block
On some platforms, only two CPU-thread component objects fit into on
page-sized slab block.

Issue #3834
2023-12-13 12:32:19 +01:00
Christian Helmuth
0046edf761 base: statically check for reasonable Tslab block size
Per default Tslab checks that 8 slabs incl. overhead fit into one block.
If this is not desired the template parameter 'MIN_SLABS_PER_BLOCK' can
be used to control the minimum number of blocks.

Fixes #3834
2023-12-13 12:32:19 +01:00
Christian Prochaska
ff5a474e74 ports: remove old GDB monitor
Fixes #5067
2023-12-13 12:32:19 +01:00
Christian Prochaska
9a049789de core: mark implicitly detached regions as reserved
Fixes #5069
2023-12-13 12:32:19 +01:00
Norman Feske
f57da7e645 trace: remove parent_levels session argument
The argument was originally designated to restrict the reach of the
trace monitor but the idea remained unimplemented. It is now superseded
by the use of the trace-session label as trace-subject filter.

Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
12b89852e0 sculpt: add "runtime" and "global" TRACE options
Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
f66ce025d3 Adapt run scripts to trace-subject filtering
Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
bfe88307de core: filter trace subjects by TRACE session label
This patch changes core's TRACE service to expose trace subjects only if
their PD label matches the label of the TRACE monitor. Hence, by default,
a trace monitor can only observe itself and its child components. Only
if the trace monitor's parent rewrites the trace-session's label, the
view of trace monitor can become broader. For example, when rewriting
the trace label to an empty string "", the trace monitor becomes able to
observe the sibling components hosted in the same init instance as the
trace monitor.

To grant a trace session the special privilege of obtaining a global
system view (including the kernel's trace subjects), the top-level init
has to rewrite the session's label to an empty string. At core, this
specific label "init -> " is handled as a special case that discharges
the filtering/namespacing of trace subjects.

Note that the trace-subject label as reported as subject info is now
given relative to the label of the trace session. As a nice side effect
of this change, the pkg/test-trace_logger works now when executed by the
depot_autopilot as well as via the test.run script.

Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
610ba6e3b6 touch_keyboard: add dialog API to src recipe
This is a follow-up commit to issue #5059. Without it, the binary
archive for the touch_keyboard remains empty.
2023-12-13 12:28:05 +01:00
Norman Feske
66160e6bd3 os/run/test.run: adapt to changed runtime format
Issue #4922
2023-12-13 12:28:05 +01:00
Norman Feske
e2d1888f52 trace_logger: priority config attr in config.xsd 2023-12-13 12:28:05 +01:00
Christian Prochaska
2aeea45c30 os: build 'lib/ld' in 'monitor_gdb.inc'
Fixes #5068
2023-12-13 12:28:05 +01:00
Norman Feske
82a9582dd7 qemu-usb: minor documentation fixes 2023-12-01 11:17:22 +01:00
Norman Feske
4e4b95bfe3 core: remove support for "unlabeled" LOG sessions
Fixes #5054
2023-12-01 11:01:29 +01:00
Josef Söntgen
9d989b1557 fetchurl: add 'ignore_failures' option
This option is useful in cases where batching is configured and
failing to fetch a resource should not influence the over-all
result.

Issue genodelabs/genodians.org#32.
2023-12-01 10:43:45 +01:00
Norman Feske
4685ba394e mk: .lib.so and .abi.so depend on linker scripts
Fixes #3978
2023-12-01 09:49:31 +01:00
Norman Feske
5734ea736c mk: remove unused LIB_SO_DEPS variable
Spotted during our work on issue #5061.
2023-12-01 09:45:47 +01:00
Christian Helmuth
5fdea3a595 version: 23.11 2023-11-30 15:15:51 +01:00
Norman Feske
efccd9c961 News item for version 23.11 2023-11-30 15:11:36 +01:00
Norman Feske
87c5fa1279 Release notes for version 23.11 2023-11-30 15:11:36 +01:00
Christian Helmuth
8baf19022c depot: update recipe hashes 2023-11-30 15:11:36 +01:00
Johannes Schlatow
518a57d8e5 base-nova: allow access to Intel IOMMU
This allows the platform driver to take over control of DMA remapping
and keeps NOVA-driven interrupt remapping active.

genodelabs/genode#5002
2023-11-30 14:22:54 +01:00
Johannes Schlatow
039ade7ad0 pc/platform: allow booting with enabled IOMMU
genodelabs/genode#5002
2023-11-30 14:22:54 +01:00
Johannes Schlatow
1f1437747c platform_drv: don't copy Bdf
genodelabs/genode#5002
2023-11-30 14:22:54 +01:00
Johannes Schlatow
3f1e1323f0 pc/platform: enable IOMMU with default mappings
genodelabs/genode#5002
2023-11-30 14:22:54 +01:00
Johannes Schlatow
bc09ff7498 platform_drv: add default DMA mappings interface
genodelabs/genode#5002
2023-11-30 14:21:51 +01:00
Johannes Schlatow
4163367b53 pc/platform: detect invalid IOMMU devices
genodelabs/genode#5002
genodelabs/genode#2700
2023-11-30 14:20:53 +01:00
Johannes Schlatow
c06b53e52e acpi_drv: add config for ignoring DMAR table
By not evaluating the DMAR table, we disable the IOMMU.

genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
196133c582 platform_drv: use guard pages for DMA buffers
genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
d018cb62f3 platform_drv: guard against Out_of_* exceptions
In the scope of alloc_dma_buffer(), Out_of_* exceptions might be thrown
at different stages. By adding a Guard object, we make sure to rollback
already created objects accordingly.

genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
350a3d9ae4 platform_session: increase RAM and CAP quota
As a consequence of the adding IOMMU support to the platform driver,
additional RAM and CAPs are needed for setting up IO page-table
structures.

genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
3a62676da8 sculpt: increase RAM quota for platform driver
The platform driver needs additional 2MB of RAM for managing IO page
tables (root table and context tables) that are shared among sessions.

genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
44617b8c9d sculpt: route iommu report from platform driver
genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
855147a021 pc/platform: add intel IOMMU support
Add DMA remapping support for Intel devices to the platform driver.

genodelabs/genode#5002
2023-11-30 14:20:49 +01:00
Johannes Schlatow
70b1ae3d1b platform: move enable/disable_pci_device
genodelabs/genode#5002
2023-11-30 14:19:45 +01:00
Johannes Schlatow
f55d06fd5c base-nova: allow MSI for non-PCI devices
DMA remapping hardware units use MSI for fault events. However, MSI
were bound to the presence of a PCI configuration space.

genodelabs/genode#5002
2023-11-28 19:35:16 +01:00
Johannes Schlatow
eefaa07024 base: add irq_type session argument
By adding the `irq_type` argument, one can explicitly specify whether to
use LEGACY, MSI or MSI-X interrupts. We formerly used the
`device_phys_config` to implicitly select MSI, however, with the
addition of IOMMU support to the platform driver there is at least one
instance where we need an MSI for a non-PCI device.

Yet, by adding another session argument to the Irq session, we exceed
the character limit for session args. Since not all arguments are
relevant for LEGACY interrupts resp. MSI, we can split the Irq_connection
constructor to handle the two cases separately and omit unneeded
arguments.

genodelabs/genode#5002
2023-11-28 19:35:16 +01:00
Johannes Schlatow
a80464299a platform_drv: add phys_addr to add_range()
We need the physical address of a DMA range in order to insert it into
the translation table.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
0182e81b51 platform_drv: map actual DMA dataspace size
DMA buffer allocations are always performed as full pages. However, they
got mapped into the IOMMU domain using the requested size, which may not
be a multiple of the page size. This behaviour was introduced as a regression
by #4761 and is corrected by this commit.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
ae7e461452 platform_drv: move IOMMU domain destruction
Destruction of IOMMU domain should happen after the PCI device was
disabled in order to prevent faulty DMA transactions.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
d7b9cd0654 platform_drv: move add_range calls from base class
The virtual add_range()-method must not be called from the base-class
constructor since the derived class is not be fully initialized at
this point.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
022762605b pci_decode: add <irq/> to drhd devices
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
7c5b59556a pci_decode: add <iommu> node to devices
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
e816020346 pci_decode: add intel_iommu devices to devices ROM
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
7b99a43c9e acpi_drv: add size attribute to drhd
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Christian Helmuth
a90e0e249e pc_nic_drv: implement gpiod_get_optional() as dummy 2023-11-28 14:46:28 +01:00
Martin Stein
3b7124bb37 wireguard: README and config.xsd
Ref #4957
2023-11-28 14:46:28 +01:00
Martin Stein
49dd55313a sculpt_manager: select correct launcher in + menu
The sculpt manager views only launchers in the + menu that are not present in
the runtime already. However, this check was missing when finding the right
launcher on a click event inside that menu. This could cause the manager to
try deploying an already deployed launcher a again (without any effect)
instead of deploying the launcher that was actually clicked.

Ref #5064
2023-11-28 14:46:28 +01:00
Christian Prochaska
801c4aa72f depot: add support for debug info files
Fixes #5015
2023-11-28 14:45:29 +01:00
Norman Feske
ee8c76b42e dde_linux: use [build_artifacts] in run scripts
Issue #4860
2023-11-28 14:45:29 +01:00
Norman Feske
67741655d1 dde_rump: use [build_artifacts] in run scripts
Issue #4860
2023-11-28 14:44:29 +01:00
Norman Feske
1e166c7236 Supplement the build of shared libs where needed
This is a follow-up commit to the adaptation of the run scripts to the
consistent use of [build_artifacts] (issue #4860).

The missing build of libm remained undetected until the recent removal
of implicit shared-library builds (issue #5061).
2023-11-28 14:44:29 +01:00
Alexander Boettcher
ff740e300a wm: free window id on destroy_view
Issue #5048
2023-11-28 14:44:29 +01:00
Norman Feske
cb10fe1d77 decorator: add missing initial call _handle_mode
This call is needed whenever the mode has settled before the decorator
has started up.
2023-11-28 14:44:29 +01:00
Norman Feske
5ae0dab6c5 mk: remove implicit build of shared libraries
This patch removes the implicit build of all shared libraries a target
depends on. Targets only depend on the respective ABIs instead. This
alleviates the need to locally build complex shared libraries (think of
Qt) when developing applications. Instead, application developers can
use binary depot archives.

The implementation splits the mk/lib.mk file into three files:
- mk/a.mk   for building one static library (.lib.a)
- mk/so.mk  for building one shared object  (.lib.so)
- mk/abi.mk for building one ABI stub       (.abi.so)

Furthermore, the commit moves messages and the collection of build
artifacts to var/libdeps, triggers the build of kernel-specific
ld-<kernel>.lib.so, and prunes the lib-dependency tree at ABIs.

Fixes #5061
2023-11-28 14:44:29 +01:00
Alexander Boettcher
c02aa759e6 vbox: avoid stuck network during high tx load
- finished tx ack queue should be checked before new allocations
- packets which got not sent must be released in packet stream,
  otherwise the network packet stream gets filled up and starves after a while
- rRegister for ack avail packets and process them concurrently to EMT-* threads
  by nic_ep thread (thanks @Peter for the findings) + add synchronization.
- add sigh_ready_to_submit to network adapter to improve latency by notifying
  the network model explicitly in case we had a full packet stream error case
  (_retry resp. VERR_TRY_LATER)

Fixes #5045
2023-11-28 14:44:29 +01:00
Norman Feske
5410ecf9ad run: check consistency of build_boot_image args 2023-11-28 14:44:29 +01:00
Norman Feske
2d48e209f4 fb_sdl: fix build on 64-bit ARM Linux 2023-11-28 14:44:29 +01:00
Norman Feske
5a75a2f930 gems: use [build_artifacts] in run scripts
Issue #4860
2023-11-28 14:44:29 +01:00
Norman Feske
b843dbf045 pc: use [build_artifacts] in run scripts 2023-11-28 14:44:29 +01:00
Norman Feske
5af3ffd6a8 hello_tutorial: use [build_artifacts] in hello.run
Issue #4860
2023-11-28 14:44:29 +01:00
Norman Feske
727d307089 ports: use [build_artifacts] in run scripts
Issue #4860
2023-11-28 14:44:29 +01:00
Norman Feske
ab0058a454 ports: remove debug_nitpicker.run 2023-11-28 14:44:29 +01:00
Norman Feske
b27bd256dd libports: use [build_artifacts] in qt5 run scripts
Issue #4860
2023-11-28 14:44:29 +01:00
Norman Feske
db72301eb0 nic_router.run: use [build_artifacts]
Issue #4860
2023-11-28 14:44:28 +01:00
Johannes Schlatow
aa7058a3b4 test-read_only_rom: fix false positive
The test is rendered ineffective by a failed resource request.
2023-11-28 14:44:28 +01:00
Norman Feske
769a6ce987 touch_keyboard: use dialog API
Fixes #5059
2023-11-28 14:44:28 +01:00
Norman Feske
9144d47fe2 sculpt/nitpicker/default: focus of touch_keyboard
Without setting the focus to "transient", the touch keyboard is
not able to respond to mouse clicks.
2023-11-28 14:44:28 +01:00
Norman Feske
4a5632ab6d dialog: support view attribs in sandboxed_runtime
This patch mirrors the interface of Sculpt's distant_runtime to the
sandboxed_runtime variant, allowing the configuration of xpos, ypos,
min_width, min_height, opaque, and background color.

Issue #5008
2023-11-28 14:44:28 +01:00
Christian Prochaska
789ae1ea8d hw: distinguish 'Alloc_error' conditions in 'Cap_space'
Issue #5057
2023-11-28 14:44:28 +01:00
Norman Feske
0f54ad8e26 dialog: add text-area widget
This patch moves the text-editing facility of app/text_area to a
text-area widget as part of the dialog library. This has two benefits.
First, it simplifies app/text_area by using the dialog API. Second, the
editor can now easily be reused by other dialog-API-based applications.

Fixes #5058
2023-11-28 14:44:28 +01:00
Norman Feske
e326371762 gems: make gems/dynamic_array.h publicly available
The 'Dynamic_array' utility is used by the text_area as internal
representation of text. As a prerequisite step of making the text
editing features generally available as a text-area widget, the
utility must become public.

Issue #5008
2023-11-28 14:24:26 +01:00
Norman Feske
40c0db2e8d dialog: add Sandboxed_runtime::View::if_hovered
Issue #5008
2023-11-28 14:24:26 +01:00
Norman Feske
9fae8a7532 dialog: support Sandboxed_runtime::Event_handler
This allows applications to get hold of the raw input events,
in particular keyboard input.

Issue #5008
2023-11-28 14:24:26 +01:00
Johannes Schlatow
767ea7f5b1 tool: add sd_card_zynq to autopilot.list
genodelabs/genode#5056
2023-11-28 14:24:26 +01:00
Johannes Schlatow
00ede822c6 disable demo and fb_bench for zynq_usrp_e31x
genodelabs/genode#5056
2023-11-28 14:24:26 +01:00
Johannes Schlatow
cd34effd64 run/cpu_bench.run: add timeout for zynq_usrp_e31x
genodelabs/genode#5056
2023-11-28 14:24:26 +01:00
Christian Prochaska
e9f3101105 base: restore the session phase in `Parent_service'
Issue #5055
2023-11-28 14:24:26 +01:00
Christian Helmuth
2bacd2bf62 run/netperf.inc: unique value for zynq_usrp_e31x
Also renumbered other platforms for sparse use of port space.
2023-11-28 14:24:26 +01:00
Norman Feske
0a71c8f3e1 sculpt_manager: use dialog API
Issue #5053
2023-11-28 14:24:26 +01:00
Norman Feske
1490c58f8b dialog: Hosted::if_hovered method
This method allows for the inquiry of the current hovering state,
e.g., to suppress an update of the Wifi accesspoint list while
the list is hovered.

Issue #5008
Issue #5053
2023-11-28 14:24:26 +01:00
Norman Feske
fa6c7204cd dialog: allow custom 'Select_button' attributes
This is useful to conditionally set the style to "unimportant", or to
use text other than the widget Id::Value.

Issue #5008
Issue #5053
2023-11-28 14:24:26 +01:00
Norman Feske
133cbd272e dialog: make 'click()' const wherever possible
This eases the use of, e.g., 'Select_button' as temporary variable.

Issue #5008
Issue #5053
2023-11-28 14:24:26 +01:00
Norman Feske
ec60011852 dialog: let 'Scope::widget' take 'hosted' as const
This eases the use of temporary 'Hosted' objects. The 'view' code path
is not expected to modify any state.

Issue #5008
Issue #5053
2023-11-28 14:24:26 +01:00
Norman Feske
1aba8182a4 dialog: pass value to Select_button::click
This eliminates the need to distinguish enum values in the body of the
handler, easing the forwarding of the selected value.

Issue #5008
Issue #5053
2023-11-28 14:24:26 +01:00
Stefan Kalkowski
e3881163c4 libc-net: eliminate annoying warning in sendmsg
Fix genodelabs/genode#5052
2023-11-28 14:24:26 +01:00
Stefan Kalkowski
040cf2eb2a tool/run/image/uefi: make silent sgdisk
Fix genodelabs/genode#5051
2023-11-28 14:24:26 +01:00
Christian Prochaska
5d9d3bff11 acpi_drv: detach dataspaces in 'Acpi::Memory'
Issue #5046
2023-11-28 14:24:26 +01:00
Christian Helmuth
536277ec55 lx_emul: prevent compiler warnings in usb.c 2023-11-28 14:24:25 +01:00
Christian Helmuth
7cefeac8ed lx_emul: make memory allocation more clear 2023-11-28 14:24:25 +01:00
Christian Helmuth
963b8b0607 lx_emul: comply boundary constraints of dma pool
Several DMA pools of the EHCI/UHCI USB host controller driver declare
that buffers should not cross 4K boundaries. If this property is not met
fatal errors like NMIs may happen during USB operation.

Discussed in issue #5000
2023-11-28 14:24:25 +01:00
Christian Helmuth
e337f2cb0f lx_emul: natural alignment of power-of-two kmalloc 2023-11-28 14:24:25 +01:00
Stefan Kalkowski
62492f3cd2 lx_emul: do not reset ep in usb flush transfers
Certain USB devices do not react anymore after an endpoint reset
in the use case of USB devices passed through to a virtual machine.
When investigating the only USB session client that needs the
flush transfers request - namely the Qemu xhci model used in
VirtualBox - there seems to be no need to reset the endpoint in fact.

Fix genodelabs/genode#5050
2023-11-28 14:24:25 +01:00
Christian Prochaska
4ecae91fc3 monitor: use a registry for the memory map
Issue #5046
2023-11-28 14:24:25 +01:00
Christian Prochaska
ad28da66b0 usb_hid_raw.run: filter out KVM switch messages
Fixes #5049
2023-11-28 14:24:25 +01:00
Sebastian Sumpf
3264a22c1e socket fs: simplify AF_UNSPEC
Remove separate context state for AF_UNSPEC.

issue #5031
2023-11-28 14:24:25 +01:00
Sebastian Sumpf
c7956aa41b socket_fs/vfs_lxip: errno 65 is EHOSTUNREACH
Return "no route to host" on errno 65 which is EHOSTUNREACH in legacy
dde_linux, return EHOSTUNREACH accordingly in libc's socket fs.

issue #5031
2023-11-28 14:24:25 +01:00
Christian Helmuth
7fb0c9ba30 pc: implement kobject_uevent_env() in shadow/
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
f663168ffd sculpt: version 23.11 2023-11-28 14:24:25 +01:00
Christian Prochaska
98f7227ed0 gdb: fix failed assertion triggered by pagination
Fixes #5047
2023-11-28 14:24:25 +01:00
Christian Prochaska
e309c38263 monitor: prevent overlapping region list entries
Issue #5046
2023-11-28 14:24:25 +01:00
Christian Helmuth
4962340985 pc_linux: enable pinctrl, evdev, i2c_hid
Issue #5036
2023-11-28 14:24:25 +01:00
Sebastian Sumpf
48865337b1 pc_linux: enable gpio, audio
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
c05d4e5b49 dde_linux: prevent scatter-gather in USB devio
USB devio splits large transaction into 16 KiB buffers in scatter-gather
lists. Unfortunately, this mechanism seems unreliable most certainly because
of issue #4809 "DDE Linux struct page object aliasing".

Issue #5036
2023-11-28 14:24:25 +01:00
Alexander Boettcher
65b619e7b4 dde_linux: implement kmem_cache_destroy
Note, this enables more information on wifi-driver error recovery.

Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
4d1e75ce3b dde_linux: enhance clock infrastructure
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
394a495b55 pc: unify string_helpers and get_option()
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
fec1765cc4 pc: run script for pc_nic_drv
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
a942efd92b pc: remove software_node_notify from common dummies
Issue #5036
2023-11-28 14:24:25 +01:00
Sebastian Sumpf
e56437ff0a pc: add "is_acpi_data_node" to lx_emul
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
0f8dd3a7a0 pc: remove __register_chrdev from common dummies
Issue #5036
2023-11-28 14:24:24 +01:00
Christian Prochaska
445ecba9b5 monitor_gdb.run: disable pagination earlier
Issue #5047
2023-11-28 14:24:24 +01:00
Christian Prochaska
f13463325a mk: fix clean rule dependencies in build.mk
Issue #5015
2023-11-28 14:24:24 +01:00
Benjamin Lamowski
a482bb8a89 libc: silence sysconf(_SC_GETPW_R_SIZE_MAX) warning
Currently, running ripgrep on Genode emits
"Warning: sysconf(71) not implemented".

Return -1 without setting errno, which is a valid return value according
to getpwnam(3) and silence the warning.

Fixes #5043
2023-11-28 14:24:24 +01:00
Christian Prochaska
6eaf333f10 ports: adapt GDB test to separate debug info files
Fixes #5044
2023-11-28 14:24:24 +01:00
Norman Feske
d7ee460704 list_model.h: rename 'apply_first' to 'with_first'
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
0f686a774d list_model.h: retire 'update_list_model_from_xml'
This transition vehicle to the modern interface has now been replaced by
the new 'List_model::update_from_xml' method.

Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
b9b2a7de34 Simplify 'List_model'
This patch replaces the original policy-based 'update_from_xml' by a new
method that takes three functors for creating, destroying, and updating
elements as arguments. XML nodes are associated with their corresponding
internal data models by annotating the element type with the
'type_matches' class function and the 'matches' method.

The patch also improves safety by enforcing that list-model elements can
never be copied.

Fixes #4317
2023-11-28 14:24:24 +01:00
Norman Feske
b7b74e62a0 platform driver: don't copy list-model elements
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
6e0d44397f depot_autopilot: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
58f7ed268d window_layouter: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
47ac55e9c5 decorator: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
c9938e424b menu_view: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
3e24a86b87 depot_download: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
b249d9f66d depot_deploy: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Christian Prochaska
b41df1fb7a mk: create separate debug info files
Commit also adapts Qt5 libraries.

Issue #5015
2023-11-28 14:24:24 +01:00
Norman Feske
d8b87b2593 wireguard: simplify 'Config_model'
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
784d4e39d5 wireguard: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
50d0a1b8f9 vmm: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
672b03f553 pci_decode: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
df71cecc66 drivers/platform: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Stefan Thöni
1895931918 pci_decode: parsing TPM2 table
issue gapfruit#1938

Fixes genodelabs/genode#5042
2023-11-28 14:24:24 +01:00
Roman Iten
0d344de496 base: extend constness of Genode::Token
Fixes #5039
2023-11-28 14:24:24 +01:00
Pirmin Duss
b53a630592 Re-connect test for wireguard
Issue genodelabs/genode#4957
2023-11-28 14:24:23 +01:00
Pirmin Duss
37a7119eb3 wireguard: initialize timekeeping with RTC
This commit fixes the "Invalid handshake initiation" error when the
client restarts.

Fixes genodelabs/genode#4957
2023-11-28 14:24:23 +01:00
Pirmin Duss
f66a7db87f lx_emul: allow setup of the persistent clock
This commit adds support to initialize the timekeeping for
the Linux subsystem with the value from the RTC.

Only the seconds part of timespec64 is supported.

Issue genodelabs/genode#4957
2023-11-28 14:24:23 +01:00
Christian Prochaska
9aa0de24af libc: implement '_spinlock()' and '_spinunlock()'
FreeBSD libc code uses only a single spinlock instance and, thus there
is no obvious reason why it would need to be implemented as an actual
spinlock. _spinlock() and _spinunlock() functions are implemented with a
static pthread mutex.

Issue #725
2023-11-28 14:24:23 +01:00
Christian Prochaska
94bbdbb71d libc: add ___pthread_cleanup_push/pop_imp aliases
Issue #725
2023-11-28 14:24:23 +01:00
Christian Prochaska
ebea6fb23f libc: use threaded mode
Issue #725
2023-11-28 14:24:23 +01:00
Tomasz Gajewski
002eb6f649 lib/timout: fix interpolation optimization
Issue #4960
2023-11-28 14:24:23 +01:00
Tomasz Gajewski
02753b3c2c tool/run: fixed tftp support in boot_dir/hw
Changes needed after merging `uboot` and `uboot_fit` modules into a
single module.

Additionally `image.elf` file is removed when either `image.itb` or
`uImage` is created, so it cannot be processed when `image/uboot` module
is loaded. Therefore `image.elf` processing is done conditionally now.

Fixes #5037
2023-11-28 14:24:23 +01:00
Alice Domage
6402182815 sntp_client: add DNS lookup option
This commit adds a new configuration option, `dst_addr` to the
'sntp_client' that accepts either an IP address or a DNS hostname. If a
DNS hostname is provided, the 'sntp_client' will resolve the IP address
before each SNTP request. The 'dst_ip' configuration option is
deprecated but kept for compatibility until 'dst_addr' is fully adopted.

xsd/net_types.xsd: add Net_address type
sntp_dummy_rtc: adjust configuration to use pool.ntp.org

Fixes genodelabs/genode#5003
2023-11-28 14:24:23 +01:00
Alice Domage
132e027c69 os/include/net: add support for the DNS protocol
Issue genodelabs/genode#5003
2023-11-28 14:24:23 +01:00
Alexander Boettcher
58a420511c nic_router: show offered IPs
If verbose_domain_state is enabled, the server logs detailed information
about the DHCP offer.
2023-11-28 14:24:23 +01:00
Johannes Schlatow
392ed76344 nvme_drv: arch-specific Dma_buffer allocation
Different cacheability properties should be applied dependent on the
target architecture.

genodelabs/genode#5000
2023-11-28 14:24:23 +01:00
Johannes Schlatow
25ad0ad530 nvme_drv: remove unused Dma_allocator
genodelabs/genode#5000
2023-11-28 14:24:23 +01:00
Johannes Schlatow
b7855cc517 base: remove overriden try_alloc default argument
`Expandind_pd_session_client::try_alloc` is an overriden virtual method
of `Ram_allocator::try_alloc`. The latter specifies the default Cache
argument as CACHED. The overriden method should either do the same or
not even specify a default argument at all.

genodelabs/genode#5000
2023-11-28 14:24:23 +01:00
Johannes Schlatow
c738f4b029 dde_linux: use CACHED dma buffers
On x86, DMA buffers are actually always mapped as cached. We should
therefore actually ask for a cached buffer in order to avoid confusion.

genodelabs/genode#5000
2023-11-28 14:24:23 +01:00
Johannes Schlatow
686b9d44f4 dde_bsd: use CACHED dma buffers
On x86, DMA buffers are actually always mapped as cached. We should
therefore actually ask for a cached buffer in order to avoid confusion.

genodelabs/genode#5000
2023-10-26 15:29:43 +02:00
Johannes Schlatow
0cf2b1be89 gpu/intel: use CACHED dma buffers
On x86, DMA buffers are actually always mapped as cached. We should
therefore actually ask for a cached buffer in order to avoid confusion.

genodelabs/genode#5000
2023-10-26 15:29:39 +02:00
Norman Feske
579a5e7845 News item for Sculpt 23.10 2023-10-26 12:17:56 +02:00
Christian Helmuth
b634549722 depot: update recipe hashes 2023-10-25 14:01:40 +02:00
Norman Feske
49aecc20b7 sculpt: update README for version 23.10 2023-10-25 12:58:30 +02:00
Martin Stein
c188f792b2 gems/sculpt: update mstein pubkey 2023-10-25 08:59:15 +02:00
Alexander Boettcher
70737c034b core: hand out RAM region as IOMEM to ACIPCA
The special region seems not to be declared as reserved nor ACPI
related. However, ACPICA depends on this physical range.

Issue #4643
2023-10-25 08:59:15 +02:00
Norman Feske
b50a88a95d depot_download_manager: optimize report processing
Feed the high-frequent fetchurl reports into a list model to speed up
the subsequent evaluation of the data.

Also limit the rate of state reporting during updates to visible changes
in percent such that most fetchurl reports do not cause any UI activity
(status updating) any longer.

This patch noticeably speeds up the installation of complex packages
(i.e., the morph browser) on the PinePhone.

Issue #5038
2023-10-25 08:58:54 +02:00
Christian Helmuth
20239dc27f sculpt/pc: increase usb_hid_drv cap quota
This is required to support more than 3 USB input devices.
2023-10-25 08:58:54 +02:00
Norman Feske
ca85cb936b sculpt: debug-dialog tweaks
Shorten the visible text. Make "wait" option depend on "wx" option.
Indent checkboxes similar to the resource dialog.

Issue #5012
2023-10-25 08:58:54 +02:00
Stefan Kalkowski
5471ef7e1e hw: increase default page-table array
Fix #5035
2023-10-25 08:58:53 +02:00
Alexander Boettcher
26be862e08 acpica: suppress pci related output during startup
Issue #4643
2023-10-25 08:58:53 +02:00
Christian Helmuth
e88e3680aa genode_c_api: remove global-static constructors
The execution of global-static constructors in Genode is optional for
native components or determined in the libc for libc components. By
convention, we avoid static constructors wherever possible but in rare
cases the component can tweak the point when constructors are executed
and initialize an environment beforehand. The wifi_drv applies this
pattern for the uplink initialization, but is a libc component on the
other hand, and, thus, statics in the Genode C API for uplink are
constructed later by the libc. So, the prior initialization is reverted,
i.e. the signal-handler capability becomes invalid.

This addresses a regression exposed by the following commit.

  drivers/wifi: perform multi-staged construction

Related to #3509
Fixes #5024
2023-10-25 08:58:53 +02:00
Norman Feske
0a001443e9 sculpt: don't use component names as widget IDs
Component names can be larger than widget IDs, which are capped at 20
characters. To uniquely correlate the component depicted in the graph
with clicks, this patch uses a dedicated graph ID for each runtime
component instead.

Fixes #5034
2023-10-25 08:58:53 +02:00
Norman Feske
94d04b724a sculpt: add system-control in resource dialog
This patch allows for the interactive assignment of the system-control role
to a new component via the resource dialog. This is useful for integrating
low-level components like the Intel frequency/power monitoring tool.

Fixes #5033
2023-10-25 08:58:53 +02:00
Norman Feske
b3a9a2eb4e touch_keyboard: minor UI tweaks
Remove diagnostic message, remove vertical spacers between buttons.
2023-10-25 08:58:53 +02:00
Johannes Schlatow
7b15cce099 depot: add src/qt5_svg to pkg/goa
Fixes genodelabs/genode#5032
2023-10-25 08:58:53 +02:00
Johannes Schlatow
19ec0b2dd4 depot: add compat-libc to pkg/goa
Fixes genodelabs/genode#5030
2023-10-25 08:58:53 +02:00
Sebastian Sumpf
83d4fcdf27 vfs/lxip: support connect(...AF_UNSPEC..) on UDP sockets
Note, Linux supports connection reset via this mechanism for UDP as well
as TCP sockets and vfs_lxip retains this feature.

Issue #5031
2023-10-25 08:58:53 +02:00
Sebastian Sumpf
5261fe626d libc: support connect(..AF_UNSPEC..) on UDP sockets
A 'connect' with AF_UNSPEC dissolves address association in order to
re-connect to another address.

Issue #5031
2023-10-25 08:58:53 +02:00
Josef Söntgen
cf43e0c3da libdrm/lima: always map BO with ID 1 2023-10-25 08:58:53 +02:00
Sebastian Sumpf
d49700f562 stdcxx: add another 'std::basic_ios' flavor 2023-10-25 08:58:53 +02:00
Norman Feske
1224162072 menu_view: refine zero-size condition
Commit "menu_view: ignore zero-sized widgets in box layout" introduces
zero-sized child widgets as a special case but defined zero-sized as
zero covered pixels (w*h == 0). However, for layouting, a widget with a
non-zero height and zero width is not zero-sized.

This patch refines the zero-size condition such that only widgets with
both zero width and zero height are considered as zero-sized.

It thereby solves the missing display of empty lines in the text_area
component.
2023-10-25 08:58:53 +02:00
Norman Feske
87b7dfed5d xml_node: skip whitespace in differs_from
The 'Xml_node::differs_from' method takes the constructor arguments
(addr, size) for a byte-wise comparison whereas 'with_raw_node'
restricts the byte range to the actual XML tags. In cases where
the XML start tag is preceeded by whitespace, both ranges can differ.

Since the 'differs_from' method is meant for comparing actual XML
nodes - not any whitespace around them - whitespace should be ignored
on both operands.

Issue #5029
2023-10-25 08:58:53 +02:00
Norman Feske
1b23d3b8cb sculpt: reset popup menu on close
This avoids an unexpected geometry animation when opening the popup right
after closing it from a sub menu.
2023-10-25 08:58:53 +02:00
Christian Prochaska
82705cfc0f tool_chain_auto.run: remove posix.lib.so preload config
Fixes #5028
2023-10-25 08:58:53 +02:00
Christian Prochaska
c4677042e1 ldso: load posix.lib.so first
Fixes #5027
2023-10-25 08:58:53 +02:00
Norman Feske
d3e5e5c286 sculpt: fix interplay of popup with old dialogs
This is a follow-up fix for commit "sculpt: apply Dialog API to diag,
panel, and graph", which happened to render the legacy dialogs (network
and settings) inaccessible.

The patch avoids the use of clack seq numbers for the 'popup_opened'
condition (which happens on click, not clack). It also overrides old
click information on the arrival of a new click, avoiding the evaluation
of stale click sequence numbers in distant_runtime.cc. Furthermore, it
reduces the rate of 'Distant_runtime::_try_handle_click_and_clack'.

Issue #5008
2023-10-25 08:58:53 +02:00
Christian Helmuth
eb2843de33 pc_nic_drv: implement pcie utility dummies 2023-10-25 08:58:52 +02:00
Benjamin Lamowski
3f80249204 sculpt: offer passphrase dialog for WPA3 networks
On WPA3 encrypted networks the AP picker does not indicate encryption
and does not prompt for a passphrase.

Also indicate an encrypted network when "protection=WPA3", remedying
both issues.

Fixes #5022
2023-10-25 08:58:52 +02:00
Alexander Boettcher
9b312054f5 intel/display: support force_* and configured mode
Up to now, when using force_*, all other configured modes of a connector
got overwritten and the force_* got enforced. With the commit,
the connector mode is considered (if below max_*) and the resulting
framebuffer may be larger then the dimension of force_*.
2023-10-25 08:58:52 +02:00
Alexander Boettcher
ab91750869 acpica: add option to select GPE usage
Mitigates the ACPI IRQ storm of T490s.

Issue #4643
2023-10-25 08:58:52 +02:00
Christian Prochaska
64b3ab59b0 gdb_interactive.run: pass Ctrl-C to GDB on hardware
Issue #5019
2023-10-25 08:58:52 +02:00
Christian Helmuth
66c2c74147 depot/publish: let gpg overwrite .sig files
Without this change gpg aborted with

  gpg: Sorry, no terminal at all requested - can't get input

and after adding --batch onlye with

  gpg: signing failed: File exists
2023-10-25 08:58:52 +02:00
Christian Prochaska
794b178032 sculpt: update falkon preset
Fixes #5018
2023-10-25 08:58:52 +02:00
Christian Helmuth
0db4116ba6 sculpt: version 23.10 2023-10-25 08:58:52 +02:00
Christian Helmuth
accfc4145a Stable TAR archive metadata content in recipes
Differences in TAR archive member metadata results in unstable depot
hashes. The following properties have to be fixed: modification time
(incl. time zone), numeric owner and group, permission modes.

Releated to #2842
2023-10-25 08:58:52 +02:00
Alexander Boettcher
e36170c997 nova: add guarded access to MSRs
via Genode Pd::system_control interface

Issue #5009
2023-10-25 08:58:52 +02:00
Michael Mueller
539bb07995 Made TASKING service, Suoritin, a member of the Habitat rather than Hoitaja. This way the habitat has direct access to the Suoritin sessions without sending pointers around. Also added new entrypoint for Hoitaja's timer. 2023-10-13 19:01:45 +02:00
Michael Mueller
80bde5fd90 Updated session interface and fixed off-by-one bug in interface allocator. 2023-10-13 18:59:29 +02:00
Michael Mueller
02de7a4e56 Suoritin: Redefined TASKING session interface. 2023-10-13 18:58:49 +02:00
Michael Mueller
ec52fd1e8b Suoritin: Added file description to component.h. 2023-10-10 17:37:58 +02:00
Michael Mueller
29eaa64d2e Added Suoritin client component for testing. 2023-10-10 16:41:38 +02:00
Michael Mueller
7a127d5402 Moved code into a header file. 2023-10-10 16:39:59 +02:00
Michael Mueller
cd124b4860 Updated vscode run script to include Suoritin example. 2023-10-10 16:39:19 +02:00
Michael Mueller
22b814489c Removed source file from Hoitaja's Makefile due to refactoring. 2023-10-10 16:38:33 +02:00
Michael Mueller
1bcc85e556 Announce Suoritin as one of Hoitaja's services. 2023-10-10 16:37:41 +02:00
Michael Mueller
e614c0fb33 Implemented session and root component for Suoritin 2023-10-10 16:36:14 +02:00
Michael Mueller
0b5b89a469 Made Suoritin tasking service more verbatim for debugging. 2023-10-10 16:35:02 +02:00
Michael Mueller
f362843245 Fixed broken link for paper 2023-10-10 11:48:57 +02:00
Christian Prochaska
fe3a958dbf os: add a terminal_crosslink pkg recipe
Fixes #5017
2023-10-04 14:00:46 +02:00
Christian Prochaska
16ba978025 ports: add a gdb_x86 pkg recipe
Fixes #5016
2023-10-04 14:00:42 +02:00
Christian Helmuth
07c4b92335 depot: update recipe hashes 2023-10-04 13:22:08 +02:00
Christian Prochaska
aea90dc7da hw: fix vmm_arm test on arm_v8a
Fixes #4975 regression
2023-10-04 13:22:08 +02:00
Christian Prochaska
ae899b9bc7 ports: add a test for GDB
Fixes #5014
2023-10-04 13:22:08 +02:00
Christian Prochaska
471e61f0e4 monitor: move monitor_gdb test commands to separate file
Fixes #5013
2023-10-04 13:22:08 +02:00
Christian Prochaska
51875b89fd ports: add socat_tcp pkg
Issue #5007
2023-10-04 13:22:08 +02:00
Christian Prochaska
1bb1ebe2ae sculpt: use debug monitor as runtime init
Fixes #5012
2023-10-04 13:22:08 +02:00
Christian Prochaska
7731e02a20 monitor: remove terminal write busy loop
Fixes #5011
2023-10-04 13:22:07 +02:00
Norman Feske
529cdc949b doc/getting_started.txt: fb_sdl changed to SDL2
Issue #4993
2023-10-04 13:22:07 +02:00
Norman Feske
aff17cb177 sculpt: propagate managing_system role
This change allows for the hosting of system-management components
in Sculpt's runtime. The special role must be declared either as
<launcher managing_system="yes"> attribute or in the deploy
configuration's <start managing_system="yes"> attribute.

Issue #5009
2023-10-04 13:22:07 +02:00
Benjamin Lamowski
558a00138c vmm: rename State to Vcpu_state for clarity
Rename locally extended VCPU state from State to Vcpu_state for clarity.
The local namespace only adds two accessor methods, which does not
justify a local generic name.

Ref #4968
2023-10-04 13:22:07 +02:00
Benjamin Lamowski
0e49149a46 base-hw: rename Vm_state to Vcpu_state
Make naming across architectures coherent by renaming Vm_state to
Vcpu_state, to reflect that it contains the state of a Vcpu and not that
of an entire VM.

Ref #4968
2023-10-04 13:22:07 +02:00
Christian Prochaska
149a0183ec monitor: fix 'vCont?' command response
Fixes #5010
2023-10-04 13:22:07 +02:00
Alexander Boettcher
72a3c2fe97 vbox6: disable RDTSC exit (SVM)
Issue #4726
2023-10-04 13:22:07 +02:00
Alexander Boettcher
9ab593e1b5 nova: provide system_control cap per cpu
Issue #5009
2023-10-04 13:22:07 +02:00
Alexander Boettcher
916bd88e5e base: extend PD session by system_control_cap
Per Affinity::Location a system control cap can be requested. The capability
provides an RPC interface to request and set Cpu_state, as provided by the
former Pd::managing_system(Cpu_state) method. Invocation of those system
control capabilities then *can* (see below) be executed on the desired CPU
as described by Affinity::Location.

The system control cap will be invalid for kernels that don't support
system_control/managing_system functionality at all.

The system control cap will be ever by the same, e.g. ignoring the
Affinity::Location parameter, if the used kernel doesn't support or doesn't
require the feature to execute the system control per CPU.

The commit is a preparation step to add guarded and selective x86 MSR
access per CPU.

Fixes #5009
2023-10-04 13:22:07 +02:00
Norman Feske
ffc25fde53 sculpt: apply Dialog API to diag, panel, and graph
This patch partially converts the Sculpt manager to the dialog API.
At this stage, both the old utilities and the new dialog API are still
used simultaneously.

Issue #5008
2023-10-04 13:22:07 +02:00
Norman Feske
0c40d52010 sculpt: add Dialog::Distant_runtime
The so-called 'Distant_runtime' implements GUI dialogs via menu_view
components hosted at a distant init instance as opposed to child
components (as implemented by the 'Sandboxed_runtime'). This is
particular the case in Sculpt OS where the sculpt manager is not the
parent of the menu_view instances.

Issue #5008
2023-10-04 13:22:07 +02:00
Norman Feske
9d5af71c3d sculpt: seq events for touch_release 2023-10-04 13:22:07 +02:00
Norman Feske
37d5bdbae5 sculpt: deprecate original 'Dialog' interface
By renaming 'Dialog' to 'Deprecated_dialog', we become able to use the
name 'Dialog' for the new API while temporarily keeping the original
interface in tact.

Issue #5008
2023-10-04 13:22:07 +02:00
Norman Feske
f90058488f sculpt: screensaver refinements
- Increase default timeout to one minute
- Ignore power-button events during display-driver startup to avoid
  entering another forced blank when pressing the power button twice.
- Prevent wakeup from user activity except for the power button.
  So the volume can be adjusted without leaving the screensaver.

Issue #4950
2023-10-04 13:22:07 +02:00
Norman Feske
4fdc999087 Dialog API
The new API at gems/include/dialog/ aids the creation of simple GUI
applications based on the menu-view widget renderer. Its use is
illustrated by the simple test application at src/test/dialog/
that is accompanied with the dialog.run script.

Issue #5008
2023-10-04 13:22:06 +02:00
Norman Feske
6895175764 menu_view: omit label hover details by default
Each hover change of the character position within a label results in a
new hover report, which needs to be evaluated by the application. For
the common cases where labels are used as button texts or for presenting
passive information, the level of detail is not needed while the
recurring hover reports induce overhead at the application side.
This patch mitigates this overhead by excluding labels from the hover
reporting by default.

For use cases that actually depend of precise hover reporting of labels,
for example an editable text area, the hover reporting can be enabled by
setting the 'hover="yes"' attribute of the label.
2023-10-04 13:22:06 +02:00
Norman Feske
391c261199 menu_view: propagate widget version attr
The 'Widget::_version' attribute was meant to allow the deliberate
replacement of a widget by a same-named widget by changing the version
while keeping the name, thereby suppressing any geomety animation.

However, the implementation missed to populate the attribute with the
value provided by the dialog ROM, prompting the unconditional
re-creation of the widget whenever a 'version' attribute was specified.
Even though this had the (desired) effect of preventing geometry
animations, it could cause feedback loops between hover reports and
dialog ROMs because the 'hover_changed' condition in 'Menu_view::Main'
would always stay true while a versioned widget is hovered.
2023-10-04 13:22:06 +02:00
Norman Feske
76adfff091 menu_view: add styles/button/invisible/hovered.png
This avoids the need to handle a special case at the menu_view user side.
2023-10-04 13:22:06 +02:00
Christian Prochaska
4bef85d7bc ports: add socat
Fixes #5007
2023-10-04 13:22:06 +02:00
Christian Prochaska
abc3c5f0df libc: stat: classify transactional files as character devices
Fixes #4981
2023-10-04 13:22:06 +02:00
Josef Söntgen
ef0c859b7a virtualbox6: cache USB DMA bounce buffers
To prevent exessive allocations the bounce buffers are allocated
once and afterwards re-used. The DMA buffers are provided by an
range allocator whose backing store increases in 4 MiB chunks.

The range allocator might not merge the ranges as those chunks
are not necessarily allocated continously. Allocations larger
than the static chunk size are therefor treated as error.
2023-10-04 13:22:06 +02:00
Alexander Boettcher
264160797d qemu-usb/webcam: cache large allocation of libyuv 2023-10-04 13:22:06 +02:00
Alexander Boettcher
0d868515a5 libyuv: add support to overwrite default allocator
Internally libyuv uses malloc & free for short time dynamic memory
allocation during image transformation. The converted images are
such large, that the Libc allocator will create and destroy new Genode
dataspace per image.  In time sensitive code paths, the overhead can be
noticeable by the caller of the image transformation.
The patch adds the option to register callbacks in the libyuv library to
implement the image allocation by users of the library. They may implement
caching strategies to avoid the overhead, e.g. as seen with qemu-usb and
the webcam model.
2023-10-04 13:22:06 +02:00
Alexander Boettcher
63c5ec7390 qemu-usb: reduce overhead of capturing one picture
from 3 USB packet to 1 packet per picture. Set the maximal supported
payload to the size of one picture + the size of the required protocol
header.
2023-10-04 13:22:06 +02:00
Alexander Boettcher
385b37dca7 qemu-usb/webcam: close session after timeout
and not before. On Windows guest with more than 1 vCPU, the packets
seem to arrive and/or seem to be handled too late in the Webcam model.
An intermediate state, to due the late packet, has been used to decide to
close the Capture session too early.
2023-10-04 13:22:06 +02:00
Christian Prochaska
9c32d53914 os: add a src recipe for test-terminal_echo
Fixes #5006
2023-10-04 13:22:06 +02:00
Christian Prochaska
3cb567d0b1 GDB: support an empty initial thread list on Genode
Fixes #5005
2023-10-04 13:22:06 +02:00
Christian Prochaska
f0b734886e GDB: don't cache the memory map
Issue #5004
2023-10-04 13:22:06 +02:00
Christian Prochaska
d77cb2b1fc monitor: add 'qXfer:memory-map:read' command`
Fixes #5004
2023-10-04 13:22:06 +02:00
Christian Helmuth
c6881a8126 vbox6: silence stack-size limit warning
Our stack slots are 1M per thread including room for metadata.
Therefore, this patch reduces the stack demand of EMT threads to
1M - 16K.
2023-10-04 13:22:06 +02:00
Christian Helmuth
a7a7c56ad6 libc: silence "Warning: missing sysctl for [0][3]
The warning results from sysctlnametomib() that uses an undocumented
FreeBSD kernel interface we do not support.

Fixes #4673
2023-10-04 13:22:05 +02:00
Christian Helmuth
9db4293d7a vbox6: implement ioctl(SUPPAGEFREE &request)
Fixes #4674
2023-10-04 13:22:05 +02:00
Christian Helmuth
15d1beca1b Fix use-after-free warnings in test-libc 2023-10-04 13:22:05 +02:00
Christian Helmuth
cc1a6041a7 fb_sdl: adapt RAM quota for large screen sizes
Issue #4993
2023-10-04 13:22:05 +02:00
Robin Eklind
d3d822cd9d fb_sdl: refactor to only construct window once
In SDL2, support has been added for multiple windows.

As such, prior to this commit, invoking _sdl_screen.construct
would create a new window each time the original window was
resized.

To avoid this, refactor to only construct the window once, and
upon resize events, reconstruct the SDL_Surface and SDL_Texture
of Sdl_screen to the new window dimensions.

Issue identified by @chelmuth in https://github.com/genodelabs/genode/pull/4993#issuecomment-1729530634

Fixes #4993
2023-10-04 13:22:05 +02:00
Robin Eklind
3e68b07db0 fb_sdl: fix handling SDL_WINDOWEVENT_RESIZED
Issue #4993
2023-10-04 13:22:05 +02:00
Robin Eklind
9799adda79 fb_sdl: update to use sdl2
Following the official migration guide of SDL [1], the
fb_sdl framebuffer driver was update from SDL1 to SDL2.

The sdl2 port in world/src/lib/sdl2 is used.

Since SDL1 is in maintenance mode [2], support for other
display servers than X11 will never be implemented. In
particular, support for Wayland is missing from SDL1.

Fortunately, a port of sdl2 is maintained in genode-world.

As SDL2 is actively developed, it will provide support for
modern hardware architectures, and has mature support for
Wayland [3].

[1]: https://wiki.libsdl.org/SDL2/MigrationGuide
[2]: https://wiki.debian.org/Wayland#SDL1_.28unsupported.29
[3]: https://wiki.debian.org/Wayland#SDL2_.28supported_since_2.0.2.2B-.29

Issue #4993
2023-10-04 13:22:05 +02:00
Benjamin Lamowski
5abd2dddb8 tz_vmm: port to new VMM library API
Ref #4968
2023-10-04 13:22:05 +02:00
Christian Helmuth
3a566262fe lx_emul: multi-touch trackpad support in evdev.c
Also addresses remarks in issue #3019.
2023-10-04 13:22:05 +02:00
Christian Helmuth
12fc9a0fbb trace_logger: log priority of trace subject
Optionally log thread priority with

  <config priority="yes" ...> ... </config>

The commit also applies a cleanup of format calculations.
2023-10-04 13:22:04 +02:00
Alexander Boettcher
484bde4b4b vbox5: remove VM generic version
Issue #4968
2023-10-04 13:22:04 +02:00
Stefan Kalkowski
17a140db3d dde_linux: delete orphaned files
Fix genodelabs/genode#4998
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
cfab4e74a9 vmm: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
7e79128c03 vmm_x86: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
9f054635bd virtualbox6: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
1515a0a51e base-sel4: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
5136883ded base-foc: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
85012d5edd base-nova: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
9489bf41a5 base-hw: port to new VMM library API
Ref #4968
2023-10-04 13:22:03 +02:00
Benjamin Lamowski
daafe3f4e2 base: rework vmm library API
The new API emphasizes control over the vCPU data by granting access
through the Vcpu::with_state() method, which makes sure that the vCPU is
stopped, invokes the supplied function with a reference to the VM state
and resumes the vCPU if the function returns true.

The old Vcpu::run(), Vcpu::pause() and Vcpu::state() methods are removed
in favor of the new API. Execution of the vCPU is now interrupted by
sending a native Genode Signal to its Vcpu_handler, which will run the
VMM's exit handling method. When this method retrieves the vCPU state by
calling Vcpu::with_state(), the outside interruption is detected and on
x86 a recall exit is injected into the state to signal the vCPU
interruption / pause request to the VMM's vCPU handler.

Ref #4968
2023-10-04 13:22:03 +02:00
Alexander Boettcher
5c27993884 nova: transfer guest fpu state via utcb
instead via the hardware registers of the FPU. On Genode all components and
so VMMs are built such, that the compiler may generate optimized code by
using the FPU at any time. We had to make sure to save the
FPU state as early as possible before the VMM component touches the FPU,
to avoid corrupting & losing guest FPU state. This caused headache again
and again. To avoid the uncertainty, we remove this feature and explicitly
transfer the FPU state via the UTCB.
2023-09-29 12:21:04 +02:00
Benjamin Lamowski
37a6669e71 libc: add support for FreeBSDs KERN_ARND sysctl
Provide FreeBSDs KERN_ARND systemctl by calling getentropy().

To use it, configure an RNG via the `rng` libc runtime parameter.

Ref #4997
2023-09-29 12:21:04 +02:00
Benjamin Lamowski
aa5751b7fc libc: add more dummies for the Rust libc crate
Add dummies for pthread_set_name_np(),
posix_spawn_file_actions_addchdir_np() and
cpuset_getaffinity().

Ref #4997
2023-09-29 12:21:04 +02:00
Benjamin Lamowski
159c3d0606 compat_libc: add versioned symbols for lstat and readdir_r
Ref #4997
2023-09-29 12:21:04 +02:00
Josef Söntgen
02c8d73426 timer-session: decrease min timeout to 1 ms
Depending on the client and use-case the current minimal timeout
value of 5 ms could be too high, lowering it to 1 ms stays within
the limit imposed by most timer drivers.

Issue #4990.
2023-09-29 12:17:45 +02:00
Josef Söntgen
ab4c36c834 virtualbox6: wait at least 1 ms during halt
When the wait value is too small the HALT attempt turnes into
busy-polling in the VMM. To prevent that always wait a minimal
amount of time.

Issue #4990.
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
2bb901e1e3 rpi: disable run scripts that use 'drivers_nic_rpi'
The 'drivers_nic_rpi' packet uses the 'usb_net_drv' which is currently not
supported by the virt_linux version.
2023-09-29 12:17:45 +02:00
Norman Feske
3ebb715c5c libports: use [build_artifacts] in run scripts
...except for the run scripts related to Qt and the NIC router.

Issue #4860
2023-09-29 12:17:45 +02:00
Norman Feske
e8059ccba5 vfs/pipe: fix dangling read_ready_waiters element
This patch removes the obsolete 'io_progress_elem', which was wrongly
enqueued to the 'read_ready_waiters' fifo and not dequeued at
destruction time.

Fixes #4987
2023-09-29 12:17:45 +02:00
Norman Feske
458206b11a monitor: apply affinity to monitored children
Fixes #4996
2023-09-29 12:17:45 +02:00
Robin Eklind
d7bbb27671 doc/gdb: fix phrase "to a certain extent" 2023-09-29 12:17:45 +02:00
Robin Eklind
8009e9ca59 doc/depot: fix typo, use 64-bit (instead of 32-bit) when referring to x86_64 2023-09-29 12:17:45 +02:00
Robin Eklind
0489f3673c doc/depot: fix minor typo in 'Depot structure' section 2023-09-29 12:17:45 +02:00
Christian Helmuth
b15fb2bbaf Adapt autopilot output checks in usb_hid_raw test
Issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
b025ddcc8f tool/dde_linux: fix create_dummies for GNU Make 4.4
GNU Make 4.4 will pass TARGET to the sub-make of UNDEF_REFS where it can
be later used as link TARGET by Genode's build system. Before 4.4 TARGET
was undefined in the sub-make leading to the correct result.
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
bb51c113ca dde_linux.port remove USB client driver sources
Remove 'usb_hid', 'usb_net', 'usb_modem' from dde_linux port. These
versions have been updated to Linux 6.1.20 which uses the 'linux.port'
file.

issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
798fb709a2 dde_linux: remove usb_modem driver
The driver is superseded by the USB network driver (usb_net) which also
contains MBIM support for LTE modems previously provided by this
driver.

issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
7e823f7c19 dde_linux: remove legacy_usb_net
issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
cd2910eb2c dde_linux: remove usb_hid_legacy
issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
d5cf77539a dde_linux: update usb_net driver to Linux 6.1.20
Driver for network-interface cards and LTE modems with MBIM support
connected via USB.

issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
f668aea42a dde_linux: update usb_hid driver to Linux 6.1.20
The drivers uses the 'virt_linux' api and the current lx_kit
implementation. It is a drop-in replacement for the Linux 4.16.3 based
version.

issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
e1b463082a usb_net.run: enable Qemu device pass-through
issue #4958
2023-09-29 12:15:07 +02:00
Sebastian Sumpf
f4d7455a9f recipe: wireguard use virt_linux api
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
5bce4dac81 recipe: virt_linux api
for x86_32, x86_64, arm, arm_64

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
c835993ac3 lx_emul: add wheel events to shadow evdev.c
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
6ac68494db lx_emul/arm: add 'pteval_t'
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
c4ec847680 lx_emul/shadow/uaccess_64: add 'clear_user'
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
3925c7ec60 virt/lx_emul: add usb_client.c
This registers C-API USB-client device handle (i.e., USB::Connection) as
Linux 'usb_device' and probes all the initialized drivers.

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
5eff895f9d virt/lx_emul: shadow urb handling for USB clients
allocate, free, and submit urbs to an USB service using Genode's USB
client C-API.

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
d27e0a8fe6 virt_lx_emul: add shadow 'vmalloc.c'
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
22231c0604 virt_lx_emul: adjust dummies for usb_hid/net
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
71c32f2923 virt_linux: add init calls for USB HID/NET
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
57d2b7235d virt_linux: add USB HID/NET/MBIM to kernel configuration
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
f9e70b0300 genode_c_api/event: add wheel events
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
c5a55e5af4 genode_c_api/usb_client: API USB clients
Through this API C-code can connect to an USB service.

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
f896fcfadb genode_c_api/usb: add ALT_SETTING and CONFIG
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
9f8ccc030b linux.port: add usb_net_cdc_ncm.patch
NCM tries to batch TX packets using timeouts (500us) and does not send packets
before 3 packets are in the submit queue. Timeouts take milliseconds on
dde_linux which leads to delayed ACKs and poor performance for the RX case.
Therefore, we send small packets (<100 Bytes) immediately without batching (it
might be an ACK or last packet of a larger transfer).

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
5c1b9399b0 linux.port: add usb_net_pinephone.patch
The PinePhone Modems' CDC Ethernet Interface does not respond if RX/TX queue size
is greater 12 (experimentally determined), the default would be 60, meaning 60
RX Bulk URBs are sent at once to the device.

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
9a6423b4ef dde_linux: move usb_net -> legacy_usb_net
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
8f34c27ca5 dde_linux: move usb_hid -> usb_hid_legacy
issue #4958
2023-09-29 12:15:05 +02:00
Christian Helmuth
41adf8d196 jitterentropy: clear memory in jent_zalloc() 2023-09-29 12:15:05 +02:00
Johannes Schlatow
119f679278 fs_report: handle WRITE_ERR_WOULD_BLOCK
A WRITE_ERR_WOULD_BLOCK may occur when large reports are written to a file
system because this fills up the submit queue of the packet-stream interface.

Fixes genodelabs/genode#4988
2023-09-29 12:15:05 +02:00
Alice Domage
6881a71a87 depot_remove.run: improve <remove_all/> tests
This commits introduces changes to test number 4, so it must keep
more than one PKG. Also, it introduces a 5th test to verify that the
<remove_all/> functionality does delete everything in the depot.

Issue genodelabs#4866
2023-09-29 12:15:05 +02:00
Alice Domage
3f661a75e4 depot_remove.run: make test functions more intuitive
This commits introduces improvements to the test functions to avoid
code duplication, and renames these functions to reflect better what they
are used for.

Issue genodelabs#4866
2023-09-29 12:15:05 +02:00
Johannes Schlatow
0622446f09 base: print last character of unterminated strings
The last character should only be skipped if a `\0` or `\n` is found. If
the string ends without such a character or the maximum line length is
hit, we do not skip the last character.

Fixes genodelabs/genode#4985
2023-08-24 14:12:21 +02:00
Christian Helmuth
e78a84196d version: 23.08 2023-08-24 11:54:57 +02:00
Christian Helmuth
4f8d8b760c News item for version 23.08 2023-08-24 11:54:13 +02:00
Norman Feske
7541c357ca Release notes for version 23.08 2023-08-24 11:33:24 +02:00
Norman Feske
8cba87420b doc/components.txt: update to Genode 23.08 2023-08-24 11:33:24 +02:00
Christian Helmuth
134a785fe0 depot: update recipe hashes 2023-08-24 11:01:40 +02:00
Benjamin Lamowski
9f7e47368f libports: transform compat-libc into a static library
Dynamically loading the `compat-libc` breaks `fork(2)` on Genode.

Switch `compat-libc` to a special api package that provides a source
file for statically linking the library, analogous to the `blit`
package. This also requires a quirk in Goa but should prevent breaking
`fork()` and removes the runtime and archive dependencies for Rust
packages using `compat-libc`.

Ref genodelabs/goa#61
2023-08-23 13:46:37 +02:00
Sebastian Sumpf
0a85964f91 libports: add 'compat-libc'
Implement FBSD_1.0 versions of libc functions ('stat', 'fstat'). The
functions are versioned with @FBSD_1.0, and therefore, will not clash
with libc during linking. However, to be called by our dynamic linker,
the library must be before libc in the NEEDED section of the binary
using it. This requires the lib to be in front of libc in the LIBS
variable. The library currently will call libc 'stat' and 'fstat' by
looking up the symbols via 'dlsym'.

Ref genodelabs/goa#61
2023-08-23 13:46:37 +02:00
Christian Helmuth
da53a11508 pc_nic_drv: drop incoming packets on missing uplink
Fixes sporadic null-pointer dereferences like

  [init -> nic_drv] Error: illegal READ at address 0x204 by pager_object: pd='init -> nic_drv' thread='ep' ip=0x86467
2023-08-23 13:46:37 +02:00
Christian Helmuth
bd0c680ec8 pc_nic_drv: implement dst_release 2023-08-23 13:46:37 +02:00
Christian Prochaska
8a279855ff cleanup file permissions
Fixes #4983
2023-08-23 13:46:37 +02:00
Christian Prochaska
efae71dac7 acpica: fix download link
Fixes #4982
2023-08-23 13:46:37 +02:00
Christian Prochaska
7000fb8642 monitor: add more debugging features
Fixes #4977
2023-08-23 13:46:37 +02:00
Christian Prochaska
8b7f959451 hw: send exception signals and support single-stepping
Fixes #4975
2023-08-23 13:46:37 +02:00
Christian Prochaska
f3b03fa01b ports: add gdb_arm_64 variant
Fixes #4980
2023-08-21 08:12:02 +02:00
Christian Prochaska
7a6d9f8530 ports: install GDB with install-strip
Fixes #4979
2023-08-21 08:12:02 +02:00
Christian Helmuth
65d9607ece vbox6: force C/H/S disk geometry from calculation
Some Ubuntu installations (e.g., 20.04) create installation disks with
strange C/H/S MBR partitions like 3988/255/2. Normally, VirtualBox reads
the MBR to guess disk geometry information for the virtual BIOS.
Unfortuantely, the strange values from Ubuntu lead to a heavy
virtual-disk activity on boot. Therefore, this commit forces the use of
calculated values based on the assumption that large disks use LBA
addressing anyway.

Fixes #4978
2023-08-21 08:12:02 +02:00
Christian Prochaska
9e41848927 ports: GDB fixes
Fixes #4976
2023-08-21 08:12:02 +02:00
Christian Prochaska
48e6468df1 os: support UART drivers in board-specific repositories
Fixes #4973
2023-08-21 08:12:01 +02:00
Christian Prochaska
419e5e46f6 base: add more x86_64 exception type enums
Fixes #4972
2023-08-21 08:12:01 +02:00
Alexander Boettcher
c88e6bb81d gpu/intel: fix disable invocation in fw_disable
Erroneous enable was used
2023-08-21 08:12:01 +02:00
Martin Stein
c3c7a01df5 nic_router_uplinks.run: raise report-rom caps
Caused the test to fail on x86_64+pc+sel4.

Ref #4923
2023-08-21 08:12:01 +02:00
Martin Stein
280ca8982b os net tests: unify & document target restrictions
Ref #4966
2023-08-21 08:12:01 +02:00
Martin Stein
53018515a9 net_test-pc.sculpt: minimal setup for net tests
A small sculpt setup with routed and raw access to the PC NIC-driver as well
as a launcher for the ping app.

Ref #4966
2023-08-21 08:12:01 +02:00
Martin Stein
8bad3d08d7 util/formatted_output.h: hex-dump utility
Adds Genode::Hex_dump class to the formatted_output.h header. This class can be
used to print a hexadecimal dump of a byte range. The data is printed in a
format similar to that used by Linux's 'xxd'. In addition to the 'xxd' format,
consecutive duplicate lines are replaced with a single "*\n" as done also by
Linux's 'hexdump'.

Ref #4966
2023-08-21 08:12:01 +02:00
Martin Stein
9a94fbb1ec ping: align dhcp client more with nic_router again
The DHCP client implementations of Ping originally is a copy of the NIC router
implementation adapted for Ping. The two versions diverged further over the
years. This issue should be solved by should merging them into a centralized
implementation. However, this commit treats only a recent issue with the
nic_uplink.run test on pbxa9 qemu but does this by re-aligning the two
implementations partially. The final merge should be done in a separate commit.

Ref #4966
2023-08-21 08:12:01 +02:00
Martin Stein
d8c51656d7 depot_autopilot: forward tabs and color sequences
The Depot Autopilot used to filter out tabs and color sequences before
forwarding the test log to the own log. This commit prevents this and further
cleans up the string-filters code.

Ref #4922
2023-08-21 08:12:01 +02:00
Martin Stein
987dea5f7f depot_autiopilot: consider log_prefix attribute
The new 'log_prefix' attribute is effective when used in a tests runtime in
<succeed> or <fail> tags that have a non-empty content string. When matching
the log against the pattern given in the affected <succeed> or <fail> tag, the
Depot Autopilot will consider only those test-log lines that start with the
given prefix.

Ref #4922
2023-08-21 08:12:01 +02:00
Martin Stein
c47a6b0830 depot_autopilot: simplify success-criterion syntax
* Removes the <event> tag from all test package runtime files and replaces the
  contained <timeout> and <log> sub-tags with the new tags <succeed> and
  <fail>. If a <succeed> or <fail> tag has a content, it defines a log pattern
  that should be recognized and render the test failed or successful. If a
  <succeed> or <fail> tag has an attribute after_seconds that is not set to 0,
  it defines a timeout after which the test should be rendered failed or
  successful.

* Adapts the Depot Autopilot to support the new syntax in the test-package
  runtime files. However, for now, the Depot Autopilot is kept compatible to
  the old syntax as well. If the <events> tag is present, it is prioritized
  over the new syntax.

Fixes #4922
2023-08-21 08:12:01 +02:00
Martin Stein
b587134a8d net tests: raise nic_drv/drivers cap quota
Several nightly network-related tests fail currently on sel4/pc because the
new e1000 NIC driver requires more capabilities. The "drivers nic" package
was already adapted to the new requirement but some tests fail to provide
enough caps to the corresponding sub system. This commit tries to fix all
remaining tests.

Ref #4923
2023-08-21 08:12:01 +02:00
Stefan Kalkowski
4277bdd3cd lx_emul usb: solve session close races
* During a session-close, the device-specific usb task and driver data
  gets freed. Part of it was the RPC data. To prevent use-after-free
  turn it into a pointer and leave it on the stack of the caller thread
* During a device release, URBs discards, and reset operation the Linux task
  might get blocked, and then a RPC caller task might return if the RPC
  operation was marked as finished already, although it hasn't succeeded yet
* USB devio RESET has to be done before a device release to be effective

Fix genodelabs/genode#4969
2023-08-21 08:12:01 +02:00
Stefan Kalkowski
8f4903ca86 lx_emul usb: make reset ep effective
* Within flush_transfer of the USB session a given entrypoint gets
  resetted, to be effective al related URBs need to be discarded first
* Discarding URBs shall be done in reverse order, like libusb is doing it,
  where it warns about potential races otherwise

Ref genodelabs/genode#4969
2023-08-21 08:12:00 +02:00
Martin Stein
68fd016746 ping: src and pkg recipes
Ref #4966
2023-08-21 08:12:00 +02:00
Martin Stein
c23491ef3c nic_uplink: connect a Nic to an Uplink session
* Adds a new component server/nic_uplink that forwards packets unmodified
  between one Uplink session at one side and potentially multiple Nic sessions
  at the other side.
* Adds a new run script nic_uplink.run that does a basic test with multiple
  Nic clients on this component and adds it to the autopilot list.
* Adds a new depot recipe src/nic_uplink for this component.
* Adds a new depot recipe pkg/pc_nic for deploying the pc_nic_driver together
  with a nic_uplink server. This allows for raw access to the network connected
  to the Nic of the system in contrast to the commonly used routed and NAT'd
  access via NIC router. That said, it enables the use of network protocols
  not yet supported by the NIC router at the cost of less protection.

Ref #4966
2023-08-21 08:12:00 +02:00
Martin Stein
4c4962b306 nic_router: clean-up session creation with class
Introduces a new class that does the clean-up if some exception is
thrown while creating the session. This reduces redundancy and overall
lines of code.

Ref #4966
2023-08-21 08:11:37 +02:00
Michael Mueller
1205032bd6 Use absolute path to resize2fs as on Debian /sbin is not in PATH by default. 2023-08-07 18:33:24 +02:00
Michael Mueller
6f60db5209 blinktree: More complex scenario using TRACE service and top. 2023-08-07 18:31:51 +02:00
Michael Mueller
02dd7fdb78 Updated vscode configuration. 2023-08-07 18:23:21 +02:00
Michael Mueller
1b3eef72f7 Example for using the low-level interface for PMCs. 2023-08-07 18:18:58 +02:00
Michael Mueller
d1ee1e82a4 top: Changed CPU configuration to work with topology used by blinktree. 2023-08-07 18:14:40 +02:00
Michael Mueller
667e272a8a hoitaja: Added Suoritin as service to Hoitaja. 2023-08-07 18:13:34 +02:00
Michael Mueller
6b31730301 Removed default memory configuration for qemu. 2023-08-07 18:12:51 +02:00
Michael Mueller
ecf760f4b5 Print directories for verbose build to create build.log for vscode. 2023-08-07 18:11:32 +02:00
Michael Mueller
e4f43c1edd hoitaja: Added new CPU interface providing abstraction for task-parallelism. 2023-08-07 18:09:58 +02:00
Michael Mueller
278fbb2281 hoitaja: Added state_handler callback for notifying hoitaja about a cells construction or termination. 2023-08-07 18:07:49 +02:00
Michael Mueller
025a7ce667 hoitaja: Dummy classes for functions to be implemented later. 2023-08-07 18:06:26 +02:00
Michael Mueller
fd216a5613 hoitaja: Implemented core (re-)allocation upon Cell construction/destruction. 2023-08-07 18:05:14 +02:00
Michael Mueller
01cf697875 hoitaja: First version of static core allocator. 2023-08-07 18:03:45 +02:00
Michael Mueller
d603ea90c0 hoitaja: Added class representing Cells. 2023-08-07 18:03:11 +02:00
Michael Mueller
6f3449f568 hoitaja: Fixed include error in cell_controller.h. 2023-08-07 18:02:07 +02:00
Michael Mueller
2dd211a1b3 Updated hash for shim. 2023-08-07 18:00:09 +02:00
Michael Mueller
c39a9201e7 Added priorities to yield testing scenario. 2023-08-07 17:59:31 +02:00
Michael Mueller
0f3368cbe4 base: Updated symbols table. 2023-08-07 17:58:03 +02:00
Michael Mueller
260079b5c4 Print directory when VERBOSE= is given on make cmdline. 2023-08-07 17:57:34 +02:00
Michael Mueller
550c376e40 sandbox: Refactored sandbox library to make it extensible via inheritance. 2023-08-07 17:56:28 +02:00
Michael Mueller
b711e0d091 Example for a cell that voluntarily terminates after a period of time. 2023-08-07 17:54:24 +02:00
Michael Mueller
4ee2070573 Example code for persistent cell. 2023-08-07 17:53:44 +02:00
Michael Mueller
e58e468808 blinktree: Use PMCs by default. 2023-08-07 17:52:04 +02:00
Michael Mueller
6d53c9c874 blinktree: Updated PMC definitions for AMD Epyc. 2023-08-07 17:51:37 +02:00
Michael Mueller
1245236ee2 Convenience scenario creating build.log for vscode's Intellisense. 2023-08-07 17:49:48 +02:00
Michael Mueller
fa1e794c4d Example scenario for PMC usage. 2023-08-07 17:48:38 +02:00
Michael Mueller
df48b8b963 hoitaja: Example scenario for long-term scheduling of cells. 2023-08-07 17:47:58 +02:00
Michael Mueller
44166feb15 base: Updated hash. 2023-08-07 17:46:42 +02:00
Michael Mueller
316f12855a base: Added RPC to allow to change affinity of CPU and TOPO session after creation. This is necessary, as a cell might be pushed out of its original CPU region by Hoitaja. 2023-08-07 17:45:54 +02:00
Michael Mueller
e002117098 Implemented Genode::print for Affinities to make printing affinities to console more convenient. 2023-08-07 17:41:51 +02:00
Michael Mueller
005b3dfdf4 base_nova: Include hotfix for performance counters. 2023-08-03 13:03:11 +02:00
Norman Feske
7aa301361d depot: update recipe hashes 2023-07-14 12:06:32 +02:00
Alexander Boettcher
7c77a98118 cpu_balancer: make test reliable
by just test the migration feature, without relying on load measured on the
CPUs. On Qemu (and depending on other load in the Linux system), the migration
feature gets not triggered in time reliable.
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
ec60ad3a80 dde_linux: remove legacy_rpi_usb_host_drv
* Cleanup the dde_linux port

Fix genodelabs/genode#4965
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
175ec07c06 lx_emul: allow non-SMP kernel configurations
Fix genodelabs/genode#4963
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
2f6864a487 lx_emul: make ARM irqchip handler extendable
* Allow support for kernel configurations without CONFIG_IRQ_DOMAIN_HIERARCHY
* Export `irq_domain` instantiated for driver-specific extensions of the irqchip

Fix genodelabs/genode#4964
2023-07-14 12:06:32 +02:00
Martin Stein
f30c49c0c3 ping.run: raise drivers cap quota
Otherwise, at least on sel4+x86_64+qemu, the nic driver ends up in a resource
request.

Ref #4931
2023-07-14 12:06:32 +02:00
Martin Stein
ca1a94d74c base-hw imx epit-timer: improve code readability
Improves the readability of the implementation of the Timer::_duration method.

Ref #4959
2023-07-14 12:06:32 +02:00
Norman Feske
5ca6dd10f8 monitor: forward priority session argument
This change allows a monitored VBox instance to specify a distinct
(lower) priority to the VM session to ensure that the VMM is always
prioritized higher than the VCPUs. This is important because host
I/O at the VMM should always be able to preempt a busy guest.

Issue #4917
2023-07-14 12:06:32 +02:00
Norman Feske
4918035258 sandbox.h: supply Request::args to Local_service
This change allows a local service to interpret session arguments other
than the label.
2023-07-14 12:06:32 +02:00
Norman Feske
7ce734d886 tool/dts: accept 'label: &ref { };' syntax
The combination of a label with a node supplement was not yet covered by
the dts/parse tool so far.

Fixes #4962
2023-07-14 12:06:32 +02:00
Josef Söntgen
93d6d71a1d dde_bsd: add patch to limit internal buffer size
Decreasing the internal buffer size will implicitly limit the number
of blocks provisioned for recording and brings them in line with
the number of blocks used for playback (2).

Note that this patch also sets an upper-bound on the number of
samples in 'Audio_*::PERIOD'.
2023-07-14 12:06:32 +02:00
Alexander Boettcher
0f70cafb91 intel/display: handle all connectors disabled case
If all connectors are set to disabled by configuration, the connectors
stayed enabled since the new configuration reveals no preferred or minimal
resolution/mode. Instead, use the last set resolution in order to get to the
disabling code.
2023-07-14 12:06:32 +02:00
Josef Söntgen
d6da06913e tool/run/boot_dir/hw: fix iPXE boot 2023-07-14 12:06:32 +02:00
Martin Stein
647631af09 test/timeout: revert use of memory barriers
The memory barriers where introduced with commit "test-timeout: fix build
errors with -std=gnu++20" presumably in order to prevent GCC optimization from
removing the empty for loops the test is using because using a volatile index
variable was no longer an option.

However, the memory barriers seem to have a negative effect on the measurements
performed with the affected loops. The commit caused the timeout test to fail
at least on imx53_qsb.

This commit fixes the issue by using a simple empty for loop without volatiles
or memory barriers but protected inside a function that is compiled with
optimization disabled.

Ref #4959
2023-07-14 12:06:32 +02:00
Josef Söntgen
e18c02991e lx_kit: use central signal handler for scheduling
This commit extends the Lx_kit initialization function by passing in
a signal handler that is used to perform the normally occurring
scheduler execution and is a follow-up change for the decoupling
scheduler execution commit.

Instead of burying the signal handler in the 'Lx_kit::Scheduler'
object it is provided by the main object where the driver is free
to perform any additional step before or after executing the scheduler.

Issue #4927
Fixes #4952
2023-07-14 12:06:32 +02:00
Josef Söntgen
dd1b8a106f drivers/wifi: perform multi-staged construction
Since the wireless LAN driver is actually a 'Libc::Component' due to
its incorporation of the 'wpa_spplicant' application, we have to
intercept its construction because we have to initialize the Lx_kit
environment before any static ctors are executed. Most Linux initcalls
are implemented as ctors that will be otherwise implicitly executed
before the controll is given to us in 'Libc::Component::construct'.

Issue #4927.
2023-07-14 12:06:32 +02:00
Josef Söntgen
fc24ffcdb8 wifi: use mac address reporter
Remove the handcrafted MAC address reporter in favour the Genode
C API utility (cf. #4918).

Issue #4927
Issue #4918
2023-07-14 12:06:32 +02:00
Martin Stein
90ba794e8e base-hw imx epit-timer: fix duration calculation
The timer used to read the counter first and then the IRQ status. This
could cause a non-wrapped counter value to be considered a wrapped
counter value, leading to bogus timeout durations.

This commit fixes the bug and documents the used timer mode in the
driver in order to make future debugging of the driver easier.

Ref #4959
2023-07-14 12:06:32 +02:00
Martin Stein
9d98e8ac01 nic_dump.run: raise drivers cap quota
Fixes failing nightly test with x86_64 sel4.

Ref #4923
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
cccb763737 lx_emul usb: handle RPC calls after async-URBS
Prevent missing new RPC calls handed over to a Linux task
of a corresponding usb-device, while that task blocked
during enqueuing of asynchronous URBs.

Fixed genodelabs/genode#4955
2023-07-14 12:06:32 +02:00
Christian Helmuth
62a0605cf0 depot_autopilot: skip RAM-hungry tests on foc/pbxa9
foc (or maybe bootstrap) seems to cap RAM at 256 MiB while hw uses the
entire RAM configured at the Qemu command line.
2023-07-14 12:06:32 +02:00
Christian Helmuth
7ba00f3692 drivers_interactive: increase CAP quota of usb_drv 2023-07-14 12:06:32 +02:00
Martin Stein
f33ff21ab2 nic_router_flood.run: prios, init stage, clean-up
* add a sensible priority setup into the test script in order to protect
  drivers and stack components from the demanding net clients
* delay the starting of the net clients by 5 seconds in order to give the
  drivers and stack components some time to startup in peace
* use only explicit service routing and caps values

Ref #4923
2023-07-14 12:06:32 +02:00
Norman Feske
3af5a0ca4e monitor: intercept VM session
This is needed to translate the thread capability argument of
'Vm_session::create_vcpu'.

Issue #4917
2023-07-14 12:06:32 +02:00
Alexander Boettcher
38152d6c72 intel_display: use Expanding_reporter 2023-07-14 12:06:32 +02:00
Alexander Boettcher
5ffdda783b nova: remove timestamp from kernel binary
Fixes #4956
2023-07-14 12:06:32 +02:00
Christian Helmuth
fb1d66b254 Remove timestamp from image.elf.gz
Issue #4956
2023-07-14 12:06:32 +02:00
Martin Stein
2fb0bfdf85 drivers_nic-pc: raise nic drv cap quota
The reason for this was that run/nic_router_disable_arp was failing on
sel4+qemu+x86_64.

Ref #4923
2023-07-14 12:06:32 +02:00
Martin Stein
c05a0eca86 xml_unquoted: fix bug with string of length 0
Ref #4922
2023-07-14 12:06:32 +02:00
Norman Feske
852bc3fc62 base-linux: remove exceptions from region_map_mmap
This patch replaces the exception-based error propagation by the use of
'Attempt' return values, which eliminates side effects of the exception
handling - cxx_heap allocations - from code paths that are used by the
the cxx_heap itself (when growing the cxx_heap).

It thereby fixes the failure of the sub_rm test at the "attach RAM ds to
any position at sub rm - this should fail" step.

Fixes #4953
2023-07-14 12:06:32 +02:00
Norman Feske
75bfc37b18 sculpt: screensaver infrastructure
This patch enhances Sculpt with the ability to detect user inactivity
for driving a screensaver by combining nitpicker's hover and focus
reports with a timer.

Issue #4950
2023-07-14 12:06:32 +02:00
Norman Feske
8463f4910a nitpicker: improve activity reporting
Nitpicker's hover and focus reports contain an 'active' attribute, which
can be inspected for the detection of user activity, e.g., as trigger
for a screensaver or for dynamic clipboard policies.

When using the 'Event' session, the reporting code updated the reports
only on incoming events. This patch adds the periodic reporting as used
when using the old 'Input' session.

Issue #4950
2023-07-14 12:06:32 +02:00
Norman Feske
ba67b535f8 gems: remove leitzentrale.run
This run script is superseded by modular Sculpt, which is able to run on
base-linux.
2023-07-14 12:06:32 +02:00
Josef Söntgen
1cac134030 lx_kit: support multiple pending IRQs
Decoupling the scheduler execution can lead to missed interrupts
because the current implementation only handles one pending
interrupt and requires immediate processing.

This commit introduces a helper object that is used to capture
any occuring interrupts that are then handled consecutively.

Issue #4927.
2023-07-14 12:06:32 +02:00
Josef Söntgen
caac994da8 lx_kit: decouple schedule execution
Prior to this commit, whenever an external event occurred, for example
timer or interrupt, the corresponding I/O signal handler was triggered.
This handler unblocked the task waiting for the event and initiated the
immediate execution of all unblocked tasks. Since these tasks may hit
serialization points, e.g. synchronously waiting for packet stream
operations, that require handling of other I/O signals this leads to
nested execution. This, however, is not supported and mixes application
and I/O level signal handling.

The flagging of the scheduling intent is now decoupled from its
execution by using an application level signal handler that is run in
the context of the components main entrypoint. The I/O signal handler
now triggers the scheduling execution by sending a local signal to
the EP.

Since it might be necessary to execute a pending schedule from the EP
directly the scheduler is extended with the 'execute' member function
that performs the check that the scheduler is called from within the
EP and triggers the execution afterwards.

Issue #4927.
2023-07-14 12:06:32 +02:00
Alexander Boettcher
1f1fafb0cf intel_fb: disable encoders of disconnected ports
On disconnect of displays, e.g. seen with Type-C connectors, the encoder was
not properly disabled due to a missing drm_client_modeset_commit. In order that
the commit succeed, however a fb must be assigned to the modeset. Missing to
do so leads to an -EINVAL by the drm_client_modeset_commit.

Fixes #4948
2023-07-14 12:06:32 +02:00
Josef Söntgen
70c57a3be3 pci_decode: calculate 64bit BAR size
Issue #4949.
2023-07-14 12:06:32 +02:00
Christian Prochaska
02209e5455 monitor: add memory write support
Fixes #4947
2023-07-14 12:06:32 +02:00
Martin Stein
7b7851abfb vfs/tresor_trust_anchor: fix alignment faults
Fixes alignment faults that occured in the AES256 implementations while
wrapping or unwrapping keys on imx53_qsb, imx6q_sabrelite, and imx7d_sabre.
The problem was that the unwrap_key/wrap_key functions did reinterpret casts
from unsigned char pointers to uint64_t pointers and then directly used the 64
bit values of referenced by the latter. Most probably this caused the compiler
to optimize operations in the assumption that the pointer is 8-byte aligned
which then created alignment faults.

As a solution, this commit changes the interface of the wrap_key/unwrap_key
functions to take uint64 pointers as arguments instead of unsigned char
pointers and then adapts the function users to ensure that they refer to
appropriately aligned memory regions.

Fixed #4932
2023-07-14 12:06:32 +02:00
Christian Helmuth
6e7b66cb8a Finally move __dso_handle into genode.ld
Issue #4784
2023-07-14 12:06:32 +02:00
Christian Helmuth
18c00e58cc tool: remove sel4 x86_32/pc and imx7-sabre artifacts
Issue #4918
2023-07-14 12:06:32 +02:00
Christian Helmuth
c84bbea1ca base-foc: avoid global ctor in Irq_session_component
Issue #4784
Issue #3509
2023-07-14 12:06:32 +02:00
Christian Helmuth
f6dcc3ca74 genode.ld: preserve ctors/dtors sections for analysis
Issue #3509
2023-07-14 12:06:32 +02:00
Josef Söntgen
317c5429d2 dde_bsd: decrease overall memory consumption
The initial memory backend implementation was brought over from DDE
Linux and was geared towards use-cases where a high-performing
allocator is useful. In case of the audio driver this is overkill
and since no other driver that could benefit from such an
implementation was ported in the meantime rather use a simpler
implementation that keeps the overhead down.

Fixes #4946.
2023-07-14 12:06:31 +02:00
Josef Söntgen
ff0ba89e91 dde_bsd: update mixer state report on HP sense
Issue #4946.
2023-07-14 12:06:31 +02:00
Norman Feske
fa3f5edcc2 base: remove deinit_heartbeat_monitoring function
Issue #4940
2023-07-14 12:06:31 +02:00
Norman Feske
f9bb7246ef base: remove destroy_signal_thread function
With the removal of the 'Entrypoint::schedule_suspend' mechanism, this
function is no longer called.

Issue #4940
2023-07-14 12:06:31 +02:00
Norman Feske
4193279560 base: remove entrypoint.cc from core
Since component.cc is no longer linked to core, we can also remove
entrypoint.cc, which was merely a dependency of component.cc.

Related to issue #4784
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
13e0710d20 os: remove i.MX GPIO drivers
Ref genodelabs/genode#4945
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
3d5ec9ea3f dde_linux: remove legacy imx6 usb host driver
Ref genodelabs/genode#4942
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
5e7e6514be Remove i.MX6 platforms from base repositories
Fix genodelabs/genode#4941
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
edcd44d9a7 lx_emul: shadow ARM-specific asm/uaccess.h file
Fix genodelabs/genode#4939
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
b15fd68b60 lx_emul: shadow the ARM-specific asm/domain.h file
Fix genodelabs/genode#4938
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
720d2847b6 lx_emul: correct the return value of clk_get
Fix genodelabs/genode#4937
2023-07-14 12:06:31 +02:00
Christian Helmuth
7563cf5c55 Remove blank lines between template<> and struct
The blank line disconnects the struct from its template definition,
which makes the whole definition harder to comprehend.
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
15b30f3547 sculpt_image: add MNT Reform2 as target board
Fix genodelabs/genode#4936
2023-07-14 12:06:31 +02:00
Christian Prochaska
2dd1365af3 monitor: separate 'monitor_gdb' run scripts
Fixes #4944
2023-07-14 12:06:31 +02:00
Christian Prochaska
5a2d4c3437 monitor: apply 'wx' policy
Fixes #4943
2023-07-14 12:06:31 +02:00
Norman Feske
6e03d731a2 base-linux: avoid global ctor in wait_for_exit
This patch replaces the global '_wait_for_exit_sem' object by a local
static variable, which does not rely on the global ctors. It thereby
fixes the fault_detection test after the removal of the global ctors
execution from core ("base: remove component.cc from core").

Issue #4784
2023-07-14 12:06:31 +02:00
Christian Helmuth
1a7ff195d9 pc_linux: enable EFI and EFI_STUB
With these options enabled comparative testing between pc_linux drivers
and bzImages becomes much easier on EFI-only machines. The impact on the
actual Genode drivers is minimal.
2023-07-14 12:06:31 +02:00
Christian Helmuth
e2ddcee440 lx_emul: prevent warning about unsused static func 2023-07-14 12:06:31 +02:00
Norman Feske
1139492c4f base: remove Entrypoint::schedule_suspend
Fixes #4940
2023-07-14 12:06:31 +02:00
Norman Feske
1fd1786122 test/lx_hybrid: don't call glibc exit
This patch removes the use of the Entrypoint::schedule_suspend mechanism
and the call of glibc's exit from the lx_hybrid tests, for two reasons.

First, the interplay of atexit handlers executed by the glibc and
Genode's lx_hybrid library is complicated while bringing no benefits in
practice as lx_hybrid applications are usually servers that don't exit
anyway.

Second, the Entrypoint::schedule_suspend mechanism in not used by any
other component. By removing its use from the lx_hybrid tests, we can
remove this mechanism from the base library.

Issue #4940
2023-07-14 12:06:31 +02:00
Norman Feske
e2836bf68a ldso: remove deprecated support for legacy 'main'
Besides the removal of the legacy 'main' support, this patch simplifies
the lib/startup/_main.cc.

Issue #2199
2023-07-14 12:06:31 +02:00
Josef Söntgen
1d82a049bf nvme: address conversion warnings
This commit removes the CC_CXX_WARN_STRICT_CONVERSION suppressor
and address the resulting warnings.

Fixes #4935.
2023-07-14 12:06:31 +02:00
Norman Feske
7e1a2ac684 base: remove internal use of 'env_deprecated'
Fixes #4784
2023-07-14 12:06:31 +02:00
Norman Feske
de99945af0 base: pass 'Platform &' to 'bootstrap_component'
This eliminates the need of component.cc to pull the platform resources
out of thin air (calling 'env_deprecated()').

Issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
415d4ab23d startup: merge init_main_thread.cc into _main.cc
This makes the interplay of 'init_main_thread', 'init_platform',
'_main', and 'bootstrap_component' easier to follow.

Issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
7093258649 base: move 'prepare_init_main_thread' to Genode::
Issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
3f9698a292 base: remove component.cc from core
Issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
3a8c3dcc2d base: unify platform.cc between base, base-linux
This is a preparatory step for merging 'init_platform()' with
'bootstrap_component()'.

Issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
54cc70f9b1 base: remove Env arg from init_exception_handling
By supplying only the parts of the Env that are actually relevant for
initializing the cxx heap, we avoid the need for the 'Env' interface.
The patch also moves the call of 'init_ldso_phdr' to the outside
of the cxx library because it does not belong there.

Issue #4784
2023-07-14 12:06:31 +02:00
Christian Prochaska
59ce64b638 monitor: handle Monitored_thread case in kill_thread()
Fixes #4934
2023-07-14 12:06:31 +02:00
Christian Prochaska
8264b63e0b core: replenish UTCB quota in exception case
Fixes #4933
2023-07-14 12:06:31 +02:00
Christian Helmuth
ea294fff0c lx_emul: fix unplug of unclaimed USB devices
USB devices that are never associated to client sessions lack
usb_per_dev_data (and a kernel thread). Therefore, the devices should be
discontinued directly on unplug as no URBs can be pending.

Issue genodelabs/genode#4795
2023-07-14 12:06:31 +02:00
Josef Söntgen
afaabb3121 pc_nic_drv: add R8169 driver
This commits enables the R8169 driver and was tested with two
RTL8168h/8111h (10ec:8168 rev 0x15 sub 1462:7a38 / 1d05:109f) and
two equal RTL8125B (10ec:8125 rev 0x5 sub 1458:e000) devices
running Sculpt.

Firmware loading is for now not implemented but specific Linux
commits suggest it could be necessary. However, doing so will be
post-poned until we have gathered more experience with the driver.

Restarting the driver might lead to the following IOMMU error
messages but the device seems to work anyway:

[ 0] IOMMU:0xffffffff817ec040 FR:0x8a00000000002500 FI:0xfffffffdf8d30000 type:0x8 BDF:25:00.0
[ 0] IOMMU:0xffffffff817ec040 FR:0x2000004200002500 FI:0x000c21b0 type:0x2 BDF:25:00.0
[ 0] IOMMU:0xffffffff817ec040 FR:0x2020004200002500 FI:0x000c21a0 type:0x2 BDF:25:00.0
[ 0] IOMMU:0xffffffff817ec040 FR:0x2020004200002500 FI:0x00138000 type:0x2 BDF:25:00.0
[…]
[ 0] IOMMU:0xffffffff817ec040 FR:0x8a00000000002500 FI:0xfffffffdf8d30000 type:0x8 BDF:25:00.0
[ 0] IOMMU:0xffffffff817ec040 FR:0x2020004300002500 FI:0x00124000 type:0x2 BDF:25:00.0

Issue #4921.
2023-07-14 12:06:31 +02:00
Josef Söntgen
1996041dcc pc_linux: update initcall order for pc_nic_drv
Issue #4921.
2023-07-14 12:06:31 +02:00
Josef Söntgen
18c23ddb0c pc_linux: enable R8169
Issue #4921.
2023-07-14 12:06:31 +02:00
Christian Helmuth
2232b33b8e pci_decode: limit bus parsing to subordinate buses
While this approach still scans "holes" in the bus range, it stops
scanning at the maximum subordinate bus number reachable from the base
PCI bus at the host bridge. Startup under Qemu no longer takes about 12
seconds for scanning 256 buses.
2023-07-14 12:06:31 +02:00
Norman Feske
0ab69a2bb8 base: de-duplicate src/lib/base/platform.cc
By splitting the 'init_capability_slab()' implementation to a separate
compilation unit 'capability_slab.cc', base-hw no longer needs a
customized version of 'lib/base/platform.cc'.

Related to issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
6e30d00eef base: remove env_deprecated from signalling code
Issue #4784
2023-07-14 12:06:31 +02:00
Christian Helmuth
ee564125df Replace ipxe_nic_drv by pc_nic_drv in run scripts
Issue #4921
2023-07-14 12:06:31 +02:00
Christian Helmuth
8ecbc48211 sculpt: replace ipxe_nic_drv by pc_nic_drv
Issue #4921
2023-07-14 12:06:31 +02:00
Christian Helmuth
48cc8fb657 drivers_nic-pc: replace ipxe_nic_drv by pc_nic_drv
Also, the configuration enables MAC-address reporting and includes a
verbose mac_report_rom.

Issue #4921
2023-07-14 12:06:27 +02:00
Christian Helmuth
d258422c34 pc_nic_drv: ethernet NIC driver based on Linux 6.1
Fixes #4921
2023-07-14 12:05:54 +02:00
Christian Helmuth
8de0d8d4e0 pc_linux: update initcall order for pc_nic_drv
Issue #4921
2023-07-14 12:01:19 +02:00
Christian Helmuth
36c1dc16d4 pc_linux: enable e1000, e1000e, pcnet32
Issue #4921
2023-07-14 12:01:19 +02:00
Norman Feske
3489672bc0 base: remove env_deprecated from thread-start code
This patch replaces the internal use 'env_deprecated()' from the
implementation of the thread API in the base library. It also
replaces the global accessor 'main_thread_cap' by the explicit
propagation of the main-thread's capability to the single point of
use via a new 'init_thread_bootstap' function.

Issue #4784
2023-07-14 12:01:19 +02:00
Josef Söntgen
adf0b893e8 lx_kit: add random dummy back end
This back end can be used in place of the existing jitterentropy based
on in case random is not strictly needed by the component but one
wants to use the available 'shadow/drivers/char/random.c'
implementation.

Issue genodelabs/genode-allwinner#21.
2023-07-14 12:01:19 +02:00
Alice Domage
943c9809ed depot_remove.run: replace x86_64 by [depot_spec]
This change makes the run script compatible with all CPU architectures.

Issue genodelabs#4866
2023-07-14 12:01:19 +02:00
Josef Söntgen
c888fcbdd9 lx_emul: implement __get_random_u32_below
The implementation was already part of the Zynq's sd_card driver and
since other ARM drivers need it as well, promote it to the common
shadow library.

Issue genodelabs/genode-allwinner#21.
2023-07-14 12:01:19 +02:00
Josef Söntgen
7109b80bbd dde_linux: enable -gnu11
The option is default since 5.18 and several compilation units
require it.

Issue genodelabs/genode-allwinner#21.
2023-07-14 12:01:19 +02:00
Stefan Kalkowski
098bc66fc9 usb genode_c_api: reduce config report updates
Prevent unnecessarty config report updates, if a new USB device gets reported.

Fix genodelabs/genode#4929
2023-07-14 12:01:19 +02:00
Christian Helmuth
0a28df8805 lx_emul: skb_init() in lx_emul_init_task_function()
Issue #4921
2023-07-14 12:01:19 +02:00
Martin Stein
abe163c335 tresor: do not use on-disc-layouted structs
* Removes all previous structs that represented an on-disc block layout
  and were therfore subject to a number of layout restrictions (packed,
  padding members, enum representations, etc.).
* Adds a replacement struct without any layout restrictions for each of the
  removed structs. The new structs are named similar to the old structs.
* Adds block encoding and decoding utilities for easily converting from the
  new structs to on-disc blocks and vice-versa (Block_scanner, Block_generator,
  T::decode_to_blk, T::encode_from_blk)
* Adapts all affected places in the library to encode and decode proberly
  instead of simply casting pointers.
* Thereby cleans up the hashing utilities to use typed-reference args instead
  of void pointers.
* Re-enables run/tresor_tester and test-file_vault_vonfig_report for platforms
  rpi, imx53_qsb, imx53_qsb_tz, imx6q_sabrelite, imx7d_sabre.

Ref #4819
2023-07-14 12:01:19 +02:00
Martin Stein
434a4db637 lib/net: no color coding in packet print methods 2023-07-14 12:01:18 +02:00
Martin Stein
bf18ffbbdd lib/net: enable strict warnings
Enables strict warnings in the net lib and fixes all related compile errors.

Fixes #4924
2023-07-14 12:01:18 +02:00
Martin Stein
c907e44a02 register framework: read bitfields to fitting uint
* Replaces bool access types with uint8_t access types
* Ensures, that the framework always uses the smalles possible uint type
  for the return value wherever a bitfield is read and returned to the user.

Ref #4924
2023-07-14 12:01:18 +02:00
Norman Feske
79e262921e depot: update recipe hashes 2023-06-16 11:24:26 +02:00
Timo Nicolai
0a81bd5d5a depot_download_manager: fix verifying failed download
In some instances, the fetchurl progress determined by
depot_download_manager will be empty when the download fails (e.g. due
to a 404), this commit fixes a bug where this would be interpreted as
the download having completed which would subsequently start hash
verification of a package that has never actually been downloaded.

Fixes #4919
2023-06-16 11:24:26 +02:00
Christian Helmuth
c09b4ba46b depot: recipe for acpi_event 2023-06-16 11:24:26 +02:00
Johannes Schlatow
6e607349e1 depot: add black_hole and fonts_fs to pkg/goa
Goa now makes use of the black-hole component and has been enabled to provide
a fonts_fs.

genodelabs/genode#4928
genodelabs/goa#42
2023-06-16 11:24:26 +02:00
Alice Domage
fb0e8fffa2 New depot_remove component
The depot_remove component can delete PKG archives with
automatically resolving dependencies and deleting archives that are not
required on the system anymore.

Issue genodelabs#4866
2023-06-16 11:24:26 +02:00
Martin Stein
40338f9acb ping*.run: raise test timeout
On some platforms (x86_32/pistachio, x86_64/sel4) system startup is slow
and the previously configured 30 seconds not sufficient. With this commit, the
timeout is raised to 60 seconds only when running on such a platform.

Ref #4923
2023-06-16 11:24:26 +02:00
Martin Stein
21d4b8aba0 nic_router_disable_arp.run: raise test timeout
The previous, rather small timeout of 30 seconds caused problems on
x86_64/sel4.

Ref #4923
2023-06-16 11:24:26 +02:00
Martin Stein
62db70e2ea nic_router_dhcp: raise test timeout
It seems that the previous rather small timeout of 35 seconds caused problems
with our nightly tests on fiasco/x86_32.

Fixes #4923
2023-06-16 11:24:26 +02:00
Martin Stein
563f55e57b nic_dump.run: relax test procedure
This test was originally a copy of ping.run and therefore unnecessarily
inherited all its complexity for testing ping component behavior. Additionally,
ping.run was more actively maintained and evolved over time whereas
nic_dump.run didn't receive the same care. Now, the test fails on certain
platforms although NIC dump works just fine. Therefore, this commit reduces the
test behavior to what is really necessary for testing nic_dump and by doing so,
also fixes the failing targets.

Fixes #4926
2023-06-16 11:24:26 +02:00
Martin Stein
45e5a33b26 sd_card.run: fix broken config and automate
Fixes #4925
2023-06-16 11:24:26 +02:00
Martin Stein
cc99646b23 nic_router_flood.run: adjust success condition
On x86_32 okl4, the test timed out although the test timeout was already at
240 seconds for this platform. Instaed of raising it further, this commit
reduces the number of ping rounds for all platforms that are considered as
slower by the test.

Ref #4923
2023-06-16 11:24:26 +02:00
Norman Feske
e8ee2cc227 tool_chain_auto.run: incr. stack size for x86_32 2023-06-16 11:24:26 +02:00
Norman Feske
f789c8152c stdcxx: add missing symbol
Needed for building noux_pkg/gcc_x86 for x86_32 when using the
compiler's default optimization level (not Genode's default CC_OLEVEL).
2023-06-16 11:24:26 +02:00
Norman Feske
70cf9fe3dd doc/news.txt: grammar fix 2023-06-16 11:24:26 +02:00
Christian Helmuth
98cbfa3561 genode_c_api: MAC address reporter utility
Issue #4918
2023-06-16 11:24:26 +02:00
Christian Helmuth
29b441c6fa net: const Network_address source buffer
Issue #4918
2023-06-16 11:24:26 +02:00
Norman Feske
a27e46989f tool_chain_auto.run: use [build_artifacts]
The run script used to miss a few build targets for boot modules
specified at the 'build_boot_image' step.
2023-06-16 11:24:26 +02:00
Norman Feske
57b66987dd mk/gnu_build.mk: declare .tar as BUILD_ARTIFACTS
This way, run scripts using GNU build targets can use the result of
[build_artifact] for the 'build_boot_image' step.
2023-06-16 11:24:26 +02:00
Sebastian Sumpf
d7440a8b1c tool/ports/current: use silent option for GNU Make 4.4
If this file is called from a Makefile via

! $(shell <path>/tool/ports/current qt5-host)

'shell' will return

"Entering directory '' <path-to-libc> Leaving directory '' Stop.",

and thus, producing multiple targets in the 'tool_chain_qt5' case.

issue #4725
2023-06-16 11:24:26 +02:00
Norman Feske
3c5d27506f base: stricter distinction between rx and rwx
This patch restricts 'Region_map::attach_executable' to create read-only
mappings, while offering the option to map the full rights using a new
'attach_rwx' method.

The 'attach_rwx' method is now used by the dynamic linker to explicitly
attach the linker area with full rwx rights. With the old page-fault
handling code, the execute flag was evaluated only for leaf dataspaces,
not for managed dataspaces while traversing region-map hierarchies.
With the new page-fault handling code, the execute bit is downgraded
to no-execute when passing a managed dataspace that is not attached
as executable.

Issue #4920
2023-06-16 11:24:26 +02:00
Norman Feske
a4c59c03e3 core: rework page-fault resolution
The change "core: allow offset-attached managed dataspaces" addressed a
corner case of the use of nested region maps. Apparently, this change
negatively affects other scenarios (tool_chain_auto).

In order to confidently cover all the differnt situations, this patch
reworks the page-fault resolution code for improved clarity and safety,
by introducing dedicated result types, reducing the use of basic types,
choosing expressive names, and fostering constness.

It also introduces a number of 'print' hooks that greatly ease manual
instrumentation and streamlines the error messages printed by core.
Those messages no longer appear when a user-level page-fault handler
is reistered for the faulted-at region map. So the monitor component
produces less noise on the attempt to dump non-existing memory.

Issue #4917
Fixes #4920
2023-06-16 11:24:26 +02:00
Norman Feske
65d3b3a32f base-linux: build fix for BOARD=pc
This is a follow-up commit to "base: remove internal use of format
strings".

Issue #2064
2023-06-16 11:24:26 +02:00
Norman Feske
47fa54992f run/libc_vfs_filesystem_test: adjust caps for sel4
Fixes libc_vfs_fs_ext2 and libc_vfs_fs_fat on x86_64/qemu/sel4.
2023-06-16 11:24:26 +02:00
Norman Feske
6af42c9fb5 test-sanitizer: simplify, increase caps for sel4 2023-06-16 11:24:26 +02:00
Christian Helmuth
54a549d808 lx_emul: move arch_atomic64_add_return to dde_linux 2023-06-16 11:24:26 +02:00
Norman Feske
6a57683e52 New debug monitor
The new monitor component at os/src/monitor is the designated successor
of the gdb_monitor. This initial version, however, implements only the
subset needed to inspect the memory of the monitored component(s).

In contrast to the gdb_monitor, the new component supports the monitoring
of multiple components, leveraging the sandbox API. It can therefore be
used as a drop-in replacement for the init component. Like the gdb_monitor,
the new monitor speaks the GDB protocol over Genode's terminal session.
But the protocol implementation does not re-use any gdbserver code,
sidestepping the complexities of POSIX.

There exist two run scripts illustrating the new component. The
os/run/monitor.run script exercises memory inspection via the 'm' command
by letting a test program monitor itself. The os/run/monitor_gdb.run
script allows for the interactive use of GDB to interact with monitored
components.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
65f65073e6 sandbox: allow supplemental config nodes
Let the sandbox library disregard all unknown config sub nodes so that
supplemental information - like the monitor policy configuration - is
not interpreted as a misconfiguration ("unknown config element type ...").

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
add6dbac4e sandbox: add Pd_intrinsics::start_initial_thread
This hook allows for intercepting the creation of initial threads
whenever a new child is started.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
0d5571a820 base: close PD session last when destructing child
This patch moves the destruction of the child's PD session after the
closing of all other sessions because the PD session's role as resource
container might still be needed for orderly reverting the session quotas
when closing the other remaining sessions.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
734fc252e8 base: add Child_policy::start_initial_thread
The added interface allows for the local interception of
'Cpu_thread::start' RPC calls.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
f2153f9b2f sandbox: allow for customized PD access
By default, the sandbox uses the Env::pd() as reference PD session of
the sandbox children.

However, to accomodate use cases where the interplay of the reference
PD session and the child's address space needs to be intercepted, this
patch adds a constructor that takes an interface for the controlled
access of PD intrinsics as argument.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
30b70da6c1 base/child.h: Child_policy::with_address_space
This patch replaces the former 'address_space' accessor by a new
'with_address_space' interface that grants access to the region map of
the child's address space, but limits the interface lifetime to the
scope of the caller.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
f47c64e246 core: allow offset-attached managed dataspaces
This patch adds the missing application of the region offset to the
resolution of page faults inside managed dataspaces, which resulted in
an unexpected "invalid mapping" message after attaching a managed
dataspace with an offset.

This limitation could be observed during the implementation of the debug
monitor that locally maps a portion of the debugging target's address
space, e.g., a view port of 16 MiB. All traditional uses of managed
dataspaces (e.g., stack area, linker area) happened to attach the
managed dataspaces from their beginning.

Issue #4917
2023-06-16 11:24:26 +02:00
Sebastian Sumpf
3e0e86f720 mesa: remove 'printf' from 'iris_bufmgr_tmp.patch'
also rename it to 'iris_bufmgr_fd.patch'

issue #4916
2023-06-16 11:24:26 +02:00
Sebastian Sumpf
e3c2fdf414 gpu/intel: enable GPU reset for GEN(8)/9/12
* add semaphore command to ring in order to be able to stop ring
  execution before reset (Wa KabyLake)
* implement reset sequence as done by the Linux driver
* reset ring and cancel job of vgpu causing hang
* lower watchdog timeout 1000ms -> 200ms
* improve scheduling of vgpus so progress after reset is made
* improve the generation chaos a little
* tested on Skylake, Kaby Lake, Tiger Lake

issue #4916
2023-06-16 11:24:26 +02:00
Alexander Boettcher
b599f4e106 sel4: stop thread on alignment fault
by not replying to the IPC. Otherwise, endless alignment faults are triggered,
seen on imx6q Sabrelite and usb_hid_raw.
2023-06-16 11:24:26 +02:00
Alexander Boettcher
530ec3115f sel4/x86: remove Nehalem kernel config adjustment
since the used Genode Qemu model now supports it.
2023-06-16 11:24:26 +02:00
Martin Stein
dea53f635f Refine tresor tests
* Use jitterentropy only if supported.
  On certain targets like pbxa9 or zynq_qemu, the performance counter always
  yields 0, which renders jitterentropy unusable. On these platforms, the
  Tresor tests now use a static value as entropy source instead.

* Adds a new package test-file_vault_config_report_no_entropy that is used by
  the Depot Autopilot on targets without jitterentropy support instead of
  test-file_vault_config_report. The only difference between the two packages
  is the value of the above described new config attribute of the File Vault.

* Circumvent alignment fault.
  The Tresor lib for now has the deficiency of using on-disc data structures
  directly in code instead of decoding them first to unpacked, naturally
  aligned structures. This causes problems with memory-access alignment on
  several platforms (rpi, imx6q_sabrelite, imx53_qsb, imx7d_sabre). As fixing
  this properly is a bit of work, the commit disables the tresor_tester and
  file_vault_config_report test on the affected platforms in autopilot mode for
  now.

* Further adjustments
  * Make benchmarks optional
  * Use a smaller tresor for rekeying
  * Clean up image parameters
  * No use implicit routes/resources
  * Reduce ram consumption
  * Reduce test timeout
  * Raise cap quota, required for sel4 x86_64.

Ref #4819
2023-06-16 11:24:26 +02:00
Martin Stein
5800ab4961 vfs/tresor_trust_anchor: remove debug mode
The debug mode turned out to be unnecessry because the plugin can be simply
replaced with an <inline> file VFS plugin that has a content size of 32 bytes.

Ref #4819
2023-06-16 11:24:26 +02:00
Martin Stein
03d7258d33 tresor: better handling of hash mismatches
Instead of throwing an uncaught exception, the corresponding request is marked
failed.

Ref #4819
2023-06-16 11:24:26 +02:00
Martin Stein
7c5c92351e file_vault: compatibility with 21.05 containers
* Fix minimum passphrase size to be the same as with File Vault 21.05.
* Adapt to different image name of File Vault 21.05.

Ref #4819
2023-06-16 11:24:25 +02:00
Martin Stein
80b729703b file_vault_config_report tests: fix for pistachio
* relaxes the timing and reduces the test steps because pistachio is quite
  slow and would otherwise trigger problems with our easy approach of using a
  dynamic rom instead of a proper manager

* provide IO_PORT and IRQ session to timer driver

Ref #4819
2023-06-16 11:24:25 +02:00
Josef Söntgen
194af03fe9 autopilot.list: replace cbe with tresor tester
Issue #4819.
2023-06-16 11:24:25 +02:00
Martin Stein
c40205e93f pkg/test-file_vault_config_report: minor style fix
Ref #4819
2023-06-16 11:24:25 +02:00
Martin Stein
d9dd518a20 pkg/file_vault: fix missing fs route
The File System route for the Tresor Init sub-component was somehow missing.

Ref #4819
2023-06-16 11:24:25 +02:00
Alexander Boettcher
ceaa02230e qemu: set default cpu model for x86_64 explicitly
With the update to sel4 and the gcc 12, assembly instructions are generated
and used, like POPCNT. The instruction is available on our native hardware,
but not emulated by the default cpu model necessarily, which leads to
undefined opcode exceptions (Qemu 4.2.1 && seL4). Additionally, the features
of the default Qemu cpu model may vary between Qemu releases and makes it
harder to correlate effects.
2023-06-16 11:24:25 +02:00
Martin Stein
e0dc544aa5 tool: add qemu run opts for zynq_qemu
Ref #4819
2023-06-16 11:24:25 +02:00
Christian Helmuth
6cb697e6d8 base: remove ancient artifact of config library
The config library was removed in issue #2431 in 2017.
2023-06-16 11:24:25 +02:00
Norman Feske
250c16ddcf os/path.h: fix misleading comments
Issue #4708
2023-06-16 11:24:25 +02:00
Christian Helmuth
4a15621dc8 libc: warn about unsupported RTLD_GLOBAL in dlopen()
Fixes #3779
2023-06-16 11:24:25 +02:00
Christian Helmuth
7441548458 Configure ld soname also for lib.so files
Fixes #4914
2023-06-16 11:24:25 +02:00
Alexander Boettcher
11764ed755 core: remove io_mem attachments before destruction
The attachment removal is triggered actually on _ds member destruction time,
but after the io_mem representation for the specific base-<platform> possibly
vanished already during _unmap_local in the ~Io_mem_dataspace. This creates
on base-sel4 several kernel warnings about invalid capabilities.

Issue #4913
2023-06-16 11:24:25 +02:00
Alexander Boettcher
b349dd9c0a sel4: convert io memory on demand
instead all during boot. On x86 and qemu this takes quite a while until
the system is booted.

Fixes #4913
2023-06-16 11:24:25 +02:00
Stefan Kalkowski
97bf616b5b lx_emul: fix rcu_needs_cpu() for older kernels
Resolves observed regression for the older usb host drivers (< linux
version 5.18).

Ref genodelabs/genode#4798
2023-06-16 11:24:25 +02:00
Norman Feske
6f4242f03b sculpt: version 23.06
Increase version due to upcoming binary incompatibility with 23.04.
2023-06-16 11:23:57 +02:00
Michael Mueller
2c5ebb131c Makefile for Hoitaja. 2023-06-13 18:52:04 +02:00
Michael Mueller
a72727fd45 Defined method prototypes for the internal interfaces of Hoitaja. 2023-06-13 18:51:25 +02:00
Michael Mueller
aa183af6a4 Added run script to produce dry-run output for VSCode. 2023-06-13 18:47:58 +02:00
Michael Mueller
1f7bfe1426 Benchmarks to evaluate cost of resource yield requests and resource allocation notifications. 2023-06-13 18:46:55 +02:00
Michael Mueller
c1b8001cb9 Small test app for new resource allocation interface. 2023-06-13 18:44:59 +02:00
Michael Mueller
5c13d93050 Refactored sandbox implementation to make its functionality available to alternative implementations of Init, e.g. Hoitaja. 2023-06-13 18:44:04 +02:00
Michael Mueller
04264bc678 Fixed bug in enumeration of performance counters. 2023-06-13 18:40:38 +02:00
Michael Mueller
fb03597775 Updated symbol table to include new symbols for class Child. 2023-06-13 18:40:07 +02:00
Michael Mueller
c72849ee95 Provide children with information about what new resources have been allocated. 2023-06-13 18:39:23 +02:00
Michael Mueller
d72527809b Updated NOVA. 2023-06-01 15:52:26 +02:00
Christian Helmuth
716579b12f version: 23.05 2023-05-31 12:09:19 +02:00
Norman Feske
df25d23eb9 News item for version 23.05 2023-05-31 12:09:19 +02:00
Norman Feske
66c3463749 Release notes for version 23.05 2023-05-31 11:10:25 +02:00
Christian Helmuth
dfc1b97fa2 depot: update recipe hashes 2023-05-31 09:42:19 +02:00
Christian Helmuth
d6f65901f9 Add trace policy binary to BUILD_ARTIFACTS 2023-05-30 17:00:01 +02:00
Stefan Kalkowski
5253d4ddd7 platform_drv: dissolve shared irq session
Fix genodelabs/genode#4912
2023-05-30 16:32:22 +02:00
Sebastian Sumpf
2dbf3322d8 dde_rump: fix rump recipe for RISC-V
issue #4800
2023-05-30 16:01:03 +02:00
Martin Stein
798e3ee306 file_vault: fix deinit fs in tresor vfs
Ref #4819
2023-05-30 12:26:01 +02:00
Christian Helmuth
583f2d6a36 depot: update recipe hashes 2023-05-30 12:13:34 +02:00
Christian Helmuth
c1104ccbc7 depot_autopilot: skip file_vault on riscv and rpi
Issue #4819
2023-05-30 12:13:34 +02:00
Benjamin Lamowski
e882ca748d base-hw: virt: implement support for SVM
Ref #4826
2023-05-30 12:13:34 +02:00
Benjamin Lamowski
b277b84e19 base: extend Vcpu_state for base-hw x86 virtualization
Changes are preliminary and will most certainly be removed when fully
enabling the virtualization feature on base-hw.

Ref #4826
2023-05-30 12:13:34 +02:00
Benjamin Lamowski
1e3836f8b5 base-hw: pass generic Vm_data structure to the kernel object
This enables passing additional data structures to the kernel on x86.

Ref #4826
2023-05-30 12:13:34 +02:00
Benjamin Lamowski
312b638220 base-hw: export Intel TSC platform information
Export TSC invariant and the frequency reported on Intel processors.
Currently lacks TSC calibration and reports a fixed frequency on AMD.

Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
c75b07e0fd base-hw: SVM: allow execute on NPT mappings
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
cb69c59fa3 base-hw: implement VMCB data structure for AMD SVM
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
fa6e819f9a base-hw: x86: use Vcpu_state as Vm_state
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
0a819d5e19 base-hw: add MSR and CPUID registers for AMD SVM
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
e11ed069bf base-hw: fix x86 CPUID register width
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
7477f99d05 base-hw: x86: detect CPU Vendor and SVM support
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
6ca7119267 base-hw: copy virtualization structure for x86_64
Ref #4826
2023-05-30 12:13:33 +02:00
Norman Feske
256a989550 base-nova: update include guard 2023-05-30 12:13:33 +02:00
Norman Feske
34c7085ada sculpt.run: whitespace 2023-05-30 12:13:33 +02:00
Stefan Kalkowski
30e0452faf sculpt: increase sculpt_manager's cap quota
Fix genodelabs/genode#4911
2023-05-30 12:13:33 +02:00
Stefan Kalkowski
435c9719a7 sculpt: support for wifi on MNT Reform 2
Fix genodelabs/genode#4908
2023-05-30 12:13:33 +02:00
Alexander Boettcher
d92bd3afee sel4: update to 12.1.0 release
Fixes #4910
2023-05-30 12:13:33 +02:00
Alexander Boettcher
7351aa1670 sel4: remove x86_32/pc and imx7-sabre
The imx7 is not supported officially [0] anymore and the 32bit pc version is
not used nor intended to be used.

https://github.com/seL4/seL4/issues/254

Issue #4910
2023-05-30 12:03:34 +02:00
Christian Helmuth
22bee79534 port/metadata: improve info for multi-source ports
Now, ./tool/ports/metadata dde_linux produces the following output.

  PORT:     dde_linux
  LICENSE:  GPLv2
  VERSION:  individual (see sources)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.3.tar.xz VERSION 4.4.3 (lxip)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (fec)
  SOURCE:   https://github.com/cproc/dwc_otg.git git r5 (dwc_otg_host)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_host)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_hid)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_modem)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_net)

Issue #4685
2023-05-30 12:03:34 +02:00
Christian Helmuth
5a97297282 fiasco: gather patch files with sort + wildcard
Using $(shell find $(REP_DIR)/patches -name *.patch) fails if the
current working directory contains *.patch files due to shell wildcard
expansion before execution. Additionally, the patch list was unstable
because it was not sorted resulting in divergent hashes.
2023-05-30 12:03:33 +02:00
Benjamin Lamowski
80c8775d77 base: make Entrypoint available in Vcpu_handler_base
Fixes #4906
2023-05-30 12:03:33 +02:00
Stefan Kalkowski
1c790b2776 lx_emul: use alternative initcall for pci on ARM
On platforms different than x86 the subsys initcall `pci_subsys_init`
is not available. Therefore, we choose an alternative one here.

Fix genodelabs/genode#4907
2023-05-30 12:03:33 +02:00
Stefan Kalkowski
0aef0959d5 hw: catch all cache lines for mis-aligned addresses
Fix genodelabs/genode#4905
2023-05-30 12:03:33 +02:00
Christian Helmuth
6b2338257d Let linker assume stacks are non-executable
In our binaries, the .note.GNU-stack section is missing, which is okay
as we do not interpret these sections anyway and map stack pages
non-executable per default.

Issue #4827
2023-05-30 12:03:33 +02:00
Norman Feske
823349fffb libc: make libc-plugin headers private to libc
Fixes #4904
2023-05-30 12:03:33 +02:00
Norman Feske
e1e26c4439 libports: update doc/libc.txt 2023-05-30 12:03:33 +02:00
Christian Prochaska
b1be660c7b libusb: remove use of obsolete libc-plugin interface
Fixes #4854
2023-05-30 12:03:33 +02:00
Martin Stein
8992dadb15 libports: remove unused libsparkcrypto
The main user of libsparkcrypto in the past was the CBE block encryption
ecosystem. However, the CBE was replaced with the Tresor block encryption that
uses libcrypto instead.

Ref #4819
2023-05-30 12:03:33 +02:00
Josef Söntgen
497c8b0922 wifi: provide WPA3-personal support
This commit introduces preliminary support for joining networks secured
via WPA3-personal. So far it was only tested with the one OpenWRT AP
configured for WPA3 (see excerpt below) where it WPA3-only as well as
WPA2/WPA3 mixed worked fine.

Scan results excerpt:

00:11:22:33:44:55    5180    -45     [WPA2-SAE-CCMP][SAE-H2E][ESS][UTF-8]    PewPew
00:11:22:33:44:55    2412    -67     [WPA2-PSK+SAE+PSK-SHA256-CCMP][SAE-H2E][ESS][UTF-8]     PewPew2

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
cfd3be675f pc_wifi: enable RTL8192CE support in rtlwifi
Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
dc178e0ab2 dde_linux: enhance KBUILD_MODNAME generation
It turns out solely relying on the name of the compilation-unit
is not enough. In at least one multi-device driver, e.g. rtlwifi,
an equally called compilation-unit is found in several different
directories. There KBUILD_MODNAME is used to name the driver,
which fails later on as the driver framework refuses to register
an equally named driver twice.

Instead of only considering the name of the compilation-unit also
include the last element of the path to generate differentiating
KBUILD_MODNAME value.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
0e82322605 pci_decode: force GSI for ath9k device
As noted in 'wifi/pc: add ath9k driver' it appears the tested device
only works with GSIs.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
22c9157231 wifi: add RFKILL notification interface
Add somewhat cosmetic changes to the RFKILL interface used between
the management layer and the driver library to make the intent clear.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
6b406469f6 dde_linux: remove unused var from libnl_include
Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
080b0fb9b3 dde_linux: update wpa_supplicant to version 2.10
The supplicant is updated to the current release and is now downloaded
as archive rather than pulled from git. For the time being 'libnl' is
still kept at 3.2.25 as the current 3.7.0 release relies on more Linux
infrastructure that our integration does not provide.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
ea0a692879 wifi: get firmware from tar archive
This commit changes the firmware handling from requesting each
firmware file as a ROM module that is checked against a list of
known images (including their size) to requesting each file via
the local VFS of the 'wifi_drv'. This allows for using the original
probing mechanism that tries to select a matching firmware version.

The 'repos/dde_linux/src/drivers/wifi/README' file contains more
detailed information on how to configure the driver.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
3ba070e5e4 pc_wifi: implement __crypto_xor generated dummy
This function is called when decrypting RX frames on the CPU on 32 bit
platforms. Since the frames are normally decrypted by the wireless LAN
device and this code path is triggered rather infrequently the byte-wise
implementation should not pose a performance risk.

So far it was only encounter with a 7260 device when running netperf.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
d5710d9de3 Move 'wifi' driver to dde_linux repository
The bulk of the driver code now lives in the 'dde_linux' repository,
which is available on all platforms, from where it can be referenced by
other repositories.

The 'wifi_drv' binary was delegated to a generic harness that includes
all configuration and management functionality shared by all wireless
device driver components, e.g., the wpa_supplicant. The code of the
device driver emulation environment is located in 'src/lib/wifi'. It
is referenced by the platform-specific driver library that resides in
the corresponding platform repository. The runtime configuration needs
to point the driver to proper driver library.

The platform-specific library is in charge of orchestrating the contrib
source utilized by the driver as well as providing the 'source.list'
and 'dep.list' files. It must include the generic library snippet
'repos/dde_linux/lib/wifi.inc' that deals with managing the emulation
environment code.

The 'repos/dde_linux/src/drivers/wifi/README' file contains more
detailed information on how to deploy the driver.

Issue #4861.
2023-05-30 12:03:32 +02:00
Josef Söntgen
6727b5ea49 dde_linux: promote PC specific additions
Issue #4861.
2023-05-30 12:03:32 +02:00
Martin Stein
aeb65d6b1b file_vault: version 23.05
* ARM support and detaching from Ada/SPARK

  * Remove all CBE-related code - especially the Ada/SPARK-based CBE library.

    * We have no means or motivation of further maintaining big projects in
      Ada/SPARK (the core Genode team is native to C++).

    * The Genode Ada/SPARK toolchain and runtime don't support ARM so far - an
      important architecture for Genode. This would mean extra commitment in
      Ada/SPARK.

    * We realize that block encryption more and more becomes a fundamental
      feature of Genode systems.

  * Implement a new block encryption library named Tresor that is inspired by
    the design and feature set of the former CBE library and that is entirely
    C++ and part of the Genode gems repository.

    * The Tresor block encryption is backwards-compatible with the on-disk
      data layout of the former CBE block encryption.

    * Except from the snapshot management and the "dump" tool, the Tresor
      block encryption provides the same feature set as the former CBE block
      encryption and accepts the same user requests at the level of the
      Tresor library API.

    * So far, the Tresor block encryption does not support the creation of
      user-defined snapshots.

    * In contrast to the former CBE, the Tresor ecosystem has
      no "dump" tool beause with the CBE library it turned out to be rarely of
      use.

    * In contrast to the Block back-end of the CBE "init" tool, the Tresor
      "init" tool uses a File System back-end.

    * The former CBE VFS-plugin is replaced with a new Tresor VFS-Plugin.

      * The Tresor-VFS plugin in general is similar to the former CBE VFS but
        has a slightly different API when it comes to re-keying and re-sizing.
        Each of these operations now is controlled via two files. The first
        file is named <operation> and the user writes the start command to it.
        The user must then read this file once in order to drive the operation.
        The read returns the result of the operation, once it is finished.
        The second file is named <operation>_progress and can be watched and
        read for obtaining the progress of the operation as percentage.

    * The file vault is adapted to use the new Tresor ecosystem
      instead of the former CBE ecosystem and thereby also gains ARM support.

    * The former CBE tester and CBE VFS-tests are replaced by equivalent
      Tresor variants and are now run on ARM as well (testing with a persistent
      storage back-end is supported only when running on Linux).

    * So far, the new Tresor block encryption has no internal cache for meta
      data blocks like the former CBE.

* Add config/report user interface

  * Add a second option for the administration front end to the file vault
    named "config and report". With this front end the File Vault communicates
    with the user via XML strings. A ROM session is requested for user input
    and a Report session for user output. The front end type must be set at
    startup via the component config and is a static setting. The graphical
    front end that was used up to now is named "menu view" and remains the
    default.

  * The File Vault can now reflect its internal state and user input ("config
    and report" mode only) at the LOG session via two new static config
    attributes "verbose_state" and "verbose_ui_config" (both defaulting to
    "no").

  * The Shutdown button in "menu view" mode is replaced with a Lock button. The
    new button doesn't terminate the File Vault but merely lock the encrypted
    container and return to a cleared passphrase input. The same transition is
    also provided in "config and report" mode.

  * The file_vault.run script is replaced with file_vault_menu_view.run and
    file_vault_cfg_report.run that address the two front end modes. In contrast
    to the former script, which is interactive, the latter script is suitable
    for automatic testing.

  * There is a new recipe/pkg/test-file_vault_cfg_report that essentially does
    the same as file_vault_cfg_report.run but uses the File Vault package and
    can be executed with the Depot Autopilot. The new test package is added to
    the default test list of depot_autopilot.run

  * The File Vault README is updated to the new version of the component and
    has gained a chapter "functional description".

  * Fixes a regression with the cbe_init_trust_anchor component that prevented
    reacting to a failed unlock attempt in the File Vault.

* The new Tresor software Trust Anchor has an optional deterministic mode in
  which it replaces the normally randomized symmetric keys with 0. This mode
  comes in handy for debugging. However, it should never be activated in
  productive systems. When activated, the user is warned extensively on the
  LOG that this system mode is insecure.

Ref #4819
2023-05-30 12:03:32 +02:00
Johannes Schlatow
d3d3351b99 base-nova: fix map for small sizes
Changes to the platform driver triggered a map() error while mapping an
address block at 0x3000 of size 0x800. Since the mapped size was larger, the
loop continued and tried mapping address 0x4000 where no dataspace was
found.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
cb0546aa9b os: increase platform_session quota 2023-05-30 12:03:32 +02:00
Johannes Schlatow
b558cd18d4 platform_drv: make Device_pd a Io_mmu::Domain
By transforming the Device_pd into an Io_mmu::Domain, we implement an
IOMMU device that uses the kernel API for controlling the IOMMU. This
device gets special treatment and is used by default for every device
that has no <io_mmu/> child.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
9b5944b90c platform_drv: use IOMMU devices
Every session component manages a registry of Io_mmu::Domain objects
that it creates on demand depending on the acquired devices (i.e. the
IOMMU devices referenced by the acquired devices). Via the domain
objects, a session component adds/removes the address ranges of the
allocated DMA buffers. Additionally, domain objects provide an interface
for enabling/disabling pci devices.

Domain objects get destroyed with the corresponding control device.
Moreover, on devices/policy ROM updates, domain objects of control
devices that are not referenced by any acquired device anymore get destroyed.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
d3357b4c53 platform_drv: propagate IOMMU devices to session
genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
b2e4f95f27 platform_drv: add <io_mmu> to devices ROM
This allows referencing an arbitrary number of IOMMU devices within a
<devices> node, e.g.:

<device>
  <io_mmu name="foobar"/>
</device>

The specified name is supposed to refer to an existing device in the
devices ROM. The platform driver automatically acquires known IOMMU
devices whenever they become available so that the device object can be
looked up from the platform-driver-owned devices.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
f2e63bdd64 platform_drv: add IOMMU devices to common
With this change, platform-specific code is able to define factories that
acquire IOMMU devices to be used by the platform driver.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
f98466430f platform_drv: don't restrict ownership to session
This is a prerequisite for letting the platform driver acquire control devices.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
3520492f09 platform_drv: fix update_policy()
The method did not handle device changes properly. When a new policy
does not contain an owned device any more, we must consider this device
as changed and release it.  Moreover, the warning messages were interchanged.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Alexander Boettcher
475bcfc2b9 qemu: use EPYC as model for AMD SVM virtualization
"-cpu phenom" does not support all CPU instructions necessary with
gcc 12 toolchain update issuing more SSSE3, e.g. pshufb.

Additionally, remove good/bad Qemu version check of outdated versions.

Issue genodelabs/genode-world#329
2023-05-30 12:03:32 +02:00
Christian Prochaska
11f3df6e72 ports: remove obsolete noux-pkg dummy libs
Issue #4827
2023-05-30 12:03:32 +02:00
Christian Prochaska
a4fd743973 grep: disable use of unsupported pcre JIT compilation
Issue #4827
2023-05-30 12:03:32 +02:00
Christian Prochaska
9b4cd59d09 ports: preload posix.lib.so in tool_chain_auto.run
Issue #4827
2023-05-30 12:03:32 +02:00
Christian Prochaska
44046a82d4 binutils: support Genode lib name patterns with '-l' option
Issue #4827
2023-05-30 12:03:32 +02:00
Stefan Kalkowski
8cb9d19079 lx_emul: add vmalloc defines to ARM64
Ref genodelabs/genode#4813
2023-05-30 12:03:32 +02:00
Stefan Kalkowski
46c8267fa9 Fix "wifi: support building for ARM64"
Issue #4813
2023-05-30 12:03:32 +02:00
Sebastian Sumpf
4903487f21 vbox6: fix "Error: slab block [xxx] is corrupt"
In 'SUPR3InitEx' (SUPLib.cpp) a 'SUPQUERYFUNCS' structure is allocated
with

!  (PSUPQUERYFUNCS)RTMemAllocZ(SUP_IOCTL_QUERY_FUNCS_SIZE(CookieReq.u.Out.cFunctions));

where 'CookieReq.u.Out.cFunctions' is 0. To determine the size of the
allocation

! #define SUP_IOCTL_QUERY_FUNCS_SIZE(cFuncs) \
!   RT_UOFFSETOF_DYN(SUPQUERYFUNCS, u.Out.aFunctions[(cFuncs)])

is used with cFuncs = 0 (SUPDrvIOC.h) leading to an allocation up to the
arrow below

! typedef struct SUPQUERYFUNCS
! {
!     /** The header. */
!     SUPREQHDR               Hdr;
!     union
!     {
!         struct
!         {
!             /** Number of functions returned. */
!             uint32_t        cFunctions;
!             /** Array of functions. */
==> end of allocation
!             SUPFUNC         aFunctions[1];
!         } Out;
!     } u;
==> sizeof(SUPQUERYFUNCS)
! } SUPQUERYFUNCS, *PSUPQUERYFUNCS;

In sup.cc (Genode) 'ioctl(SUPQUERYFUNCS &request)' will lead to
'with_out_ioctl'

! auto &out = request.u.Out;

where auto is 'SUPQUERYFUNCS' and finally

! out = { };

will zero out 'SUPQUERYFUNCS' up to the second arrow above. Because
'RTMemAllocZ' will call 'calloc' to allocate the memory 'out = { };'
will corrupt the slab block after the allocation. Therefore, it is
reasonable to allocate at least 'sizeof(SUPQUERYFUNCS)'.

Note there might be other 'ioctl' cases like this. A better way might be
to use 'SUPQUERYFUNCS.Hdr.cbOut' to determine the 'out' size.

fixes #4675
2023-05-30 12:03:32 +02:00
Sebastian Sumpf
40f31a9050 libc: add message for corrupted allocation on 'free'
In case the meta data (or more) got zeroed upon 'free', print error
message. The offset in the meta data can never be zero. This does not
help on other memory corruptions, but at least gives a hint in the too
much zeroed out case.

issue #4675
2023-05-30 12:03:32 +02:00
Christian Prochaska
4c98be54eb libports: remove pcre16
Fixes #4903
2023-05-30 12:03:32 +02:00
Christian Helmuth
86ebbc2191 libc_integration: fix build errors with '-std=gnu++20 -Og'
Issue #4827
2023-05-30 12:03:31 +02:00
Alexander Boettcher
60b44f071b nova: avoid assertion during cross core IPC 2023-05-30 12:03:31 +02:00
Alexander Boettcher
75d43555c8 nova: limit rate of too long helper chain message
to 1 per every 10s.
2023-05-30 12:03:31 +02:00
Sebastian Sumpf
61d1226805 mesa: remove Mesa run scripts
GPU device access is hard to achieve in run scripts and even harder to
implement generic.

Use the "Modularize Sculpt OS image creation"
(commit b723b11b30)
approach instead.

issue #4900
2023-05-30 12:03:31 +02:00
Sebastian Sumpf
d69113643f mesa: disable some warnings form C++20
Remove on Mesa update
2023-05-30 12:03:31 +02:00
Sebastian Sumpf
ccc04a7082 qemu-usb: support read/write of unused IO ranges
The XHCI model reserves 0x4000 of IO memory but uses only 0x530.
Implement read (0) and write (nop) for these regions as real hardware
does.

fixes #4902
2023-05-30 12:03:31 +02:00
Christian Helmuth
f8bcb1999e lan9118: fix build errors with -std=gnu++20
Issue #4827
2023-05-30 12:03:31 +02:00
Christian Helmuth
c35714dc81 genode_c_api: fix build errors with -std=gnu++20
Issue #4827
2023-05-30 12:03:31 +02:00
Christian Helmuth
97b015b8c7 virtio: fix MMIO build errors with -std=gnu++20
Issue #4827
2023-05-30 12:03:31 +02:00
Christian Helmuth
b60190a73c gdb_monitor: force build with -std=gnu++17
Issue #4827
Fixes #4873
2023-05-30 12:03:31 +02:00
Christian Helmuth
f5477dc53b part_block: fix build errors with -std=gnu++20
Fixes #4876
2023-05-30 12:03:31 +02:00
Christian Helmuth
4961ee293d Enable -std=gnu++20 by default
Issue #4827
2023-05-30 12:03:31 +02:00
Christian Prochaska
c3b53bc2ec test-timeout: fix build errors with -std=gnu++20
Fixes #4899
2023-05-30 12:03:31 +02:00
Christian Prochaska
9e3233f13f test-timer_rate: fix build error with -std=gnu++20
Fixes #4898
2023-05-30 12:03:31 +02:00
Christian Prochaska
44bed3495d test-timer: fix build errors with -std=gnu++20
Fixes #4897
2023-05-30 12:03:31 +02:00
Christian Prochaska
d2b12b5c79 test-thread: fix build errors with -std=gnu++20
Fixes #4896
2023-05-30 12:03:31 +02:00
Stefan Kalkowski
90690d96d4 hw: fix build errors with -std=gnu++20
Fix genodelabs/genode#4894
2023-05-30 12:03:31 +02:00
Christian Prochaska
87bed28ef8 test-smp: fix build errors with -std=gnu++20
Fixes #4895
2023-05-30 12:03:31 +02:00
Christian Prochaska
0285e5f217 test-rm_fault: fix build error with -std=gnu++20
Fixes #4891
2023-05-30 12:03:31 +02:00
Christian Prochaska
49f835db86 test-slab: fix build error with -std=gnu++20
Fixes #4893
2023-05-30 12:03:31 +02:00
Christian Prochaska
7eb0b6928a test-rm_nested: fix build error with -std=gnu++20
Fixes #4892
2023-05-30 12:03:31 +02:00
Christian Prochaska
da6b384e3a test-mmio: fix build error with -std=gnu++20
Fixes #4890
2023-05-30 12:03:30 +02:00
Christian Prochaska
7f170e492e mixer: fix build errors with -std=gnu++20
Fixes #4889
2023-05-30 12:03:30 +02:00
Christian Prochaska
c4810c5db4 virtio_pci_nic: fix build errors with -std=gnu++20
Fixes #4888
2023-05-30 12:03:30 +02:00
Christian Prochaska
e88a84e2ab wireguard: fix build error with -std=gnu++20
Fixes #4887
2023-05-30 12:03:30 +02:00
Alexander Boettcher
de986c5f0b nova: make compatible with C++20
Fixes #4886
2023-05-30 12:03:30 +02:00
Josef Söntgen
cb531e4cf9 libports: update ada-runtime .ali files for GCC 12
Fixes #4880
2023-05-30 12:03:30 +02:00
Josef Söntgen
6355b48eee ada: ignore unknown pragmas
Triggered by the toolchain update to GCC 12 certain pragmas lead to
a build error as those are now unknown. As quick-fix add '-gnatwG',
which suppresses warnings on unrecognized pragmas.

Issue #4880.
2023-05-30 12:03:30 +02:00
Alexander Boettcher
37735d84d9 virtualbox5: make it compatible to C++20
Fixes #4871
2023-05-30 12:03:30 +02:00
Christian Helmuth
bfecea9001 vcpu_state: fix build errors with -std=gnu++20
Issue #4872
Issue #4871
Fixes #4878
2023-05-30 12:03:30 +02:00
Christian Helmuth
058990de48 pc/uart: fix build errors with -std=gnu++20
Fixes #4885
2023-05-30 12:03:30 +02:00
Christian Helmuth
cfca9899b2 virtualbox6: fix build errors with -std=gnu++20
Fixes #4872
2023-05-30 12:03:30 +02:00
Sebastian Sumpf
e1b6855352 libport: remove icu library
This was required by QtWebKit in the past, the QtWebEngine ships its own
version. No other code depends on this. Revive if needed.

fixes #4870
2023-05-30 12:03:30 +02:00
Sebastian Sumpf
9713fa505f vbox6: bump version from 6.1.26 to 6.1.44
Fixes most of the GCC 12 problems.

issue #4666
2023-05-30 12:03:30 +02:00
Christian Prochaska
ee9281b458 qt5: install host tools in /usr/local/genode/tool/23.05
Issue #4868
2023-05-30 12:03:30 +02:00
Christian Prochaska
c4b8fae563 launchpad: fix build errors with -std=gnu++20
Fixes #4884
2023-05-30 12:03:30 +02:00
Christian Prochaska
b696439a67 intel_gpu_drv: fix build errors with -std=gnu++20
Fixes #4883
2023-05-30 12:03:30 +02:00
Christian Prochaska
74734b7dd9 vfs_tap: fix build errors with -std=gnu++20
Fixes #4882
2023-05-30 12:03:30 +02:00
Alexander Boettcher
1f2dc78feb intel/display: replace intel_fbdev with drm/kms
Fixes #4806
2023-05-30 12:03:30 +02:00
Sebastian Sumpf
ae19ab0cff gpu/intel: remove vgpus from schedule before destruction
When a GPU session is destroyed, remove vgpu of session from scheduling
and as possible active vgpu. Otherwise, page faults might occur in case
already destroyed vgpu object is referenced during interrupt handling.

fixes #4881
2023-05-30 12:03:29 +02:00
Sebastian Sumpf
e64f2eaff9 ldso: save floating point arguments on arm_v8a (GCC 12)
Apparently we need to save the floating point arguments when entering
the linker in case "-fno-tree-vectorize" is at work. Otherwise this
registers get corrupted during jump slot relocation.

Fixes #4879
2023-05-30 12:03:29 +02:00
Norman Feske
a12fcfea0d libc: replace enum by static constexpr (C++20)
Related to issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
8e32e7a14e os: replace enum by static constexpr (C++20)
Fixes the build of the nic_router.

Issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
29079b2ac8 os: define CAP_QUOTA as constexpr (C++20)
Issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
604d6bf567 os: make nitpicker compatible to C++20
Avoid arithmetics on enum values, disambiguate '==' operator of
handle_registry.

Fixes #4875
2023-05-30 12:03:29 +02:00
Norman Feske
f679864c23 trace: C++20 compatibility
With the new standard, volatile variables cannot be incremented,
decremented, or modified by compound assignments (e.g., +=).

Issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
1dac048413 base: make RPC framework compatible to C++20
Avoid the use of arithmetics on enum values.

Issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
81e85bf1b5 sculpt_manager: fix build errors with '-std=gnu++20'
Fixes #4874
2023-05-30 12:03:29 +02:00
Christian Prochaska
2383d802ba test-stdcxx: fix build errors with '-std=gnu++20'
Fixes #4877
2023-05-30 12:03:29 +02:00
Christian Helmuth
11de03fedc vbox5_genode_usb_hid_raw: adapt to usb_host changes
Issue #4795
2023-05-30 12:03:29 +02:00
Christian Prochaska
1e1df21a94 Remove stale Xen support
Fixes #4859
2023-05-30 12:03:29 +02:00
Christian Helmuth
502f5b8a59 vbox6: fix build errors with GCC 12
The fixes were manually backported from virtualbox-trunk.

Issue genodelabs/genode#4827
Fixes genodelabs/genode#4846
2023-05-30 12:03:29 +02:00
Christian Prochaska
03c23d299a qt5: reduce external dependencies of host tools
Fixes #4868
2023-05-30 12:03:28 +02:00
Christian Helmuth
590cf78c0f lx_emul: clarify Linux does not support -O0/-Og 2023-05-30 12:03:28 +02:00
Norman Feske
978f86ba60 recipes/pkg/sculpt/README: spelling fix 2023-05-30 12:03:28 +02:00
Stefan Kalkowski
5e0a9052d2 hw: prevent alignment faults in bootstrap
Either enable strict-alignment or disable FPU code generation by gcc
regarding bootstrap code, which cannot handle alignment faults during
initialization properly.

Ref genodelabs/genode#4827
2023-05-30 12:03:28 +02:00
Christian Helmuth
37d1855907 lx_fs: fix build errors with GCC 12
/data/genode/repos/os/src/server/lx_fs/directory.h: In member function ‘virtual Genode::size_t Lx_fs::Directory::read(char*, Genode::size_t, File_system::seek_off_t)’:
/data/genode/repos/os/src/server/lx_fs/directory.h:224:53: error: ‘dent’ may be used uninitialized [-Werror=maybe-uninitialized]
  224 |                                 .type  = type(dent->d_type),
      |                                               ~~~~~~^~~~~~
/data/genode/repos/os/src/server/lx_fs/directory.h:197:40: note: ‘dent’ was declared here
  197 |                         struct dirent *dent;
      |                                        ^~~~

Issue genodelabs/genode#4827
2023-05-30 12:03:28 +02:00
Sebastian Sumpf
d59a2b4b38 ldso: fix page fault at IP 0 with GCC 12 on RISC-V
Eliminate the creation of 'Genode::String's before the linker has been
self relocated, because 'Genode::String's will call 'Genode::strlen' on
construction from C-Strings, which has now become a GOT relative call,
while the GOT contains only zeros before relocation -> page fault at
IP 0.

fixes #4867
related to #4827
2023-05-30 12:03:28 +02:00
Christian Helmuth
d35e6f1aa2 Remove extra ‘;’ 2023-05-30 12:03:28 +02:00
Alexander Boettcher
8f5fe6dfe1 tool/run/load/ipxe: use installed_command
to find lighttpd if it is installed in /usr/sbin
2023-05-30 12:03:28 +02:00
Sebastian Sumpf
cc5d476fb1 libc/riscv: fix link errors with GCC 12
Dynamically linked functions can not be called directly with jump ("j",
"jal") and friends. Calls must go through the PLT.

issue #4827
2023-05-30 12:03:28 +02:00
Sebastian Sumpf
ff497bc710 stdcxx/riscv: update to version 12.3.0
issue #4827
2023-05-30 12:03:28 +02:00
Sebastian Sumpf
69d3d83930 lx_emul: set minimum alignment of allocations to 16 byte
FPU allocations on x86/ARM require a minimum alignment or may raise
faults (#GP or general protection in the x86 case).
2023-05-30 12:03:28 +02:00
Christian Helmuth
9cb9060794 base-nova: prevent linker warning
ld: warning: hypervisor has a LOAD segment with RWX permissions

Issue #4827
2023-05-30 12:03:28 +02:00
Christian Prochaska
369af8d8c3 sanitizer: update to version 12.3.0
Issue #4827
2023-05-30 12:03:28 +02:00
Christian Prochaska
02a8c279dc gcov: update to version 12.3.0
Issue #4827
2023-05-30 12:03:28 +02:00
Christian Prochaska
2e754da822 stdcxx: update to version 12.3.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
78b8b2785c gcc: update to version 12.3.0
Issue #4827
2023-05-30 12:03:27 +02:00
Sebastian Sumpf
07c089e860 stdcxx: add 'std::basic_filebuf' for char
needed by glmark2 2023.1

related to genodelabs/genode-world#326
2023-05-30 12:03:27 +02:00
Josef Söntgen
bab90d4837 depot/download: let curl fail on 404 response
Downloading non-existent archives from 'depot.genode.org' leads to
files in the 'public' directory containing the 404 error website
delivered by the HTTP server. Specifying the '--fail' option results
in curl generating an exit-code that leads to the appropriate action
by the tool, e.g.:

 Error: failed to download 'https://depot.genode.org/user/pkg/x/version.tar.xz'

Issue #4865.
2023-05-30 12:03:27 +02:00
Christian Helmuth
3fa275354d test-smp: fix build errors with GCC 12
error: 'void operator delete(void*, Genode::Deallocator&)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]

Issue #4827
Fixes #4850
2023-05-30 12:03:27 +02:00
Christian Helmuth
d0578700bc test-cache: fix build errors with GCC 12
error: ‘void operator delete(void*, Genode::Deallocator&)’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]

Issue #4827
Fixes #4848
2023-05-30 12:03:27 +02:00
Christian Prochaska
e4ac393de4 sel4: fix build errors with gcc 12
Fixes #4864
2023-05-30 12:03:27 +02:00
Christian Prochaska
417547c7d9 qt5: fix build errors with gcc 12
Fixes #4863
2023-05-30 12:03:27 +02:00
Christian Prochaska
9e021422c7 sanitizer: update to version 12.2.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
106e322f82 gcov: update to version 12.2.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
b8c80c9570 stdcxx: update to version 12.2.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
8920e5fbea tool_chain: update gprbuild to version 23.0.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
de70f17ee4 gdb: update to version 13.1
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
b12ebae6cd gcc: update to version 12.2.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
8602837fd4 binutils: update to version 2.40
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
f18a12a592 tool chain: update version to 23.05
Issue #4827
2023-05-30 12:03:27 +02:00
Norman Feske
8c9ca0e7a9 nitpicker: fix gcc build error
An early version of nitpicker used a pointer as 'owner' with the null
pointer representing nitpicker's built-in views, which are nowadays
represented by 'Main::_global_view_ower'. The null-pointer check is a
left-over from the earlier days.

Fixes #4847
2023-05-30 12:03:27 +02:00
Benjamin Lamowski
29238498b6 libc: implement signal(3)
Fixes #4824
2023-05-30 12:03:27 +02:00
Benjamin Lamowski
70644186c1 libc: add dummy symbols for the Rust std library
Add dummies for sigaltstack(3) and FreeBSD's _umtx_op(2).

Ref #4824
2023-05-30 12:03:27 +02:00
Christian Prochaska
0c70e9e8df gdb_monitor: fix build error with gcc 12
Fixes #4841
2023-05-30 12:03:26 +02:00
Norman Feske
b2bc5912c8 os: use [build_artifacts] in run scripts
Issue #4860
2023-05-30 12:03:26 +02:00
Norman Feske
a2832995d0 Remove long unused kdb_uart_drv for fiasco and foc
Removed in the context of issue #4860.
2023-05-30 12:03:26 +02:00
Norman Feske
dab7c64762 os: remove obsolete input.run script
Since repos/base/board/pc/devices is empty, the run script no longer
works on PC. Nobody noticed because the use case of this run script -
as development test loop for the ps2 and fb_sdl - are better served by
other scenarios nowadays, e.g., using declaring 'build: ps2' for a
custom Sculpt OS build.

Removed in the context of issue #4860.
2023-05-30 12:03:26 +02:00
Norman Feske
1cb4b4e2d8 os: remove gpio_led.run and gpio_signal.run
The gpio session interface is deprecated and the run scripts are not
regularly executed.

Removed in the context of issue #4860.
2023-05-30 12:03:26 +02:00
Norman Feske
71bda7db24 Move cpu_quota.run from os to base-hw repository
This test works only on the base-hw kernel after all.
2023-05-30 12:03:26 +02:00
Norman Feske
f119d9ee8b base: use [build_artifacts] in run scripts
The patch also removes a few legacies along the way, unifies the coding
style, and cuts back superfluous comments.

Issue #4860
2023-05-30 12:03:26 +02:00
Christian Helmuth
fc71f1848f tool/tool_chain: log PLATFORM on installation 2023-05-30 12:03:26 +02:00
Josef Söntgen
03ed5fc3f4 dde_bsd: update audio driver to OpenBSD 7.3
Fixes #4857.
2023-05-30 12:03:26 +02:00
Norman Feske
05e5ecca86 vfs: fix dangling allocation in dir_file_system
Issue #4855
2023-05-30 12:03:26 +02:00
Alexander Boettcher
2a0e45d0f7 log_core: limit buffer to max log string
Fixes #4853
2023-05-30 12:03:26 +02:00
Christian Helmuth
d9643b61af acpi_drv: count only memory allocated by new()
Fixes #4844
2023-05-30 12:03:26 +02:00
Norman Feske
2a49eee50f libc: improve diagnistics on initialization errors
This change helps to draw the connection between warnings during the
initialization of file descriptors and the libc configuration.
2023-05-30 12:03:26 +02:00
Christian Prochaska
901cbf0af3 sd_card_drv: fix build errors with gcc 12
Fixes #4851
2023-05-30 12:03:26 +02:00
Christian Prochaska
1742eb16b2 test-segfault: fix build error with gcc 12
Fixes #4849
2023-05-30 12:03:26 +02:00
Christian Helmuth
5c501997ca tool/depot/publish: prevent empty .sig files
If GPG signing is aborted, e.g., by pressing CTRL-C, an empty .sig file
remained in PUBLIC_DIR because the file was created by the Bash
redirection. By using '--output $@', gpg maintains the .sig file.
2023-05-30 12:03:26 +02:00
Christian Prochaska
b96004fd71 nvme_drv: fix build errors with gcc 12
Fixes #4845
2023-05-30 12:03:26 +02:00
Christian Prochaska
4dc5426a45 trace_recorder: fix build error with gcc 12
Fixes #4843
2023-05-30 12:03:26 +02:00
Christian Prochaska
db69104f1a text_area: fix build error with gcc 12
Fixes #4842
2023-05-30 12:03:25 +02:00
Christian Prochaska
1edde7c1bc fetchurl: fix build errors with gcc 12
Fixes #4840
2023-05-30 12:03:25 +02:00
Christian Prochaska
c2aacfa9c4 vfs: fix build error with gcc 12
Fixes #4839
2023-05-30 12:03:25 +02:00
Christian Prochaska
aa44ada2d4 okl4: fix hanging tests when built with gcc 12
Fixes #4838
2023-05-30 12:03:25 +02:00
Christian Prochaska
0eda98b03e pistachio: fix build errors with gcc 12
Fixes #4837
2023-05-30 12:03:25 +02:00
Christian Prochaska
ed5cbbfa1b fiasco: fix build errors with gcc 12
Fixes #4836
2023-05-30 12:03:25 +02:00
Christian Prochaska
36a1428c55 base-sel4: fix build errors with gcc 12
Fixes #4835
2023-05-30 12:03:25 +02:00
Christian Prochaska
c74c8d12cf base-nova: fix page fault in init when built with gcc 12
Fixes #4834
2023-05-30 12:03:25 +02:00
Christian Prochaska
920e240f67 foc: fix build errors with gcc 12
Fixes #4833
2023-05-30 12:03:25 +02:00
Christian Prochaska
b29db99f1c hw: fix build error with gcc 12
Fixes #4831
2023-05-08 15:55:35 +02:00
Christian Prochaska
acfeda15a7 base-linux: fix build error with gcc 12
Fixes #4830
2023-05-08 15:55:35 +02:00
Christian Prochaska
eab8db228b base: fix build errors with gcc 12
Fixes #4829
2023-05-08 15:55:35 +02:00
Christian Prochaska
98bf2dadb8 core: fix build errors with gcc 12
Fixes #4828
2023-05-08 15:55:34 +02:00
Stefan Kalkowski
97e3572844 lx_emul: use devio API for USB driver operations
Fix genodelabs/genode#4795
2023-05-08 15:55:34 +02:00
Stefan Kalkowski
f079d1f7c3 usb_hid_drv: ensure freeing packets in destructor
Ref genodelabs/genode#4795
2023-05-08 15:55:34 +02:00
Stefan Kalkowski
19e2b5b8b2 usb_net_drv: ensure freeing packets in destructor
Ref genodelabs/genode#4795
2023-05-08 15:55:34 +02:00
Stefan Kalkowski
3c3e45746a usb_modem: ensure freeing packets in destructor
Ref genodelabs/genode#4795
2023-05-08 15:55:34 +02:00
Stefan Kalkowski
cad11093f1 lx_emul: align of page-size allocations properly
Use page-alignment for multiple of page-size allocations within
all kmalloc allocations.

Ref genodelabs/genode#4795
2023-05-08 15:55:34 +02:00
Christian Prochaska
5080e88a7a qt5: split api recipes with Qt module granularity
Fixes #4823
2023-05-08 15:55:34 +02:00
Christian Prochaska
b7d1d8d091 qt5: create 'bin' directory in test run scripts
Fixes #4822
2023-05-08 15:55:34 +02:00
Josef Söntgen
bcc454aa89 drivers/usb_block: treat SYNC as barrier
The commit implements the SYNC and TRIM as successful NOP, while
the former is handled as an barrier to all other out-standing
requests.

Fixes #4825.
2023-05-08 15:55:34 +02:00
Josef Söntgen
280724e6b5 nvme_drv: read proper FLBAS value
Bit 0:3 indicate which of the (up to) 16 supported LBA formats is
used for this namespace. Instead of only looking at those bits the
driver looked at the complete 0:7 bits. Those, however, also include
information on how metadata may be transferred. That leads to using
the wrong index for reading the LBA format.

Fixes #4832.
2023-05-08 15:53:13 +02:00
Christian Helmuth
4a5d31e248 depot: update recipe hashes 2023-05-08 15:53:05 +02:00
Josef Söntgen
eb93b5f863 sculpt_manager: check passphrase before ENTER
Prevent setting an invalid configuration by guarding against are
premature generation.

Issue #4858.
2023-05-04 11:59:14 +02:00
Norman Feske
f712d97763 sculpt: always update keyboard focus after input
This patch solves keyboard-focus issues with the wifi dialog that were
caused by making the focus update conditional. However, since the update
is not expensive, we can unconditionally re-evaluate the focus atfer
each user interaction.

Issue #4820
Fixes #4856
2023-05-04 11:59:14 +02:00
Norman Feske
0e3a9bfe1f libc: fix cached ioctl info file access
This patch solves the false-negative error message "failed to open file"
referring to an ioctl info file during an ioctl call. The message is
now avoided by checking for the existence of the file before reading it.

However, the observed symptom uncovered an actual bug that was
introduced in commit "libc vfs: open OSS 'info' file only once" with
the attempt to cache the content of ioctl info files. When called
multiple time for different paths, 'Vfs_plugin::_with_info' would
wrongly return the info from the first call as cached in a local
static variable.

The patch fixes the problem by a new added 'Cached_ioctl_info'
implementation in the scope of the 'Vfs_plugin'.

Issue #4372
Fixes #4852
2023-05-04 11:59:14 +02:00
Christian Helmuth
2e76374a35 depot: update recipe hashes 2023-04-28 15:10:43 +02:00
Christian Helmuth
db8fb0e168 News item for Sculpt 23.04 2023-04-28 15:01:17 +02:00
Norman Feske
ab0fe21ac7 sculpt: update README for version 23.04 2023-04-28 15:01:17 +02:00
Christian Helmuth
22d8c4059e sculpt: hide system_view in graph 2023-04-28 14:46:11 +02:00
Christian Helmuth
97070620af depot: update recipe hashes 2023-04-28 14:46:11 +02:00
Norman Feske
de106608a0 sculpt: reduces space between depot users
Otherwise, the default list of depot users won't fit with the touch
keyboard on the PinePhone's screen.
2023-04-28 14:46:11 +02:00
Norman Feske
01b198657d sculpt: reset update dialog on changed sculpt fs
When changing the used sculpt partiton, the dialog state should be
cleared from the information of the original selection.

Issue #4820
2023-04-28 14:46:11 +02:00
Norman Feske
43d51c4499 sculpt: refine keyboard entry of new depot URL
This patch includes the system dialog in the global keyboard focus
handling, supports hovering of the "Edit" and "Add" buttons,
allows the use of the enter key to finish URL editing, and
triggers a re-scan of depot users after adding a new one.

Issue #4820
2023-04-28 14:46:11 +02:00
Norman Feske
937ddd012b sculpt: refresh update window when network is up
This way, the update-index button becomes immediately visible once we
have connectivity.

Issue #4820
2023-04-27 15:07:45 +02:00
Norman Feske
280fc45c5f sculpt: sanitize depot-user selection
Should the selected depot user not be present in the depot - for example
after switching the sculpt partition to another - unfold the selection
of all present depot users so that the one can pick an existing one.

Issue #4820
2023-04-27 14:58:04 +02:00
Christian Helmuth
091db48843 vfs_block: warn only once if sync is not supported
Issue #4825
Issue #4820
2023-04-27 14:24:29 +02:00
Norman Feske
6717494c5b sculpt: avoid installation-complete feedback loop
Issue #4820
2023-04-27 14:07:58 +02:00
Norman Feske
6d91b5d51b sculpt: show system dialog only after prepare step 2023-04-27 12:36:43 +02:00
Sebastian Sumpf
8f0a191c2a gpu/intel: comment for read execlist status
Adds a comment to the exec list status loop.

issue #4820
2023-04-26 16:23:13 +02:00
Alexander Boettcher
bdbfa532cd platform/x86: improve DMA memory alignment
If the DMA memory allocation alignment is unfortunate (not natural size
aligned), the IOMMU (AMD/INTEL) may not use larger(super) pages with effects
on the page table walk frequency and TLB caching.

Issue #4820
2023-04-26 16:22:16 +02:00
Alexander Boettcher
98a31bbfdb platform/x86: exclude special range from device_pd
Issue #4820
2023-04-26 16:12:52 +02:00
Christian Helmuth
7deee978c5 driver_manager: disable USB driver BIOS handoff
We repeatedly experience issues with XHCI handoff in the USB host driver
at runtime on modern systems. Mostly, these issues manifest as
initialization delays with very high CPU load. Investigations show that
during this time the handoff MMIO write does not return, which hints the
firmware driver enters some spinning loop. I suspect the enabled IOMMU
does not play well with the firmware due to insufficient RMRR
information.

Therefore, we disable USB handoff in Sculpt via the driver manager (as
we do for dedicated devices already in other contexts). Note, UHCI and
EHCI handoff is still done in the platform driver and succeeds on all
our test hardware.

Issue #4820
2023-04-26 15:57:20 +02:00
Alexander Boettcher
d68f5446b1 acpica: remove irq dependency in package
Issue #4679
Issue #4820
2023-04-26 15:55:20 +02:00
Christian Helmuth
d8ff3f655a depot: update recipe hashes 2023-04-26 15:19:57 +02:00
Norman Feske
4edd45dd8f depot: split pkg/goa-linux from pkg/goa
This split allows us to cross-compile all arm_v8a packages needed for
'goa build' by creating pkg/arm_v8a/goa.

The components featured on pkg/goa-linux are solely needed for 'goa
run'. As they contain a number of lx/hybrid components, pkg/goa-linux
must be complied on Linux running on the target architecture.
2023-04-26 15:19:57 +02:00
Christian Helmuth
ddc3b88cd2 depot: update pkg/goa recipe hash
This package depends on genode/world/recipes/src/sdl, which had an
outdated hash file.
2023-04-26 13:56:23 +02:00
Christian Helmuth
e9a497abe4 depot: update recipe hashes 2023-04-26 11:58:16 +02:00
Norman Feske
83d0214099 sculpt: make hovering build-time configurable
This way, we can disable the visual hovering at one place for the phone
version.
2023-04-26 11:58:16 +02:00
Norman Feske
105b3cd21d sculpt: system update and presets
The new dialog accessible via the "System" panel button hosts the
system-update dialog and the preset selection.

Fixes #4744
2023-04-26 11:58:16 +02:00
Norman Feske
5687dc06fd sculpt/default-pc: example presets 2023-04-26 11:58:16 +02:00
Martin Stein
1dbad87139 cbe: fix propagation of results of unlock attempts
Fixes a regression with the cbe_init_trust_anchor component that prevented
reacting to a failed unlock attempt in the File Vault. The regression was
caused by new semantics in the vfs that did not allow for using the file
operation result as indicator for whether the unlock attempt failed or
succeeded. The correct and hereby applied approach is to check for the data
read from the file after having written the unlock command. The data reads
either "ok" or "failed".
2023-04-26 11:58:15 +02:00
Sebastian Sumpf
bd58bd8279 gpu/intel: read execlist status multiple times (GEN < 12)
Before scheduling we check if the execlist is empty. When many clients
are present, the bits might not be cleared by hardware yet. Before the
watchdog timer would trigger, because we scheduled nothing. Now we try
serval times, even if this fails, we still schedule because in the worst
case only a preemption would happen.

issue #4820
2023-04-26 11:58:15 +02:00
Josef Söntgen
75917f6595 file_vault: use VFS to sync data file
Issue #4820.
2023-04-26 11:58:15 +02:00
Norman Feske
67c1ca1e61 sculpt: increase max fb height to 1504 pixels
This is needed to boot Sculpt OS on the Framework laptop.

Issue #4820
2023-04-26 11:58:15 +02:00
Norman Feske
114a199321 Meta package gems/recipes/pkg/goa 2023-04-26 11:58:15 +02:00
Alexander Boettcher
38f4b15df1 intel_fb: set default brightness of connector
which is unconfigured to 70%

Issue #4820
2023-04-26 11:58:15 +02:00
Timo Nicolai
83f78e7fe6 base: add Xml_node::for_each_attribute
Adds a function that allows iterating over an XML node's attributes
without relying on `Xml_node::Nonexistent_attribute`.

Issue #4817
2023-04-26 11:58:15 +02:00
Christian Helmuth
7e06aa13c1 vbox6: disable GSO in e1000 model
Commit "vbox: avoid uncaught nic Empty_ack_queue exception" introduced a
performance regression due to packet retransmission because of faulty
GSO segment handling. As fixing the GSO handling is fairly complex, we
disable GSO until a fix was developed.

Issue #4820
Issue #4821
2023-04-26 11:58:15 +02:00
Christian Helmuth
8752d8d677 vbox6: critsect in nic via pfnBeginXmit/pfnEndXmit
Issue #4820
Issue #4821
2023-04-26 11:58:15 +02:00
Sebastian Sumpf
5f469589eb recipe: mesa gears increare ram quota
Becaues the Iris DRM allocator now allocates 16MB chunks, more RAM is
needed for smaller 3D applications.

issue #4820
2023-04-26 11:58:15 +02:00
Sebastian Sumpf
c7c9542262 libc: add 'wakeup_remote_peers' to 'with_libc'
Libc components using 'with_libc' should wakeup peers in case a libc function
makes I/O progress.

issue #4820
2023-04-26 11:58:15 +02:00
Norman Feske
8893b800e0 depot_deploy: report only on state changes
This patch mitigates potential busy feedback effects when evaluating the
reports produced by 'depot_deploy' in a closed control loop. Reports
are now generated only if the deployment state has changed.

Issue #4818
2023-04-26 11:58:15 +02:00
Norman Feske
a289eff741 depot_download_manager: remove debug message 2023-04-26 11:58:15 +02:00
Norman Feske
cec8a401ae depot_deploy: check ROMs as deploy precondition
This patch marks a child as incomplete if one of the ROM modules listed
in its blueprint is missing. This, in turn, triggers the update system
in Sculpt, which then tries to download the missing pieces.

Issue #4818
2023-04-26 11:58:15 +02:00
Norman Feske
1c160d2366 sculpt: "Reattempt Install" option in popup dialog
Issue #4818
2023-04-26 11:58:14 +02:00
Norman Feske
bb6a189589 sculpt: show failed downloads in diagnostics
This patch complements the diagnostics view with the failure state
tracked by the download queue.

Issue #4818
2023-04-26 11:58:14 +02:00
Norman Feske
9e42c94e30 sculpt: handle deploy downloads by download queue
By managing downloads issued by the deploy subsystem via the
'Download_queue', failed downloads (e.g., due to HTTP error 404) are
properly tracked and don't cause infinite re-attempts.

Issue #4818
2023-04-26 11:58:14 +02:00
Christian Helmuth
5cb06b5f1c platform_drv: document PCI device naming after BDF
Issue #4812
2023-04-26 11:58:14 +02:00
Norman Feske
c705bdd6a9 depot_download: avoid spurious respawn of fetchurl
Thanks to Timo Nicolai for bringing up this issue along with an initial
patch.

Fixes #4815
2023-04-26 11:58:14 +02:00
Norman Feske
a5eb198549 sandbox/init: report exit state immediately
This patch promotes the event of an exiting child to become immediately
reported, reducing delays for management components that watch the exit
status of children.

Fixes #4814
2023-04-26 11:58:14 +02:00
Norman Feske
aab9227365 pkg/mesa_gpu-cpu: RAM quota adjustments
When deployed on the PinePhone, the cached_fs_rom requests additional
4 MiB of RAM.
2023-04-26 11:58:14 +02:00
Norman Feske
014066f15b sculpt: avoid stretched radio icon in wifi ap list 2023-04-26 11:58:14 +02:00
Norman Feske
54d7a48c9b sculpt: support for pinephone wifi driver
This patch replaces the former 'nic_drv' and 'nic_drv_dtb' functions
by a more general 'nic_driver_routes' function that can return one or
multiple platform-specific ROM routes for NIC-driver binaries and dtb
files. This allows for supplying customizations for the wifi driver
as well. E.g., on the PinePhone, this hook can be used to handle the
renaming of the 'wifi_drv' to 'a64_wifi_drv'.

Related to issue #4813 and issue genodelabs/genode-allwinner#17.
2023-04-26 11:58:14 +02:00
Josef Söntgen
1d376717c1 net/netaddress: make copy member function const
As the function does not alter the internal state of the
object allow for using it in r/o contexts.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
8f91f119b8 wifi: remove firmware library
The library is merely an historical artifact and the raw archive is
better used in its place.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
2b4246c59b lib/symbols/wifi: add symbols file for ABI so
Add symbols file for the wifi shared-object.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
6c36a58bb7 lib/wifi: remove unused symbols from symbol.map
Remove symboles that are no longer required.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
0b28c9ae6f lib/vfs/wifi: remove dependency on wifi library
The wifi VFS plugin is solely there to provide a hook for calling
'Lx_kit::initialize()' prior to the static ctors. As the corresponding
symbol can be resolved at run-time there is no need to add the
library as a build-time dependency.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
e6ee7d3d4a wifi: provide platform specific DTB access
The device-tree binary is normally required on ARM-based platforms
where as on x86 it is omitted. The platform-specific DTB helper
provides a generic interface for accssing the DTB and needs to be
implemented on each platform.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
eaaedb6ae8 wifi: defer supplicant start-up
The SDIO connected wireless device on the PinePhone is not available
on start-up, which leads to the supplicant failing to initalize
'wlan0'. Normally the supplicant would be used in a way that handling
devices that appear at run-time happens gracefully.

Rather than supporting this behavior we defer the start-up of the
supplicant until the device could be openend successfully for now.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
0b08ae09c4 wifi: check 'lx_get_mac_addr' before reporting
The MAC address device report should be published once the device is
available. Since this may happen at a later time we have to check the
call.

Issue #4813
2023-04-26 11:58:14 +02:00
Stefan Kalkowski
8ae5ae76fb wifi: support building for ARM64
This commit introduces support for building the WLAN driver for ARM
platforms. It makes the WPA supplicant and its support libraries
available for all platforms. It also seperates the PCI parts to
accommodate platforms where other bus protocols are used.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
56d366995c wifi/pc: add ath9k driver
The driver was only tested with an "Atheros AR9462 Rev:2" [168c:0034]
device using the 'wifi.run' run script.

Note: for it to work MSI may not be used as otherwise interrupts do not
work. Using an IOMMU leads to the following fault:

[ 0] IOMMU:0xffffffff817eb0b0 FRR:0 FR:0x22 BDF:4:0:0 FI:0xb0000000000000 (0)

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
e0d6e2e5a7 wifi: guard 6.1.x code
Needed for drivers still implemented using Linux 5.x.x.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
7b146e0563 lx_emul: use 'dma_address' in 'dma_unmap_sg_attrs'
The way the 'struct page' management is currently implemented it is
not safe to rely on it in case allocations share the same page. This
is in particular true where the virtual address is obtained by
querying the page object for maintaining the CPU caches.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
997e60d52a lx_emul: guard 6.1.x signature changes
Needed for drivers still implemented using Linux 5.x.x.

Issue #4813
2023-04-18 11:09:55 +02:00
Christian Helmuth
bba9254172 sculpt: version 23.04 2023-04-17 14:56:40 +02:00
Christian Helmuth
b5f79756b3 depot: update recipe hashes 2023-04-17 14:48:30 +02:00
Sebastian Sumpf
f91aba873e test/qt5/qpluginwidget: add dummy 'main'
issue #4794
2023-04-17 14:48:30 +02:00
Alexander Boettcher
364ff0e65c nova: avoid initial wrong idle tracing times
Issue alex-ab/nova#9
2023-04-17 14:48:30 +02:00
Pirmin Duss
2b194d47cc openssl: update to 1.1.1t
Issue #4808
2023-04-17 14:48:30 +02:00
Sebastian Sumpf
effe17c852 qt5_component: add 'main' as undefined to ABI
This causes the 'main' function to not be garbage collected when linking against
the ABI.

issue #4794
2023-04-17 14:48:30 +02:00
Christian Helmuth
4b54520579 trace_buffer: fix check for empty buffer
Issue #4805
2023-04-17 14:48:30 +02:00
Christian Helmuth
684388e737 trace_logger: log scheduling-context execution time
Optionally log scheduling-context execution time in addition to the
thread-context. This may be relevant on kernel platforms that do not
schedule threads on their own CPU share only but implement some kind of
donation scheme, for example, NOVA.

Usage

  <config sc_time="yes" ...> ... </config>

Fixes #4805
2023-04-17 14:48:30 +02:00
Josef Söntgen
1041ed8773 wifi: use latest available firmware
This commit updates the used firmware images for the iwlwifi device
to latest available ones (supported by the current 6.1.x driver).
It also removes old firmware images that by now are not used anymore.

Fixes #4807.
2023-04-17 14:48:30 +02:00
Norman Feske
595660fb84 tool/depot: sanity check for presence of port hash
If a content.mk file wrongly refers to a non-existing directory in a
call of the 'port_dir' function, the 'content_env_missing_ports.mk' gets
stuck while invoking 'cat' without argument, which makes such mistakes
difficult to diagnose. This patch adds a sanity check for the existence
of the port hash file at the specified location before attempting to
'cat' the hash-file content.
2023-04-17 14:48:30 +02:00
Norman Feske
22836e3e0f gems: add pkg/unconfigured_nano3d
Unfortunately, the change of "depot: remove empty config from
pkg/nano3d" broke the manual deployment of the nano3d demo because no
<config> is provided in this case.

This patch splits pkg/nano3d into two variants. The regular nano3d pkg
comes with an empty <config/> node as before. The unconfigured_nano3d
pkg does not feature any <config/> node and can thereby be configured
via a ROM route to a dynamic-rom service.
2023-04-17 14:48:30 +02:00
Norman Feske
f8fd202a1c depot_download: option for unverified downloads
This patch equips the depot_download subsystem with the option to
explicitly skip the signature verification for downloads by specifying
the attribute 'verify="no"' for an <installation> item. This is useful
in scenarios where the lack of integrity of downloaded content does not
pose a risk, e.g., for untrusted applications that are rigidly
sandboxed, or during development.

Note that this option does not entirely discarge the signature checking.
Whenever an download has dependencies that are verifyable - for
which the public key exists in the depot - the dependencies are still
verified. This allows untrusted content to depend of verifyable content
while protecting the integrity the verifyable content.

Issue #4804
2023-04-17 14:48:30 +02:00
Norman Feske
b6bb338011 sculpt: make download verification controllable
This patch adds the 'Verify' argument to all download-related interfaces
in order to control the checking of signatures for downloads. Note that
it does not change the sculpt_manager's existing built-in policy of
always checking signatures.

Issue #4804
2023-04-17 14:48:30 +02:00
Norman Feske
a351b0c164 sculpt: expose unique name as 'Component' constant 2023-04-17 14:48:30 +02:00
Norman Feske
3a99deef5a sculpt: reusable component-construction interfaces
This patch moves the interfaces needed for the interactive addition of runtime
components from the 'Popup_dialog' to the 'model/component.h'. So those
interfaces are no longer tied to one specific view implementation.
2023-04-17 14:48:30 +02:00
Norman Feske
daf53df670 sculpt: 'Sculpt::match_sub_dialog' function
This free-standing function is meant to gradually replace
'Dialog::match_sub_dialog' interface, which relies on the caching of
the hover state. The new function is more flexible because dialogs do no
longer need to inherit 'Dialog'.
2023-04-17 14:48:30 +02:00
Norman Feske
b91e5353ba sculpt: make Popup_view::Menu reusable 2023-04-17 14:48:30 +02:00
Norman Feske
9be7ce54c2 sculpt: avoid superfluous <installation> entries
The missing else statements resulted in the addition of a
superfluous <archive> node when installing an <index>, causing
warning messages by the depot-download subsytem.
2023-04-17 14:48:29 +02:00
Norman Feske
fb1865eb91 sculpt: support for creating small files 2023-04-17 14:48:29 +02:00
Norman Feske
9834849e95 sculpt: allow new depot users in ram_fs/depot 2023-04-17 14:48:29 +02:00
Norman Feske
0bec935ccb sculpt: hide manager_keyboard in graph 2023-04-17 14:48:29 +02:00
Norman Feske
9ef6ed52c4 sculpt: report_dump, system_clock-dummy launchers 2023-04-17 14:48:25 +02:00
Norman Feske
ed8e8b9473 fs_tool: add missing whitespace in warning message 2023-04-17 14:48:25 +02:00
Norman Feske
123df93741 depot_query/deploy: allow pkg <rom> relabeling
This patch adds the ability to specify an optional 'as' attribute in a
<rom> module declarion of a runtime file.

  <runtime ...>
    ...
    <content>
      <rom label="camera-pinephone.dtb" as="dtb"/>
      ...
    </content>
  </runtime>

If specified, The depot-deploy tool uses the provided attribute value to
hand out the ROM 'camera-pinephone.dtb' under the label 'dtb' to the
subsystem.
2023-04-17 14:48:25 +02:00
Norman Feske
7927c0b540 depot: recipe for pkg/nitpicker
This pkg is useful for using an instance of nitpicker as a video bridge.
2023-04-17 14:48:25 +02:00
Josef Söntgen
118fff0472 iwlwifi: limit rx bufs to 2048
Recent devices are configured with 4096 RX pages that lead to an
increased memory usage. For the moment lower the amount to 2048
and treat in potientially lower throughput for more conservative
memory consumption.

Fixes #4801.
2023-04-17 14:48:25 +02:00
Sebastian Sumpf
e27737a0a5 dde_rump: add RISC-V support
This commit adds RISC-V file-system support through the backport
originally provided by ARMv8.

fixes #4800
2023-04-17 14:48:25 +02:00
Christian Helmuth
7be915a185 vbox6: disable RDTSC exit
For Windows guests, it's crucial to configure the paravirtualization
provider in .vbox6 like follows. Otherwise, the TSC calibration fails
(issue #4726) and the CPU frequency (in task manager) is bogus.

  <Paravirt provider="HyperV"/>

Fixes #4726
2023-04-17 14:48:24 +02:00
Stefan Kalkowski
0bc5bcce4a test/driver_time: fix page-fault of ARMv8a variant
The get_cycles() call within the test doesn't apply to RDTSC
access when running on ARM but to arch_timer_read_counter, which
is an empty function pointer. By setting it to a function that
returns Genode::Trace::timestamp() we can enable the test for ARM.

Issue #4775
2023-04-17 14:48:24 +02:00
Stefan Kalkowski
2269f42e17 lx_emul: update Linux port to 6.1.20
Fix genodelabs/genode#4798
2023-04-17 14:48:24 +02:00
Sebastian Sumpf
80038ad936 qt5: split qt5 api
Split api into 'qt5', 'qt5_qml', and 'qt5_webkit'. This makes it
possible to link Qt5 apps more fine grained. Needed by Goa.

fixes #4793
2023-04-17 14:48:24 +02:00
Christian Helmuth
7c84d73d67 Spend min. 4K on platform session upgrade for DMA buffer
Issue #4792
2023-04-17 14:48:24 +02:00
Christian Helmuth
6a80b4bd17 dde_linux: move test/driver_time to virt_linux
Fixes #4775
2023-04-17 14:48:23 +02:00
Alexander Boettcher
807e2a1eb4 test/driver_time: adjust output to headline
Issue #4775
2023-04-17 14:48:23 +02:00
Alexander Boettcher
f4f292d22f test/driver_time: add wifi testcase
Issue #4775
2023-04-17 14:48:23 +02:00
Christian Helmuth
3a9ef48721 dde_linux: separate virt_linux from wireguard
Preparation to support further hardware-agnostic dde_linux components
(incl. lxip and tests).

Fixes #4774
2023-04-17 14:48:23 +02:00
Christian Helmuth
4016c799f2 lx_emul: move shadowed random.c from pc to generic
Issue #4774
2023-04-17 14:48:23 +02:00
Christian Helmuth
ef5e211fa0 lx_emul: check usb actconfig after potential preemption
Issue #4795
2023-04-17 14:48:23 +02:00
Christian Helmuth
3c45f5c7ab usb: support 32 in-flight packets
- move metadata specific to isochronous transfers from the descriptor
  into the content of USB-session packets
- restore support for 32 in-flight packets in the USB C API

Fixes #4749
2023-04-17 14:48:23 +02:00
Christian Helmuth
217d59ce68 usb: use buffer type in C API
Also, some reasonable sanity checks of client-passed parameters were
added and for-int loops replaced by for-range loops where applicable.

Issue #4749
2023-04-17 14:48:23 +02:00
Christian Helmuth
21d9854a81 sculpt_manager: refresh storage if part_block got stuck
Fixes #4791
2023-04-17 14:48:23 +02:00
Christian Helmuth
a2e29c0226 driver_manager: defer block_devices report
Now, block_devices are reported earliest right after the devices ROM was
parsed and neither AHCI nor NVMe were found. If one or both devices were
found, the report is deferred after all expected reports arrived.

Issue #4791
2023-04-17 14:48:22 +02:00
Christian Helmuth
6884e6b1ec fatfs: cleanup synchronous use of block connection 2023-04-17 14:48:22 +02:00
Christian Helmuth
6ab06f417d base-nova: log IOMMU feature in verbose boot info 2023-04-17 14:48:22 +02:00
Josef Söntgen
25c8c0f9e9 nvme_drv: fix wrong identify length 2023-04-17 14:48:22 +02:00
Christian Helmuth
34db8f5360 Fix single-client handling in some block providers 2023-04-17 14:48:22 +02:00
Christian Helmuth
927d71ad59 part_block: modernize implementation
Fixes #4790
2023-04-17 14:48:22 +02:00
Christian Helmuth
082d1780cf nvme_drv: reduce state-change intervals
- probe changes of CSTS.RDY every 20 ms
- check admin-queue completion every 50 ms
2023-04-17 14:48:22 +02:00
Josef Söntgen
f7b910b298 part_block: split reporting from parsing
Previously the 'partitions' report was implicitly generated after
parsing the partition-table by accessing the referenced reporter
object.

Now the report is explicitly created by calling the 'generate_report'
member function. At this point we no longer have access to all
required information so the 'Partition' class was extended to
accommodate for the data needed by MBR as well as GPT reports.

Fixes #4786.
2023-04-17 14:48:22 +02:00
Norman Feske
bd3936c7ed Test for combining select with a pipe
The test exercises the VFS's read-ready mechanism when using the
vfs_pipe plugin.

Issue #4785
2023-04-17 14:48:22 +02:00
Michael Mueller
a913fbd62c Removed debug messages from performance counter code. 2023-03-30 15:57:25 +02:00
Michael Mueller
32a4d09d04 Added README for EalánOS. 2023-03-27 17:31:05 +02:00
Michael Mueller
412cf94f59 Added simple example for using the performance counter syscalls in EalánOS. 2023-03-27 17:22:00 +02:00
Michael Mueller
561a2ddbf9 blinktree: Added scenario from FOSDEM talk. 2023-03-27 17:19:49 +02:00
Michael Mueller
f91d1900ac mxtasking: Updated revision and hash. 2023-03-27 17:19:14 +02:00
Michael Mueller
3d41f682a6 blinktree: Updated Makefile to include performance counters. 2023-03-27 17:16:21 +02:00
Michael Mueller
aeb402ad50 libc: Increased stack size. 2023-03-27 17:15:31 +02:00
Michael Mueller
7ac39fb7a7 base-nova: Use larger frame limit for NOVA. 2023-03-27 17:15:00 +02:00
Michael Mueller
a088b5696c base-nova: Updated Makefile. 2023-03-27 17:14:25 +02:00
Michael Mueller
48543e93cc base: Added symbols for performance counter syscalls to ld script. 2023-03-27 17:13:36 +02:00
Michael Mueller
7cc6d4e828 base-nova: Added syscall for querying the CPU vendor. This is helpful to implement CPU vendor-specific features in userspace drivers. 2023-03-27 17:11:00 +02:00
Michael Mueller
9dc7af6ba8 base: Preserve 1MB more of memory for core to accomodate for larger memory consumption by TOPO. 2023-03-27 17:09:41 +02:00
Michael Mueller
3f690a1e32 base: Increased RAM quota for TOPO session to accomodate for larger CPU counts. 2023-03-27 17:08:04 +02:00
Michael Mueller
d74754adb5 base: Use define MAX_SUPPORTED_CPUS for dimensioning affinity array. 2023-03-27 17:07:13 +02:00
Michael Mueller
dec071829d blinktree: Implemented performance counter interface for Genode. 2023-03-27 17:05:05 +02:00
Michael Mueller
b9e1da2ad1 base: High-level interface for hardware performance counters. 2023-03-27 17:00:58 +02:00
Michael Mueller
e5c8167992 base-nova: Added hypercalls to access hardware performance monitoring counters. 2023-03-27 17:00:18 +02:00
Michael Mueller
0f1002fab8 base: Set affinity of platform thread according to its location. 2023-03-27 16:57:48 +02:00
Michael Mueller
072a65623d base: Added more detailed error message on insufficient quota. 2023-03-27 16:55:57 +02:00
Michael Mueller
43df00ea55 base: Zero attached dataspace upon creation. 2023-03-27 16:54:37 +02:00
Michael Mueller
2042a2083f blinktree: Always stop measurement on core 0. 2023-03-27 16:51:26 +02:00
Michael Mueller
b2397cfac3 Updated parameters for blinktree benchmark. 2023-03-27 16:50:41 +02:00
Norman Feske
2c1b51be65 fs_query: increase file-content limit to 64 KiB
The former limit to 4 KiB is too small for complex Sculpt presets like
the video-chat scenario.

Fixes #4788
2023-03-15 17:05:35 +01:00
Norman Feske
fd7001d020 os/vfs.h: don't truncate File_content
The 'File_content' utility throws an exception whenever a file happens
to get truncated during the reading process. But it silently truncates
the data against the specified limit. In practice, exceeding the limit
is usually an error case. This patch enhances the 'File_content' utility
by throwing 'Truncated_during_read' in the limit-exceeded case as well,
in order to ease the diagnosis of such cases.

Issue #4788
2023-03-15 17:05:35 +01:00
Sebastian Sumpf
40333a8ee2 gpu/intel: use _owner.cap during session destruction
'cap()' will return invalid capability within session destructor, therefore Vram
objects that belong to the session will not be destroyed, leading to danling
references later on. Use '_owner.cap' of session instead.
2023-03-15 17:05:35 +01:00
Norman Feske
61926ebc07 base: introduce platform_init function
The new 'init_platform' function performs the platform-specific
component-local low-level initialization. It allows for the
differentiation between core and regular components as well as
kernel-dependent peculiarities.

This patch introduces a consistent notion of a 'Platform'. Within core,
the 'Platform' contains the kernel-specific initialization. Outside
core, the platform sets up the interplay with the parent component. In
all cases, the platform is constructed while running on the initial
stack.

Issue #4784
2023-03-15 17:05:01 +01:00
Pirmin Duss
9e0ef550a8 vfs_pipe: Fix large transfers after 23.02
Readers need to be woken up when data is ready.

Issue #4785
2023-03-15 17:02:51 +01:00
Pirmin Duss
d5051c439d test-libc_fifo_pipe: increase buffer size
Issue #4785
2023-03-15 17:02:51 +01:00
Stefan Kalkowski
61454178c0 vmm: support mode change in virtio gpu
Fix genodelabs/genode#4783
2023-03-13 17:01:32 +01:00
Stefan Kalkowski
cb3b6c4b88 vmm: distinguish virtio interrupts
VirtIO device models can assert interrupts to notify about
buffer and configuration changes. By now, we could only assert
buffer notification interrupts, but no configuration changes.
The latter is needed, e.g. to notify about GPU mode changes.

Ref genodelabs/genode#4783
2023-03-13 17:01:32 +01:00
Norman Feske
441186468c base: remove env_deprecated from rpc_cap_alloc
Issue #4784
2023-03-13 15:22:00 +01:00
Norman Feske
223e185b83 base-linux: rm env_deprecated from region_map_mmap
Issue #4784
2023-03-13 14:47:19 +01:00
Christian Helmuth
73771669f1 depot: update recipe hashes 2023-03-13 14:32:54 +01:00
Norman Feske
dc8fcc254d sculpt_image.run: fix var name in assert_run_arg 2023-03-13 14:32:54 +01:00
Christian Helmuth
b609411e76 part_block: add partition type to log message 2023-03-13 14:32:53 +01:00
Christian Helmuth
188a214a29 libusb: fix constructor order in vfs_libusb 2023-03-13 14:32:53 +01:00
Norman Feske
f2485f624b Link to hackster.io article in release notes 23.02
Provide a link to the new "Taking control over DMA" article
and apply a few minor style tweaks.
2023-03-13 14:32:53 +01:00
Norman Feske
805fae5bab Update README files
This patch removes outdated information and improves the language of
various README files.
2023-03-13 14:32:53 +01:00
Josef Söntgen
9b9d1f4e12 part_block: use expanding reporter
Depending on the number of partitions the current fixed size of 4096
bytes might not be sufficient for the resulting partitions report.
The use of the expanding reporter allows for accomodating large reports
while still keeping the resource usage down for the common case of
few partitions (with potentially short names).

Fixes #4782.
2023-03-13 14:32:53 +01:00
Norman Feske
d0f4791413 demo: remove use of format strings from mini_c lib
The implementations of snprintf and vsnprintf are not needed for the
loading of png images by the demo applications. So we can avoid the
dependency from the format library hosted in the libports repository.

Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
2c32e9ee18 base: remove util/avl_string.h
The use case is covered by util/dictionary.h now.

Fixes #4780
2023-03-13 14:32:53 +01:00
Sebastian Sumpf
c14007f559 vfs_trace: replace use of Avl_string by Dictionary
issue #4780
2023-03-13 14:32:53 +01:00
Josef Söntgen
ae0e0c118e nvme_drv: add support for host-memory-buffer
This commit introduces support for the HMB feature and will setup the
buffer during start-up. The host-memory-buffer (HMB) feature is mostly
used on NVMe devices that do not make use of an DRAM cache to store its
translation tables amongst other operational data. Not using HMB can
impair the performance on such devices.

The memory is allocated in 2 MiB chunks of DMA-capable memory and its
total size in bytes is configurable via the 'hmb_size' config attribute.
The driver always checks the minimal and preferred size of the HMB and
issues a warning in case it is not enabled via the configuration.
Moreover, if the configured size is less than the minimal amount
required by the device the HMB is not configured at all and a warning
is issued also. If the configured size is more than the preferred size
it will be capped to that amount.

Fixes #4715.
2023-03-13 14:32:53 +01:00
Norman Feske
239d4864e9 loader: support dynamic session upgrades
This patch converts the loader implementation to the 'Session_object'
interface to implement the ability to upgrade the session caps and RAM
after after the session creation. This is needed to accommodate the
change of the Loader::Connection in commit "Remove format strings from
connection types".

Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
c99fb2b69b core: replace use of Avl_string by Dictionary
Issue #4780
2023-03-13 14:32:53 +01:00
Stefan Kalkowski
ec700e88f7 pci_decode: do not handle signals after decoding
Remove signal handler and ACPI report ROM from Main class
to prevent to react on report changes.

Fix genodelabs/genode#4779
2023-03-13 14:32:53 +01:00
Norman Feske
8698e693d5 trace_logger: replace Avl_string by Dictionary
Issue #4780
2023-03-13 14:32:53 +01:00
Norman Feske
d4047e9af7 nic_router: remove stale include of avl_string.h 2023-03-13 14:32:53 +01:00
Norman Feske
d727d18871 base: remove format strings from API
This patch ultimatedly removes format strings from Genode's base API.
Users of the former base/snprintf.h and base/console.h headers may
use the free-standing 'format' library hosted in the ports repository.

Fixes #2064
Fixes #3869
2023-03-13 14:32:53 +01:00
Norman Feske
e9b249b709 Replace use of base/snprintf.h by format library
Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
9ef0f1b6cb libports: freestanding 'format' string library
This little library implements rudimentary format-string support. It is
useful for porting 3rd-party code that ought not depend on a full libc.

Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
50ee8dfaf8 Remove obsolete includes of base/snprint.h
Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
94b8c61e32 libc: remove internal use of base/snprintf.h
Issue #2064
2023-03-13 14:32:52 +01:00
Norman Feske
8b44f49d75 vbox5: remove use of base/snprintf.h
Issue #2064
2023-03-13 14:32:52 +01:00
Norman Feske
36c00cc294 gems: remove use of format strings
Issue #2064
2023-03-13 14:32:52 +01:00
Norman Feske
ecd0066e80 os: remove use of format strings
Issue #2064
2023-03-13 14:32:38 +01:00
Norman Feske
915adcd0dd base: remove internal use of format strings
Issue #2064
2023-03-13 14:32:38 +01:00
Norman Feske
9debad4e91 Remove format strings from connection types
Issue #2064
2023-03-13 14:32:37 +01:00
Norman Feske
fb66e733b5 base: add 'Connection' constructor accepting args
The new 'Connection' constructor accepts the session label, affinity,
and args as constructor arguments. The session arguments are passed as a
'Genode::String'. This allows for side-stepping the need for rendering a
format string passed to 'Env::session'.

Issue #2064
2023-03-13 14:32:37 +01:00
Christian Helmuth
bed084c17c Add missing sources to wireguard
The additional files provide Chacha implementation in case
may_use_simd() returns false because in_interrupt() returns true.

Related to issue #4778, commit "lx_emul: track irq state changes"
2023-03-13 14:32:37 +01:00
Christian Helmuth
9ae4fc2371 dde_linux: explicitly list patch files
Using wildcards for selecting patch files clashes with files from
linux.port.
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
6a7a30ceaa lx_emul: unify udelay implementation
Implement udelay for all architectures within common lx_emul code,
remove driver-specific version.

Always do busy looping in udelay and use cpu_relax()
like the original Linux code. Thereby, we profit from architecture specific
instructions (cpu cool down), and jiffies are updated if irqs are on.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
50541c68ec lx_emul: shadow cpu_relax to update jiffies
There are rare use-cases where cpu_relax is used inside a busy loop
(i2c bus functions), which only will break when the jiffies counter
reaches a specific value.
Because of the cooperative scheduling done in lx_emul, no timer
interrupt will break such a loop. As a workaround, we check for
necessary jiffies updates inside cpu_relax if interrupts are enabled.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
7e2c546d8e lx_emul: update jiffies during schedule
Whenever a new schedule decision is made in the Linux emulation layer,
we try to update the jiffies counter.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
c90b61f571 lx_emul: track irq state changes
To be able to check for interrupts being on or off,
the enabling and disabling is tracked in lx_emul.
When interrupts get received, they have to be turned off.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
eba2c8cf2f lx_emul: set timer irq task to highest priority
If a timer signal got received, first all time updates
have to be done, before other tasks get active.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
2c1724d7f2 lx_emul: adjust start & stop tick behaviour
Do not start and stop idle ticking within the timer interrupt
routine, but do it around the whole Lx_kit scheduling, which
is always called when Linux code gets active again, either
because of backend signals, interrupts, or timing signals.

This commit implicitly reverts the (incomplete) solution of
issue #4550

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Roland Bär
b9b18c92d0 usb_host: deliver UTF-16 strings on request
Linux kernel static functions usb_string_sub() and usb_get_langid() were
made accessible to implement robust string rerieval.

Fixes #4756
Fixes #4757
Fixes #4772
2023-03-13 14:32:37 +01:00
Christian Helmuth
ea2584e2fb Fix usb_block.run and add to autopilot.list 2023-03-13 14:32:37 +01:00
Christian Helmuth
182ba3a931 run/load/ipxe: prevent error on kill_spawned
... if the run script exits early.
2023-03-13 14:32:37 +01:00
Josef Söntgen
23cc96e661 wifi/pc: add firmware for the Intel AX210 2023-03-13 14:32:37 +01:00
Norman Feske
2e6dd010ae core: introduce 'Core' namespace
The namespace draws a clear line between the base library and the core
component.

It is declared at the new core-local header <types.h>, which is expected
to be included by all code of the core component. It is thereby a
natural place for kernel-agnostic general types like commonly used C++
utilities.

Fixes #4777
2023-03-13 14:32:37 +01:00
Josef Söntgen
487aad6db1 wifi: allow driver dump in error case
This commit implements dummies that would otherwise trigger a
'generated dummy' call that stops the driver.
2023-03-01 16:30:00 +01:00
Alexander Boettcher
98fa0a1ad2 wifi: don't use kzalloc directly
Avoid using wrong pointer when calling free_page() which causes
otherwise memory corruption.
2023-03-01 16:29:53 +01:00
Stefan Kalkowski
caef7d642a usb_block: enable WARN_STRICT_CONVERSION switch
Implicitely fixes problems with USB devices having more than 4G blocks.
Formerly the 16-Cmd LBA requests were silently casted to 32-bit.

Fix genodelabs/genode#4771
2023-03-01 16:28:55 +01:00
Christian Helmuth
57fcc7a25f version: 23.02 2023-02-28 15:11:55 +01:00
Norman Feske
f4cd47fa48 News item for version 23.02 2023-02-28 15:11:10 +01:00
Norman Feske
89e198204f Release notes for version 23.02 2023-02-28 15:11:10 +01:00
Christian Helmuth
e265cf6d49 depot: update recipe hashes 2023-02-27 08:22:51 +01:00
Roland Bär
470f07d462 Some documentation tweaks/cleanups
Fixes #4773
2023-02-27 08:22:50 +01:00
Christian Helmuth
a4d45921c6 Document event handling in acpi_event 2023-02-27 08:22:50 +01:00
Josef Söntgen
8145ff6303 qemu-usb: only copy data when packet succeeded
In case the packet is erronous the value of 'actual_size' can be
invalid and using it may lead to a page-fault due to out-of-bounce
access.

With this commit access is only performed on successful packets.

Fixes #4763.
2023-02-27 08:22:50 +01:00
Sebastian Sumpf
e2c334d6e4 linux: allow more workers when scheduling works
Workers are only summoned by the manager or when there are no workers on
a work queue. In case a work in front of a work queue depends on a work
behind it, a deadlock may occur. To solve this Linux spawns a rescue
worker using timers. Timing of Linux based drivers is currently reworked
and not reliable. Therefore, we increase the number of workers that are
spawned from 1 to 3 per work queue in order to resolve possible
deadlocks.

Fixes #4762
2023-02-27 08:22:50 +01:00
Alexander Boettcher
df27cc87b5 hw/x86: add suspend kernel syscall
using the ACPI mechanism. The syscall can be triggered solely via core's
RPC managing_system call.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
30c6feb86e hw/x86: re-init devices on resume
Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
1ea6708d84 hw/x86: prepare ACPI resume entry
Set wakeup pointer in FADT/FACS tables and prepare/place ACPI resume code
at application processors (AP) 16-bit entry. Exclude memory used for AP resume
from RAM range to avoid usage by Genode core in allocators.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
faf54244c4 hw/x86: keep cpu id after resume
The CPUs are woken all at once and up to now the IDs are assigned depending
on the arrival order, which is unfortunate for the resume case. Keep track
of once assigned IDs for CPUs, so that on resume the very same CPU id is given.
The APIC id is guaranteed to be fixed per CPU on suspend, but unfortunately
not dense packed.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
32b1aa605a hw/x86: add ACPI tables for resume
The ACPI table FACS and FADT are required to support ACPI suspend/resume. The
commits add the lookup of the ACPI table in bootstrap and the general usage
of the ACPI registers via the MMIO framework.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
dc1996d289 hw/x86: add interrupt controller re-init support
Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
1da71afbf3 hw: add Serial re-init/resume support
Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
5587476b4e hw: add Timer re-init/resume support
Add explicit init() to Timer infrastructure to re-initialize the hardware
based on the parameters given during constructing time of the timer object.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
1b5bfec8f9 hw: add CPU re-init/resume support
On resume the CPU state must be re-initialized, since all CPUs have been
potentially off (depending on sleep form) and lost state. Handle the halt
and suspend state explicitly by an extra Job implementation which can be
executed without holding the global kernel lock.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
a20a26b41b hw: add IPI type to flush and stop CPUs
as preparation before powering off the CPU

Issue #4669
2023-02-27 08:22:50 +01:00
Stefan Kalkowski
80453236c4 hw: don't depend on ARMv8 HCR, CPTR EL2 reg values
Instead of re-using the register values found in HCR_EL2 and CPTR_EL2
and setting single bits within them, define the complete content to
prevent inconsistent hardware/hypervisor state.

Ref genodelabs/genode#4759
2023-02-27 08:22:49 +01:00
Stefan Kalkowski
c5b9cabd89 vmm: enable effective C++ error switch
Several explicit casts could not be avoided yet, due to the missing
differentiation in between virtual and physical addresses that leads
to casting problems when using 32-bit ARM, and because the MMIO
register framework does not allow to return narrowed types of bitfields.

Apart from that, this commit fixes a switch-case fallthrough error in
Mmio_register::write.

Fix genodelabs/genode#4770
2023-02-27 08:22:49 +01:00
Stefan Kalkowski
adc594a7e6 os: remove conversion warnings/errors from virtio
The read_config and write_config functions in the generic virtio
headers used by all drivers lead to compiler warnings resp. errors
if effective-c++ switch is enabled. Moreover, the functions require
to define the access width as parameter. We can better turn them
into template functions using the value type to read resp. write to
derive the access width.

Ref genodelabs/genode#4344
2023-02-27 08:22:49 +01:00
Alexander Boettcher
ac69189e23 nova: support to re-enable IOMMU after ACPI resume
Issue #4669
2023-02-27 08:22:49 +01:00
Norman Feske
b044520344 Add missing includes of base/exception.h
This header used to be included implicitly by base/blocking.h, which
does no longer exist.

Issue #4768
2023-02-27 08:22:49 +01:00
Norman Feske
78b85339b0 vfs: buffer XML in <inline> file system
The use of 'Buffered_xml' removes the risk of the XML node's underlying
data to change during a component-config update.

Related to #4285
2023-02-27 08:22:49 +01:00
Norman Feske
6d25ffc70b Remove base/lock_guard.h
For Genode API users, the 'Mutex::Guard' is the way to go.
Special lock implementations can bring their own 'Guard' utilities.

Fixes #4769
2023-02-27 08:22:49 +01:00
Norman Feske
356506a67a base: remove base/blocking.h
This patch removes the obsolete exception type 'Blocking_canceled'.

Issue #4768
2023-02-27 08:22:49 +01:00
Norman Feske
32f9d1fceb os: remove server/input_event_bridge
This component was solely used during the transition of the
input-session to the event-session interface.

Fixes #4767
2023-02-27 08:22:49 +01:00
Norman Feske
b0e52ba7d4 util/misc_math.h: remove abs function
Fixes #4766
2023-02-27 08:22:49 +01:00
Norman Feske
e09941f310 Remove base/debug.h
Fixes #4765
2023-02-27 08:22:49 +01:00
Norman Feske
bdf47785b8 vfs: remove 'file_size' from read/write interfaces
The 'file_size' type denotes the size of files on disk in bytes. On
32-bit architectures it is larger than the size_t, which refers to
in-memory object sizes.

Whereas the use of 'file_size' is appropriate for ftruncate and seek, it
is not a suitable type for the parameters of read/write operations
because those operations refer to in-memory buffers.

This patch replaces the use of 'file_size' by size_t. However, since it
affects all sites where the read/write interface is uses, it takes the
opportunity to replace the C-style (pointer, size) arguments by
'Byte_range_ptr' and 'Const_byte_range_ptr'.

Issue #4706
2023-02-27 08:22:49 +01:00
Josef Söntgen
6e1517ca3c libdrm/lima: introduce disjunct contexts
Prior to this change the libdrm Lima implementation supported the
creation of multiple contexts where each context, however, was
treated as the same client like it was done in the Lima driver
itself.

With this commit each context becomes its own client while the
main context always performs all buffer object related allocation
and the other context import each needed BO before submitting.

Fixes #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
89f99df44d libdrm/lima: check buffer id in WAIT
Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
66fedecf34 libdrm/lima: handle unknown buffer ids gracefully
Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
46fc41ba50 libdrm/lima: rename Syncobj_space
Align the naming with the 'Gpu_context_space'.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
909b25db57 libdrm/lima: refactor session and context handling
Merge 'Gpu_session' and 'Gpu_context' and create the main session
as context.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
da32849ac2 libdrm/lima: move sync fd handling into DRM object
Converting from the sync-fd to the actual handle is internal
implementation detail.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
401da72a86 libdrm/lima: remove try-catch from ioctl call
Remove the exception handling as at this point all exceptions should
have been handled internally already.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
b8d8ff6d4d libdrm/lima: use sync-fd range beyond libc's reach
Sync file-descriptors a purely virtual and are not known by the libc and
should be only accessed by 'drm_poll'. To prevent accidental access move
them to range never used by the libc fd allocator.

Issue #4760.
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
c0e98f4481 base: fix conversion errors of smp timeout test
The cpu affinity index is an int no unsigned long within the interface
definition.

Ref genodelabs/genode#4344
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
e6c64290fa libpng_static: silent strncpy warnings
Ref genodelabs/genode#4344
2023-02-27 08:22:48 +01:00
Norman Feske
b88951345f depot: recipe for pkg/stdin2out 2023-02-27 08:22:48 +01:00
Norman Feske
07e3e09652 util/string.h: add 'Const_byte_range_ptr'
The new 'Const_byte_range_ptr' type is suitable as argument type that
refers to a read-only byte buffer, e.g., the source buffer of a write
operation.
2023-02-27 08:22:48 +01:00
Christian Helmuth
73f7f8aef6 dde_linux: generalize kmalloc_order() implementation 2023-02-27 08:22:48 +01:00
Sebastian Sumpf
0a8ac9fe4d gpu/intel: don't copy sesion cap for onwership check
We determine the owner of a Vram object by the session cap of the
session that created the object. We should not copy this cap to other
places because this increases reference counting, that can become very
large with many objects. Therefore, we pass a wrapper 'Owner' object
containing the cap by reference.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
34b2a83b84 gpu_session: add notes to interface
Describe differences for Intel and Lima (Mali) based GPUs.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
f1bc791c22 gpu_session: rename Gpu::Virtual_address:va
rename 'va' into 'value' to stay consistent with other types.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
d10c7c31a4 black_hole: adjust to VRAM GPU session interface
issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
8279038da2 lx_emul: provide _raw_read_lock/unlock functions
Required by i.MX8's gpu driver. '_raw_read_lock' was already present but
not implemented, add it's counter part as well.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
56e7e2ad53 libdrm/lima+etnaviv: adjust to VRAM GPU session interface
Keep buffer abstraction by mapping one buffer to one VRAM object.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
47f1eaac2a gpu/intel: add VRAM support
Remove buffer abstraction and replace it by VRAM objects.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
f72cb2b69b ibdrm/iris: add VRAM support
Allocate 16MB or larger chunks and implement buffer abstraction for Iris
which possible share VRAM.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
23b87929f5 libdrm/iris: remove unsused functions
* 'map_buffer', GTT mappings are currently not used by Iris
* 'set_tiling', tiling is currently not used by Iris because there are
  no GTT mappings

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
3260c86d15 gpu_session: VRAM interface
Change the abstraction from buffers to video RAM (VRAM). The notion of
buffers can be provided at the client side (e.g., Mesa) and multiple
buffers can be there be associated to one VRAM area, thus saving
resources (meta data overhead) when allocating many buffers. A VRAM area
can also be mapped to one single buffer as before for clients or drivers
that do not take advantage of this feature.

issue #4713
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
13453e3c68 hw: activate strict conversion checking in kernel
Fix genodelabs/genode#4753
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
da0dbd901c base: fix conversion error in Bitset_2::get()
Ref genodelabs/genode#4753
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
0212f94809 hw: eliminate -DNR_OF_CPUS, use constant instead
Fix genodelabs/genode#4752
2023-02-27 08:22:48 +01:00
Norman Feske
1d5fc3ef60 sculpt/depot: remove depot user trimpim
Fixes #4754
2023-02-27 08:22:47 +01:00
Norman Feske
c10904967b core: improve coding-style consistency 2023-02-27 08:22:47 +01:00
Martin Stein
5bdc88bf57 base-hw scheduler: sanitize access to invalid head
Issue #4755
2023-02-27 08:22:47 +01:00
Alexander Boettcher
c8cf33a251 sel4: flush vm pages on out of index pressure
re-create semantic as done before commit

"core: kernel-agnostic 'Mapping' type"

Issue #4751
2023-02-27 08:22:47 +01:00
Alexander Boettcher
d089e80906 sel4: handle non pagefault exceptions
by checking for it in core, submitting a signal (if registered) and not
replying instantly. Before this commit, an exception (a non page fault)
caused and endless "unknown exception" loop between originator and core.

This was handled before commit "core: kernel-agnostic 'Mapping' type" by
throwing an exception, which was with that commit not working anymore.

Fixes #4751
2023-02-27 08:22:47 +01:00
Sebastian Sumpf
79d389d812 base/ld: only assign .dynamic to the PT_DYNAMIC segment
Segment assignment stays valid for all sections following .dynamic,
which implies that .got and co also end up in the PT_DYNAMIC segment.
This is not intended.  Therefore, we move the .dynamic section before
bss and assign bss to the rw PT_LOAD segment only.

fixes #4750
2023-02-27 08:22:47 +01:00
Alexander Boettcher
76828f25c5 tool: bender with optional 'serial' UART discovery
By default, bender will not report any serial findings anymore, if not
explicitly asked for with the 'serial' option. Without this option, an
invalid ioport is reported, so that neither the kernel nor Genode core
will make serial output.
2023-02-27 08:22:47 +01:00
Norman Feske
62af32270b depot: remove empty config from pkg/nano3d
This allows for routing the nano3d config to a ROM services like
dynamic rom.
2023-02-27 08:22:47 +01:00
Norman Feske
291beb1145 depot: recipe for pkg/dynamic_rom 2023-02-27 08:22:47 +01:00
Norman Feske
dbf02ac3c1 depot: add runtime pkg for cpu_load_display 2023-02-27 08:22:47 +01:00
Norman Feske
6e20ffb990 gems: simple oscilloscope for audio input 2023-02-27 08:22:47 +01:00
Norman Feske
fa167bcdc4 gems: screenshot trigger for virtual print button
The screenshot trigger displays a little red dot at the upper-left
corner of the screen. When touched or clicked-on, it generates an
artificial key-press-release sequence for the print key and disappears
for one second. In this time, a separate screenshot component can handle
the print key by capturing the screen without the red dot appearing in
the saved picture.
2023-02-27 08:22:47 +01:00
Norman Feske
d26770eb40 gems/gui_buffer.h: grammar fix in comment 2023-02-27 08:22:47 +01:00
Norman Feske
4653e2eb3b touch_keyboard: make background configurable
The touch-keyboard config accepts the new attributes 'opaque="yes"
and 'background=#112233' to control the dialog background. The
attributes are passed unmodified to embedded the menu view.
2023-02-27 08:22:47 +01:00
Norman Feske
611efd9921 sculpt_manager: increase fs_tool buffer size
This speeds up the use of the fs_tool when installing system images.
2023-02-27 08:22:47 +01:00
Norman Feske
791c389923 sculpt_manager: allow image, image-index download
Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
6b3c7c9a6c sculpt_manager: 'File_operation_queue' enhancement
This patch add the support needed for implementing on-target
system-update functionality. The new 'empty' method is required for the
two-step procedure of updating image-index files - removing the old
index, followed by downloading the most current one. It is used to the
detect the completion of the first step.

Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
60a089d795 sculpt_manager: 'Download_queue' enhancements
This patch reflects more details such as the percentage value for
downloads maintained in the download queue. This makes this information
easier to display at the GUI.

Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
1f11e4b8db sculpt_manager: Popup_dialog::_scan_rom -> main
This change allows the consumption of the list of depot users by the
forthcoming system-update functionality.

Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
46eb175b17 sculpt_manager: detailed storage progress messages
This patch replaces the generic "In progress..." message by slightly
more concrete information about the type of operation. This is useful to
distinguish the two steps during the expansion of a partition.
2023-02-27 08:22:47 +01:00
Norman Feske
677c8e828c depot_download,depot_query: support system images
This patch enhances the depot_download subsystem with support for
downloading and querying system images.

The installation ROM support the following two now download types:

  <image_index path="<user>/image/index"/>
  <image       path="<user>/image/<name>"/>

Internally, the depot-download subsystem employs the depot-query
component to determine the missing depot content. This component
accepts the following two new queries:

  <images      user="..."/>
  <image_index user="..."/>

If present in the query, depot_query generates reports labeled as
"images" and "image_index" respectively.

The also tracks the completion of each job depending on the depot-
query results, so that the final report contains a result for each
installation item requested. Prior this patch, the inactivity of the
depot-download manager (indicated by an empty state report) was
interpreted as success. But that prevents the proper association of
results and requested installation items.

Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
b3bcab6c13 depot_query: split main.h from main.cc
This will allow for the implementation of 'Main' methods in .cc files.

Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
866e84ec49 depot_query: supplement url to scanned user
The 'scan' query for depot users used to list the names of depot users.
However, the URL and existence of a pubkey is useful to know when
assembling a GUI menu from this list.

Issue #4744
2023-02-27 08:22:46 +01:00
Norman Feske
06a53abe68 tool/depot/publish: support system images
This patch equips the publish tool to handle system images.

System images reside at <depot-user/image/. The directory contains an
index file that contains the meta information of the available images
in XML form, e.g.,

  <index>
    <image name="sculpt-pinephone-2023-01-19" board="pinephone">
       <info text="initial version"/>
    </image>
  </index>

To publish a new version of the index:

  ./tool/depot/publish <depot-user>/image/index

Each system image comes in two forms, a bootable disk image and an
archive of the boot directory. The bootable disk image can be used to
install a new system from scratch by copying the image directly ot a
block device. It contains raw block data. The archive of the boot
directory contains the content needed for an on-target system update to
this version. Within the depot, this archive a directory - named after
the image - that contains the designated content of the boot directory
on target. Depending on the board, it may contain only a single file
loaded by the boot loader (e.g., uImage), or several boot modules, or
even the boot-loader configuration.

To publish both forms:

  ./tool/depot/publish <depot-user>/image/<image-name>

This results in the following - accompanied by their respective .sig
files - in the public directory:

  <depot-user>/image/<image-name>.img.gz  (disk image)
  <depot-user>/image/<image-name>.tar.xz  (boot archive)
  <depot-user>/image/<image-name>.zip     (disk image)

The .zip file contains the .img file. It is provided for users who
download the image on a system with no support for .gz.

Fixes #4735
Issue #4744
2023-02-27 08:22:46 +01:00
Norman Feske
3355d14b65 sculpt_image.run script for creating system images
Issue #4744
2023-02-27 08:22:46 +01:00
Norman Feske
4de71549d4 sculpt: supplement build info as boot module
This allows us to reflect the information about the running image to the
user.

Issue #4744
2023-02-27 08:22:46 +01:00
Norman Feske
2986d46fd3 fs_tool: add <copy-all-files> operation
Related to issue #4744
2023-02-27 08:22:46 +01:00
Norman Feske
7ada79b5ca Don't use deprecated Readonly_file::read variants
Issue #4745
2023-02-27 08:22:46 +01:00
Norman Feske
61a7671de1 os/vfs.h: read loop in Readonly_file::read
This patch improves the Readonly_file::read method such that the
capacity of the specified buffer is used as upper bound for the read
operation instead of VFS-internal I/O buffer sizes. This relieves the
caller from implementing a read loop in most cases.

As a step away from C-ish use of the API, the patch deprecates the old
'read' method that takes the buffer as char *, size_t arguments.

Fixes #4745
2023-02-27 08:22:46 +01:00
Norman Feske
345b77cfc9 menu_view: use Expanding_reporter for hover report
This allows for arbitrary large hover reports.
2023-02-27 08:22:46 +01:00
Norman Feske
3447d0ccb9 menu_view: avoid flicker when enlarging the view
Each time when enlarging the menu view, a new 'Gui_buffer' is
constructed with the new size. At its contruction time, the default
reset background color is in effect, which is evaluated by
'reset_surface' as part of the construction. A custom reset color
takes effect only after the construction. Hence, when the Gui_buffer is
flushed to screen immediately at construction time, the gray default
becomes visible for a short time.

This patch changes the Gui_buffer to accept the reset background color
as construction argument so that it takes immediate effect.

Related to #4592
2023-02-27 08:22:46 +01:00
Norman Feske
11ff774f72 tool/run/image/disk: find resize2fs in /usr/sbin
This patch adjusts the run/image/disk plugin to search for resize2fs in
/usr/sbin, which is not included in the PATH variable on Debian by
default.

Issue #4746
2023-02-27 08:22:46 +01:00
Christian Helmuth
21a9527686 pc/wifi: remove redundant Genode:: prefix 2023-02-27 08:22:46 +01:00
Christian Helmuth
de9ea43616 dde_linux: remove custom lx_backtrace (use lx_emul_backtrace) 2023-02-27 08:22:46 +01:00
Christian Helmuth
52fb4eee5f pc/wifi: restore optional MAC-address reporting
Issue #4133
2023-02-27 08:22:46 +01:00
Alexander Boettcher
208547e3af tool/grub2: factor out common part
to avoid divergence

Issue #4741
2023-02-27 08:22:46 +01:00
Alexander Boettcher
c3843cd0d6 image/disk: factor out common boot parts
to avoid divergence

Issue #4741
2023-02-27 08:22:46 +01:00
Alexander Boettcher
eb354be20d image/uefi: factor out common boot parts
to avoid divergence.

Issue #4741
2023-02-27 08:22:46 +01:00
Christian Helmuth
264ee999a1 acpi_event: generalize config for any key
Fixes #4748
2023-02-27 08:22:46 +01:00
Christian Helmuth
3403a91213 input: provide keycode-by-name lookup
The new utility returns a key code for a passed name and is implemented
by linear search, which is slow but sufficient in situations like config
updates.

Issue #4748
2023-02-27 08:22:45 +01:00
Alexander Boettcher
e8424e19fa vbox_share: increase resources for tcp_terminal 2023-02-27 08:22:45 +01:00
Christian Prochaska
f1b048c595 qt5: up-mix mono audio output data in QtWebEngine OSS backend
Fixes #4747
2023-02-27 08:22:45 +01:00
Christian Helmuth
e17d104c0a mk: restore compatibility to Make 4.1
The leading newline in the _capture function confused _filecontent,
which resulted in empty port hashes.

Fixes regression introduced in 437fd21ba0
(issue #4725).
2023-02-27 08:22:45 +01:00
Christian Prochaska
9dbaa150d6 gnu_build.mk: pass static libraries in '-l:' format
Fixes #4743
2023-02-27 08:22:45 +01:00
Alexander Boettcher
0724db2d80 sel4: avoid out_of* in several run scripts
caused by platform_drv and report_rom
2023-02-27 08:22:45 +01:00
Alexander Boettcher
d2f27a34f7 nova: avoid fault during thread migration
triggert by cpu_balancer.run on Qemu

Fixes #4742
2023-02-27 08:22:45 +01:00
Alexander Boettcher
93e26cae35 grub2: add small default font
Issue #4741
2023-02-27 08:20:46 +01:00
Christian Helmuth
84c5a7b0cd vfs_lwip: receive payload without breaking refcount
lwip uses a sophisticated reference-counting scheme in chains of pbufs,
which the former manual implementation of read() for TCP data broke.
Using pbuf_free_header() keeps the chain intact and also relieves our
implementation from the burden of "offset" maintenance.

Fixes #4722
2023-02-27 08:20:46 +01:00
Christian Helmuth
7858c00539 test/tcp: ascending integer mode
Add alternative (statically configurable) mode to fill the test data
with ascending integers for increased debugability.

Issue #4722
2023-02-27 08:20:45 +01:00
Christian Helmuth
297947bec7 Cleanup netty network tests
Issue #4722
2023-02-27 08:20:45 +01:00
Johannes Schlatow
4d0cb175da base-hw: use global timer on Cortex A9
genodelabs/genode#4360
2023-02-27 08:20:45 +01:00
Josef Söntgen
777b093cad sculpt_manager: add RTL8188EE FW routes
Issue #4714.
2023-02-27 08:20:45 +01:00
Josef Söntgen
578a8c9918 wifi/pc: add rtlwifi driver
Due to lacking hardware access the driver was test with one RTL8188EE
based device, namely [10ec:8179] (rev 01), only. As the access to the
PCI config space is restricted the driver loads the non power-saving
FW and the driver port is therefor only tested with that. The
accesses are documented should we choose to support them one way or
another later on.

The 'wifi.run' run script as well as Sculpt served as testing ground
where the driver worked fine so far.

Fixes #4714.
2023-02-27 08:20:45 +01:00
Josef Söntgen
e826095e71 legacy/lx_emul/usb: handle saturated submit queue
Check if we are able to submit the Usb packet before attempting to
allocate it. In case the queue is already full we wait until another
pending packet is freed.

Fixes #4701.
2023-02-27 08:20:45 +01:00
Josef Söntgen
25d0dc19d5 nvme_drv: provide get/set feature command
These admin commands are used to configure features of the NVMe device.

Issue #4715.
2023-02-27 08:20:45 +01:00
Josef Söntgen
00a6d1306c nvme_drv: allow for accessing admin cmd results
Up to now it was only checked if an issued admin command was processed
in a timely fashion. Otherwise it has been treated as failed.
However, the completion-queue entry was not examined and the caller was
not able to access the entry itself. Depending on the command, checking
the completion-queue entry might be necessary, e.g. GET/SET_FEATURE.

Issue #4715.
2023-02-27 08:20:45 +01:00
Josef Söntgen
9f9bed7aa8 nvme_drv: move PRP list helper construction
Since the 'Platform::Device' constructor will defer the creation until
the content of the devices ROM is valid performing the PRP list helper
creation afterwards should be done with valid IOMMU information.

Issue #4715.
2023-02-27 08:20:45 +01:00
Norman Feske
76a99015c1 Mention genodians.org in top-level README 2023-02-27 08:20:45 +01:00
Benjamin Lamowski
faf37b51e7 dde_linux: backport fix for use-after-free reported by GCC 12
On my system, compiling dde_linux fails with `-Werror=use-after-free`.
Backport the fix from mainline to get rid of the issue.

Fixes #4740
2023-02-27 08:20:45 +01:00
Josef Söntgen
1f8438a6ae tool_chain: check ncursesw as well
Fixes #4699.
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
bfa90ab3e8 vmm: make initramfs an optional feature
Fix genodelabs/genode#4723
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
80687e702c vmm: implement VirtIO input model
Fix genodelabs/genode#4698
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
85c8bd7d7e vmm: implement VirtIO GPU model
Ref genodelabs/genode#4698
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
f2188bd397 vmm: silent several VirtIO config accesses
Ref genodelabs/genode#4698
2023-01-24 12:21:21 +01:00
Christian Helmuth
9de81369a7 libusb: retry configuration-descriptor retrieval
Some USB devices (e.g., webcams) fail to deliver their configuration
descriptor early after power-up. Testing revealed that retrying the
requests usually succeeds on second or third attempt.

Fixes #4739
2023-01-24 12:18:18 +01:00
Christian Helmuth
da673cfad7 tool/depot: replace wget by curl to support file:// URLs
File-scheme URLs permit users to host downloadable archives (which may
be sync'd by other means beforehand) on the local file system.

Fixes #4737
2023-01-24 12:18:16 +01:00
Christian Helmuth
07d02f8d46 tool/port: access to metadata of ports
Fixes #4685
2023-01-24 12:17:24 +01:00
Alexander Boettcher
4ab52aaf12 acpica: access ACPI IRQ via Platform "acpi" device
Issue #4679
2023-01-24 12:14:29 +01:00
Christian Helmuth
2353082bda pci_decode: report ACPI SCI IRQ in acpi device
Issue #4679
2023-01-24 12:14:23 +01:00
Christian Helmuth
53c2cff331 acpi: report ACPI tables and SCI IRQ
Issue #4679
2023-01-24 12:10:17 +01:00
Alexander Boettcher
661330a97a acpica: add dependency on acpi device
Issue #4679
2023-01-24 12:09:19 +01:00
Alexander Boettcher
dca71dbad9 pci_decode: add acpi device
Use it as point to defer clients (e.g. ACPI-CA) until platform driver could
claim all resources.

Issue #4679
2023-01-24 12:09:16 +01:00
Christian Helmuth
25eac6b9e6 depot: update recipe hashes 2023-01-24 12:07:33 +01:00
Norman Feske
3561ff90e9 sculpt_manager: remove unused Storage::dialog
This member variable remained unused since we moved the storage dialog
into the component graph.
2023-01-24 12:07:33 +01:00
Norman Feske
ffb8321e57 sculpt_test.run: add '-boot d' to Qemu args
When using '--include image/iso', we want to ensure that the virtual
machine boots from CD-ROM.
2023-01-24 12:07:32 +01:00
Christian Prochaska
ff8f7875f3 qt5: make physical screen size info configurable
Fixes #4733
2023-01-24 12:07:32 +01:00
Christian Prochaska
14483f64fd qt5: apply fix for QTBUG-83895
Fixes #4732
2023-01-24 12:07:32 +01:00
Sebastian Sumpf
437fd21ba0 mk: use _file_content instead of echo | cat
Use _file_content function to retrieve port hash instead of 'echo | cat'
construct that lead to 'Broken pipe' erros in GNU Make 4.4.

issue #4725
2023-01-24 12:07:32 +01:00
Tomasz Gajewski
d33139c40a enable ccache for reference Linux kernel
Genode build system allows to easily enable 'ccache' for builds. This
change allows to enable using 'ccache' also for build of reference
Linux kernel used during porting device drivers.

To enable 'ccache' it is enough to pass value of 'CC' variable when
executing Linux build but this build by default depends on time when it
is built which causes 'ccache' misses. To solve this issue additional
flags are passed to make build independent from time, current user and
host on which build is performed.

Issue #4718
2023-01-24 12:07:32 +01:00
Norman Feske
114238c248 sculpt_manager: query presets
This patch queries the files at config/presets/ in addition to
config/launcher using the existing launcher_query component.

Issue #4731
2023-01-24 12:07:32 +01:00
Norman Feske
88becbe29d sculpt: integration of optional presets
With the new 'presets:' tag, .sculpt files can now refer to deploy
configurations to be integrated in the presets/ subdirectory of the
config file system. Those files can thereby be used as preconfigured
system scenarios. Such a preconfigured scenario can be loaded at
runtime by copying the preset file to config/deploy.

Issue #4731
2023-01-24 12:07:32 +01:00
Norman Feske
a7a5c5ce54 run/image/uboot: move uImage to boot/
This patch changes the 'run_image' function to replace a boot/image.elf
file by the corresponding boot/uImage file.

Issue #4730
2023-01-24 12:07:32 +01:00
Alexander Boettcher
c06f5e2661 nova: flush on iommu context change (intel)
Fixes #4717
2023-01-24 12:07:32 +01:00
Alexander Boettcher
41865e6c30 nova: avoid oom fault on cross CPU
Fixes #4719
2023-01-24 12:07:32 +01:00
Alexander Boettcher
5f0ba7d722 intel_fb: handle rapid config change gracefully
In case of very rapid config ROM change (<300ms), the linux driver may still
be in progress of applying the previous change (e.g. switching connector on/off).

During this progress all tasks may become not runnable (waiting for IRQ/timeouts
until hardware state settles), the newest config ROM change/signal gets
dispatched, which lead to continuing the previous change request, but not
to re-starting/re-applying the new config change. To avoid this situation,
explicitly track whether a previous config change was finished and track if an
interim config change request came in. If so, re-start the lx_user
task with the newest config change.

Fixes #4721
2023-01-24 12:07:32 +01:00
Norman Feske
41ebf3bd94 run: remove argument from 'run_image' function
The argument is superfluous because only run/image/uboot evaluated it
anyway, and the argument is always boot/image.elf. With this change, the
official semantics of run_image become: "replace the boot/image.elf file
by platform-specific file(s) at boot/ that can actually be booted".

Issue #4730
2023-01-24 12:07:32 +01:00
Martin Stein
eba22b7551 nic_router: rework updating of TCP/UDP links
* Update links from forward rules only with forward rules and links from
  transport-routing rules only with transport-routing rules. Besides raising
  the performance of the code, this also fixes a former bug that allowed
  forward-rule links to falsely stay active because of a transport-routing
  rule that matched the client destination ip and port.

* Don't use good-case exceptions for updating TCP/UDP links on re-configuration
  of the router.

* Make conditions when to dismiss a forward rule easier to read.
  * Introduces != operator to the public Port class in the net library.

* Fix unnecessary log message that a link was dismissed when only a potentially
  matching forward rule turned out to be not matching.

* Apply Genode coding style to if statements with a single body statement.

Fix #4728
2023-01-24 12:07:31 +01:00
Martin Stein
845694bc44 nic_router: fix updating UDP/TCP links
This fixes a bug that was introduced by this earlier commit:

"nic_router: find forward rules w/o exceptions"

The NIC router used to falsely dissolve TCP/UDP connection states when
reconfiguring although the connection states were still legal according to the
new config. The reason was that the above mention commit nested lambdas but
missed to return from the last nesting level when having found a configuration
that legitimates the connection state.

Ref #4728
2023-01-24 12:07:31 +01:00
Roman Iten
17e4e2497f tool/depot: don't overwrite PATH variable
Issue #4725
2023-01-24 12:07:31 +01:00
Sebastian Sumpf
515854a19f tool/depot: adapt to .NOPARALLEL changes in GNU make 4.4
The semantic of .NOPARALLEL has changed in GNU Make 4.4

Quote:

New feature: .NOTPARALLEL accepts prerequisites If the .NOTPARALLEL
special target has prerequisites then all prerequisites of those targets
will be run serially (as if .WAIT was specified between each
prerequisite).

This means that only prerequisites are made sequential. Before
everything within a Makefile would be done in sequential order.

Therefore, we had to add the *.hash target (appears multiple times) to
the .NOPARALLEL prerequisites.

issue #4725
2023-01-24 12:07:31 +01:00
Norman Feske
d86309957e Road map for 2023 2023-01-24 12:07:31 +01:00
Benjamin Lamowski
641fadb3e9 base-hw: remove memory hole in bootstrap page table
Tests on qemu would fail when started with RAM sizes from 1025MiB to
2048MiB, because the the mapping hole in the page table from 1GiB to
2GiB would interfere with qemu's mapping addresses for ACPI.

Identity-map the complete first 4GiB of memory to catch all early
memory accesses during bootstrap.

Fixes #4724.
2023-01-24 12:07:31 +01:00
Norman Feske
79d8d1d557 sculpt_manager: Deploy::use_as_deploy_template
This patch simplifies the 'Deploy::update_managed_deploy_config'
interface by keeping an internal copy of the currently used deploy
template inside the 'Deploy' class. The template is updated whenever
the config/deploy file is modified.

This change weakens the coupling between the '_manual_deploy_rom' and
the '_deploy' subsystem, easing the upcoming implementation of the
switching between presets.
2023-01-24 12:07:31 +01:00
Norman Feske
bf231f7fca sculpt_manager: use update_list_model_from_xml
This patch replaces the use of 'List_model::Update_policy' types by
simpler 'update_list_model_from_xml' function calls.

Issue #4317
2023-01-24 12:07:31 +01:00
Norman Feske
39ca06114b sculpt_manager: keep launchers in 'Dictionary'
This patch replaces the direct use of an 'Avl_tree' by the modern
'Dictionary' utility.
2023-01-24 12:07:31 +01:00
Norman Feske
be7022dadc util/dictionary.h: alphabetically sorted for_each
This patch reverses the AVL-tree criterion to let 'for_each' traverse
the elements in alphabetical sorting order.

Issue #4610
2023-01-24 12:07:31 +01:00
Norman Feske
0e311845bf base-hw: don't show ROM modules at boot time
On complex scenarios like Sculpt on the phone, this change noticeably
reduces the boot time.

Issue #4705
2023-01-24 12:07:31 +01:00
Martin Stein
c665f4e51d base-hw scheduler test: add to autopilot
Fix #4151
Fix #4710
2023-01-24 12:07:31 +01:00
Martin Stein
68afbbc0f0 base-hw scheduler test: print method
Adds befriended test-local wrappers for the classes Cpu_share and Cpu_scheduler
and adds a print method to the scheduler wrapper that prints the internal state
of the scheduler to the given output. Cpu_shares are referenced in the output
via a the IDs that the test uses to organize them. I.e., this corresponds to
how the CPU shares are named when calling the atomic steps the test is made of.

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
f60a004cff base-hw scheduler test: rename test.cc main.cc
Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
20fea7fdd2 base-hw scheduler test: adapt to new behavior
This adapts the test to the changes that were applied to the scheduling scheme
by the following commits:

* base-hw scheduler: optimize quota depletion events
* base-hw scheduler: fix bug on removing head
* base-hw scheduler: fix ready method
* base-hw: optimize & cleanup scheduler

Part of that is that the test used to check whether the act of setting a share
ready outdates the head or not. However, with the current version of the
scheduler, this check is not possible anymore. We can merely check whether the
head is outdated after setting the share ready. So, among other adaptions, this
commit adapts the expectations of the test to the new semantics of the check.

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
615dd377dd base-hw scheduler test: clean up
* Get rid of preprocessor macros.
* Introduce Main as class.
* Exit with -1 instead of endless loops on errors.
* Don't try to deal with error conditions, just print a message and exit
  with -1.
* Only one operation per line.

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
0467b4aaf3 base-hw scheduler: optimize quota depletion events
This is an optimization for the case that a prioritized scheduling context
needs slightly more time during a round than granted via quota. If this is the
case, we move the scheduling context to the front of the unprioritized schedule
once its quota gets depleted and thereby at least ensure that it does not have
to wait for all unprioritized scheduling contexts as well before being
scheduled again.

Note that this introduces the possibility of undeserved starvation of
unprioritized scheduling contexts to the scheduling scheme. If there are
enough prioritized contexts that deplete their quota during a round,
they may cover up also the rest of the round with their unprioritized time
slices. If this happens every round, contexts without a priority/quota may
never get a turn. In the previous scheduling scheme, this could not occur as
the unprioritized schedule was completely independent from prioritized
schedules and rounds.

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
f74962bdad base-hw scheduler: fix bug on removing head
The scheduler did not consider the consumed quota during a call to "update"
if the head that consumed the quota was removed from the scheduler. When this
occured, the internal round time did not advance as expected but remained at
its previous value untile the next call to "update" (without a removed head)
This commit introduces a new flag that is set only when the head gets removed
in order to detect and handle the situation correctly on the next call to
"update".

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
ab298b6337 base-hw scheduler: fix ready method
Setting the _need_to_schedule member in the 'ready' method of the scheduler
was not done correctly. At least, the _need_to_schedule was set true in
situations were the head was not outdated by the 'ready' operation.

Ref #4151
2023-01-24 12:07:31 +01:00
Stefan Kalkowski
1151706243 hw: rename functions of Ipc_node class signature
* Remove *request* in context of: wait, reply, send to shorten it.
* Use ready_to_* instead of can_*, which is regularily used in Genode's APIs
* Replace helping_sink with helping_destination, as destination is more common

Ref genodelabs/genode#4704
2023-01-24 12:07:30 +01:00
Stefan Kalkowski
fd3c70ec5b hw: mark threads as dead in case of ipc violations
The IPC protcol violations are:

* Sending to an unknown thread (cap)
* Waiting for messages if a reply hasn't happened yet

This silents threads that otherwise repeatedly cause kernel messages
about the violation.

Ref genodelabs/genode#4704
2023-01-24 12:07:30 +01:00
Stefan Kalkowski
fc690f1c47 hw: re-work the ipc node's internal state machine
* Split the internal state into incoming and outgoing message relations
* Avoid fragmenting of one state like formerly '_state' and '_help'
* Remove pointer to caller, use incoming FIFO instead

This commit fixes at least two bugs that were triggered by tests that
destroy threads in many different states, like run/bomb:

* The '_help' data member was not reset reliable in each situation where a
  helping relationship came to an end. However, when we fixed this bug alone
  in the old state model, the issues remained. The new state model fixes
  this bug as well.

* A thread sometimes referenced an already dead thread as receiver. This caused
  the kernel IPC code to access the vtable of an object that didn't exist any
  longer. Note that the two threads were not in direct IPC relationship while
  the receiver was destroyed, so, there must have been an intermediate node
  between them. Due to the complexity of this problem, we eventually gave up
  pin-pointing the exact reason in the kernel IPC code. The issue disappeared
  with the new state model.

Fix genodelabs/genode#4704
2023-01-24 12:07:30 +01:00
Josef Söntgen
5a558a64e1 gpt_write: use GPE LBA from header
When writing the GPT header, the tool always wrote the GPT entries
belonging to the primary header to LBA following the header. Normally
this is LBA 2 as the header is located in LBA 1. The GPT allows for
up to 128 entries that all in all cover 16 KiB of storage space.
However, on some systems, e.g. ARM-based machines, the bootloader can
be stored in this region. For this reason the GPT entries may be moved
to a different LBA.

This commit changes the tool to adhere to then given GPE LBA in header
when writing out the modified GPT data.

Fixes #4720.
2023-01-24 12:07:30 +01:00
Norman Feske
ddeaccf728 vfs: documentation of Vfs::Env::User
Issue #4706
2023-01-24 12:07:30 +01:00
Christian Prochaska
09c1a9cfc0 qt5: don't pass non-printable unicode values on key repeat
Fixes #4716
2023-01-24 12:07:30 +01:00
Norman Feske
25e4bcefbf vfs: remove 'Io_response_handler' interface
The old 'Io_response_handler::io_progress_response' interface has been
replaced by the 'Vfs::Env::User::wakeup_vfs_user' (issue #4697). The
remaining 'read_ready_response' method is now hosted in the
appropriately named 'Read_ready_response_handler'.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
74e6370187 cbe/vfs/trust_anchor_vfs.h: avoid 'Constructible' 2023-01-24 12:07:30 +01:00
Norman Feske
53b67810ba vfs/cbe_trust_anchor: Remove Io_response_handler
This patch keeps driving the internal state machines until no progress
can be made. This required fixing the return values of several execute
functions, which used to report progress while being in complete state.

Along the way, the patch removes default switch cases to ensure that all
states are covered.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
909c3571e3 vfs/cbe: Remove use of Io_response_handler
The patch also touches app/cbe_init because it depends on the
public cbe/vfs/trust_anchor_vfs.h header.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
6c79e95052 vfs_replay: Remove Io_response_handler
Note that this change has not been tested as we have no ready-to-use
run script stressing this component.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
f56883e238 cbe_init_trust_anchor: Remove Io_response_handler
Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
f4da21252b cbe_tester: Remove use of Io_response_handler
Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
bb904b9166 vfs: propagate I/O activity via 'wakeup_vfs_user'
This commit supplements the various I/O signal handlers of the VFS
plugins with calls of the new 'Vfs::Env::User::wakeup_vfs_user'
interface, which will subsequently replace the old 'Io_progress_handler'
(issue #4697).

Issue #4706
2023-01-24 12:07:30 +01:00
Stefan Kalkowski
767632e1af dde_linux: remove leftovers of legacy fec_nic_drv
Some relicts in `repos/dde_linux/lib`.

Ref #4651
2023-01-24 12:07:30 +01:00
Norman Feske
782fad0b41 vfs/lwip: remove 'blocked_handles' queue
The 'blocked_handles' queue was used to notify the VFS user via the
'io_progress_response' mechanism. This is now covered by the
'wakeup_vfs_user' interface introduced in issue #4697.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
9a2c03d2c6 vfs: remove Read_result::READ_ERR_INTERRUPT
The error condition was too vague and thereby remained unused in
practice.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
ba78cf72ae vfs: remove Read_result::READ_ERR_AGAIN
The condition is covered by READ_ERR_WOULD_BLOCK.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
1aba073e32 vfs: remove File_io_service::General_error
Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
a1fb51e050 vfs: remove File_io_service::register_read_ready
Issue #4706
2023-01-24 12:07:30 +01:00
Christian Helmuth
e483fc2525 nova: remove frame size compiler warnings 2023-01-24 12:07:30 +01:00
Christian Helmuth
89b0eca383 wm: ensure eight views fit into slab block
Issue #3834
2023-01-24 12:07:29 +01:00
Christian Helmuth
bccc57bb29 Adapt run scripts for Intel Xe GPU 2023-01-24 12:07:29 +01:00
Christian Prochaska
0c465fbb4d trace session: fix double quota accounting
Fixes #4707.
2023-01-24 12:07:29 +01:00
Christian Helmuth
b4f6f796d6 Clear board/pc/devices
Information about PS/2 and PIT where moved to app/pci_decode in the
following commit.

  pci_decode: report devices from ACPI info

We still provide an empty <devices> node as the file itself is used by
platform agnostic run scripts.
2023-01-24 12:07:29 +01:00
Norman Feske
0fefee804c vfs: remove File_io_service::ioctl interface
This interface has been obsoleted by the use of pseudo files,
implemented in the context of issue #3519.

Issue #4706
2023-01-24 12:07:29 +01:00
Stefan Kalkowski
08c56e61e1 hw: avoid overhead for cache maintainance
When running on x86, and riscv never enter the kernel for cache maintainance,
but use the dummy implementation of the generic base library instead.

On ARMv8 it is not necessary to enter privileged mode for cache cleaning, and
unification of instruction/data cache, but only for invalidating cache lines
at all levels, which is necessary for the use cases, where this function it
needed (coherency of DMA memory).

Fix genodelabs/genode#4339
2023-01-24 12:07:29 +01:00
Josef Söntgen
66fd027b96 base-hw: introduce 'cache_line_size' call
This call is used to query the cache line size of the underlying CPU.
For now it is only implemented and used by 'arm_v8' platforms.

It does not distinguish between D-/I-cache sizes and always uses the
smallest size. Furthermore it does not account for any discrepancy
in 'big.little' CPUs.

Issue #4339.
2023-01-24 12:07:29 +01:00
Josef Söntgen
e8f748cfed base-hw: unprivileged cache maintenance on ARMv8
Set 'Sctlr_el1::Uci' bit to allow for executing cache clean and
invalidate instruction from user space.

Issue #4339.
2023-01-24 12:07:29 +01:00
Stefan Kalkowski
8fe7fa5532 hw: don't take the log backend's mutex in kernel
To prevent the kernel to deadlock, or call itself with a syscall when
using a lock potentially hold by a core thread, the log console's
backend for core (hw) gets replaced by a specific variant that checks
whether it runs in the kernel context before using the mutex.

Fix genodelabs/genode#3280
2023-01-24 12:07:29 +01:00
Christian Helmuth
b59ec55d50 lx_emul: provide irqsave/restore write-lock functions 2023-01-24 12:07:29 +01:00
Christian Helmuth
6d14f5442e lx_emul: provide more pci functions
- pci_dev_present() based on devices on bus
- pci_request_regions() as dummy
- pci_release_regions() as dummy
2023-01-24 12:07:29 +01:00
Norman Feske
0fa683f244 vfs/cbe_trust_anchor: add sanity check
This patch adds a null-pointer check to the '_close_handle' method,
which triggers when using the vfs_cbe.run script in interactive mode.
2023-01-24 12:07:29 +01:00
Norman Feske
ca0d3757cc vfs: make 'File_io_service::read_ready' const
... and replace pointer argument to const reference.

Issue #4706
2023-01-24 12:07:29 +01:00
Martin Stein
1b1a9ca95c nic_router: fix bad connection states on IP change
When a domain receives a new dynamic router IP address and that domain has
active connection states (TCP/UDP/ICMP) from another domain with NAT applied,
the connection states used to stay active while becoming obsolete. They
become obsolete because their identification and their packet processor
use the old routers IP address due to NAT.

One consequence was that connections became dysfunctional when the server
domain received a new dynamic router IP address. Request packets were still
routed from client to server, but when entering the server, their source IP
address was the outdated router address. Consequently, the server responses
used the outdated address as destination and the router dropped the responses
because it did not know this address anymore.

This commit fixes the problem by letting a domain destroy all its connection
states that were initiated from within other domains whenever it detaches from
its current IP configuration.

Strictly speaking, it is not necessary to destroy all connection states, only
those that the domain applies NAT to. However, the Genode AVL tree is not built
for removing a selection of nodes and trying to do it anyways is complicated.
So, for now, we simply destroy all connection states.

Note that the other way around was handled correctly already. When a domain
detaches from its IP config, all interfaces of that domain destroy all the
connection states they created (towards other domains).

Fixes #4696
2023-01-24 12:07:29 +01:00
Martin Stein
7a7cac57d9 nic_router: futile ip config updates on dhcp renew
If the IP config does not change on updates to the router IP config of a domain
change (a common case on DHCP RENEW), prevent detaching from the old config and
attaching to the new one. Because this would not only create unnecessary CPU
overhead but also force all clients at all interfaces that are listening to
this config (via config attribute 'dns_config_from') to restart their
networking (re-do DHCP).

Ref #4696
2023-01-24 12:07:29 +01:00
Christian Prochaska
68ba648897 libdrm/lima: fix double file descriptor close
Fixes #4703
2023-01-24 12:07:29 +01:00
Christian Prochaska
16ce6b7acc mesa/lima: don't call 'close()' for non-libc fd
Fixes #4702
2023-01-24 12:07:29 +01:00
Sebastian Sumpf
2c92fc4b6f vbox6: add null pointer check for clipboard
Check 'pv == nullptr' in 'ShClSvcImplWriteData' and return
VERR_INVALID_POINTER if invalid (as is done, for example, in the X11
implementation).

issue #4666
2023-01-24 12:07:29 +01:00
Christian Helmuth
41d0c89a52 libc: remove misleading SNDCTL_DSP_RESET error message
Fixes #4676
2023-01-24 12:07:29 +01:00
Norman Feske
e5272b65a1 vfs: remove unused Fs_file_system::_read method 2023-01-24 12:07:29 +01:00
Josef Söntgen
8384d7b5ed run/acpica: fix devices report route
Issue #4679.
2023-01-24 12:07:29 +01:00
Josef Söntgen
794b019a8a sculpt/launcher: add top launcher 2023-01-24 12:07:29 +01:00
Josef Söntgen
aed3b6c6be Add test-audio_out pkg recipe 2023-01-24 12:07:29 +01:00
Josef Söntgen
14d0b72f52 black_hole: add report session support 2023-01-24 12:07:28 +01:00
Josef Söntgen
03165c96cc Add cpu_burner pkg recipe 2023-01-24 12:07:28 +01:00
Josef Söntgen
a96c7ebd8d cpu_burner: only use timer when not 100 perecent 2023-01-24 12:07:28 +01:00
Josef Söntgen
916d45b450 os: add top pkg recipe 2023-01-24 12:07:28 +01:00
Christian Helmuth
a16eeeec5d nova: set initial TSC after all CPUs are ready
Issue #4669
2023-01-24 12:07:28 +01:00
Norman Feske
2a1240d1e9 base: provide generic cpu/string.h
This patch uses the formerly x86-specific cpu/string.h for all
architectures if no spec/<arch> variant exists.

Issue #4456
2023-01-24 12:07:28 +01:00
Norman Feske
0ebb572f48 pkg/test-libc_connect_lwip: increase server RAM 2023-01-24 12:07:28 +01:00
Norman Feske
ff2176a586 vfs,libc: support write fds in select
By adding a 'write_ready' interface following the lines of the existing
'read_ready', VFS plugins become able to propagate the (de-)saturation
of I/O buffers to the VFS user. This information is important when using
a non-blocking file descriptor for writing into a TCP socket. Once the
application observes EAGAIN, it expects a subsequent 'select' call to
return as soon as new I/O buffer space becomes available.

Before this patch, the select call would always return under this
condition, causing an unnecessarily busy write loop.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
5ad98f2b7c vfs,libc: introduce Vfs::Env::User interface
The new interface is meant to replace the 'Vfs::Io_response_handler'.
In contrast to the 'Io_response_handler', which had to be called
on a 'Vfs_handle', the new interface does not require any specific
'Vfs_handle'. It is merely meant to prompt the VFS user (like the libc)
to re-attempt stalled I/O operations but it does not provide any
immediate hint, about which of the handles have become ready for
reading/writing.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
cf87b0fadb vfs: simplify File_io_service::write return values
This patch removes the 'Insufficient_buffer' exception by returning the
WRITE_ERR_WOULD_BLOCK result value instead. It also eliminates the
superfluous WRITE_ERR_AGAIN and WRITE_ERR_INTERRUPT codes.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
d9f5dda322 lwip: increase TCP send buffer 32->80 packets
Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
0584ac195c curl: increase maximum write-buffer size
The original size of 16K impedes the batched processing of network
packets. Changing the value to 256K reduces the number of context
switches when downloading large files and thereby improves the
throughput by more than 25% (base-hw on qemu_x86_64, using fetchurl
to download a file of 100 MiB via the NIC router from lighttpd).

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
8a9974b6f9 vfs/lwip: deferred wakeup of NIC server
This patch fosters the batching of network packets transferred by the
lwIP stack over the NIC connection. It replaces the eager submission of
the packet-stream's data-flow signals by explicit wakeup notifications.

The commit also increases the NIC session's buffer size from 128 to 1024
packets.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
60175631df vfs/lwip: remove obsolete mutexes
Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
5fdacae88b vfs: remove obsolete mutexes
...and tighten constness in adjacent code parts.

The VFS-internal synchronization via mutexes is no longer needed because
the access to the VFS is serialized by the VFS client, i.e., the libc.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
fcf5fcd58c libports: remove stand-alone variant of lwIP
Since the lwip library is used only by the vfs_lwip plugin, this patch
moves the Genode-specific support code local to the VFS plugin, easing
further simplification and allowing for a tighter integration with the
VFS plugin.

The recipes for api/lwip and src/vfs_lwip stay separate as both parts
use different licenses.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
e9541605ab ports: lighttpd_fetchurl.run script
This networking scenario is useful for analysing and optimizing the
interplay of the VFS, libc, TCP/IP, and the NIC router. It downloads a
file via fetchurl from lighttpd, both of which are hosted on a virtual
network.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
7d8d4f4532 vfs,libc: deferred wakeup of remote peers
This patch facilitates the batching of I/O operations in the VFS library
by replacing the implicit wakeup of remote peer (via the traditional
packet-stream interface like 'submit_packet') by explicit wakeup
signalling.

The wakeup signalling is triggered not before the VFS user settles down.
E.g., for libc-based applications, this is the case if the libc goes
idle, waiting for external I/O.
In the case of a busy writer to a non-blocking file descriptor or socket
(e.g., lighttpd), the remote peers are woken up once a write operation
yields an out-count of 0.

The deferring of wakeup signals is accommodated by the new 'Remote_io'
mechanism (vfs/remote_io.h) that is designated to be used by all VFS
plugins that interact with asynchronous Genode services for I/O.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
9421a449ab test/libc_many_writes for examining write batching
This test reveals the patters of the batching of consecutive write
operations on a file-system session. It issues 100 writes of one byte
each, which should ideally result in large batches of operations
submitted to the file-system session at once.

The run script performs the write operations through a chain of two VFS
servers, thereby exercising the write batching of both the libc and the
intermediate VFS server.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
6edede0db9 server/vfs: facilitate batching of requests
By replacing the calls of 'acknowledge_packet' and 'get_packet' with
'try_ack_packet' and 'try_get_packet', we avoid the implicit triggering
of data-flow signals. Instead, the VFS server now relies on explicit
calls of the packet stream's 'wakeup' interface.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
a15c894385 file_system_session: increase TX_QUEUE_SIZE to 32
The change of the queue size from 16 to 32 has negligible costs (4 KiB
instead of 2 KiB for the packet-stream queues) while facilitating the
batching of many small consecutive write operations.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
9c57157e44 Audit VFS-plugin improvements
- Log read and write operations
- Fix leaf_path implementation
- Support queue sync

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
9a662249eb vfs_cbe_init.run: adapt to use of libcrypto 2023-01-24 12:07:27 +01:00
Christian Helmuth
772f89e77f linux.port: xhci patch to fix "unknown event type 37"
Issue #4678
2023-01-24 12:07:27 +01:00
Christian Helmuth
8661936d7d base: aquire context mutex in local_submit()
Some signal-heavy scenarios (e.g., libc_integration) produced the
following warning that hinted a data race on signal data in the context
object.

  Warning: returning signal with num == 0

The cause was the use of Signal_context::local_submit() in the libc
introduced in

  424ed1b79a libc: remove Reconstructible / use local_submit in kernel

in combination with a missing context-mutex aquisition resulting in a
data race on Signal_context::_curr_signal.

Issue #3923
2023-01-24 12:07:27 +01:00
Alexander Boettcher
377f2166a1 nova: support detection of Intel P & E CPUs
Fixes #4694
2023-01-24 12:07:27 +01:00
Michael Mueller
917c5fa261 blinktree: Compile with clang. 2022-12-08 11:25:26 +01:00
Michael Mueller
32f42d693a mxtasking: Made hello world example working again. 2022-12-08 11:23:26 +01:00
Michael Mueller
fb91e40f0c libports: Ported libpfm4 to Genode. 2022-12-08 11:20:24 +01:00
Michael Mueller
84a5e1ac0a NOVA: Added syscall to read and write MSRs. This enables core to use performance counters. 2022-12-08 11:18:30 +01:00
Michael Mueller
e0a9f13197 core: Clear dataspace on free() by default. 2022-12-08 11:15:37 +01:00
Christian Helmuth
83ac80460e depot: update recipe hashes 2022-12-05 16:37:21 +01:00
Christian Helmuth
ed9a8299b2 run/image/uboot: merge with uboot_fit
Both modules were quite similar except the the name of the FIT image
(image.itb) and the mkimage command line. FIT images are now produced by
the following RUN_OPT.

  RUN_OPT += --include image/uboot --image-uboot-fit

Issue #4693
2022-12-02 11:08:59 +01:00
Norman Feske
a9383dfa79 run/image/uboot: use gzip --fast by default
By making the use of gzip's '--best' option configurable and disabling it
by default, this patch noticably reduces the built-test cycle from 15 to
10 seconds when integrating the Sculpt system image for the PinePhone.

Fixes #4693
2022-12-02 11:08:58 +01:00
Martin Stein
f10c470969 sculpt_manager: fix router label lookup
The commit "sculpt_manager: relax nic_drv policy label" introduced the use of
the "label_prefix" attribute instead of "label" for the uplink policy in the
NIC router. However, it missed an appropriate adaption of the lookup of that
attribute when the Sculpt manager has to decide which uplink is used in a
manually managed router config. This caused the uplink to disappear whenever a
user created a manually managed router config. This commit fixes the problem.

Issue #4660
Fixes #4695
2022-12-02 09:54:33 +01:00
Norman Feske
f3fc11713a sculpt: re-enable inspect view by default
The inspect view got accidentally disabled by commit "sculpt: make graph
features configurable".
2022-12-01 13:51:58 +01:00
Christian Helmuth
4c5db31110 base: ld-<platform>.abi.so depends on symbol.map
This prevents errors like the following during parallel builds.

      MERGE    ld-hw.abi.so
  /usr/local/genode/tool/21.05/bin/genode-arm-ld:symbol.map:0: syntax error in VERSION script
2022-12-01 11:47:32 +01:00
Norman Feske
2dae1e0504 Adjust image name in release_notes/22-11.txt 2022-11-30 14:39:49 +01:00
Christian Helmuth
f44b16eaa3 version: 22.11 2022-11-30 14:02:24 +01:00
Christian Helmuth
aa2f61fa0e depot: update recipe hashes 2022-11-30 14:02:24 +01:00
Norman Feske
65135f5f7a News item for version 22.11 2022-11-30 13:58:37 +01:00
Norman Feske
faa1e6f1b2 Release notes for version 22.11 2022-11-30 13:58:36 +01:00
Norman Feske
0048ff2a2f doc: updated components.txt 2022-11-30 13:58:36 +01:00
Norman Feske
168aa04c85 doc: minor fix in release notes of version 22.08 2022-11-30 13:58:36 +01:00
Michael Mueller
0fc7184eb9 base: Added missing symbols. 2022-11-29 12:34:43 +01:00
Michael Mueller
6603f4d147 stdcxx: Use atomics for 64-bit integers instead of 32-bit. 2022-11-29 12:33:50 +01:00
Christian Helmuth
b033b30f95 depot: update recipe hashes 2022-11-29 12:32:49 +01:00
Michael Mueller
e539d12b86 mxtasking.port: Updated revision. 2022-11-29 12:32:46 +01:00
Michael Mueller
a73bcf8bc1 mxtasking: Updated hash. 2022-11-29 12:32:10 +01:00
Michael Mueller
484d6714c3 mxtasking: Use clang to build. 2022-11-29 12:31:53 +01:00
Michael Mueller
9d0298f5fd libc and stdcxx: added missing symbols used by clang. 2022-11-29 12:31:26 +01:00
Christian Helmuth
5ff8e7cadf lx_emul: use usb_unlink_urb() in timeout handler
Replace usb_kill_urb() by usb_unlink_urb() in the timeout handler for
control URBs, as usb_kill_urb() may block and is not allowed to be
called in IRQ/bottom half contexts.

Fixes #4681
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
5cff81fc29 usb c_api: prevent exception on full ack queue
Count more accurately how much packets are in flied, and whether
new packets can be handled. Moreover, catch potential exceptions
whenever acknowledging a packet, and warn about the lost acknowledgement.

Fix genodelabs/genode#4678
2022-11-29 12:29:57 +01:00
Alexander Boettcher
8ddd93ec27 vbox: avoid uncaught nic Empty_ack_queue exception
Fixes #4677
2022-11-29 12:29:57 +01:00
Christian Prochaska
331a2e39eb qt5: reduce warning messages from QPA plugin
Fixes #4692
2022-11-29 12:29:57 +01:00
Josef Söntgen
15f75216c7 libdrm/lima: serialize poll and ioctl with mutex
There is at least one client that performs DRM calls from multiple
pthreads, which is not supported for now. We guard the concurrent
access by grabbing a pthread_mutex before each operation.
2022-11-29 12:29:57 +01:00
Christian Prochaska
f4b06be24b fetchurl: handle leading '/' in '_process_fetch()'
Fixes #4691
2022-11-29 12:29:57 +01:00
Christian Prochaska
ffb48ed030 extract: handle leading '/' in 'create_directories()'
Fixes #4690
2022-11-29 12:29:57 +01:00
Alexander Boettcher
a91467f3a8 platform_drv: support enforced 1:1 DMA mapping
Follow up commit of

"platfrom_drv: map DMA memory non-natural when iommu is present"

Issue #4665
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
b596db3eed pistachio: size-aligned I/O mem mapping in core
This commit circumvents faulty behaviour of base-pistachio, if
the PCI config space gets requested megabyte-wise. It occurs that
we get a mapping sequence in between sigma0, core and component,
like the following: 0xe1000000 => 0xbf001000 => 0x10b000,
with the consequence that the component stalls when accessing
the latter one. By requesting I/O memory aligned to the size,
the faulty behaviour vanishes.

Ref #4686
2022-11-29 12:29:57 +01:00
Christian Helmuth
424ed1b79a libc: remove Reconstructible / use local_submit in kernel 2022-11-29 12:29:57 +01:00
Christian Prochaska
acb6bbb649 hw: fix 'Kernel::time()' deviation in RISC-V timer
Issue #4360
2022-11-29 12:29:57 +01:00
Christian Prochaska
345c01677d hw: fix 'Kernel::time()' deviation in ARM generic timer
Issue #4360
2022-11-29 12:29:57 +01:00
Christian Prochaska
866df56131 libc: handle empty path string in file I/O functions
Fixes #4689
2022-11-29 12:29:57 +01:00
Christian Prochaska
5d62429164 libc: check path pointer in 'symlink' and 'unlink'
Fixes #4688
2022-11-29 12:29:57 +01:00
Johannes Schlatow
132906c925 platform_drv: update ROM in device_by_type()
This is required for scenarios in which a device appears at a later
point in time. If the ROM is not updated, the device_by_type() method may
operate on an outdated dataspace and never find the device it is waiting for.
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
f6825eea5f pci_decode: increase default ram quota
To circumvent problems of the page-table entries getting short on sel4,
increase the RAM quota for this component in all run-scripts.

Fix #4686
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
10aa5ebf03 pci_decode: report devices from ACPI info
Although we do not have the full ACPI information parsed yet, to
announce non-PCI devices derived from the ACPI tables, the device
description of the assumed devices is now integral-part of pci_decode.
Formerly, the information was gained separatedly as boot-module, whereby
we lost synchronization in between ACPI/PCI parsing, BIOS handover, and
PS/2 emulation code already acting.
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
c9efcfab17 sntp_dummy_rtc: add depot package recipe
This recipe combines the dummy_rtc_drv, which consumes a given time,
and provides the "Rtc" service to its clients with the simple NTP client,
which provides the current time to the RTC driver in regular intervals.

Ref genodelabs/genode#4687
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
7cb19ee2b3 sntp_client: add depot src recipe
Ref genodelabs/genode#4687
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
9e61fb90c5 Remove legacy platform_drv, API, and platform.inc
Fix genodelabs/genode#4671
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
08378dd148 libports: remove platform_drv.inc from run-scripts
Ref genodelabs/genode#4671
2022-11-29 12:29:56 +01:00
Stefan Kalkowski
de083efcf2 os: remove platform_drv.inc from run-scripts
* block_tester.run: use Linux only
* vfs_block: was not dependent on platform_drv anyway

Ref genodelabs/genode#4671
2022-11-29 12:29:56 +01:00
Stefan Kalkowski
3274270951 os: remove audio_out_click run-script
Almost a duplicate of repos/dde_bsd/run/audio_out.run

Ref genodelabs/genode#4671
2022-11-29 12:29:56 +01:00
Alexander Boettcher
224b766eb1 add acpi suspend test scenario
Test to trigger periodically ACPI suspend and resume and periodically
trying to restart graphic driver.

Tested successfully with X201 and T420.

Issue #4669
2022-11-29 12:29:56 +01:00
Michael Mueller
7144a96a00 core-nova: Removed debug messages. 2022-11-29 12:28:59 +01:00
Michael Mueller
cd7780fd50 libc: Allocate memory cacheline-aligned by default to prevent false sharing. 2022-11-29 12:27:18 +01:00
Michael Mueller
2a8fe2b335 blinktree: Updated run script to include topology service. 2022-11-29 12:26:00 +01:00
Michael Mueller
e2ddc82102 blinktree: Use Genode::timestamp() instead of std::chrono's functions. 2022-11-29 12:24:55 +01:00
Michael Mueller
70869735d7 blinktree: Start measurement via task to avoid measuring worker thread creation. 2022-11-29 12:23:58 +01:00
Michael Mueller
195be5ff6e core: Export interface for explicit thread migration and pinning. 2022-11-29 12:21:02 +01:00
Michael Mueller
a894a008eb core: Allocate dataspaces with cache-alignment. 2022-11-29 12:18:50 +01:00
Michael Mueller
2115c5557f core: Allow pinning and migration of threads from userspace components. 2022-11-29 12:17:51 +01:00
Michael Mueller
c2c66bbcb5 core-nova: Use shorter time quantum. 2022-11-29 12:16:53 +01:00
Michael Mueller
a8d64786bd core-nova: Fixed wrong report of memory ranges for NUMA nodes. 2022-11-29 12:15:09 +01:00
Michael Mueller
1746f55306 core: Removed zeroing of new dataspace, as this takes a lot of time for huge dataspaces. 2022-11-29 12:14:16 +01:00
Michael Mueller
9980c4f0b5 blinktree: Print runtime parameters at start. 2022-11-29 12:11:44 +01:00
Alexander Boettcher
dee178aae5 acpica: execute suspend&resume ACPI methods
on 'system' ROM state changes.

Issue #4669
2022-11-18 14:46:04 +01:00
Alexander Boettcher
58ff53ec52 acpica: report S0-S5 sleep state support
Issue #4669
2022-11-18 14:46:04 +01:00
Alexander Boettcher
fd2a216909 base: support ACPI suspend via Pd::managing_system
Issue #4669
2022-11-18 14:45:27 +01:00
Alexander Boettcher
03470e7bab nova: use kernel with suspend/resume support
Issue #4669
2022-11-18 14:45:27 +01:00
Norman Feske
565be454aa Mention Johannes' VM guide in Sculpt documentation 2022-11-18 08:47:15 +01:00
Stefan Kalkowski
7ebe09fbf7 pci_decode: limit PCI config space mappings
Map only one PCI bus at once when parsing the PCI buses.

Fix genodelabs/genode#4686
2022-11-17 17:22:58 +01:00
Roman Iten
da60200377 libports: use GitHub mirror for fatfs
It looks like http://www.elm-chan.org is blocking certain IP ranges,
because downloading the source archive on certain machines fails with
"403 Forbidden".

Fixes genodelabs/genode#4623
2022-11-17 15:35:58 +01:00
Alexander Boettcher
790e81349f mixer.run: adjust to new platform driver
Issue #4656
2022-11-17 14:48:26 +01:00
Josef Söntgen
4bacba431b nvme_drv: do not mask interrupts
During interrupt handling the driver masked and cleared interrupts as
recommended in the spec to prevent spurious or unnecessary interrupts
from occurring.

Due to the way the current implementation operates new Block requests
got submitted while handling completions for already finished ones.
Since interrupts where masked at this point the controller did not
generate interrupts when the newly submitted requests got completed.

As the mask/clear optimization is apparently not strictly needed and
according to the spec undefined when using MSI-X it is removed.

Fixes #4684
2022-11-17 14:45:57 +01:00
Christian Helmuth
c58d799f16 depot: update recipe hashes 2022-11-17 08:00:37 +01:00
Christian Helmuth
25d7970b6f depot: fix README of pkg/usb_modem_drv 2022-11-17 08:00:37 +01:00
Sebastian Sumpf
3250f1951b vbox6: gim system time update measurement
200 TSC ticks for max measurement duration can get too small on platforms
with high TSC frequencies (e.g., >3GHz) and low CPU frequencies often
caused by HWP configurations. Therefore, we express the measurement
duration in NS (not ticks) and calculate max duration ticks using the
TSC frequency. This way the max duration becomes independent of the TSC
frequency.

fixes #4672
2022-11-17 08:00:37 +01:00
Stefan Kalkowski
b78b543011 vmm: make ARM VMM configureable
This commit enables users of the VMM to define CPU type and count, RAM size,
kernel and initrd ROM names, GIC version, and Virtio devices to be used.
Derived from the configuration values a flattened device-tree blob (DTB) is
generated and transfered to the VM.

Fix genodelabs/genode#4670
2022-11-17 08:00:37 +01:00
Benjamin Lamowski
0e9a49d1cf wifi/pc: add firmware for the Intel AX211
Lenovo Thinkpads with 12th gen Intel i7 CPUs such as the X1 Nano G2 may
contain such a wifi card.

Issue #4663
2022-11-17 08:00:37 +01:00
Benjamin Lamowski
e46a7dd6f5 dde_linux: fix Intel Intel AX211 wifi without MSI-X
Lack of MSI-X support in DDE Linux causes a timeout when the Intel AX211
tries to call back into the driver while loading the PNVM file while
interrupts are still disabled.

With the patch picked up from QubesOS the card works on an X1 Nano G2:
5fcfe0f19e

Issue #4663
2022-11-17 08:00:37 +01:00
Benjamin Lamowski
04efe88044 wifi/pc: add support for loading PNVM files
Intel wifi cards in the AX210 family need additional PNVM firmware to
function properly. Enable the bundling and loading of *.pnvm files.

Issue #4663
2022-11-17 08:00:37 +01:00
Benjamin Lamowski
bcea2a958e wifi/pc: implement firmware requests without warning
Until now, requesting optional blobs such as 'iwl-debug-yoyo.bin' has
just failed silently. To support desired blobs such as PNVM firmware,
implement the loading of optional firmware while preserving the nowarn
characteristics of the function.

Issue #4663
2022-11-17 08:00:37 +01:00
Sebastian Sumpf
0a8d6ddba9 core: Ignore constraints on allocations if allocator is exhausted
Try to allocate within constraint area first. In case the area is exhausted,
try allocation at other memory locations.

The motivation for this is to limit DMA allocations to 4GB (since some
devices require addresses below 4GB). On some platforms there is little
physical RAM in this area (<1GB) and the constrainted area exhausts. In
case an IOMMU is present, RAM at higher locations can still be mapped
below 4GB, which is done in the platform drivers.

issue #4665
2022-11-17 08:00:37 +01:00
Sebastian Sumpf
77fc2f1e86 platfrom_drv: map DMA memory non-natural when iommu is present
Consume '<iommu/>' tag from 'devices' report. In case an IOMMU is
present map physical memory to arbitrary locations within IO page table
range 1K-4G. This way every device PD has access to ~4GB of DMA space.

issue #4665
2022-11-17 08:00:37 +01:00
Sebastian Sumpf
b66987e1ce base-nova: export iommu feature from HIP to platform_info
issue #4665
2022-11-17 08:00:37 +01:00
Christian Helmuth
a89eb5e7e3 Increase acpi_drv RAM/CAP quota in USB tests
The amount of 7M/350 matches repos/gems/sculpt/drivers/pc.
2022-11-17 08:00:37 +01:00
Johannes Schlatow
f5ab6ea7ae libports: update expat to 2.5.0
Fixes #4662
2022-11-17 08:00:37 +01:00
Christian Prochaska
d323072bb6 libc: build 'libc-string' library with -O3
Fixes #4658
2022-11-17 08:00:37 +01:00
Josef Söntgen
3936fe25dc sculpt: fix VESA framebuffer driver integration
The platform driver configuration is missing the required 'info'
attribute that allows the 'vesa_fb_drv' to map the proper I/O
memory address of the framebuffer. In addition the driver requires
at least '2' more CAPs, so raise the quota to '110'.

Fixes #4668.
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
0b569ed8c7 mesa/iris: remove binder patch
There is one binder with one memory zone per OpenGL context. The patch was
needed before because Genode didn't have proper context support (separate page
tables) leading to binders from one or more context being allocated to the same
GPU address with the same page tables. This was clearly an error and is fixed
with context support.

issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
c0367fc30e libdrm/iris: synchronization
The Morph browser seems to access libdrm multi-threaded. Put this into a
separate commit in order to revert it easily.

issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
25c1cdec95 libdrm/iris: GEN12+
* timestamp fequency
* topology

issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
aafe9ae2d6 sculpt: add Intel Xe GPU (Tigerlake)
issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
2aa01e309c gpu/intel: GEN12+
* clock frequency
* topology
* exec lists
* IRQ handling
* improved resource management

issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
852d21db14 vbox6: print error in case machine powerup fails
Retrieve error message (best effort and might fail) from progress
information.

issue #4666
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
8bd548416d sculpt: increase drivers caps for fuji4 (has ahci and nvme)
One test notebook has an AHCI and NVMe controller and reaches the quota
limit in Sculpt.

issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
f76f5db2fa drivers: use DMA buffer more consistent
Replace 'alloc_dma_buffer' by 'Dma_buffer'

issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
ff6b2bffdc ahci: use Dma_buffer instead of 'alloc_dma_buffer'
issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
22460525a0 platform_session/dma_buffer: remove 'retry_with_upgrade'
'retry_with_upgrade' is called by 'platform_session/connection.h' ->
'alloc_dma_buffer' already.

issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
1b66b1bd7c platform_drv: check quota before dma allocations (taken from legacy)
'_env_ram' allocations can lead to
'Expanding_pd_session_client::try_alloc' quota upgrades, which in turn
may lead to a resource request by the platform driver. Therefore, we
check the available quota within the platform driver before allocations.
This is not an optimal solution.

issue #4667

related issue #3767
2022-11-17 08:00:36 +01:00
Stefan Kalkowski
03a142174f os: add dummy RTC driver package 2022-11-17 08:00:36 +01:00
Norman Feske
bbcca835a5 sculpt: make graph features configurable
This patch makes the component graph better reusable for the phone
version of Sculpt. In the phone version, the '+' menu does not exist.
So we need to omit the corresponding button. Furthermore, the storage
dialog is presented in a dedicate section of the GUI instead of
presenting it inside the 'storage' graph node. The phone version
also does not offer the inspect view. So we need to omit the
corresponding buttons.
2022-11-17 08:00:36 +01:00
Stefan Kalkowski
7cb0986c1f rtc_drv: extend src package to dummy driver 2022-11-17 08:00:36 +01:00
Josef Söntgen
e507f1438a libports: add mesa_gpu-lima recipe
Similar to the others 'mesa_gpu' pkgs add one for 'lima'.
2022-11-17 08:00:36 +01:00
Christian Helmuth
49b07f898e qemu-usb: remove diagnostic error message 2022-11-17 08:00:36 +01:00
Christian Helmuth
a579e92400 wifi.run: configure /dev/urandom as libc RNG 2022-11-17 08:00:36 +01:00
Christian Helmuth
1593b64680 vbox: reduce noise of some unimplemented fucntions 2022-11-17 08:00:36 +01:00
Johannes Schlatow
f78710a4ea Fix version typo in Sculpt documentation 2022-11-17 08:00:36 +01:00
Stefan Kalkowski
bc5663f1a3 os: remove obsolete i.MX framebuffer session
Ref genodelabs/genode#4661
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
3082950e74 usb_session: align USB packet allocation correctly
To prevent caching side-effects of USB DMA memory taken from the packet stream
all allocations of USB packets need to be on separated cachelines at least.

Fix genodelabs/genode#4655
2022-11-17 08:00:35 +01:00
Josef Söntgen
b03059b933 dde_linux: allow GPIO state access
To complement the GPIO support allow for setting and reading input
pins. So far this is needed by drivers that attempt to perform I2C
bit-banging via GPIO pins.

Fixes #4624.
2022-11-17 08:00:35 +01:00
Josef Söntgen
85f98d7038 dde_linux: provide __phys_to_pfn for arm64
This macro is needed by the 'pinephone_camera_drv' driver port.

Fixes #4625.
2022-11-17 08:00:35 +01:00
Alexander Boettcher
95ee0f58f2 sculpt: enforce max width/height by configuration
Issue #4659
2022-11-17 08:00:35 +01:00
Alexander Boettcher
eb318d5ceb intel_fb: handle too large framebuffer allocation
In case the allocation fails for the largest possible connector mode,
try smaller modes. Additional add option to specify maximal resolution.

Issue #4659
2022-11-17 08:00:35 +01:00
Alexander Boettcher
72217a6771 intel_fb: support larger resolutions
Increase "assumed" internal kernel memory size based on available memory
to support allocation of framebuffer larger than 16M, which was before
hardcoded.

Issue #4659
2022-11-17 08:00:35 +01:00
Alexander Boettcher
5df68922eb linux/pc: enable IOMMU config for intel fb
to apply scanout scratch page GTT workaround

drivers/gpu/drm/i915/gt/intel_ggtt.c
 -> gen8_gmch_probe() -> intel_scanout_needs_vtd_wa(i915)

Fixes #4659
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
bb067f529b sculpt_manager: relax nic_drv policy label
When using the newer genode_c_api uplink library, an uplink connection uses
the device name as label, which enables integrators to use different policies
resp. routes for different devices driven by one driver. The nic_drv policy
of the nic_roouter configuration generated by the sculpt_manager however uses
an empty label like: "nic_drv -> ". This is the way how existent NIC drivers,
like ipxe_nic_drv requested their uplink session. To support both driver
variants this commit relaxes the policy by checking for a prefix only.

Ref genodelabs/genode#4660
2022-11-17 08:00:35 +01:00
Norman Feske
3b06a27465 sculpt: add pin_session and pin_control resources 2022-11-17 08:00:35 +01:00
Norman Feske
49b4b8597d os/pin_driver: support for time-multiplexed in/out
This patch equips the pin-driver framework with support for the
time-multiplexed operation of a pin as output or input. This is needed
when implementing I2C communication via a bit-banging driver.

To operate pin in both directions, a driver obtains both a pin-state and
a pin-control session for the same pin. The pin-state session can be
used to sense the current pin state. The control session allows the
client to set the pin to high or low (using the 'state' method), or to
set it to high-impedance via the 'yield' method. Once switched to
high-impedance, the pin can be used as input.

Issue genodelabs/genode-allwinner#10
2022-11-17 08:00:35 +01:00
Christian Prochaska
cd8538da9a qt5: apply pull request, change screen pixel format to RGB32
Fixes #4657
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
73fec3bdb7 sculpt: add ROM route to nic_drv's DTB
Ref genodelabs/genode#4652
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
11a6117da6 genode_c_api: add config update to block interface
Ref genodelabs/genode#4653
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
d8d9f94075 base-sel4: implement clean cache operations
This commit uses the seL4_BenchmarkFlushCaches syscall to partly implement
cache maintaince for this kernel.

Ref genodelabs/genode#4651
2022-11-17 08:00:35 +01:00
Christian Helmuth
a670c2a674 Download expat from GitHub
The tar.gz archive of version 2.4.9 vanished from sourceforge. As the
project moves to GitHub currently and the archive of 2.4.9 is still
available there, just update the download location.

Content and hashes did not change.
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
01e1e4e5b9 platform_drv: add "leave_operational" attribute
If a device should not be reset, powered off, and its clocks
shall stay untouched when it gets released, the leave_operational
attribute can be set to true in the device node of the related
device inside the devices ROM delivered to the platform driver.
This is useful for drivers, which only enable and initialize
their device, and can be closed afterwards.

Ref genodelabs/genode#4654
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
f0315b2715 dde_linux: remove legacy fec_nic_drv
Ref genodelabs/genode#4651
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
018c562447 lx_emul: refine configurations & memory attributes
Ref genodelabs/genode#4651
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
9482355c47 lx_emul: allow different irqchip declarations
To enable other irqchip declarations beyond the lx_emul generic code base,
make the ARM specific initialization routine public.

Ref genodelabs/genode#4651
2022-11-17 08:00:34 +01:00
Johannes Schlatow
b2189ae88b vfs/log: block indefinitely on read access
With this change, the log file system mimics the behaviour of
/dev/stdin.

Fixes #4649
2022-11-17 08:00:34 +01:00
Alexander Boettcher
7a5eab9541 grub2: make ISO bootable on hardware
With "grub2: update to newer grub2 2.06 version" a regression slipped in
which makes the ISO not bootable on real hardware. The commit reverts to
the previous behaviour, to load the GRUB2 modules after boot later one by
one in the ISO format case.

Fixes #4647
2022-11-17 08:00:34 +01:00
Christian Helmuth
9c136f66d4 ieee754: adjust RAM quota to sel4 2022-11-17 08:00:34 +01:00
Christian Helmuth
5a06a9dec1 lx_emul: provide pci_try_set_mwi() 2022-11-17 08:00:34 +01:00
Christian Helmuth
9467d4cb0b pci_decode: initial device-report buffer of 32K
This prevents multiple generation attempts with undersized buffers on
recent hardware, which needs at least 12K.
2022-11-17 08:00:34 +01:00
Christian Helmuth
d5577421f8 wireguard: create dir before generating asm file
Prevents errors like follows.

  /bin/bash: arch/arm64/crypto/poly1305-core.S: No such file or directory
  make[4]: *** [.../genode/repos/dde_linux/lib/mk/spec/arm_64/wireguard_lx_inc_dirs.mk:17: arch/arm64/crypto/poly1305-core.S] Error 1
2022-11-17 08:00:34 +01:00
Christian Helmuth
df4c4d5be2 base: check for used blocks in Allocator_avl
The check is required for alloc_addr() as the desired range may already
be backed by a used block.
2022-11-17 08:00:34 +01:00
Johannes Schlatow
4dee72a487 sculpt: fix shape-report routing in deploy example
The deploy example mistakenly applied label rewriting for the pointer-shape
report.

Fixed genodelabs/genode#4645
2022-11-17 08:00:34 +01:00
Sebastian Sumpf
cd08cd54a4 usb_block_drv: allow for using UAS devices via BOT
Reintroduce:

USB Attached SCSI devices might expose a bulk-only interface
as fall-back at interface 0 and alternate setting 0. This commit
allows for probing all alternate settings of the active interface
to be able to use such devices.

The configuration was extended so that in case the device interface
is known beforehand the driver can be configured accordingly.

Additionally:

Perform configuration reset upon sessions close in order to bring USB
device to a well defined state.

fixes #4494
2022-11-17 08:00:34 +01:00
Christian Helmuth
ab7101e3d2 ahci_block: fix timer route in test
Thanks to Cedric for the patch.

Fixes #4644
2022-11-17 08:00:34 +01:00
Alexander Boettcher
7ebd3a086a nova: avoid reset on machines with too many CPUs
The NOVA kernel and Genode's roottask core are configured to be runnable
with up to 64 CPUs (MAX_SUPPORTED_CPUS in core resp. NUM_CPU in kernel).
On machines with more CPUs a reset occurred. The commit checks for this
case, bootstraps the first 64 CPUs only, and sends all other CPUs to
sleep.

Also, the platform_info ROM size is increased to host information about
more than 32 CPUs.

Issue #4640
2022-11-17 08:00:34 +01:00
Norman Feske
c0fddd0a14 nitpicker: drop double press/release events
Fixes #4639
2022-11-17 08:00:34 +01:00
Stefan Kalkowski
759ed40d98 hw: implement MSI support for x86
Fix genodelabs/genode#4633
2022-11-17 08:00:34 +01:00
Johannes Schlatow
5e4e634625 libs: use select_from_ports in eager assignments
If `select_from_ports` is evaluated lazily, we might miss a port during
the dependency check. A way to prevent this is to use the `:=` operator.

Fixes genodelabs/genode#4618
2022-11-17 08:00:34 +01:00
Christian Helmuth
c086eb088d vmm_x86: guest code page in separate asm file
Implement the guest code in dedicated assembler source file, assemble
and link the binary to vmm_x86. The resulting guest-code binary
populates one page that is mapped to host the reset vector of the guest.

This approach simplifies future guest code adaption resp. extension,
e.g., to test rdmsr/wrmsr exiting.

Fixes #4638
2022-11-17 08:00:34 +01:00
Christian Helmuth
2edf02dccb themed_decorator: break link dependency to theme
plain_decorator_theme.tar is not linked to the app but must be generated
as side effect. Therefore, use CUSTOM_TARGET_DEPS to trigger the
generation.

Fixes #4637
2022-11-17 08:00:33 +01:00
Alexander Boettcher
00ac4afb9f acpica: make battery report working for thinkpads
tested on T460p, X201, T470p

by periodically checking and reporting.

Issue #4631
2022-11-17 08:00:33 +01:00
Michael Mueller
f4e1b9faaa Updated makefiles and ABI symbols for base. 2022-10-20 17:04:52 +02:00
Michael Mueller
e4041147ff core: New heap allocator for NUMA-regional allocations. 2022-10-20 17:03:46 +02:00
Michael Mueller
59d06871a3 nova: Store memory ranges for NUMA nodes. 2022-10-20 17:02:27 +02:00
Michael Mueller
0761449e9f core: Extended Ram_allocator by NUMA-specfic allocation and deallocation. 2022-10-20 17:01:48 +02:00
Michael Mueller
63d6827f16 core: Added interface to allocate memory from a given NUMA region. 2022-10-20 17:00:30 +02:00
Michael Mueller
953afdaff3 topo: Added RPC to query the NUMA information to a given NUMA node ID. 2022-10-20 16:58:45 +02:00
Michael Mueller
20ef1af61b vscode: Added file associations for C++ header files without suffix. 2022-10-18 15:40:32 +02:00
Michael Mueller
310418667a vscode: Added configuration for IntelliSense. 2022-10-18 15:37:53 +02:00
Michael Mueller
7920207bdb thread_test: Resolved ambiguity of uint_16t. 2022-10-18 15:36:53 +02:00
Michael Mueller
f3301f0049 nova: Fixed garbled CPU-NUMA mapping. 2022-10-17 18:52:09 +02:00
Michael Mueller
5866364d6b Merge branch 'master' into ealan to sync with upstream. 2022-10-14 16:56:15 +02:00
Michael Mueller
b8285e34fb nova: Updated ports file to latest NOVA version. 2022-10-14 16:49:48 +02:00
Michael Mueller
14f6f35eba nova: Do not use vanilla version, as we need custom extensions that are not merged yet. 2022-10-14 14:50:57 +02:00
Michael Mueller
f38762f9f0 Merge branch 'master' of github.com:mmueller41/genode 2022-10-14 14:31:37 +02:00
Michael Mueller
36663b0856 Updated hash for MxTasking. 2022-10-14 13:55:54 +02:00
Michael Mueller
b35664e0f4 nova: Allocate pages for Report ROM module depending on max count of CPUs supported by NOVA. 2022-10-14 13:53:58 +02:00
Michael Mueller
bad3ae4bd0 Expanded thread playground scenario with topology session. 2022-10-13 16:11:47 +02:00
Michael Mueller
51818bd0fc Added source file for Topo_session_component to source includes for NOVA. 2022-10-13 16:10:31 +02:00
Michael Mueller
a81b3198ac Added topology service to Libc::Env. 2022-10-13 16:08:57 +02:00
Michael Mueller
4673f0354e Removed redundant NUMA affinity attribute from class thread. The topology service provides this info now. 2022-10-13 16:08:19 +02:00
Michael Mueller
fa7e2a0e5d Fixed remapping skipping every second virtual CPU ID. 2022-10-13 16:01:51 +02:00
Michael Mueller
90b921b3cd Automatically create a topology session when a new component is created. 2022-10-13 16:00:18 +02:00
Michael Mueller
f2386c623e Fixed confused affinity spaces and locations. 2022-10-13 15:58:59 +02:00
Michael Mueller
e2e6153e7e Renamed Genode::Node to Topology::Numa_region to avoid name clash with VFS plugin. 2022-10-13 15:56:13 +02:00
Christian Helmuth
9079a083d2 depot: update recipe hashes 2022-10-13 12:35:27 +02:00
Norman Feske
ee969efe5f News item for Sculpt 22.10 2022-10-13 12:35:27 +02:00
Norman Feske
fd174d7e92 Update Sculpt documentation to version 22.10 2022-10-13 12:35:27 +02:00
Martin Stein
e052dc282b Revert "nic_router: incremental L4 checksum updates"
This reverts commit 9a37ccfe29 except for the
new declarations in public headers (in order to not change any APIs again).

We revert the commit as we found that there are corner cases in which it
produces a bad UDP checksum. The bad UDP checksum was observed via Wireshark at
a TFTP server in a Sculpt 22.10 Debian 11 VM on the first request of fetching a
file with the TFTP client of the uboot on our iMX8 test board.

Ref #4636
2022-10-13 12:35:27 +02:00
Christian Helmuth
847266d027 depot: update recipe hashes 2022-10-12 14:31:50 +02:00
Christian Helmuth
f53daa4450 Remove vbox6-capture from sculpt 2022-10-12 14:19:43 +02:00
Christian Helmuth
2fa547cdea pkg/vbox6-capture: adapt to current pkg/vbox6 2022-10-12 12:20:54 +02:00
Sebastian Sumpf
ac9ca67861 acpica: Increase RAM quota
Increase RAM quota to 6MB.

issue #4631
2022-10-12 12:09:37 +02:00
Josef Söntgen
a420670217 pci_decode: disable MSI on HDAUDIO cards
According to OpenBSD's azalia driver some AMD HDAudio devices do not
play nice with MSIs although the capability is set. At least the
0x1457 device was tested and worked using GSIs only.

genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Stefan Kalkowski
bc1e231775 platform_drv: implement PCI powering and reset
Ref genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Alexander Boettcher
8f0a012345 acpica: adjust to new platform driver
genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Alexander Boettcher
3e8ffe179b pci_decode: check sys_rom on boot
If the ROM is already available, no signal will wakeup the pci_decode app on
sigh registration.

 genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Sebastian Sumpf
1286b967ed virtualbox5/6: handle NIC setup correctly
During initialization _handle_link_state may be called concurrently from EMT and
"nic_ep" (signal handler). Therefore, sent signal to "nic_ep" instead of calling
_handle_link_state from EMT thread.

issue #4632
2022-10-12 12:09:37 +02:00
Martin Stein
c83f307b62 nic_router: consider DHCP client optimization
Some DHCP clients (Debian VM in Sculpt) persistently store the last lease they
obtained and try to directly DHCP REQUEST it on a new startup whithout doing
DHCP DISCOVER beforehand. In case the NIC router doesn't know about the lease
anymore (timeout, new router instance), the router used to just ignore the DHCP
REQUEST. This led to significant delays in the network startup of the client
(delayed retries until give-up and DHCP DISCOVER). With this commit, the router
answers such packets with a DHCP NAK instead, causing the client to directly
switch to DHCP DISCOVER.

Fixes #4634
2022-10-12 12:09:37 +02:00
Norman Feske
5dfd0274b9 sculpt: avoid depot queries during installation
This patch removes the intermediate querying of the depot while the
installation of packages is in progress. This avoids misleading warning
messages and reduces superfluous file-system load during the
installation of large packages.

Issue #4631
2022-10-12 12:09:37 +02:00
Norman Feske
0ccf11256f sculpt: remove vbox5 from default index
Issue #4631
2022-10-12 12:09:37 +02:00
Sebastian Sumpf
7f0c89f378 pci_decode: enable all bridges
set I/O port, MMIO, and bus master to enabled for bridges where
disabled.

issue #4578
2022-10-12 12:09:37 +02:00
Christian Helmuth
e7ba0b7371 pci: initialize BAR config on demand only
On-demand initialization prevents read-write operations on BARs of
invalid devices at construction time, which may result in surprising
behavior later on, for example, when resetting X260 notebooks via ACPI
information.
2022-10-12 12:09:37 +02:00
Stefan Kalkowski
ba97415ef9 pci_decode: prefer MSI over MSI-x
Ref genodelabs/genode#4578
2022-10-12 12:09:36 +02:00
Norman Feske
eb6a745a18 platform: add Guard utils for Clock/Reset/Power
These utilities simplify the control of clocks, resets, and power
domains from within the platform driver.

This is needed when driving a low-level device directly from the
platform driver, for example for driving the mbox mechanism to access
the system-control processor of the PinePhone.
2022-10-12 12:09:36 +02:00
Norman Feske
add4990044 sculpt: distinguish devices,pci_devices in /report
This patch reflects both the pci_decode results and the platform
driver's aggregated device information in Sculpt's /report/drivers/ in
the form of pci_devices and devices files respectively.
2022-10-12 12:09:36 +02:00
Stefan Kalkowski
3841ee1d51 platform_drv: implement MSI-x support
Ref genodelabs/genode#4578
2022-10-12 12:09:36 +02:00
Josef Söntgen
9c3867e173 libc: increase stat I/O blksize hint to 64 KiB
The configured 'st_blksize' influences the sizing of the FILE buffer,
see '__swhatbuf()'. Increasing the blksize hint can lead to larger
'fread()' requests and in return to fewer roundtrips.
2022-10-12 12:09:36 +02:00
Josef Söntgen
75f7fd546c depot_download_manager: increase fs buffer
Default tx buffer size of 128 KiB will cut 64 KiB due to packetstream
overhead, increase it to 144 KiB.
2022-10-12 12:09:36 +02:00
Josef Söntgen
7e4154b063 sculpt_manager: increase inspect fs buffer size
128 KiB (apparent cp(1) default size) + 16 KiB.
2022-10-12 12:09:36 +02:00
Josef Söntgen
f4f1092f1d verify: increase IOBUF size to 64 KiB
The old value of 8192 seems to be conservative. By increasing it we
can make better use of the available I/O bandwidth.
2022-10-12 12:09:36 +02:00
Sebastian Sumpf
7cbf5cd075 sculpt_manager: Increase RAM quota for file systems
With the increased allocation size to 4MB in rump
(20df224b19), the supplied quota by the
sculpt_manager does not suffice any more.

issue #4631
2022-10-12 12:09:36 +02:00
Josef Söntgen
e0f5cdacf0 dde_bsd: update audio driver to OpenBSD 7.1
This commit updates the driver from version 6.6 to 7.1. In contrast
to the old driver the new one will now probe all available HDA devices
and will drive the first usable one, e.g.:

```
[init -> audio_drv] azalia0 [8086:160c]
[init -> audio_drv] :
[init -> audio_drv] azalia0: no supported codecs
[init -> audio_drv] azalia1 [8086:9ca0]
[init -> audio_drv] :
[init -> audio_drv] azalia1: codecs: Realtek ALC292
[init -> audio_drv] audio0 at azalia1
```

Fixes #4629.
2022-10-12 12:09:36 +02:00
Josef Söntgen
3186e47807 dde_bsd: adapt Audio_in script to new platform_drv
Issue #4629.
2022-10-12 12:09:36 +02:00
Josef Söntgen
a78a7e1f67 platform_drv: disable no snoop for ATI/AMD HDA
Implemented as depicted in the OpenBSD driver, register description
found in 'AMD SB700/710/750 Register Reference Guide'
(43009_sb7xx_rrg_pub_1.00.pdf).

Issue #4629.
2022-10-12 12:09:36 +02:00
Norman Feske
cdff00970b sculpt/pc: increase acpi driver RAM quota
This is needed for the Framework laptop.
2022-10-12 12:09:36 +02:00
Norman Feske
ccb8fe908a driver_manager: whitespace fixes 2022-10-12 12:09:36 +02:00
Stefan Kalkowski
b88959f60c sculpt: use pc_platform_drv instead of generic one
Ref genodelabs/genode#4578
2022-10-12 12:09:36 +02:00
Stefan Kalkowski
1504041c82 pc_platform_drv: introduce pc-specific driver
This driver observes a "system" ROM, as well as the acpi ROM to implement
reset functionality.

Ref genodelabs/genode#4578
2022-10-12 12:09:35 +02:00
Norman Feske
dc228b952a intel_fb_drv: add gpu/drm/drm_scdc_helper.c
With this patch, the Dell UltraSharp 4K display works in principle when
connected via HDMI to a Lenovo x260 laptop.

Fixes #4630
2022-10-12 12:09:35 +02:00
Norman Feske
a630563cbc intel_fb_drv: add kvfree_call_rcu to lx_emul.c
Issue #4630
2022-10-12 12:09:35 +02:00
Norman Feske
80e2cea4aa dde_linux: enable Intel Alderlake graphics
With this patch, the Intel framebuffer driver works on the Framework
Gen12 laptop.

Fixes #4627
2022-10-12 12:09:35 +02:00
Stefan Kalkowski
243c819257 pci_decode: use MSI enumerator as function value
Instead of using a global value to enumerate the MSIs, use a function argument
instead. Whenever the process of PCI device reporting gets started again,
due to an initially too small report buffer, the MSI enumeration value is reset
again. Formerly, we wasted MSI numbers.

Ref genodelabs/genode#4628
2022-10-12 12:09:35 +02:00
Christian Helmuth
08f1f94fcb pci_decode: IRQ reporting for MSI/MSI-X only devices
Don't skip IRQ reporting if legacy IRQ/GSIs are not supported as the
device may support MSI/MSI-X exclusively.

The commit also enables reserved_memory reporting of devices without
IRQs.

Ref genodelabs/genode#4578
2022-10-12 12:09:35 +02:00
Sebastian Sumpf
8855e5bfc9 Revert "usb_block_drv: allow for using UAS devices via BOT"
This reverts commit 87021d9fb1.

Commit breaks some USB storage devices, mostly Intenso, on Sculpt

issue #4494
2022-10-12 12:09:35 +02:00
Josef Söntgen
427bd93921 wifi/pc: add FW image for new so devices
The Framework laptop with the 12the Generation CPU contains such a
device.

Fixes #4626.
2022-10-12 12:09:35 +02:00
Christian Helmuth
ee19426f4d lx_emul: validate endpoint for isochronous URB
Thanks to Andreas for the patch.
2022-10-12 12:09:35 +02:00
Norman Feske
f81f075670 sculpt: allow for dynamic managed/system state
Until now, the /config/system ROM was not handled by the sculpt manager
but solely managed by the user. Its main purpose was the ability to
reset or power-down the machine by manually modifying the 'state'
attribute. However, down the road, we'd like to enable the sculpt
manager to drive this state, e.g., to implement the multi-staged
loading of drivers, or to drive suspend-resume states.

The support such scenarios, the 'system' state has been moved from
/config/system to /config/managed/system.
2022-10-12 12:09:35 +02:00
Stefan Kalkowski
2ccdbf1050 platform_drv: implement shared interrupt support
Ref genodelabs/genode#4578
2022-10-12 12:09:35 +02:00
Stefan Kalkowski
fa124dd340 lx_kit: do not close/re-open IRQ session
Instead of dynamically close/open IRQ session whenever an IRQ
gots masked/unmasked, track the state internally and resp.
deliver an interrupt delayed.
2022-10-12 12:09:35 +02:00
Stefan Kalkowski
00c9ac363f platform_drv: add EHCI PCI quirk, apply in order
* Add EHCI PCI quirk
* Add UHCI reset to UHCI quirk
* Apply all PCI quirks in order of the PCI bus numbering
  otherwise the machine might stall

Ref genodelabs/genode#4578
2022-10-12 12:09:35 +02:00
Norman Feske
a77ceb6871 base: remove Trace::Session::rule RPC function
This part of the trace-session interface was merely a placeholder.

Fixes #848
2022-10-12 12:09:35 +02:00
Christian Prochaska
48cc52be07 tool chain: tool check cleanup
- look for autoconf 2.69 on Ubuntu 22.04
- remove obsolete checks
- add new checks

Fixes #4622
2022-10-12 12:09:35 +02:00
Alexander Boettcher
9e33e57294 nova: support more MSIs
Issue #4578

Ref alex-ab/nova#8
2022-10-12 12:09:34 +02:00
Christian Helmuth
b20cabb6e4 pci: fix PCIe extended capability definition
Also removed the warning about unhandled capability IDs.

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
6a7247ab44 platform: remove cache attribute from io_mem call
Instead of allowing the client to set a caching attribute
in the io_mem() call of the device interface, which was
only used to decide in between of the memory  being
write-combined or not, remove it from the API.
Instead use the information delivered by the devices ROM,
whether memory from a PCI BAR is prefetchable or not,
to decide whether it is mapped write-combined or not.

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
7334128a2e pci_decode: export prefetchable attribute of BARs
Memory descriptors in PCI BARs have a prefetchable bit, which can
be used to optimize memory access when setting, e.g. write-combined
in page-table entries.

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Christian Prochaska
1d0b9ed302 qt5: fix build errors with GCC 11 host tool chain
Fixes #4621
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
6a36e8a8dc pci_decode: count MSI numbers beginning from one
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Norman Feske
5956dd591f sculpt: version 22.10 2022-10-12 12:09:34 +02:00
Sebastian Sumpf
e1e70dd927 platform_drv: fix Intel graphics PCI infos
GMCH is at offset 50 on Gen8+.

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
85e69f6882 driver_time.run: remove legacy platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
5600e21d16 virtualbox_auto tests: remove legacy platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Martin Stein
f59ee209d2 nic_router: use exact packet sizes in dhcp client
The DHCP client used to always send packets with a size of 1024 regardless of
the size of the actual content, which was always significantly lower. 1024
bytes was simply a guess to provide enough space for all types of DHCP client
packets. As we know the exact size of each packet the DHCP client sends even
before packet creation, this commit makes use of the knowledge resulting in
much smaller packets sent by the DHCP client.

Fixes #4619
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
c7c460f6e0 os: add include/pci/* to os api
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Martin Stein
665a551fcd base-hw & cortex_a9: consider timer IRQ unreliable
On some Cortex A9 platforms (Qemu 4.2.1 PBXA9), the IRQ status register is not
reliable. Sometimes, it indicates an IRQ too early, i.e., shortly before the
counter wraps. Therefore we have to accomplish wrap detection via counter
comparison only. We check whether the current counter value is higher than the
start counter value of the current timeout.

However, this implies that we have to take care to always read out the counter
before it hits the max timout value again. And, therefore, the max timeout
value has to be far away from the first value the counter has after wrapping.
Consequently, we propagate a max timeout value of half the max counter value.

Fixes #4209
2022-10-12 12:09:34 +02:00
Johannes Schlatow
32efbdfb32 vfs_tap: fix README (mode attribute) 2022-10-12 12:09:34 +02:00
Christian Helmuth
57f510d67f run/load/ipxe: spawn lighttpd on demand
An installed lighttpd HTTP server can now optionally be started to serve
the boot image with the follow run options.

--load-ipxe-lighttpd             run lighttpd automatically (default: off)
--load-ipxe-lighttpd-port <port> TCP port to run lighttpd on (default: 8080)
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
afa0bed5fc platform_drv: add USB4 pci class, update README
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
ec6f89111e virtio_pci: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
fdba7259ab platform_drv: provide Virtio PCI information
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
de0c339e0b pci: remove pci test of legacy platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
b8eab65536 dde_linux: remove legacy usb_host_drv for x86
Remove legacy platform_session API usage from legacy lx_kit/lx_emul

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
91e64c3f27 vbox5_genode_usb_hid: remove legacy platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
71eefc3315 nic_router_uplinks.run: remove legacy platform_drv
Ref genodelabs/genode#4511
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
203f24742a netperf tests: remove legacy platform_drv
Ref genodelabs/genode#4511
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
9b38af4d7d smartcard.run: remove legacy platform_drv
Ref genodelabs/genode#4511
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
c8f055c9e3 smbios_decoder.run: remove legacy platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
e7571c539c sculpt: use generic platform driver
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
250275fbfb gpu_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
03cec5cdd7 dde_bsd: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
8d746a701e drivers_nic-pc: use generic platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
7cf6651d2c ipxe_nic_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
feaaaa3e8b drivers_interactive-pc: use generic platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
92b5dda2bc vesa_fb_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
ed8f71e459 ahci_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
5528434fb6 lx_kit & lx_emul: use generic platform API
* Remove wrapper for legacy x86 platform API
* Move PCI configuration space quirks to corresponding driver
  (pc_usb_host_drv, pc_wifi_drv, pc_intel_fb_drv)
* Adapt driver test run-scripts to changed configuration

Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
9f9a5186e0 ps2_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
71129fca2d nvme_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
42a46b75f1 depot: add recipe for pc devices rom
Ref genodelabs/genode#4578
2022-10-12 11:59:09 +02:00
Stefan Kalkowski
5e42f347d8 platform_drv: attach reserved memory to device PD
Consumes the information about reserved memory region reports from
the devices ROM, and adds appropriated mappings to the corresponding
device PD.

Ref genodelabs/genode#4578
2022-10-12 11:59:09 +02:00
Stefan Kalkowski
85dc2e5b9b pci_decode: interpret reserved memory from ACPI
We need the information about reserved memory region reports
from the ACPI tables within the platform driver to pre-fill
IOMMU tables with the corresponding mappings. Therefore,
the pci_decode component now parses the information from the
ACPI ROM, and adds "reserved_memory" nodes to all related
devices in the devices report.

Ref genodelabs/genode#4578
2022-10-12 11:59:08 +02:00
Stefan Kalkowski
281785f6bd platform API: make MMIO dataspace cap accessible
In case of the GPU multiplexer, we need to delegate MMIO memory
to the framebuffer client in form of a managed dataspace. To be
able to attach a given Platform::Device::Mmio object to a region map
we need to access its capability.

Ref genodelabs/genode#4578
2022-10-12 11:59:08 +02:00
Stefan Kalkowski
c583446ade platform_drv: add HDAUDIO PCI quirks
Ref genodelabs/genode#4578
2022-10-12 11:59:08 +02:00
Stefan Kalkowski
b85b3abe20 base-hw: update cpu_scheduler unit test
* Modernize routines, eliminate pointers, use constructibles, etc.
* Use absolute time instead of relative time consumption when
  updating the scheduler

Ref genodelabs/genode#4151
2022-10-12 11:59:08 +02:00
Stefan Kalkowski
debd41081e base-hw: optimize & cleanup scheduler
* Remove useless `ready_check` function
* Implement fine-grained checking when schedule updating is necessary

Ref genodelabs/genode#4151
2022-10-12 11:59:08 +02:00
Christian Helmuth
13bfe50d00 Update expat to version 2.4.9
The tar.gz archive of version 2.4.6 vanished from sourceforge.
2022-10-12 11:59:08 +02:00
Martin Stein
c23b74e150 base-hw: problems with timeout lib in src recipe
This commit fixes two issues with the timeout lib and the base-hw src recipe:

* Add source files of timeout lib to recipe content.
  The files weren't copied to the depot until now. However, the archive
  nonetheless built successfully because of the second issue that is described
  below.

* Get rid of the usage of the BASE_DIR variable in the timeout lib.
  The BASE_DIR variable always resolves to the repos/base directory even when
  building in a depot. That said, the use of BASE_DIR in make-files that are
  not part of the build system itself must be avoided. Instead, REP_DIR,
  REP_INC_DIR, and $(call select_from_repositories, ...) should be used.

Ref #4209
2022-10-12 11:59:08 +02:00
Norman Feske
da150dbb1c Xml_node: allow whitespace around '=' characters
Fixes #4167
2022-10-12 11:59:08 +02:00
Christian Helmuth
ef269ea2e0 sd_card_bench: disable on rpi 2022-10-12 11:59:08 +02:00
Christian Helmuth
0ead7eacfd tool_chain_auto: disable on unsupported platforms
all: imx53_qsb_tz, rpi
foc: imx6q_sabrelite
2022-10-12 11:59:08 +02:00
Christian Helmuth
c8dd433e8b depot_autopilot: disable unsupported tests on foc/pbxa9 2022-10-12 11:59:08 +02:00
Stefan Kalkowski
0231ee4ad3 hw: don't halt kernel due to unknown cpu exception
Fix genodelabs/genode#4617
2022-10-12 11:59:08 +02:00
Christian Helmuth
6c6ce30389 depot_autopilot: disable unsupported tests on riscv 2022-10-12 11:59:08 +02:00
Martin Stein
88cddc35dd nic_router: use the dictionary data structure
This commit gets rid of the router-local wrapper of Genode's AVL string tree
and replaces it with Genode's new Dictionary structure. The Dictionary is now
used for managing domains and NIC clients. Due to this change, the formerly
necessary helper classes Domain_base and Nic_client_base could be removed as
well.

Ref #4610
2022-10-12 11:59:08 +02:00
Michael Mueller
c89715f905 Make Topology service part of a component's environment, just like CPU. 2022-10-11 18:00:47 +02:00
Michael Mueller
579b4833fb Introducing new topology service to query NUMA information from within a component. 2022-10-11 17:58:24 +02:00
Michael Mueller
bdb1b222cd Store NUMA node for memory descriptors in HIP. 2022-10-06 16:08:00 +02:00
Michael Mueller
ce1a137ddb Store NUMA core mapping in platform interface. 2022-10-06 16:07:01 +02:00
Martin Stein
3a616fed4d nic_router: rename is_ready() to ready()
Ref #4612
2022-09-21 14:03:31 +02:00
Christian Helmuth
3f1870841c depot: update recipe hashes 2022-09-21 12:19:10 +02:00
Christian Helmuth
548c3b46ad test-trace_buffer: increase thread stack to 8K
Prevents warnings on x86_32/linux.
2022-09-21 12:19:10 +02:00
Stefan Kalkowski
dda168fc10 platform API: simplify _wait_for_device
Fix genodelabs/genode#4615
2022-09-21 12:19:10 +02:00
Sebastian Sumpf
0370b0fa23 platform_drv: fix reference count in "Switch" class
Only decrement by 1 in the "unuse" function.
2022-09-21 12:19:10 +02:00
Stefan Kalkowski
4b9fb10fdb platform_drv: aquire_single_device return first
* Only acquire and return the first device

Fix genodelabs/genode#4614
2022-09-21 12:19:10 +02:00
Johannes Schlatow
f25070d441 irq_connection: add constructor with session label
When creating an Irq connection to a component (not core), e.g. a pin
driver, we typically need a to provide a session label in order to apply
a session policy and to distinguish multiple sessions from the same
component.

genodelabs/genode#4606
2022-09-21 12:19:10 +02:00
Norman Feske
c0e303632e gems: fix clipping in polygon_gfx/line_painter.h
This clipping check happened to wrongly test the surface's clipping area
instead of the by 1x1 pixel reduced 'clip' rectangle.
2022-09-21 12:19:10 +02:00
Norman Feske
0ff755b236 menu_view: remove minor code redundancy
This is a follow-up commit for "menu_view: configurable alpha channel
and bg color", which simplifies the code. The '_no_alpha' surface is not
needed because the 'Gui_buffer' provides a 0x0 alpha surface when using
the opaque mode.
2022-09-21 12:19:10 +02:00
Norman Feske
8bccc6e68f cached_fs_rom: increase fs buffer size to 4 MiB
The default file-system communication-buffer size of 128 KiB combined
with the clamping of requests to 1/4th the buffer size results in the
fragementation of read operations into 32 KiB chunks. This is overly
conservative and causes high context-switch overhead down the storage
stack (vfs server -> part_block -> block driver).

Related to #4613
2022-09-21 12:19:10 +02:00
Norman Feske
20df224b19 dde_rump: increase max I/O request size to 1 MiB
With the increase of MAXPHYS, the rump kernel requests a contiguous
allocation of 2101248 bytes, which exceeds the allocator's block size of
2 MiB.

  Error: backend allocator: Unable to allocate memory (size: 2101248 align: 12)

The patch avoids this corner case by increasing the allocator's block
size to 4 MiB.

Fixes #4613
2022-09-21 12:19:09 +02:00
Martin Stein
99254b4d52 nic_router: bind link state to remote DNS config
The NIC router README claims that the 'dns_config_from' attribute in a DHCP
server configuration binds the propagated link state of all interfaces at the
domain of the server to the validity of the IP config of the domain that is
given through 'dns_config_from'.

However, this was not true. The router missed to implement this detail which
led to clients of such a DHCP server sending DHCP DISCOVER packets too early.
These early DHCP DISCOVER packets were dropped by the router potentially
causing a big delay until the client started a new attempt. Unnecessary long
network boot-up delays were observed with at least the lwip run script and
Sculpt on the PinePhone and could be tracked down to this former
inconsistency in the router.

This commit fixes the inconsistency.

Fixes #4612
2022-09-21 12:19:09 +02:00
Johannes Schlatow
4fd1b52d1f trace_recorder: adopt Genode::Dictionary
genodelabs/genode#4610
2022-09-21 12:19:09 +02:00
Norman Feske
ab7c0b40f2 depot_query: avoid repetitive file accesses
This patch changes the access of pkg-archives files such that the file
read only once per pkg, not for each ROM module used by the package.

Issue #4611
2022-09-21 12:19:09 +02:00
Norman Feske
851ae574d1 depot_query: add directory cache
By caching directory listings, the performance of depot_query is no
longer impeded by a massive amount of stat calls while searching for ROM
module locations.

Issue #4611
2022-09-21 12:19:09 +02:00
Norman Feske
b4441bff04 depot_query: remove ineffective caches
Upon closer inspection of real-world access patterns, it turns out that
the 'Stat_cache' and 'Cached_rom_query' are not as effective as hoped
for because cache hits are rare while querying pkg blueprints.

However, by increasing the initial size of the blueprint reporter from 4
KiB (default) to 64 KiB has a great effect. With the small default
report size, the querying of blueprints is repeated until the buffer
size suffices, incrementing the buffer size by 4 KiB in each iteration.

Issue #4611
2022-09-19 14:00:36 +02:00
Norman Feske
3be0136901 base: add util/dictionary.h utility
The new 'Dictionary' provides an easy way to access objects using
strings as key. The 'String' received the 'operator >' to simplify the
organization of strings in an AVL tree.

The patch removes the former definition of the 'operator >' from the
platform driver because it would be ambigious now.

Fixes #4610
2022-09-19 14:00:35 +02:00
Norman Feske
6df66a77d0 sculpt: avoid superfluous depot queries
This patch avoids repetitive depot queries at the start of the Sculpt
system.

We don't need to trigger a query unconditionally whenever the
managed/deploy changes because the call of 'handle_deploy' triggers a
query when needed.

We don't need to trigger a query once the prepare step is completed
because the depot_query component is spawned at this point. The initial
blueprint produced by the depot_query component, in turn, triggers the
'handle_deploy' mechanics in the sculpt manager.

The constructor of the Sculpt manager's 'Main' does not need to call
'depot_deploy' because the prepare step - which is a precondition for
the deployment - cannot be completed at this point anyway.
2022-09-19 14:00:35 +02:00
Sebastian Sumpf
003247d883 dde_bsd: audio do not advance on silence
Do not advance ring buffer positions when playing silence, additionally
to not send progress signals when playing silence. Silence implies
underrun in the client side - not progress.

issue #4609
2022-09-19 14:00:35 +02:00
Sebastian Sumpf
e0c4d5068d audio_out_session: reset changes to 'pos = tail'
In case a driver is waiting for data, is should only investigate 'pos'.
It should not advance the ring in any way until there is data available.

issue #4609
2022-09-19 14:00:35 +02:00
Norman Feske
907641f6ea lx_fs: improve safety when using dir handles
This patch consolidates the repetitive error handling across the RPC
functions, which take node handles or directory handles as arguments.

During this change, I noticed that directory handles - which are values
provided by the client - were not checked for their type before being
used. A misbehaving client may open a file, manually construct a
directory handle using the number of the file handle, and invoke a
directory operation at lx_fs, which would then wrongly access a file
node as directory node.

This patch solves this issue by introducing two distinct methods
_with_open_node and _with_open_dir_node, which perform the respective
safety checks.

Fixes #4608
2022-09-19 14:00:35 +02:00
Martin Stein
79cc9af212 nic_router: intf. con/destruct reports link state
Creating and destructing an interface was not considered a change of its real
link state as defined in the description of the <report link_state_triggers="">
config attribute in the router's README. In case of Uplink sessions this is
obviously a problem as they communicate their real link state through session
lifetime. But also in case of NIC sessions it's a possible to create an
interface that is immediately "up" after creation or destruct an interface
without its link state going "down" beforehand.

Taking into account also the practical application of the
<report link_state_triggers=""> attribute, reporting only on destruction and
construction of interfaces that are "up" seems shorthanded. This is because a
report-receiver most likely needs to be able to synchronize the lifetime of
the objects that keep track of the link states with the lifetime of the
corresponding sessions.

That said, with this commit, the router triggers a report update on each
session construction/destruction when <report link_state_triggers=""> is
set.

Fixes #4462
2022-09-19 14:00:35 +02:00
Martin Stein
aff1db1543 nic_router: generate reports asynchronously
The NIC router used to generate reports triggered by IP config changes or link
state changes synchonously, i.e., inline with the activation context that
caused the change. This has two disadvantages. First, it can lead to an
excessive number of report updates in situations with quick bursts of
triggering changes. In such situations it is preferable to collect the changes
and reflect them with only one final report update.

Second, synchronous reporting may happen while the router is in a state that
leads to an incorrect report (e.g. during reconfiguration). To prevent this
from happening, the router so far explicitely switched off reporting when
entering incoherent states and back on when leaving them. However, this
solution is error-prone as the exclusion windows must be maintained manually.

Both issues can be solved by not directly generating a report when necessary
but instead submitting a signal and letting the signal handler do the work in
a dedicated activation context.

Ref #4462
2022-09-19 14:00:35 +02:00
Christian Helmuth
a573d3a332 Adapt tested log pattern in vbox5_genode_usb_hid_raw 2022-09-19 14:00:35 +02:00
Christian Helmuth
82f96668fa Increase cpu_burner RAM quota in test-trace_logger
Now, the test also succeeds on sel4.
2022-09-19 14:00:35 +02:00
Norman Feske
cc9368ccb4 os: add File_system_session::num_entries RPC
This patch splits the querying of the number of directory entries from
the directory's 'status' information. Subsuming the number of directory
entries as part of the status makes 'stat' calls too costly for some
file systems that need to read a directory for determining the number of
entries. So when stat'ing the entries of one directory that contains sub
directories, all entries of each sub directory are visited.

Thanks to Cedric Degea for pointing out this performance bottleneck!

With this change, the 'status' function returns a 'Status::size' value
of 0 when called for a directory handle.

Fixes #4603
2022-09-19 14:00:35 +02:00
Norman Feske
5b4b243e3d sculpt.run: distinguish DEPOT=list from DEPOT=omit
This patch splits the former DEPOT=omit option into two variants.
The new 'list' option behaves like the former 'omit' option, skipping
the creation of the tar archive from the depot content referenced by the
deploy configuration but showing a list of depot archives that need to
be published for the deployment.

When specifying 'omit' in th new version, the local depot is not queried
for the packages referenced in the deploy configuration. So the
deployment can refer to packaged hosted only remotely.

Fixes #4605
2022-09-19 14:00:34 +02:00
Norman Feske
96191fe577 gems: reanimate depot_deploy.run 2022-09-19 14:00:34 +02:00
Christian Helmuth
c8b4b83b71 base-linux: inhibit tracing in region-map attach/detach
Tracing must be inhibited in attach/detach as RPC trace points may
trigger attachment of trace dataspaces, which would result in nested
mutex acquisition.

This prevents errors in test-trace_logger like follows.

  [init -> depot_autopilot] 0.140 [init -> dynamic_rom] Error: deadlock ahead, mutex=0x500e6f00, return ip=0x50053ed7

Fixes #4607
2022-09-19 14:00:34 +02:00
Johannes Schlatow
80a2f7224e gems: src/lib/trace_recorder -> src/trace_recorder
The target.mk files for building the trace policies are no longer
reachable under src/lib/ by the build system.

genodelabs/genode#4599
2022-09-19 14:00:34 +02:00
Martin Stein
b82d83e271 nic_router: handle bad DNS in DHCP ACK gracefully
The DHCP client of the NIC router used to end up in an uncaught exception if
an IP address in the DNS server option of a DHCP ACK was invalid. This commit
makes the 'Dns_server' constructor (where the exception originated from)
private and instead introduces a public lambda method 'construct' that calls
one lambda argument on success and another on failure. This is also in line
with the most recent changes to the 'find_by_*' methods of other classes in
the NIC router and contributes to the goal of reducing expensive exception
handling.

Fixes #4465
2022-09-19 14:00:34 +02:00
Martin Stein
054990aafa nic_router: fix net session aliases
The Interface class of the router is an abstraction for NIC client sessions,
NIC server sessions, and Uplink sessions. Nonetheless, Interface generally used
to use the packet stream types of the Nic namespace and it worked because the
Uplink packet stream types are factually the same (the are typedef'd from the
same base type templates with the same parameters).

The initial intention of this issue was to remove dependency on the diverse
packet stream stream types from Interface. However, this turned out to be more
tricky than thought. The Interface class calls function templates on the packet
stream types, making a generic virtual interface impossible. And moving the
calling code to the session classes as well would produce a lot of redundancy.

Therefore, this commit removes only the use of the Nic namespace in the
interface.* files by typedef'ing the packet stream types from the generic
Genode type templates with the same parameters as in Nic and Uplink.

Fixes #4385
2022-09-19 14:00:34 +02:00
Martin Stein
ede007c2dd Bender: Intel HWP mode configurable via RUN_OPT
The updated Bender version is configurable regarding the mode in which to run
the Intel HWP plugin. This can now be controlled via the new run option
'--bender-intel-hwp-mode' (only when running on NOVA). The option knows 4 valid
values 'off', 'performance', 'balanced', and 'power_saving'. When running on
NOVA, the default value applied by the run tool is 'performance'. when running
on any other kernel, the default value of Bender ('off') is used. Therefore,
when not setting the new '--bender-intel-hwp-mode' flag, the behavior is the
same as before this commit.

Fixes #4224
2022-09-19 14:00:34 +02:00
Martin Stein
d9b5e4ae8d libc: warn on missing std*="" or <fd path=""> file
The libc kernel used to silently go on if one of the files given through
stdin/stdout/stderr or <fd path=""> was missing (with possibly vital
functionality for the component not working). A pointer to the presumably
simple configuration issue of the underlying scenario was not given to the
user.

With this commit, the libc kernel prints a descriptive warning before
proceeding with the invalid file descriptor

Fixes #4218
2022-09-19 14:00:34 +02:00
Martin Stein
5e9e003bb0 libc: warn on missing std*="" or <fd path=""> dirs
The libc kernel used to end up in an uncaught exception if one of the
directories in the paths given through stdin/stdout/stderr or <fd path=""> was
missing. The resulting error didn't point the user to the presumably simple
configuration issue of his scenario in any way and killed the affected
component.

With this commit, the libc kernel prints a descriptive warning instead and
simply continues to run the component with the corresponding file descriptor
missing. At least in case of stdin/stdout/stderr, the libc deals gracefully
with this approach.

Ref #4218
2022-09-19 14:00:34 +02:00
Christian Helmuth
5b25060730 libc: prevent compiler warning 2022-09-19 14:00:34 +02:00
Christian Helmuth
8186a1d7f8 Support seconds in vfs/rtc plugin and libc backend
Fixes #3886
2022-09-19 14:00:33 +02:00
Johannes Schlatow
4689275845 depot_deploy: do not fail on missing nodes
If provided with a config that does not include a `<static>` or
`<common_routes>` node, depot_deploy exits due to a `Nonexistent_sub_node`
exception. Instead, we should output a more useful warning.

Fixes genodelabs/genode#4600
2022-09-19 14:00:33 +02:00
Johannes Schlatow
7d143087c9 xml_node: change with_sub_node signature
The `with_sub_node` method is renamed to `with_optional_sub_node` to
better reflect that the non-existence of a sub node with the desired type is
ignored.
At the same time, the new `with_sub_node` now takes a second functor that is
called when no sub node of the desired type exists.

genodelabs/genode#4600
2022-09-19 14:00:33 +02:00
Christian Helmuth
f0e9881c7e intel_fb: prevent compiler warning 2022-09-19 14:00:33 +02:00
Stefan Kalkowski
f2c52d1570 usb c-api: manage lifetime of session handles
Fix genodelabs/genode#4602
2022-09-19 14:00:33 +02:00
Stefan Kalkowski
3d26ce9f8d usb_host: acknowledge all requests asynchronously
Fix genodelabs/genode#4601
2022-09-19 14:00:33 +02:00
Norman Feske
7c3b9c843f base-hw: tighten src-archive content of lib/mk/
This patch refines the rules for generating a base-hw src archive
for a given board by enumerating the content of the lib/mk/spec/*
directories instead of including entire directories. This avoids
the inclusion of lib.mk files found in SoC-specific repositories
(like genode-allwinner) in the kernel source archives.

When building a binary archive from such a src archive with the changes
of issue #4599, the build system would otherwise try (and fail) to build
the libraries for the accidentally included lib.mk files.
2022-09-19 14:00:33 +02:00
Norman Feske
4c1ec0404a Remove unused target from recipes/src/libc 2022-09-19 14:00:32 +02:00
Norman Feske
bd9478204d Exclude file lib from gems API
The 'file' library makes the gems API depend on the libc, which is not
desireable because most users of the gems API have no direct libc
dependency.

With the changes of issue #4599, the build of each src archive that
depends on the gems API would attempt to build the 'file' library and
thereby demand the libc.

Note that the 'file' library is a relic that should better not be
promoted as part of the gems API. Hence, this patch removes the file
library from the gems API and adds it to the src archives of the few
remaining users.

Issue #4599
2022-09-19 14:00:32 +02:00
Norman Feske
35661d065e base-linux: omit unused lib/mk/ from API recipe
The 'base-linux' API is used by hybrid Genode/Linux programs for the
lx_hybrid library. This API archive happend to contain other libraries -
like seccomp - that are solely needed for building core. With the change
of the build system in issue #4599, the build system would attempt to
build all libraries instead of merely the library dependencies of the
available targets. Hence, it would trigger the build of, e.g.,  the
seccomp library for each user of the base-linux API.

This patch avoids these superfluous build steps by pruning the content
of lib/mk/ to the libraries actually needed for lx_hybrid users.

Issue #4599
2022-09-19 14:00:32 +02:00
Norman Feske
7be98166ee run: improve 'build_boot_image [build_artifacts]'
This patch make the use of the result of the 'build_artifacts' function
as input for 'build_boot_image' more robust. Since 'build_artifacts'
obtains binary names from the progress.log, the names of core,
ld.lib.so, and the timer correspond to the kernel-specific names.

However, 'build_boot_image' expects the kernel-agnostic names as
arguments. Kernel-specific files need special treatment when integrated
in the boot image: the kernel-specific file is copied and renamed to the
kernel-agnostic name. Without this patch, the kernel-specific file is
copied as is (e.g., ld-nova.lib.so). So the name of the ROM module is
wrong. This patch resets the kernel-specific names to the generic names
so that the special-case handling comes into effect.
2022-09-19 14:00:32 +02:00
Norman Feske
f1f0ee3a21 base: disregard ld.lib.so stub as build artifact
The ld.lib.so stub library generated by base/lib/mk/ld.mk has no
purpose at runtime. On the contrary, it must not be integrated into the
boot image because its name collides with the kernel-specific dynamic
linker.
2022-09-19 14:00:32 +02:00
Norman Feske
9aab61f5a7 mk: allow declaration of build artifacts for libs
The build system automatically announces the names of shared libraries
as build artifacts. However, in rare cases, it is required to manually
define them. In particular, the 'ld' stub library plays no role at runtime
and should not be integrated into the boot image.

This patch adds a customization hook following the same pattern as used
for target.mk files, namely the BUILD_ARTIFACTS variable. If defined,
its value is taken as the list of boot artifacts generated by the
library-description file.

Issue #4368
2022-09-19 14:00:32 +02:00
Norman Feske
dd9e12601e Remove pseudo targets for building shared libs
Thanks to the change "build: support library builds via lib/<libname>",
shared libraries can now be built directly by the build system.

Issue #4599
2022-09-19 14:00:32 +02:00
Norman Feske
c560285d88 build: support library builds via lib/<libname>
This patch adds special handling for lib/<libname> arguments to the
build system, which supersedes the former LIB=<libname> mechanism.
Whereas the old mechanism was limited to a single library, the new
convention allows multiple library arguments, similar to regular
targets. The change brings the two immediate benefits.

First, the streamlining of library and target arguments allows for the
building of libraries via the 'build' command of the run tool.

Second, it alleviates the need for pseudo target.mk files for building
shared libraries that have no direct dependencies, in particular VFS
plugins.

Since this change eases the explicit creation of shared libraries
from run scripts, we may reconsider the automatic implicit building
of shared libraries driven by targets. E.g., while developing a Qt
application, a run script could import the Qt libraries from the
depot and combine those with the developed (fresh built) target without
triggering the build of the Qt libraries in the build directory.

When issueing 'make' without arguments, all targets are built. This
patch applies this behavior to libraries as well, thereby removing the
need for the base/src/lib/target.mk pseudo target as used by the CI
tools to build all libraries.

Note that target.mk files located under src/lib/ are no longer
reachable. Therefore, all run scripts that used to trigger the
build of a shared library via a pseudo target must be adapted.
E.g., 'build lib/vfs/tap' must be replaced by 'build lib/vfs_tap'.

With this patch, the LIB=<libname> option is no longer supported.

Fixes #4599
2022-09-19 13:59:28 +02:00
Norman Feske
f50971b6a9 os: src/lib/trace/policy -> src/trace/policy
The target.mk files for building the trace policies are no longer
reachable under src/lib/ by the build system.

Issue #4599
2022-09-19 13:59:27 +02:00
Norman Feske
88e13bb236 base-linux: src/lib/initramfs -> /src/initramfs
Move the target for initramfs outside the src/lib/ directory because
target.mk files within src/lib/ are no longer reachable.

Issue #4599
2022-09-19 13:59:27 +02:00
Johannes Schlatow
bc57e9e647 vfs: add Append_file class
This reverts commit cf904e0a5d and
introduces the Append_file class instead.

genodelabs/genode#4352
2022-09-19 13:59:27 +02:00
Norman Feske
06f24a73d2 doc/release_notes/22-08: minor style fix 2022-08-31 15:54:08 +02:00
Alexander Boettcher
354667bb6d lx_emul: validate USB endpoint and settings param
to avoid pagefaults and general protection faults on access to unpaged memory
regions.

Fixes #4596
2022-08-31 15:10:17 +02:00
Alexander Boettcher
b888c95024 qemu-usb: reread settings on configuration profile
changes. The alternative settings get reread on all interfaces as done before
"qemu-usb: fix device endpoint update" commit by introducing specific
reset_alt_settings function. The fallthrough case was intentionally before
the "qemu-usb: fix device endpoint update" case, which now is wrong.

Issue #4596
2022-08-31 15:10:17 +02:00
Alexander Boettcher
adc4d47251 usb_host: use Expanding reporter for device report
Issue #4596
2022-08-31 15:09:23 +02:00
Christian Helmuth
c333fc6f04 version: 22.08 2022-08-31 14:04:57 +02:00
Norman Feske
71571c4072 News item for version 22.08 2022-08-31 13:49:11 +02:00
Norman Feske
6c3d6253ef Release notes for version 22.08 2022-08-31 12:13:10 +02:00
Christian Helmuth
4dddc41b71 depot: update recipe hashes 2022-08-31 09:32:09 +02:00
Christian Prochaska
85044d65af qt5: add missing include in qtwebengine
Fixes #4595
2022-08-31 09:32:09 +02:00
Christian Helmuth
0368601b16 Prevent warning in trace-recorder policy
Make warned about

  make[2]: Circular /plain/krishna/build/genode_staging/x86_64/bin/ctf0_pcapng <- ctf0_pcapng dependency dropped.
2022-08-31 09:32:09 +02:00
Norman Feske
60194d666d menu_view: add 'important' frame style
This style is used by the upcoming phone version of Sculpt for GUI
elements that are supposed to stand out a little bit more than the
regular frame style.
2022-08-31 09:32:09 +02:00
Norman Feske
461a27a674 sculpt_manager: support opaque menu_view instances
Related to issue #4592.
2022-08-31 09:32:09 +02:00
Norman Feske
2772abc8d7 menu_view: configurable alpha channel and bg color
This patch enhances menu_view with the optional configuration attributes
'opaque' and 'background'. Setting 'opaque' to "yes" suppresses the use
of the alpha channel at the GUI session. This improves the drawing
performance by 20% on the PinePhone. Since the menu_view uses the
gems/gui_buffer.h utility, the 'Gui_buffer' received a new 'Alpha'
argument at construction time.

The 'background' attribute can be specified to define the reset color of
the GUI buffer. It alleviates the need to create a frame widget for the
top level.

The patch also switches the optimization level for compiling menu_view
to -O3, which increases the drawing performance on the PinePhone by 30%.

Fixes #4592
2022-08-31 09:32:09 +02:00
Norman Feske
bd8c7f84dd touch_keyboard: tweaks for PinePhone display
This change increases the quota to allow the use of bigger fonts, and
tweaks the style such that the keyboard gets a decent appearance on the
PinePhone's 1440x720 display.
2022-08-31 09:32:09 +02:00
Norman Feske
697d2e86d7 sculpt: add modem support via USB net
This patch adds principle support for using a USB-net modem as
mobile-data uplink. The change is motivated by the upcoming phone
manager for the PinePhone where the modem serves as the primary network
uplink. For the regular PC version of Sculpt, the feature is not needed
(hence remains disabled) because USB net can be deployed from a package
as described in:

  https://genodians.org/jschlatow/2021-07-21-mobile-network

The patch also renames the "Local" network option to "Disconnected" to
be more intuitive.
2022-08-31 09:32:09 +02:00
Norman Feske
5a0b4c98aa sculpt_manager: move Network::_menu_view to Main::
By decoupling the network dialog's menu view from the 'Network' class,
we become able to host the network dialog in the same menu view instance
as other dialogs.
2022-08-31 09:32:09 +02:00
Norman Feske
6f2237fc46 sculpt_manager: add missing includes 2022-08-31 09:32:09 +02:00
Norman Feske
4f4f270d35 sculpt.run: expose leitzentrale state to manager
This patch allows the sculpt manager hosted in the leitzentrale
subsystem to observe the toggling between the runtime and the
administrative GUI. This enables alternatives to the use of the
gui_fader for switching between both views. In particular, the
upcoming phone_manager toggles the visibility of its own GUI
depending on the leitzentrale state.
2022-08-31 09:32:09 +02:00
Norman Feske
8b85eb9b34 sculpt.run: customize initial /config/managed/
In a Sculpt system based on the upcoming phone_manager, the event filter
obtains its static configuration from /config/managed/event_filter.
Without the requirement for changes at runtime, there is no need to
have the phone_manager in the loop after all.

Without this patch however, this file was always initialized with the
template gems/sculpt/event_filter/default, which was presumably used
only at boot time until the sculpt manager has produced the first
generated event-filter configuration.

This patch applies the choice of optional configs - i.e., a custom
event_filter config - to both the config/ and the initial content of
config/managed/. So in cases where the /config/managed/event_filter
remains entirely static, the latter properly reflects the choosen
variant.
2022-08-31 09:32:09 +02:00
Norman Feske
236ebecf44 event_filter: new touch-key filter
The new <touch-key> filter type can be used to trigger artificial
press/release events for predefined touch-screen areas.

Fixes #4587
2022-08-31 09:32:09 +02:00
Christian Helmuth
59f1fe7625 rump: ext2_fs depot package
Usable via Sculpt /config/deploy, e.g. via

  <start name="nvme-0.4.fs" pkg="ext2_fs">
    <route>
      <service name="Block">
        <child name="nvme-0.part_block" label="4"/>
      </service>
      <service name="RM">
        <parent/>
      </service>
    </route>
  </start>

Fixes #4590
2022-08-31 09:32:09 +02:00
Christian Helmuth
d82d67a4b2 part_block depot package
Usable via Sculpt /config/deploy, e.g.,

  <start name="nvme-0.part_block" pkg="part_block">
    <route>
      <service name="Block">
        <parent label="nvme-0"/>
      </service>
      <service name="Report" label="partitions">
        <parent/>
      </service>
    </route>
  </start>

Issue #4590
2022-08-31 09:32:09 +02:00
Christian Prochaska
8f9f0f1d7f qt5_textedit: add mesa driver requirement to runtime
Fixes #4591
2022-08-31 09:32:09 +02:00
Christian Helmuth
6fbc953dbd Declare missing exception types thrown in USB session 2022-08-31 09:32:09 +02:00
Christian Prochaska
82a57a10e7 qt5: update to version 5.15.2
Fixes #4589
2022-08-31 09:32:08 +02:00
Christian Prochaska
6d172b8e7a qt5.run: provide mesa driver route for children
Fixes #4588
2022-08-31 09:32:08 +02:00
Norman Feske
08279e6288 Create Point, Area, Rect via 'from_xml' functions
By using the new functions provided by the base API, this patch removes
the dependency of several components from include/decorator/xml_utils.h.

Issue #4584
2022-08-31 09:32:08 +02:00
Martin Stein
f64d1bbc30 vfs_libusb: fix missing dependency to libusb
Ref #4582
2022-08-19 07:59:10 +02:00
Norman Feske
381a3406ba sculpt: evaluate initial manual nic_router config
Fixes #4586
2022-08-17 16:33:14 +02:00
Christian Prochaska
fb454a28fe libc: support 'thread_local' variable destructors
Fixes #4585
2022-08-17 14:51:50 +02:00
Norman Feske
42edac8a34 util/geometry: support 'Rect::from_xml'
This patch eases the creation of 'Point', 'Area', and 'Rect' objects
from XML attribute values.

Fixes #4584
2022-08-17 14:28:12 +02:00
Norman Feske
5319f36788 util/string.h: support 'int' for 'ascii_to'
This patch complements the 'long' version of the 'ascii_to' conversion
function by an 'int' version.

Fixes #4583
2022-08-17 14:28:12 +02:00
Martin Stein
d0a33e34da pcsc-lite: fix inc dir base in depot case
Fixes #4582
2022-08-17 12:26:44 +02:00
Martin Stein
3286d37c64 pcsc-lite: src and api recipe
Ref #4582
2022-08-17 12:26:44 +02:00
Roland Bär
8f228e3035 nic_router: no ICMP on unroutable IPv4 multicast
The NIC router used to send an ICMP "Destination Unreachable" packet as
response to every unroutable IPv4 packet. However, RFC 1812 section 4.3.2.7
defines certain properties that must be fullfilled by an incoming packet in
order to be answered with this type of ICMP. One requirement is that the packet
is no IPv4 multicast.

This commit prevents sending the mentioned ICMP response for unroutable IPv4
multicasts and instead drops them silently.

Fixes #4563
2022-08-17 12:26:01 +02:00
Christian Helmuth
44e2cd14a0 depot: update recipe hashes 2022-08-17 12:03:26 +02:00
Norman Feske
48711c6f8b sculpt: hook for audio-driver integration
This patch allows the leitzentrale subsystem to control an audio driver
hosted in the drivers subsystem. An example use case is the toggling of
the speaker during phone calls.
2022-08-17 12:03:26 +02:00
Sebastian Sumpf
b5c780993c board: Rename virt_qemu to virt_qemu_<arch>
Instead of having a generic "virt_qemu" board use "virt_qemu_<arch>" in
order to have a clean distinction between boards. Current supported
boards are "virt_qemu_arm_v7a", "virt_qemu_arm_v8a", and
"virt_qemu_riscv".

issue #4034
2022-08-17 12:03:26 +02:00
Johannes Schlatow
c462720c28 trace_recorder: add TraceCompass analyses
Define custom analyses that can be imported into TraceCompass (>= 7.3)
for evaluating the traced component interactions and checkpoints.

genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
e4aceb7845 trace_recorder: add combined ctf + pcapng policy
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
ef742001e8 trace_recorder: implementation
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
53f576e50e trace_recorder: add pcapng policy
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
be20b715ca trace_recorder: add ctf policy
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
758ba3855e trace: add types for trace_recorder policies
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
062881a484 trace: add types for ctf tracing
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
810bbc0484 nic_router: add trace_packets config option
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
cee0c9858c trace_buffer: add object() accessor
genodelabs/genode#4352
2022-08-17 12:03:07 +02:00
Johannes Schlatow
086f3efef2 trace: add trace_eth_packet event
genodelabs/genode#4352
2022-08-17 12:03:07 +02:00
Johannes Schlatow
80a422e590 trace: add GENODE_TRACE_CHECKPOINT macros
genodelabs/genode#4352
2022-08-17 11:54:19 +02:00
Johannes Schlatow
73dad70356 trace: add checkpoint event
genodelabs/genode#4352
2022-08-17 11:54:19 +02:00
Johannes Schlatow
cf904e0a5d vfs: add append mode to New_file
genodelabs/genode#4352
2022-08-17 11:54:19 +02:00
Michael Mueller
3e736fc888 posix_playground: Added test for unique_ptrs. 2022-08-10 16:33:35 +02:00
Michael Mueller
304b61613b blinktree: Use all cores from assigned affinity space. 2022-08-10 16:32:20 +02:00
Michael Mueller
a91c4bc8ae blinktree: Readded Chronometer to get performance measurements back. 2022-08-10 16:31:21 +02:00
Michael Mueller
9320380efd blinktree: Removed unnecessary mutexes. Console output is already synchronized internally. 2022-08-10 16:30:47 +02:00
Michael Mueller
84a79c2168 blinktree: Removed stdc++ I/O functions because they cannot be called from within a worker thread. 2022-08-10 16:29:54 +02:00
Michael Mueller
a8f6fc42cc blinktree: Use std::thread for fill and mixed threads. 2022-08-10 16:28:56 +02:00
Michael Mueller
8b9d93259f blinktree: Made perf functions configurable, so that Chronometer can be used without them. 2022-08-10 16:28:27 +02:00
Michael Mueller
6e9b070758 posix_playground: Updated Qemu parameters. Removed memory parameter. 2022-08-10 16:27:21 +02:00
Michael Mueller
8ff310b40d hello_mxtask: Removed GDB stub. 2022-08-10 16:26:49 +02:00
Michael Mueller
4710b24e99 mxtasking: Added missing header files in ports file. 2022-08-10 16:26:26 +02:00
Michael Mueller
918cac3cca blinktree: Defined affinity space and added POSIX library for posix_memalign(). 2022-08-10 16:25:37 +02:00
Michael Mueller
835408a828 Fixed Core crashing in creating CPU report when using more than 29 CPU cores. 2022-08-10 16:23:30 +02:00
Michael Mueller
5b44b54065 Always use COM1. Bender does not work well with SOL solutions. 2022-08-10 16:21:51 +02:00
Christian Helmuth
2e266dfe3c vbox5_genode_usb_hid_raw: support --depot-auto-update
... in nested run.
2022-08-10 13:33:04 +02:00
Christian Helmuth
eeb40d0cc2 vbox5_genode_usb_hid_raw: configure static RTC
This prevents

  Warning: clock_gettime(): missing real-time clock

log messages.

Related to #4561
2022-08-10 13:33:04 +02:00
Peter Krummenacher
11b964b759 audio_in_session: fix wrong buffer in content
Fixes #4573
2022-08-10 13:33:04 +02:00
Christian Prochaska
3f8bde1254 vbox6: don't call blocking 'read()' to start audio recording
Fixes #4580
2022-08-10 13:33:04 +02:00
Christian Prochaska
bda276f498 vfs_oss: implement 'SNDCTL_DSP_SETTRIGGER' command
Fixes #4579
2022-08-10 13:33:04 +02:00
Martin Stein
a4ec06a3b7 nic_router: no empty DNS servers opt in DHCP reply
The NIC router used to add the DNS servers field to DHCP replies regardless of
whether there were DNS servers or not. As reported by a Genode user, the empty
DNS server field irritated at least Windows 10 guests (Vbox 6) that connected
to the NIC router. This resulted in Windows 10 ignoring DHCP offers from the
router with such characteristic.

With this commit adding the DNS server DHCP option is skipped if there are no
DNS servers at the corresponding DHCP server or the domain IP config the server
shall fetch its DNS servers from.

Fixes #4581
2022-08-10 13:33:04 +02:00
Christian Helmuth
1dd69eeb6c lx_emul: skip USB config setting if already set
Skip SET_CONFIGURATION requests if the device already has the selected
config as active config. This workaround prevents issues with Linux
guests in VirtualBox and SDC-reader passthrough.

Thanks to Peter for the patch.
2022-08-10 13:33:04 +02:00
Josef Söntgen
3d8c1080b1 dde_linux: remove exited tasks
The commit introduces means to mark a task for destruction that is
removed on the next scheduling cycle. This fixes stack leakage from
dynamic kworker tasks.

Issue #4575.
2022-08-10 13:33:04 +02:00
Josef Söntgen
bc665384c3 dde_linux: free stack on task destruction
Issue #4575.
2022-08-10 13:33:04 +02:00
Stefan Kalkowski
8255053242 platform_drv: export Intel graphics PCI infos
Provide additional PCI register information inside the pci-config part
of the devices ROM for clients able to access an Intel graphic card,
namely the GMCH control register content, which contains for instance
the GTT size and stolen memory size.

Ref genodelabs/genode#4578
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
9dfc2caa11 platform_drv: add UHCI PCI quirks
Implement BIOS handover and Intel resume register update
apart from device driver to circumvent export of PCI
config space to drivers.

Ref genodelabs/genode#4578
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
413e2baa1c platform_drv: PCI assignment failure is no error
When there is no I/O MMU available the assignment is failing too,
although this is no error but normal behaviour.

Ref genodelabs/genode#4578
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
8f9b5e9bd2 depot: src package for pci_decode
Ref genodelabs/genode#4578
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
2cc6c1adef pci: export BAR indices, sub-vendor, -product, rev
The pci_decode has to extract the additional fields from the PCI configuration
space. The platform driver again has to parse and forward the knowledge too.
The PCI BAR indices are exported when info="yes" is set in the policy node for
the corresponding session.

Fix genodelabs/genode#4577
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
5bf3e72d37 pci: return correct I/O port base from BAR
The base address of I/O ports has a different encoding than
those of I/O memory. This needs to be encountered in the PCI
config helper utilities.

Fix genodelabs/genode#4576
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
49c6e01049 qemu-usb: ignore invalid USB data packets
Fix genodelabs/genode#4574
2022-08-10 13:33:03 +02:00
Johannes Schlatow
a6a856cb70 dde_ipxe: fix allocation errors under high TX load
Under high TX load, 'irq_handler()' is rarely executed but packets
are still received since 'netdev_poll()' is called for every TX packet.

'netdev_poll()' not only handles completed transmissions but also
puts the IO buffers of received packets into the RX queue and refills the RX
ring by allocating more IO buffers. However, the IO buffers can only be freed
after they have been dequeued and passed to the 'rx_callback()'. Since
this was only done by 'irq_handler()', we exhaust the slab allocator
under high TX load.

A fix for this is to process the RX queue not only in the IRQ handler
but also when transmitting packets.

genodelabs/genode#4555
2022-08-10 13:33:03 +02:00
Alexander Boettcher
e2b61231ae pc: avoid use usleep_range in m/udelay emulation
m/udelay is called with closed interrupts. Linux contrib code expects no
other task to be run respectively to be re-scheduled. usleep_range leads to
executing other tasks, which causes assertions in "spinlock taken twice" or
"unexpected preempt count" errors, seen on runtime with wifi_drv and intel_fb.
The assertion triggered with the changes by #4562.
2022-08-10 13:33:03 +02:00
Alexander Boettcher
6c5d2253c9 sel4: increase caps in filesystem tests
fixes x86_32/64 libc_vfs_fs_ext2 and libc_vfs_fs_fat
2022-08-10 13:33:03 +02:00
Martin Stein
3868df9f8b nic_router_dhcp_*: raise timeouts
On okl4, pistachio, sel4 the test didn't come up fast enough in order to still
experience the first configuration of NIC router #1. This commit doubles the
lifetime of the first configuration of NIC router #1 to 4 seconds and raises
the overall test timeout accordingly.

Ref #4555
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
89f9e7a3ee lx_emul: consolidate SMP + NO_HZ_IDLE
* Move common SMP and NO_HZ_IDLE variables and functions into
  generic lx_emul shadow implementations, and integrate them
  into the common lx_emul import rules
* Enable SMP and NO_HZ_IDLE within virt_linux kernel configuration
* Adapt pc drivers and wireguard accordingly
* Use original Linux softirq implementation in wireguard
* Remove erroneous softirq shadow implementation

Ref genodelabs/genode#4540
Ref genodelabs/genode#4562
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
48eacb6f79 qemu-usb: handle Interface_not_found exceptions
Fix genodelabs/genode#4572
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
560747c22e lx_emul: active config validation in usb driver
Fix genodelabs/genode#4567
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
92a5fa9bed lx_emul: remove usb device reset in session close
Ref genodelabs/genode#4566
2022-08-10 13:33:03 +02:00
Martin Stein
e32157e21b nic_router: packet allocation w/o exceptions
In overload situations, i.e. when a sender fills up the entire buffer, we land
in situations where the sender receives an ack_avail signal, releases one
packet, allocates and sends a packet and fails to allocate a second packet.
This is especially relevant if the receiver does not batch ack_avail signals
(such as vfs_lwip). In those ping-pong scheduling scenarios, the overhead from
catching the Packet_alloc_failed exception becomes significant. In case of the
NIC router, we will land in an overload situation if the sender is faster than
the receiver. The packet buffer will be filled up at some point and the NIC
router starts to drop packets. For every dropped packet, we currently have to
catch the Packet_alloc_failed exception.

This commit adds a new method alloc_packet_attempt to Packet_stream_source that
has almost the same signature as the older alloc_packet method but returns
an Attempt<Packet_descriptor, Alloc_packet_error> object. As the method already
used the allocator back end exception-less, changes on lower levels were not
needed. Furthermore, the NIC router was modified to use the new exception-less
alloc_packet_attempt instead of alloc_packet.

Ref #4555
2022-08-10 13:33:03 +02:00
Alexander Boettcher
3f69457a94 pc/intel: add intel_fb test to autopilot 2022-08-10 13:33:03 +02:00
Martin Stein
433029c3a6 nic_router: find ARP cache entries w/o exceptions
Replaces the former implementation of the 'find_by_ip' method at the data
structure for ARP cache entries. This method used to return a reference to the
found object and threw an exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Ref #4555
2022-08-10 13:33:03 +02:00
Johannes Schlatow
e2086ac8e4 nic_router: change max_packets_per_signal default
According to a benchmarking series on Zynq (base-hw) and x260 (base-nova) using
test-nic_perf_router, increasing the 'max_packets_per_signal' has a significant
effect on the packet throughput. By increasing the default value from 32
to 150, we could gain a few hundred Mbit/s. Increasing the value further
does not seem to have such a strong effect, though.

genodelabs/genode#4555
2022-08-10 13:33:03 +02:00
Johannes Schlatow
a2b74af59a depot: add nic_perf recipes
genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
3e562bc9bb os: add nic_perf component
The nic_perf component is used for benchmarking the throughput of Nic
and Uplink sessions.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
8df8f78fe2 nic_router_dhcp: fix signal handler in test client
The test client did not react upon packet_avail and ack_avail signals.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Martin Stein
9a37ccfe29 nic_router: incremental L4 checksum updates
The checksums for forwarded/routed UDP, TCP and ICMP, used to be always
re-calculated from scratch in the NIC router although the router changes only
a few packet fields. This commit replaces the old approach whereever sensible
with an algorithm for incremental checksum updates suggested in RFC 1071.
The goal is to improve router performance.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
b6d15fa3ab nic_router: incremental IPv4 checksum updates
The checksums for forwarded/routed IPv4, used to be always re-calculated from
scratch in the NIC router although the router changes only a few packet fields.
This commit replaces the old approach whereever sensible with an algorithm for
incremental checksum updates suggested in RFC 1071. The goal is to improve
router performance.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
d69e89f5cb internet checksum: use signed long for accumulator
We used to use 'unsigned long' for the accumulating variable when calculating
internet checksums. However, 'signed long' is more in accordance with RFC 1071
and will allow us to share the same back end for folding, once we implement
incremental updating of internet checksums.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
6b3ed6c75b internet checksum: no default arg value
Prevent public reflection of the only internally used 'init_sum' argument in
'uint16_t internet_checksum(...)' that, in addition, added a default value to
the function interface.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
07d4a7c11f nic_router: no IPv4 checksum update on ICMP echo
When sending an ICMP ECHO reply, the router merely swaps SRC and DST of the
IPv4 header of the corresponding request and these changes cancel each other
out in checksum calculation. Therefore, with this commit, the router skips
updating the IPv4 checksum in this context.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
865ee192b4 nic_router: no checksum update on IP routing
The router used to update IPv4 checksums when routing via an <ip> rule
despite the fact that it doesn't change any IPv4 header fields in this case.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
95b3b36cd9 nic_router: update checksums only once per packet
The NIC router used to update IPv4 and layer 4 checksums of a packet for each
interface it was sent to (say, all interfaces of the domain the packet was
routed to). However, there was and is no technical reason for not doing it
only once and then iterating over the interfaces with the already updated
packet. This is what this commit does in an intent to raise the router's
performance.

Ref #4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
01c9c32573 nic_router: relax timer accuracy for timestamps
The NIC router uses the timer for relatively coarse-grained timeouts.
It therefore suffices to update and store the current time when the NIC router
is signalled and use the cached time instead. This prevents frequent
syscalls or RPCs when acquiring the current time for every packet.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
735abca1b6 nic_router: avoid marginal timeout updates
The link dissolve timeout is updated for every packet, which leads to
trigger_once() RPCs that only marginally change the scheduled timeout but
significantly slow down the packet throughput.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
3ea910bf83 packet_stream: reset wakeup_needed on wakeup()
The wakeup call only emits a single signal as it assumed both are
handled by the same signal handler. However, the original implementation
did not reset the wakeup_needed variable properly.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
6a308dacd7 packet_stream: always emit ack_avail
When using signal batching, ack_avail and packet_avail should always
be emitted and preferred over ready_to_submit and ready_to_ack.
A signal receiver might decide to not register the ready_to_* signals when it
handles congestion by dropping packets. The Nic router is an example of
such a signal receiver.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
8193f5571a nic_router: batch packet stream signals
genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Alexander Boettcher
359283968a vbox6: improve NMI handling
Fixes #4568
2022-08-10 13:33:02 +02:00
Christian Helmuth
eda6c6607c Restore dynamic on/off in usb_webcam test
Issue #4565
2022-08-10 13:33:02 +02:00
Christian Helmuth
8d7ade5604 lx_emul: fix single USB interface claim/release
Fixes #4565
2022-08-10 13:33:02 +02:00
Stefan Kalkowski
596c20c199 pc: enable SMP and softirq/tasklets in lx_emul
Enables symetric-multi-processor support in the Linux kernel configuration
used as base for the driver ports for PC. This is done to be compliant with
common usage of x86 drivers today.
Moreover, this commit uses the original kernel source for softirq/tasklet
implementation to get rid of the insufficient shadow implementation
in the lx_emul sources.

Ref genodelabs/genode#4562
2022-08-10 13:33:02 +02:00
Stefan Kalkowski
ec1b060fc5 dde_linux: x86 requirements for SMP
Prepare shadow implementations in spinlocks, pagetable defines,
and irq_stack assembler macros to be able to enable SMP on x86/PC.

Ref genodelabs/genode#4562
2022-08-10 13:33:02 +02:00
Stefan Kalkowski
c898a4770b dde_linux: initialize wait_bit subsystem
This is needed to compile kernel/sched/wait_bit.c needed by
x86 SMP as prerequisite for kernel/softirq.c.

Ref genodelabs/genode#4562
2022-08-10 13:33:01 +02:00
Josef Söntgen
558e2fc35e libdrm/etnaviv: fix DRM version implementation
Issue #4559.
2022-08-10 13:33:01 +02:00
Josef Söntgen
da25b288ee libports: add mesa/lima driver
This commit introduces the Mesa3D lima driver for Mali 400 series
GPUs.

Issue #4559.
2022-08-10 13:33:01 +02:00
Josef Söntgen
d2c26fd504 libdrm: introducde DRM dispatcher
The dispatcher will select between the various DRM drivers. For
now it is only used by the etnaviv driver.

Issue #4559.
2022-08-10 13:33:01 +02:00
Josef Söntgen
1f819a26e5 mesa/etnaviv: use VFS Gpu plugin to acquire Env
Issue #4559.
2022-08-10 13:33:01 +02:00
Josef Söntgen
02f3b965b9 mesa/etnaviv: move to arm_v8 spec
Issue #4559.
2022-08-10 13:33:01 +02:00
Josef Söntgen
2e81137a80 mesa/iris: build dummy only on x86
Issue #4559.
2022-08-10 13:33:01 +02:00
Alexander Boettcher
b03cb94b43 pc: add linux driver timer test
The test runs as lx_user task and uses several *delay and wait queue test
cases happened to be used in real ported linux drivers. The test shows
the time spent with several time sources, e.g. jiffies, rdtsc,
lx_time_counter_count etc.

Issue #4540
2022-08-10 13:33:01 +02:00
Alexander Boettcher
46b487c2f7 pc: consolidate __const_udelay for linux drivers
Use common implementation used by wifi and (not merged) audio driver.
Avoid usage of lib/delay.c since lpj and loop_for_jiffies are not calibrated
for the ported drivers as done on native Linux during boot and leads to wrong
delays for usb and intel_fb.

Issue #4540
2022-08-10 13:33:01 +02:00
Alexander Boettcher
7b4556e546 intel_fb: remove schedule_timeout wrap
Issue #4540
2022-08-10 13:33:01 +02:00
Alexander Boettcher
9ecbe51e34 pc_linux: enable NO_HZ_IDLE
the option enables support to stop periodic ticking when in idle task.

Adjust dummies of intel_fb, wifi, usb drivers accordingly.

Issue #4540
2022-08-10 13:33:01 +02:00
Alexander Boettcher
ce67be5a86 lx_kit: sanitize that solely ep calls schedule()
with expected primary stack.

Issue #4540
2022-08-10 13:33:01 +02:00
Alexander Boettcher
c81b3d4757 base: add check whether stack belongs to ep
Add method to check whether a given pointer are part of the primary stack
of the rpc entrypoint.

Issue #4540
2022-08-10 13:33:01 +02:00
Christian Helmuth
fb0fe8617c dde_linux: re-enable -Wformat
Fixes #4542
2022-08-10 13:33:01 +02:00
Christian Helmuth
0f009ecbdd lx_emul: add lx_emul_backtrace()
Issue #4542
2022-08-10 13:33:01 +02:00
Christian Helmuth
3b3eef5307 lx_emul: add devm_ioremap_uc()
Issue #4542
2022-08-10 13:33:01 +02:00
Christian Helmuth
ea8df22dbb dde_linux: fully enable printk format specifiers
The new Lx_kit::Console::print_string() method skips leading
log-level markers in strings if detected.

Issue #4542
2022-08-10 13:33:00 +02:00
Johannes Schlatow
7d2f019681 libc: output warning if RTC is not present
genodelabs/genode#4561
2022-08-10 13:33:00 +02:00
Alexander Boettcher
01d7c07920 pc/linux: add contrib patches
- intel_fb: avoid pagefault in fliphandler
- usb_host: avoid hang of usb xhci hardware

Fixes #4556
2022-08-10 13:33:00 +02:00
Peter Krummenacher
f859cd11bd rom_filter: support sub nodes outside of <inline>
Fixes #4560
2022-08-10 13:33:00 +02:00
Josef Söntgen
9183870b9e gpu: add information for lima driver
Issue #4559.
2022-08-10 13:33:00 +02:00
Josef Söntgen
b6cfb5a8fe gpu_session: add PPGTT address query function
Using the 'query_buffer_ppgtt()' function allows for retrieving the
virtual address of the buffer in the PPGTT.

This is for components that manage the GPU virtual addresses rather than
the client as is the case with the lima driver.

Issue #4559.
2022-08-10 13:33:00 +02:00
Alexander Boettcher
757fdba9fd dde_linux: set max timeout for rcu_needs_cpu
Adhere to include/linux/rcutiny.h behaviour, which sets the max timeout
for rcu_needs_cpu. Without the commit, in the most cases the timeout value
is zero (or random since the pointer is on stack uninitialized), which leads
to programming very short timeouts again and again, making the system never
idle.

Issue #4540
2022-08-10 13:33:00 +02:00
Alexander Boettcher
a23f6209ae lx_emul: stop ticking in idle task
Fixes #4540
2022-08-10 13:33:00 +02:00
Norman Feske
d27c504261 menu_view: increase local font cache to 1 MiB
This allows the use of font sizes up to 50 px without constant cache
misses.
2022-08-10 13:33:00 +02:00
Norman Feske
202bb707ce menu_view: ignore zero-sized widgets in box layout
The box layout evenly distributes the child widgets according to the
number of children. This is not desired in the special case where a
child widget has a size of zero. The patch changes the layout algorithm
such that zero-sized widgets are not taken into account for distributing
residual space.
2022-08-10 13:33:00 +02:00
Norman Feske
b4ded050e1 sculpt: hook for modem-driver integration
This patch the interplay between the leitzentrale subsystem and a modem
driver hosted in the drivers subsystem.
2022-08-10 13:33:00 +02:00
Norman Feske
a9b4be3883 menu_view: make menu_view_styles.tar more obvious
This patch replaces the former implicit "phonyness" of the rule by an
explicit .PHONY and installs a symlink from the target's build directory
to bin/ as is the usual practice for regular targets.

Related to issue #3972
2022-08-10 13:33:00 +02:00
Christian Helmuth
9a47f7bf71 sandbox: prevent non-empty list model on destruction
The parent-provides model is destroyed if no <parent-provides> node is
found in the configuration, which resulted in

  Warning: list model not empty at destruction time

and leaking memory for the allocated nodes. The commit now explicitly
empties the list model in the destructor of ~Parent_provides_model.

Note, the case is implicitly tested in pkg/test-init by step "denial of
forwarded session request" and <init_config version="empty">.

Thanks to Peter for reporting this issue.

Fixes #4547
2022-08-10 13:33:00 +02:00
Christian Helmuth
f14b68202c dde_linux: shadow evdev.c and use event C API
Fixes #4543
2022-08-10 13:33:00 +02:00
Christian Helmuth
4550ec4716 genode_c_api: key-press/release and relative-motion events
Issue #4543
2022-08-10 13:33:00 +02:00
Christian Helmuth
393766a931 legacy_platform_drv: ACPI devices in configuration
Known ACPI device resources can be statically configured on startup like
follows.

  <config>
    <policy label_prefix="driver">
      <device name="ACPI0000"/>
    </policy>
    <device name="ACPI0000" typee="acpi">
      <irq number="99" mode="level" polarity="low"/>
      <io_mem        address="0xfc000000" size="0x100000"/>
      <io_port_range address="0x4000"     size="4"/>
    </device>
  </config>

Fixes #4545
2022-08-10 13:33:00 +02:00
Christian Helmuth
c5bdc1ccbe acpica: configure SCI IRQ mode
Issue #4553
2022-08-10 13:33:00 +02:00
Christian Helmuth
924e1d741d lx_emul: cleanup naming of lx_emul_random_gen*
Issue #4544
2022-08-10 13:33:00 +02:00
Martin Stein
1fbe72b7dd lx_emul: fixed types in lx_emul_gen_random_u*
* Rename lx_emul_gen_random_uint lx_emul_gen_random_u32.
* Use genode_uint*_t as return types for the lx_emul_gen_random_u* functions.

Ref #4544
2022-08-10 13:33:00 +02:00
Alexander Boettcher
5a4efcad0a tool: update to uefi mode aware bender
Fixes #4426
2022-08-10 13:33:00 +02:00
Alexander Boettcher
97d7d4b49d grub2: update to newer grub2 2.06 version
In UEFI case the lower RAM will not be used for internal allocation, which
should prevent overrides in the former legacy BDA (first page).

Issue #4426
2022-08-10 13:33:00 +02:00
Martin Stein
d5b1d9466a nic_router: clear ARP cache when domain is down
Whenever a domain looses all its interfaces or the link state of all attached
interfaces is down at once, the domain potentially moves to another Ethernet
segment and should therefore consider its ARP cache to be outdated.

RFC 826 states that "... If a host moves, any connections initiated by that
host will work, assuming its own address resolution table is cleared when it
moves. ...".

Therefore, this commit introduces clearing the ARP cache and the initially
stated events.

This commit was motivated by an issue with the PinePhone Modem and USB NIC.
On the PinePhone, the Modem has its own OS and acts as direct gateway to the
outer world for the USB NIC that is driven by Genode. However, whenever the
Modem gets restarted, Modem and USB NIC receive a new MAC address. This used
to conflict with the NIC routers ARP entry for the Modem that didn't cease to
be valid.

With this commit, the integrator of such a scenario at least has a convenient
way of fixing this by ensuring that all interfaces at the USB NIC domain go
down when resetting (e.g. by ensuring that the USB NIC is the only interface at
that domain).

Fixes #4558
2022-08-10 13:32:59 +02:00
Sebastian Sumpf
64c81e2846 usb_net: Add cdc_ether ECM support
* Enable ECM devices
* Allow disconnect of devices
* Handle link state correctly
* Required by PinePhone's USB modem

issue #4557
2022-08-10 13:32:59 +02:00
Sebastian Sumpf
96b147b63d dde_linux/usb/legacy: only free completed URBs
In case a USB client cancelled URBs, do not free them, wait until the
packets/URBs are acked by the USB session.

issue #4557
2022-08-10 13:32:59 +02:00
Sebastian Sumpf
87aa456bfd lx_emul: remove 'shadow/softirq.c' from common imports
softirq.c implements tasklets that need on the PinePhone cannot be
called directly.

issue #4557
2022-08-10 13:32:59 +02:00
Christian Helmuth
ab9a2107e4 nova: support interrupt mode config in assign_gsi
Fixes #4553
2022-08-10 13:32:59 +02:00
Christian Helmuth
47c924d1f5 pc: use lx_emul_gen_random_bytes() for randomness
Fixes #4544
2022-08-10 13:32:59 +02:00
Christian Helmuth
427f3bb634 run/load/ipxe: support ISO and UEFI images
Patch by Roman Iten and Pirmin Duss.
2022-08-10 13:32:59 +02:00
Roland Bär
789a60278c gmp: extensions for chrony
- compile nextprime, sec_div and sqr_diag_addlsh1
- updated symbols and hash

Fixes #4526
2022-08-10 13:32:59 +02:00
Roland Bär
88db584566 libc: timex, socket_fs_recvmsg and sendmsg
- Added timex.h as provided header file
- implementation of socket_fs_recvmsg
- implementation of sendmsg

Changes needed for chrony port.

Issue #4526
2022-08-10 13:32:59 +02:00
Roland Bär
18b022bf6b rtc_drv: log 'set time' message on verbose
The "verbose" config attribute instructs the driver to log 'set time'
messages when the RTC updated initially or from the 'set_rtc' ROM.

Fixes #4526
2022-08-10 13:32:59 +02:00
Johannes Schlatow
1c5db07342 lxip: add warning when schedule_timeout is called
genodelabs/genode#4551
2022-08-10 13:32:59 +02:00
Johannes Schlatow
a8070a429a libc: propagate fd flags in socket_fs_plugin
When creating a socket, fd flags can be specified by ORing them with the
socket type. Most importantly, the flag SOCK_NONBLOCK must be propagated
to the Socket_fs::Context in order to support non-blocking recv/send.

genodelabs/genode#4550
2022-08-10 13:32:59 +02:00
Josef Söntgen
7c340b1cc9 pc/wifi: implement iput dummy
The 'iput()' function is called from '__sock_release()' when the sock
object has no valid file object. The release function on the other hand
is called when the supplicant closes a socket.

Fixes #xxx.
2022-08-10 13:32:59 +02:00
Christian Prochaska
fd8d439e39 qt5: add 'QtGraphicalEffects' QML plugin
Fixes #4549
2022-08-10 13:32:59 +02:00
Christian Prochaska
91c0cde742 qt5: provide all 'qt5_declarative' QML plugins
Fixes #4548
2022-08-10 13:32:59 +02:00
Christian Prochaska
e7cc54204f qt5: add CMake support
Fixes #4546
2022-08-10 13:32:59 +02:00
Christian Prochaska
079fd0071a qt5: update port for Morph browser support
- fix OpenGL issues
- pass touch press location with touch release event to
  fix button clicks with touch screen
- fix AVX alignment error in ffmpeg code on base-linux
- add generated cmake support files

Fixes #4541
2022-08-10 13:32:59 +02:00
Martin Stein
925d229d67 nic_router: find AVL string nodes w/o exceptions
Replaces the former use of the 'find_by_name' method of the AVL string tree.
This method returned a reference to the found object and threw an exception if
no matching object was found.

The locally implemented replacement doesn't return anything and doesn't throw
exceptions. It takes two lambda arguments instead. One for handling the case
that a match was found with a reference to the matching object as argument and
another for handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Furthermore, this commit modifies the local wrapper for the  insert method of
the AVL string tree, so, that it follows the above mentioned concept as well.

Ref #4536
2022-08-10 13:32:59 +02:00
Martin Stein
6294167eff nic_router: find nat rules w/o exceptions
Replaces the former implementation of the 'find_by_domain' method at the data
structure for NAT rules. This method used to return a reference to the found
object and threw an exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Ref #4536
2022-08-10 13:32:58 +02:00
Martin Stein
65955601f0 nic_router: find permit rules w/o exceptions
Replaces the former implementation of the 'find_by_port' method at the data
structure for permit rules. This method used to return a reference to the found
object and threw an exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Furthermore, the commit introduces a convenience wrapper for finding the best
matching pair of transport rule and corresponding permit rule for a given
destination IP and port. This method as well follows the above mentioned
concept.

Ref #4536
2022-08-10 13:32:58 +02:00
Martin Stein
0f6714c6d7 nic_router: find forward rules w/o exceptions
Replaces the former implementation of the 'find_longest_prefix_match' method at
the data structure for direct rules. This method used to return a reference to
the found object and threw an exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Ref #4536
2022-08-10 13:32:58 +02:00
Martin Stein
5d14adebb5 nic_router: find direct rules w/o exceptions
Replaces the former implementation of the 'find_longest_prefix_match' method at
the data structure for direct rules. This method used to return a reference to
the found object and threw an exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Ref #4536
2022-08-10 13:32:58 +02:00
Martin Stein
baf4a85d23 nic_router: find link sides w/o exceptions
Replaces the former implementation of find_by_id at the data structure for
links. This method used to return a reference to the found object and threw an
exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Ref #4536
2022-08-10 13:32:58 +02:00
Stefan Kalkowski
4234659cac pci_decode: fix iteration bounds of PCI buses
Fix #4539
2022-08-10 13:32:58 +02:00
Stefan Kalkowski
0b5ad90bde usb_host: handle control URBs asynchronously
In the Genode C API and the DDE Linux USB host driver, turn control
URBs into asynchronously handled ones.

Fix genodelabs/genode#4535
2022-08-10 13:32:58 +02:00
Josef Söntgen
1ca2265fd4 pc/wifi: do not execute driver on user stack
The 'with_libc' call at this point is not necessary and could be
harmful as it forces the usage of the user stack for the driver.
All code depending on this distinction should only be executed
from within the pthread.

Issue #4537.
2022-08-10 13:32:58 +02:00
Josef Söntgen
a90abbc22e pc/wifi: get RFKILL state on frontend construction
Issue #4537.
2022-08-10 13:32:58 +02:00
Josef Söntgen
10451652f4 pc/wifi: avoid late frontend construction
Dissolve unintentional dependency between wifi management layer and the
control interface of the supplicant.

Issue #4537.
2022-08-10 13:32:58 +02:00
Josef Söntgen
9393c0136c pc/wifi: prevent calling driver from pthread
Querying the RFKILL state led to execution of the Lx_kit::scheduler by
the pthread running the wpa_supplicant. As this may not happen the
RFKILL state is now solely managed by the driver and only the cached
state is read by the supplicant.

Fixes #4537.
2022-08-10 13:32:58 +02:00
Piotr Tworek
9d417ee2f5 os: Allow VirtIO drivers to be built for RISC-V
Just add riscv spec files. The riscv versions should use MMIO transport
as ARM versions do. They also should work fine for riscv_qemu machine
from genode-riscv repository.
2022-08-10 13:32:58 +02:00
Piotr Tworek
e7fb38834a virtdev_rom: Add RISC-V platform support.
The location of the VirtIO device block is different on RISC-V virt qemu
machine.
2022-08-10 13:32:58 +02:00
Stefan Kalkowski
6e4c3b2fd6 sculpt: support to skip depot archive integration
To not integrate referenced depot packages when building a sculpt image,
just set the environment variable DEPOT= to be empty. This allows to produce
slim images to the price that you have to publish the packages yourself.
In that case the sculpt run-script reminds you, and prints the package
versions.

Fix genodelabs/genode#4530
2022-08-10 13:32:58 +02:00
Alexander Boettcher
f1265205b9 sculpt: add intel_opregion report/rom routing
Issue #4531
2022-08-10 13:32:58 +02:00
Alexander Boettcher
f1af654502 intel_fb: add apply_on_hotplug attribute
Make it configurable, whether on a hotplug event the current valid Genode
config for the driver will be re-evaluated. By default it will be re-evaluated.

Issue #4531
2022-08-10 13:32:57 +02:00
Alexander Boettcher
80981dbefb intel_fb: re-evalute max resolution on unplug
On connector unplug the overall resolution of all available active connectors
can shrink and must be considered to potentially re-create the Capture
connection with smaller resolution size. Additionally, update the documentation.

Issue #4531
2022-08-10 13:32:57 +02:00
Alexander Boettcher
88118b133a intel_fb: request copy of Intel opregion
acpica and the Intel display driver tries to use the Intel Opregion
simultaneously on Genode, which is not supported nor wanted for IO_MEM region as
which it is handled.

Attempts to remove the access to the region was not successful, since some
SSDT table contains ACPI AML code which is executed regularly and read/write
the Opregion.

The patch adds support to read in a copy of the Intel Opregion done by the
acpi_drv component. The copy was sufficient to make the Intel display driver
working to find and lookup the Intel VBT (video bios table) information to
setup all connectors on a Fujitsu U7411 docking station.

Fixes #4531
2022-08-10 13:32:57 +02:00
Alexander Boettcher
c2d9fbca9b acpi_drv: report Intel opregion copy
acpica and the Intel display driver tries to use the Intel Opregion
simultaneously on Genode, which is not supported nor wanted for IO_MEM region as
which it is handled.

Attempts to remove the access to the region was not successful, since some
SSDT table contains ACPI AML code which is executed regularly and read/write
the Opregion.

The patch adds support to make a copy of the Intel Opregion and report it as
is. The copy was sufficient to make the Intel display driver working to find
and lookup the Intel VBT (video bios table) information to setup all
connectors on a Fujitsu U7411 docking station.

Issue #4531
2022-08-10 13:32:57 +02:00
Alexander Boettcher
b1195508ba platform_drv: avoid filtering of dev in ALL policy
ACPICA needs access to the host bridge 0:0.0 on Intel, which is also
accessed by the Intel display driver. Since for the Intel display driver the
PCI device is specified in the policy explicitly, the PCI device is filtered
out for the ACPICA driver which uses the policy "ALL".

Issue #4532
2022-08-10 13:32:57 +02:00
Stefan Kalkowski
f4f2b456b6 base-hw: invalidate VM TLB entries in deletion
This commit introduces a hypervisor calling interface. The host kernel can
use it to either switch to a guest VM, or to invalidate the TLB with
regard to a specified VM id.
The VM-specific TLB invalidation is called whenever a VM (Vcpu)
gets destroyed.

Fix genodelabs/genode#4528
2022-08-10 13:32:57 +02:00
Stefan Kalkowski
4382d29422 base-hw: invalidate TLB only once on ARMv8
Fix genodelabs/genode#4529
2022-08-10 13:32:57 +02:00
Stefan Kalkowski
d6592ca2cb base-hw: unset deleted PD values in MMU
When a PD gets deleted check whether it is active on the current CPU resp. MMU.
If yes, switch to core/kernel's PD to prevent that invalid page-tables or
address-space IDs are still in use. Moreover, whenever we switch to an idle
thread, we switch to kernel/core's PD too. Thereby, we prevent that vanished
PDs are still active on CPUs different from the one, where the core entrypoint
is active, which does the PD deletion.
This whole scheme is only valid under the assumption that core has only one
entrypoint running on one CPU.

Fix genodelabs/genode#4527
2022-08-10 13:32:57 +02:00
Stefan Kalkowski
5cfb9e3e9d base-hw: distinguish core, idle, user threads
Do not only distinguish core and user threads, but the idle threads too.
Instead of a boolean value, introduce a new thread type.

Ref genodelabs/genode#4527
2022-08-10 13:32:57 +02:00
Sebastian Sumpf
c74a8c9fa8 lx_emul: support for 'alloc_pages_exact' 2022-08-10 13:32:57 +02:00
Sebastian Sumpf
dc77417396 lx_emul: add 'virt_range_start' to memory model
Returns the start address of are memory region for given virtual
address.
2022-08-10 13:32:57 +02:00
Sebastian Sumpf
151a5e2d7f lx_emul: add 'pgprot_noncached' to pgtable.h 2022-08-10 13:32:57 +02:00
Sebastian Sumpf
fb7282f47a base: beautify error message if not mutex owner 2022-08-10 13:32:57 +02:00
Alexander Boettcher
9b5840cb70 acpica: remove diagnostic messages
during PCIe config access.

Issue #4532
2022-08-10 13:32:57 +02:00
Alexander Boettcher
438e0adc77 acpica: remove support to access pci via i/o ports
All access to PCI devices can be handled nowadays via the platform session.
The I/O port access seems also to work not properly on newer UEFI machines.

Fixes #4532
2022-08-10 13:32:57 +02:00
Josef Söntgen
b77f59286f gpu/intel: abort client on accounting mismatch
Issue #4525.
2022-08-10 13:32:57 +02:00
Josef Söntgen
1010267dee gpu/intel: increase worst case CAP estimate
It may happen that 1 additional CAP is used during buffer allocation.

Fixes #4525.
2022-08-10 13:32:57 +02:00
Josef Söntgen
d9f6882a2a libports: update e2fsprogs to 1.46.5
Brings in Ext4 support.

Fixes #4524.
2022-08-10 13:32:57 +02:00
Josef Söntgen
0ffc55a20a Remove unneeded session_size check
As accommodating the session component object is already taken care of
be the root component implementation, remove the remaining redundant
checks.

Fixes #4521.
2022-08-10 13:32:57 +02:00
Josef Söntgen
d3e53b3cca pc_wifi_drv: unblock pthread via signal
Since unblocking the pthread directly may lead to corruption we need
to post-pone it. So we send a signal that should be handled by the EP
after the EP has finished its current line of work.

Fixes #4523.
2022-08-10 13:32:56 +02:00
Josef Söntgen
9d383037e4 lx_emul: set task 'stack' member
Instead of allocating the stack via 'kmalloc' point it to the actual
stack used by the task. This addresses issues with the USB
host-controller driver where sometimes hub port enumeration is not
working.

Fixes #4522.
2022-08-10 13:32:56 +02:00
Martin Stein
9375e8d010 wireguard: no warning about possible alignm. issue
We locally disable 'address-of-packed-member' warnings because GCC complained
about possible alignment issues when returning a reference to a packed member
as naturally aligned pointer (for some reason only on arm_v8a). We know that
the member is aligned to NETDEV_ALIGN via __attribute__ and that the warning
is therefor unnecessary.

Ref #4519
2022-08-10 13:29:40 +02:00
Martin Stein
48e396913c wireguard: don't always rebuild device.c/netlink.c
We have to correct the CC_OPT_* variable for these files and used to do so via
phony pre-requisite for the corresponding object files because the correction
had to take place after the variable initialization in
import-lx_emul_common.inc and before the creation of the object files. However,
this caused the objects to always rebuild.

This commit fixes this issue by using Make's feature of target-specific
variables instead. The drawback of this solution is that we can no longer
override CC_OPT_* with a modification of its original value but instead have to
override with a completely new value. This is because otherwise, Make would
either complain about recursive assignment or produce an empty value.

Ref #4519
2022-08-10 13:29:40 +02:00
Martin Stein
b1c77dc42b wireguard: enable WARN_STRICT_CONVERSION in lib
The strict conversion warnings were disabled during development when the
contrib code was still compiled with the wireguard lib. Now this isn't
necessary anymore as the contrib code is in the wireguard_lx_inc_dirs lib.

Ref #4520
2022-08-10 13:29:40 +02:00
Martin Stein
6f777f90a8 wireguard: test multiple peers at a time
Extends the wg_reconfig run script to test that the WireGuard component is able
to handle multiple peers at the same time if configured.

Ref #4520
2022-08-10 13:29:40 +02:00
Martin Stein
36d2374ff9 wireguard: exit on invalid configurations
With this commit, the WireGuard component exits with a descriptive uncaught
exception on invalid configurations or when the user attempts to re-configure
attributes that are not re-configurable (private_key, listen_port, interface).

This is particularly important when it comes to the not re-configurable private
key. If the component would just ignore the attempt to override the private
key, the user may come to believe that his old (potentially compromised)
private key is not in use anymore.

The fact that the component now exits instead shouldn't be a problem, as the
user would have to restart the component anyway in order to apply the new
attribute values.

The commit also extends the wg_reconfig run script to test that WireGuard
exits on the attempt to re-configure the private key.

Ref #4520
2022-08-10 13:29:40 +02:00
Martin Stein
86259b998e wireguard: support removing peers
Support removing peers by removing them from the component configuration.
This commit also introduces the wg_reconfig run script that tests adding and
removing single peers.

Ref #4520
2022-08-10 13:29:39 +02:00
Martin Stein
560a166613 wireguard: flags value via enum when adding a peer
I used to set the peer flags to 2 when adding a peer but merely because I
observed that value in my reference Linux. I now found that the flag 1<<1 means
'WGPEER_F_REPLACE_ALLOWEDIPS' and is ignored whenever the peer is new. Anyway,
I keep setting the flag but with the clearer enum name because the wg tool is
doing it as well when adding new peers and we want to stay close to how the
original code interacts.

Ref #4520
2022-08-10 13:29:39 +02:00
Christian Helmuth
871ee04ed6 wireguard: enable wg_fetchurl.run on sel4 2022-08-10 13:29:39 +02:00
Michael Mueller
99286e0c5c Updated mxtasking. 2022-07-26 17:37:22 +02:00
Michael Müller
ad0f2d3933 hello_mxtask: Turnoff optimization and compile with debug flags. 2022-07-21 13:56:51 +02:00
Michael Müller
f76aaa0abf hello_mxtask: Added config for gdb and qemu. 2022-07-21 13:43:32 +02:00
Michael Müller
668ea3f253 hello_mxtask: Needed more build modules. 2022-07-21 13:36:23 +02:00
Michael Müller
d015297925 hello_mxtask: Missed closing start tag. 2022-07-21 13:27:49 +02:00
Michael Müller
0191b42e51 hello_mxtask: Removed demo import. 2022-07-21 13:26:15 +02:00
Michael Müller
68e4ef34d3 hello_mxtask: Start drivers service. 2022-07-21 13:24:10 +02:00
Michael Müller
4af23e023f hello_mxtask: Missed tag. 2022-07-21 13:19:04 +02:00
Michael Müller
a921845e36 hello_mxtask: Added vfs for gdb_monitor. 2022-07-21 13:17:35 +02:00
Michael Müller
06fd884ef4 hello_mxtask: Missed plugin for pipe. 2022-07-21 13:13:44 +02:00
Michael Müller
2b66139f49 hello_mxtask: Missed function definition in runscript. 2022-07-21 13:07:44 +02:00
Michael Müller
8bb247da0e hello_mxtask: Integrated into gdb_monitor. 2022-07-21 13:05:26 +02:00
Michael Müller
8acd0741d4 hello_mxtask: Store tasks in std::vector. 2022-07-21 12:40:55 +02:00
Michael Müller
a7aaad6dae blinktree: Allocate Benchmark from component's heap. 2022-07-21 12:27:55 +02:00
Michael Müller
1dbdf5bd96 blinktree: Skip options. 2022-07-21 11:59:40 +02:00
Michael Müller
7d5338a393 blinktree: Fixed wrong order of cmdline arguments. 2022-07-21 11:53:52 +02:00
Michael Müller
bce0fbdc4f blinktree: Do not call std::cout outside of Libc::with_libc. 2022-07-21 11:50:32 +02:00
Michael Müller
fcaffab7d5 blinktree: Forgot to adapt call to create_benchmark in main.cpp. 2022-07-21 11:41:48 +02:00
Michael Müller
8c0ecf9ac9 Removed duplicate file. 2022-07-21 11:37:52 +02:00
Michael Müller
57662d5c8c blinktree: Use Genode::Threads for fill and mixed workload threads. 2022-07-21 11:37:13 +02:00
Michael Müller
ea036537c5 blinktree: Do not compile perf.cpp. 2022-07-20 18:44:20 +02:00
Michael Müller
6ba44cbe70 blinktree: Removed reference to chronometer from benchmark. 2022-07-20 18:41:13 +02:00
Michael Müller
1e7cd10657 blinktree: Put performance counter back as it is need for linking. 2022-07-20 18:28:26 +02:00
Michael Müller
0b42ee3da2 blinktree: Initalized arguments outside of call to main(). 2022-07-20 18:22:45 +02:00
Michael Müller
4afed37ffd blinktree: Superflous comma removed. 2022-07-20 18:17:24 +02:00
Michael Müller
bfcf897893 blinktree: Fixed compiler errors. 2022-07-20 18:15:40 +02:00
Michael Müller
fc7bdd97e0 blinktree: Fixed wrong path. 2022-07-20 18:01:40 +02:00
Michael Müller
a0c5ad77c9 blinktree: Added application path to include path. 2022-07-20 17:56:14 +02:00
Michael Müller
28a142821b blinktree: Removed perf.cpp from build. 2022-07-20 17:53:44 +02:00
Michael Müller
48b042564d Added B-link tree benchmark. 2022-07-20 17:50:56 +02:00
Michael Müller
f3eb97bf1c Hello_mxtask: Needed filename string instead of std::cout. 2022-07-20 15:09:09 +02:00
Michael Müller
d0d08c68aa Added vfs-plugins for libc to hello_mxtask.run. 2022-07-20 15:06:51 +02:00
Michael Müller
f94d7c40d1 Added profiling to hello_mxtask. 2022-07-20 15:00:17 +02:00
Michael Müller
0fdb9c7a4c Replaced Genode::Log with stdc++ iostream. 2022-07-20 14:40:56 +02:00
Michael Mueller
604a5f1f8e Merge branch 'master' of github.com:mmueller41/genode 2022-07-20 14:30:54 +02:00
Michael Mueller
0f565ba253 Removed nodiscard and added output via stdout. 2022-07-20 14:30:45 +02:00
Michael Müller
836bd76106 Added RTC to posix_playground. 2022-07-20 14:29:47 +02:00
Michael Müller
256c509550 Typo in runscript. 2022-07-20 14:23:18 +02:00
Michael Müller
c33e8cae4a Updated config for posix_playground. 2022-07-20 14:19:27 +02:00
Michael Müller
29b00817ed Fixed broken thread_test. 2022-07-15 15:05:35 +02:00
Michael Müller
a68cc9d6ee Minor changes. 2022-07-12 17:31:47 +02:00
Michael Mueller
e6da335de9 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 14:41:59 +02:00
Michael Müller
213fe79900 hello_tutorial: Corrected type for _id. 2022-07-11 14:41:44 +02:00
Michael Mueller
3b32c3f785 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 14:40:24 +02:00
Michael Müller
23b527ba85 hello_tutorial: Added RPC call to query session private _id. 2022-07-11 14:40:04 +02:00
Michael Mueller
a1856ca6d9 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 14:31:19 +02:00
Michael Müller
b8f6e86fa3 Removed unused variables. 2022-07-11 14:30:41 +02:00
Michael Mueller
544057fea1 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 14:26:49 +02:00
Michael Müller
f98359cbe6 hello_tutorial: Made hello session stateful. 2022-07-11 14:26:28 +02:00
Michael Mueller
1c3c8ca98f Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:35:26 +02:00
Michael Müller
481a26d286 hello_tutorial: Fixed broken scenario. 2022-07-11 12:35:02 +02:00
Michael Mueller
480bb08429 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:31:15 +02:00
Michael Müller
db3b242acb hello_tutorial: Adapted scenario. 2022-07-11 12:30:50 +02:00
Michael Müller
9399b07d0c hello_tutorial: Let hello_clients run periodically. 2022-07-11 12:28:26 +02:00
Michael Mueller
ed008edef8 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:19:54 +02:00
Michael Müller
baa130db17 Changed type for attributes _a and _b. 2022-07-11 12:19:35 +02:00
Michael Mueller
5a4de94aa8 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:17:27 +02:00
Michael Müller
5d6d54c066 Register config handler. 2022-07-11 12:17:09 +02:00
Michael Mueller
f8f8ea229a Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:08:34 +02:00
Michael Müller
2644b7d5aa Initialize _a and _b in constructor (-Weffc). 2022-07-11 12:08:07 +02:00
Michael Mueller
f0340b12a3 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:02:11 +02:00
Michael Mueller
1ff4093b40 Specified used APIs for MxTasking 2022-07-11 12:01:24 +02:00
Michael Mueller
e5b58e1eb6 Updated MxTasking example 2022-07-11 12:00:09 +02:00
Michael Mueller
0c1f727871 Working mxtasking port 2022-07-11 11:59:11 +02:00
Michael Müller
e6b09edaca Extended hello tutorial with second client and configurable parameters. 2022-07-11 11:57:05 +02:00
Michael Mueller
7d405d8f6a Updated include path 2022-07-06 17:48:26 +02:00
Michael Mueller
16f5ad55c8 Working ports file for mxtasking 2022-07-06 17:47:49 +02:00
Michael Müller
142ef47861 Added port of MxTasking with sample application. 2022-07-06 15:32:47 +02:00
Michael Müller
6b7fae0643 Start thread count with 1. 2022-07-04 16:35:56 +02:00
Michael Müller
64a2307c08 Forgot posix.lib.so as boot module. 2022-07-04 16:33:03 +02:00
Michael Müller
d0416903dc Typo in boot_modules. 2022-07-04 16:29:54 +02:00
Michael Müller
d1c240c6c5 Genode's stdcxx doesn't support std::make_unique(). 2022-07-04 16:28:50 +02:00
Michael Müller
48cbe050f7 Fixe type errors. 2022-07-04 16:25:50 +02:00
Michael Müller
55f07a89c6 Fixed type of thread_objs. 2022-07-04 16:20:49 +02:00
Michael Müller
33ff8591f0 Genode::log cannot print objects of type std::chrono::*. 2022-07-04 16:18:51 +02:00
Michael Müller
45fef3c8be Fixed makefile for posix_playground. 2022-07-04 16:17:05 +02:00
Michael Müller
834bebf3e5 Added POSIX playground for trying out POSIX and stdlib-related functions. 2022-07-04 16:14:55 +02:00
Michael Müller
d931e6a56e Do not use std::unique_ptr as it causes pagefaults. 2022-07-04 15:13:35 +02:00
Michael Müller
ff525b743f Use Genode timer for time measurement. 2022-07-04 15:10:53 +02:00
Michael Müller
7d9db940e2 Use component's heap for allocation. 2022-07-04 15:03:11 +02:00
Michael Müller
08ebbf001e Use correct thread type and fixed wrong call to exec_static_constructors. 2022-07-04 14:54:10 +02:00
Michael Müller
2888391eec Execute static constructors when creating component. 2022-07-04 14:50:27 +02:00
Michael Müller
95faab73fa Test for std::chrono and std::unique_ptr. 2022-07-04 14:43:48 +02:00
Michael Müller
9c4a683b33 Print affinity space before starting threads. 2022-07-01 16:42:54 +02:00
Michael Mueller
db81856dac Removed libc from LIBS in target.mk but added libc and stdcxx as boot modules for cstdint to be found 2022-07-01 16:34:58 +02:00
Michael Müller
c4a73980da Removed dependencies on stdcxx and libc. 2022-07-01 16:28:47 +02:00
Michael Müller
14ee3c0d36 Removed posix module. 2022-07-01 16:27:02 +02:00
Michael Müller
c4d4e12f7e Fixed wrong order in initializer list. 2022-07-01 16:22:54 +02:00
Michael Müller
6c0f4e232c Fixed typo in intializer list. 2022-07-01 16:20:57 +02:00
Michael Müller
a649cd8633 Use native threads. 2022-07-01 16:14:04 +02:00
Michael Mueller
71314a9ca3 Test of std::thread with posix sleep 2022-07-01 15:12:02 +02:00
Michael Mueller
29c00310ad Added missing dependencies 2022-07-01 15:11:18 +02:00
Michael Mueller
d4073612cb Removed libc from LIBS as it causes namespace mismatches. 2022-06-30 12:35:54 +02:00
Michael Müller
de772a6fc1 Wrong namespace for Component::Construct. 2022-06-30 12:28:16 +02:00
Michael Müller
f07003f2b8 Added correct namespace for Component::construct. 2022-06-30 12:26:15 +02:00
Michael Müller
ff9d123000 Fixed wrong type for parameter env. 2022-06-30 12:24:01 +02:00
Michael Müller
b5449df554 Fixed compiler errors. 2022-06-30 12:22:08 +02:00
Michael Müller
b255eb14fe Fixed wrong directory structure. 2022-06-30 12:13:19 +02:00
Michael Müller
f9d28eb8e0 Test scenario for std::thread. 2022-06-30 12:03:50 +02:00
Christian Helmuth
83f5dd8a8b pc/wifi: shared library depends on symbol.map
CUSTOM_TARGET_DEPS does not trigger relinking the lib but recreates the
.tag file only.
2022-06-02 09:33:27 +02:00
Norman Feske
6326774056 mk: trigger CUSTOM_TARGET_DEPS from 'all' rule
Build description files that feature both an actual target and
CUSTOM_TARGET_DEPS happen to re-link the target each time whenever one
of the CUSTOM_TARGET_DEPS is phony, e.g., gems/src/app/menu_view/.
The re-linking of the actual target is of course not desired. By
triggering the creation of CUSTOM_TARGET_DEPS from 'all:' instead of
'$(TARGET)', the specified files do not implicitly become link
dependencies of the target.

Issue #3972
2022-06-01 17:37:44 +02:00
Christian Helmuth
b6d313bbe6 version: 22.05 2022-05-31 13:34:17 +02:00
Norman Feske
dc0a0e0700 News item for version 22.05 2022-05-31 12:23:28 +02:00
Norman Feske
33a51ee20d Release notes for version 22.05 2022-05-31 12:23:28 +02:00
Christian Helmuth
a037fac5c5 depot: update recipe hashes 2022-05-31 10:52:11 +02:00
Stefan Kalkowski
e6602d527c lx_emul: remove duplication of ZERO_PAGE for ARM
The extra definition introduced by commit:
"lx_emul & arm: define ZERO_PAGE" re-defined the macro included
by a header of the contrib sources. This commit removes the
contrib header and defines thereby missing macros.
2022-05-31 10:52:11 +02:00
Stefan Kalkowski
d213cfa897 lx_emul: fix spinlock header for ARM
Fixes wrong atomic_*(ptr) usage with u32 pointer introduced by
commit "lx_emul: eliminate wrong include pathes". Atomic read or
write is nt needed in our case, we always schedule cooperatively.
2022-05-31 10:52:11 +02:00
Christian Helmuth
f4dabf08e2 Fix nested run in vbox5_genode_usb_hid_raw
Since "Consolidate USB test run-scripts" usb_hid_raw.run depends on
depot archives. Therefore, '--depot-dir' and '--depot-user' must be
passed to the nested run tool to cover cases that customize the depot
(e.g., our nightly CI).

Issue #4511
2022-05-31 10:52:00 +02:00
Martin Stein
aea993b96a wireguard: sculpt package
Introduces the pkg/wireguard archive that depends on the new src/wireguard
archive and deploys one WireGuard component with an empty configuration (can
be configured by the user via a launcher, for instance).

Fixed #4519
2022-05-31 10:52:00 +02:00
Martin Stein
520742cf3e wireguard: generic target.mk
Introduce an arch-specific wireguard lib that contains all code from the
former arch-specific target.mk files. This allows us to create a generic
target.mk that merely depends on the library and a dummy.cc file. The latter
ensures that building/linking of the target isn't skipped by the build system.

Ref #4519
2022-05-31 10:52:00 +02:00
Martin Stein
83408ef35c wireguard: rename wireguard lib
The wireguard library's purpose is having a separate INC_DIR setting for the
files that need Linux include paths that would clash with Genode include paths.
Therefore, the name wireguard_lx_inc_dirs is more descriptive. Furthermore,
this allows us to create a new arch-specific wireguard lib in a future commit
in the course of preventing arch-specific target.mk's (a commonly used
approach in Genode).

Ref #4519
2022-05-31 10:52:00 +02:00
Norman Feske
823d0d5360 doc/news.txt: minor spelling fix 2022-05-31 10:52:00 +02:00
Christian Helmuth
3105fa9e0f depot: update recipe hashes 2022-05-25 12:23:04 +02:00
Norman Feske
4727c18531 News item for Genode Platforms 22.05 2022-05-25 12:23:04 +02:00
Johannes Schlatow
3b0995cb49 platform_drv: fix uncaught exception
Calling alloc_dma_buffer() with size=0 will cause an exception in the
ram allocator.

genodelabs/genode#4518
2022-05-25 12:23:04 +02:00
Josef Söntgen
df5cadc8ad pc_wifi_drv: only disable failed access-point
The driver wrongfully disabled all APs if it was configured with an
auto-connect list containing multiple APs when one of those was
disabled as a result of using wrong credentials.

This commit changes the way network enable- and disablement are
handled by only operating on the given access-point in question.
It also removes unused code touched by these changes.

Thanks to Peter for bringing this problem to our attention.

Fixes #4517.
2022-05-25 12:23:04 +02:00
Josef Söntgen
03b2e3bda1 libports: rename jitterentropy's memcpy
To prevent symbol aliasing when using the static jitterentropy library
rename it to 'jent_memcpy'.

Fixes #4516.
2022-05-25 12:23:04 +02:00
Johannes Schlatow
c38b71146b trace_buffer: only iterate after initialization
There is a race between the trace subject doing the buffer
initialization and the monitor trying to iterate the buffer entries. If
the monitor tries to iterate entries of an uninitialized buffer, it will
read the very first entry twice. The monitor should therefore only start
iteration when the buffer has been initialised.

genodelabs/genode#4513
2022-05-25 12:23:04 +02:00
Norman Feske
f87209f822 Mention supplemental repos in top-level README 2022-05-25 12:23:04 +02:00
Norman Feske
e2267d2737 doc: update repos/README 2022-05-25 12:23:04 +02:00
Norman Feske
31fe7afbc4 doc: update components.txt 2022-05-25 12:23:04 +02:00
Norman Feske
8b4f12f2b0 menu_view: add new frame style 'full'
This style is useful as top-level frame whenever menu_view should cover
its entire geometry with no visible border around it.
2022-05-25 12:23:04 +02:00
Norman Feske
7adbb7c06e menu_view: menu_view_styles.tar is build artifact
By declaring the generated menu_view_styles.tar archive as build
artifact, it is automatically picked up whenever menu_view appears as
build ingredient of sculpt.

  build: app/menu_view
2022-05-25 12:23:03 +02:00
Norman Feske
a8631aeae9 sculpt: let touch input drive the input seq number
This change allows the use of the sculpt manager with touch-only input.

Issue #4514
2022-05-25 12:23:03 +02:00
Stefan Kalkowski
115ac58fd0 lx_emul: increase usb driver dynamic robustness
* Prevent page-faults when the active interface of a device got unset
  during elimination of the device
* Resets devices, where a corresponding session got closed to
  be re-useable when a new session gets opened

Ref #4512
2022-05-25 12:23:03 +02:00
Stefan Kalkowski
ba6a3526a9 libusb: when USB device vanishs throw exception
* Instead of repeatedly spam the log with errors and
  bring heavy load to the USB host controller driver
  abort yourself when the device vanishs

Fix genodelabs/genode#4515
2022-05-25 12:23:03 +02:00
Martin Stein
03349f9fff lx_emul/random: re-seed the local PRNG regularly
With this commit, the Xoroshiro128+ PRNG in lx_emul/random.cc gets wrapped
by a new class that automatically re-seeds the PRNG with jitterentropy every
1024 * 1024 + random(0..4095) bytes of generated output.

Ref #4397
2022-05-25 12:23:03 +02:00
Martin Stein
ab0bce77ec lx_emul & wireguard & wifi: centralized random.cc
Both the Wifi driver and the WireGuard port used local implementations for
their source of randomness. Wifi used a Xoroshiro128+ PRNG for rapid generation
of random values but initialized this PRNG always with the same static seed
value. WireGuard, in contrast, requested each random byte directly from the
jitterentropy lib, which is considered to be very time intensive.

This commit removes the local variants of random.cc and introduces a new
centralized lx_emul/random.cc . The new variant combines the former approaches,
so, that jitterentropy is accessed only in order to generate a random seed for
a Xoroshiro128+ PRNG. Front-end requests for random values are then fulfilled
efficiently via the PRNG.

:Warning:

The output of the Xoroshiro128+ PRNG that is used in the new implementation of
the lx_emul randomness functions has known statistical problems (see
https://en.wikipedia.org/wiki/Xoroshiro128%2B#Statistical_Quality).
Furthermore, the integration of Xoroshir128+ with the lx_emul code was not
reviewed/audited for its security-related properties, so far, and has the
known deficiency of seeding the PRNG only once during initialization. Thus,
we strongly advise against the use of the lx_emul randomness functions for
security-critical purposes.

Ref #4397
2022-05-25 12:23:03 +02:00
Norman Feske
63b0f1a2f7 wm: transpose touch events to window positions
This patch enhances the window manager with the ability to transform
touch events analogously to absolute motion events.

Issue #4514
2022-05-25 12:23:03 +02:00
Norman Feske
e3f00ce5fc menu_view: update hover in primary touch events
This patch simplifies the use of the menu_view in scenarios where no
absolute motion events but only touch events occur. Previously, such
scenarios required the creation of artificial absolute motion events
via the event filter.

Issue #4514
2022-05-25 12:23:03 +02:00
Norman Feske
1f3b6490f2 nitpicker: update hover state on touch events
The hover state is evaluated for the routing of input events. When
routing a touch event, the decision should be based on the most recently
observed touch position. Without this patch, however, the hover state kept
referring to the initial pointer position (screen center) in the absence
of any other motion events.

Issue #4514
2022-05-25 12:23:03 +02:00
Norman Feske
c4f2ceb1ca sculpt: add missing include 2022-05-25 12:23:03 +02:00
Stefan Kalkowski
f652657d9d Consolidate USB test run-scripts
Ref genodelabs/genode#4511
2022-05-25 12:23:03 +02:00
Martin Stein
4869349d57 lx_emul & x86: no unnecessary memset of zero page
Ref #4397
2022-05-25 12:23:03 +02:00
Martin Stein
a845dffa63 dde_linux: port of WireGuard kernel module
A userland component that ports the Linux WireGuard kernel module (originally
from kernel version 5.14.21) and integrates it via a NIC session (public
network side) and an Uplink session (private network side). The
WireGuard-specific device configuration is done through the component
configuration. The port is done using lx_emul, lx_kit and the virt_linux
targets. The commit adds also 4 corresponding run scripts of which 3 are fully
automated of which 1 is added to the autopilot.

:Warning:

Although in principal functioning, the WireGuard port has not been exposed to a
sufficient amount of real-world testing, so far. Therefore, we strongly
recommend not to use it in any security-critical scenarios! There is no
guarantee that the port meets any of the security goals pursued by the
WireGuard protocol or other WireGuard implementations!

Ref #4397
2022-05-25 12:23:03 +02:00
Martin Stein
f84e512ded virt_linux: support arm_64
This feature was motivated and used only by the WireGuard port, so far.

Ref #4397
2022-05-25 12:23:02 +02:00
Martin Stein
cded594346 lx_emul & arm: define ZERO_PAGE
The implementation was copied from the already existing LX-emul implementation
for x86 but the commit additionally page-aligns the array that serves as
backing store for the zero page as we assume this to be expected by the contrib
code. However, this commit doesn't apply the alignment also to the x86
implementation as we agreed, that this should be done in a separate commit.

Ref #4397
2022-05-25 12:23:02 +02:00
Martin Stein
bd501404db net: add methods required for WireGuard port
* Adds methods for copying raw data to the data field of Ethernet frames and
  UDP packets. This is used in the port to wrap the higher-layer packet data
  prepared by the contrib code with the additionally required headers before
  sending it at a network session.
* Adds a method to cast raw data to an IPv4 packet. This is required in the
  port in order to check values in stand-alone IP packets produced by the
  contrib code before sending them at a network session.
* Adds methods for setting UDP ports given big endian port values without
  having to convert to little endian in the app and then back to big endian in
  the net lib.

Ref #4397
2022-05-25 12:23:02 +02:00
Martin Stein
679be47def net: fix conversion compiler errors
Ref #4397
2022-05-25 12:23:02 +02:00
Martin Stein
99eca9fa7e nic_router: fix bad gateway values in README
Gateway configuration values contained a subnet prefix-length which is
not required nor accepted by the router.

Ref #4397
2022-05-25 12:23:02 +02:00
Stefan Kalkowski
c049aed44f lx_emul: eliminate wrong include pathes
Fix genodelabs/genode#4510
2022-05-25 12:23:02 +02:00
Stefan Kalkowski
081b878bbd lx_emul: align zero page to page size
Fix genodelabs/genode#4509
2022-05-25 12:23:02 +02:00
Alexander Boettcher
38e5972e45 Remove legacy intel display driver
The driver is superseded by the new driver located in the 'pc'
repository.

Issue #4508
2022-05-25 12:23:02 +02:00
Josef Söntgen
f146f9acb6 Move wpa_supplicant to own port
Issue #4508.
2022-05-25 12:22:10 +02:00
Josef Söntgen
fd14cf9f1e Move libnl to own port
Issue #4508.
2022-05-25 12:22:10 +02:00
Josef Söntgen
573cabaf24 Remove legacy wifi driver
The driver is superseded by the new driver located in the 'pc'
repository.

Fixes #4508.
2022-05-25 12:22:10 +02:00
Norman Feske
14bc7b9c6a tool/parse_cxx: handle 'alignas' specifier 2022-05-25 12:22:10 +02:00
Josef Söntgen
868447126f pc_wifi_drv: use arch hweight implementation
Using the generic version leads to stack corruption on x86_32.

Fixes #4507.
2022-05-25 12:22:10 +02:00
Josef Söntgen
69b5048728 pc_wifi_drv: remove inactive disable 11n option
The driver did not allow for setting module parameters and so far
no one complained. Remove the option to prevent the misleading of
users.

Issue #4506.
2022-05-25 12:22:10 +02:00
Josef Söntgen
d92b84fbc3 pc_wifi_drv: add RFKILL support
This commits hooks up a RFKILL management to the driver. The
'README' contains instructions on how to use it.

Fixes #4506.
2022-05-25 12:22:10 +02:00
Josef Söntgen
913aec1667 pc_wifi_drv: dissolve user tasks interdependence
The 'uplink' task was created by the 'socketcall' task although both
may operate independently.

Issue #4506.
2022-05-25 12:22:10 +02:00
Norman Feske
0cffda3cfe tool/depot: pass make flags to dependencies cmd
This patch harmonizes the tool/depot/download with the version of the
Goa tool.
2022-05-25 12:22:10 +02:00
Norman Feske
2691f2073a tool/depot: minor documentation fixes 2022-05-25 12:22:10 +02:00
Norman Feske
1b96d01690 tool/depot: allow versioned entries in used_apis
Normally, the APIs listed in 'used_apis' files do not carry a version
but implictly refer to the current version. This patch allows for
specifiying an concrete version. This is a useful feature in the context
of the Goa tool.
2022-05-25 12:22:10 +02:00
Norman Feske
b081988e66 tool/depot: make DEPOT_TOOL_DIR customizable
By replacing the formerly hard-coded $(GENODE_DIR)/tool/depot/ by the
variable DEPOT_TOOL_DIR, the depot tools can be hosted outside the
Genode source tree, i.e., as part of the Goa tool.
2022-05-25 12:22:10 +02:00
Norman Feske
19b6f88c33 tool/ports: customization hooks
The hooks added by this patch allow for the reuse of the hash.inc and
install.mk by Goa as is.
2022-05-25 12:22:10 +02:00
Stefan Kalkowski
f9a29f291e pci: extend Pci utilities for bridge drivers 2022-05-25 12:22:10 +02:00
Johannes Schlatow
55795127a3 lx_emul(arm): add Cortex-A9 irqchip
genodelabs/genode#4499
2022-05-25 12:22:09 +02:00
Johannes Schlatow
547db8531b lx_emul: use generic preempt_count accessor
genodelabs/genode#4499
2022-05-25 12:22:09 +02:00
Johannes Schlatow
4cdba04c88 lx_emul: fix spinlock implementation for ARM
Since Linux does not use the arch-independent spinlock structs for ARM,
we must use different members when accessing the lock value.

genodelabs/genode#4499
2022-05-25 12:22:09 +02:00
Johannes Schlatow
ba04aab75f lx_emul: initialise preempt_count for ARM 32bit
genodelabs/genode#4499
2022-05-25 12:22:09 +02:00
Stefan Kalkowski
6731067116 lx_emul: add basic ARM 32-bit support
genodelabs/genode#4499
2022-05-25 12:22:09 +02:00
Norman Feske
19574f7897 Fix spelling of PinePhone 2022-05-25 12:19:33 +02:00
Norman Feske
97b5e96e0e sculpt: mention all needed repos in documentation
The documentation missed to mention the need for the 'pc' and 'dde_rump'
repositories for building the boot image from source.
2022-05-25 12:19:33 +02:00
Stefan Kalkowski
19f50a9a45 platform_drv: enhance coding practice
* more constness where possible
* hide device reporter functionality in Device_reporter interface
2022-05-25 12:19:33 +02:00
Alexander Boettcher
91a569ac7f virtualbox6: adjust developer run script
to work again. The drivers interactive package does not provide a Platform
service anymore, so remove the audio driver. A lot more mesa related libraries
are required now.
2022-05-25 12:19:33 +02:00
Christian Helmuth
2a76ae002e vbox6: enable VM reset 2022-05-25 12:19:33 +02:00
Josef Söntgen
6954547b4c pc: consoldiate LX emul of current drivers
This commit de-duplicates the redundant dummy implementations and
to some degree also the 'lx_emul.c' implementations while also
decluttering the various 'dep.list' files.

The code is moved into 'src/lib/pc/lx_emul' where it becomes part
of the 'pc_lx_emul' library.

Fixes #4500.
2022-05-25 12:19:33 +02:00
Josef Söntgen
e313059dd5 lx_emul_common: prevent override of CC_OPT_$(1)
This allows for extending such compilation unit specific options
for down by users of the library.

Issue #4500.
2022-05-25 12:19:33 +02:00
Josef Söntgen
d324331325 pc: centralize initcall header
Instead of each driver providing its own header file use a central
header as the initcall order header should cover _all_ provided
initcalls resulting from the used 'pc_linux' kernel config.

Note that the 'pc_linux' configuration was extended with the
'USB_USBNET' option because the module's initcall is needed for the
Genode C API for USB glue-code and the 'PACKET' option needed by
the wireless lan driver.

The lack of theses options was not noticed as each driver used its
own initcall header so far that stemmed from the initial porting
effort.

Issue #4500.
2022-05-25 12:19:33 +02:00
Josef Söntgen
3fdf4c56ba pc: sort source.list files
Those are purely cosmetic changes.

Issue #4500.
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
e9b666d1a8 platform_drv: some small and cosmetic fixups
* Some fixups for the README
* Make config ROM const when used for the session policies
* Turn Reporter into Expanding_reporter
* Always first register ROM signal handler before parsing it the first time
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
14f192fb00 platform_drv: make devices ROM name configureable
Fix genodelabs/genode#4504
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
438870e223 platform_drv: outsource common parts for derivate
Outsource parts of the Main object into a common compound object,
common parts of the Makefile description and depot source package.

Fix genodelabs/genode#4503
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
9370e5e4d0 platform_drv: add PCI device support
* Parse PCI specific information from devices ROM
* Enable DMA, I/O memory and I/O port access dependent on BARs in config space
* Introduce device PD for Nova + IOMMU support
* Enable MSIs if available
* Add PCI specific policy rules

Fixes genodelabs/genode#4502
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
6b92006565 platform_drv: consider IRQ type, mode, polarity
Parse the devices ROM for additional interrupt information, and
pass them to the IRQ connection when needed.

Fix genodelabs/genode#4497
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
de7fdd3e1a platform_drv: wait for device's availability
Instead of returning an invalid device capability when a device
is (not yet) available, e.g. a PCI device is requested before the
PCI bus got parsed accordingly, we check the device capability
within the Platform::Connection utilities, and register temporarily
an Io_signal_handler to wait for changes of the devices ROM, and
try the device aquisition again. Thereby, simple drivers so not have
to take the burden to do so.

To enable this feature for all drivers, we always have to export a
devices ROM, but limit the information about physical resources
(I/O memory addresses, IRQ numbers, I/O port ranges) to clients with
'info=yes' in their policy description.

Fix genodelabs/genode#4496
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
a1564d1826 platform_drv: add report facility
By adding a 'report' node to the platform driver's configuration
one can enable either devices or config reports. The devices
report contains all devices and their detailed state, as well as
whether it is already in use or not. The config report contains
one by one the current configuration of the platform driver.
Moreover, this commit adds a README file describing the facilities
of the platform driver.

Fix genodelabs/genode#4386
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
d0694b3e0b platform_drv: separate devices info from config
Fix genodelabs/genode#4491
2022-05-25 12:19:32 +02:00
Christian Helmuth
f032bdf81c legacy_platform_drv: configurable PCI BAR remapping
If PCI devices happen to miss complete configuration after boot, the
platform driver supports <pci-fixup> nodes for concrete devices
(specified by bus-device-functions tuples). The
<bar> node instructs the platform driver to remap BAR id 0 to address
0x4017002000, which amends the BIOS configuration and is stringently
required for BARs with address 0.

! <pci-fixup bus="0" device="0x15" function="3">
!   <bar id="0" address="0x4017002000"/>
! </pci-fixup>

The issue was discovered with Intel LPSS devices in Fujitsu notebooks.

Fixes #4501
2022-05-25 12:19:32 +02:00
Norman Feske
16cf1f48d3 libc: make app stack size configurable
This patch changes the libc to query the stack size from the
config attribute <libc> <stack size=""/> </libc> for regular
components, not only cloned processes.
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
cacb6136fa app/pci_decode: prepare pci device information
To discharge the generic platform driver from certain PCI bus scanning,
and ACPI + kernel specifics, this commit introduces a new component,
which consumes the acpi drivers report and the platform_info from core
to prepare a devices ROM for the platform driver that contains all
PCI devices and its resources.

Fix genodelabs/genode#4495
2022-05-25 12:19:32 +02:00
Josef Söntgen
87021d9fb1 usb_block_drv: allow for using UAS devices via BOT
USB Attached SCSI devices might expose a bulk-only interface
as fall-back at interface 0 and alternate setting 0. This commit
allows for probing all alternate settings of the active interface
to be able to use such devices.

The configuration was extended so that in case the device interface
is known beforehand the driver can be configured accordingly.

Fixes #4494.
2022-05-25 12:19:32 +02:00
Josef Söntgen
27444617e1 ports: use expanding reporter in verify app
Deploying an overly large meta-pkg in Sculpt leads to an
'Xml_generator::Buffer_exceeded' exception. Using the expanding
reporter solves this problem.

Fixes #4493.
2022-05-25 12:19:32 +02:00
Josef Söntgen
74b5a4ae7a pc_wifi_drv: handle reauth silently
In case we are instructed to reauthenticate and were already
authenticated we ignore the request in the management layer
and let 'wpa_supplicant' deal with that.

Fixes #4488.
2022-05-25 12:19:32 +02:00
Alexander Boettcher
a8402ae782 qemu-usb: solely support labels in policy
Remove vendor/product/bus/dev from policy parsing and as criteria to decide
whether to keep USB devices.

Issue #4492
2022-05-25 12:19:32 +02:00
Alexander Boettcher
dada0dff78 qemu-usb: support policy labels w/o vendor/product
Fixes #4492
2022-05-25 12:19:32 +02:00
Alexander Boettcher
858505918a nova: support EC time in trace subject info
The vanilla NOVA kernel solely supports tracking and exporting of execution
times per SC kernel object, but not per thread (EC object). The commit extends
to track execution times per EC in the NOVA kernel, exporting it to Genode's
'core' roottask and populating Genode's Trace::Subject_info structure.

Fixes #4481
2022-05-25 12:19:32 +02:00
Alexander Boettcher
f6fedd5348 x86: remove special GPE handling nova <-> acpica
Remove handling of ACPI (SCI) interrupt from kernel and thereby let the
handling of the ACPI irq exclusively to an Genode driver. On Genode the ACPICA
library+app handles the ACPI irq, where we can now remove the contrib patches
related to the synchronization between NOVA kernel and ACPICA library.

Fixes #4479
2022-05-25 12:19:31 +02:00
Christian Helmuth
65d7b3e652 Remove unused Nic::Root implementation (nic/root.h)
Issue #3961
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
6eac4276d5 filesystem tests: remove block devices/drivers
Fix genodelabs/genode#4490
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
18dcf8af68 Remove NIC server role from drivers
* Remove "mode" attribute utility and XML description
* Remove unused nic/stat.h header

Fix genodelabs/genode#3961
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
e3d08893b7 lan9118_nic_drv: remove deprecated server mode
Ref genodelabs/genode#3961
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
56831a247f usb_net_drv: remove deprecated server mode
Ref genodelabs/genode#3961
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
0ba911bf12 virtio_nic_drv: remove deprecated server mode
Ref genodelabs/genode#3961
2022-05-25 12:19:31 +02:00
Christian Helmuth
766ac5ea27 Update download URL of e2fsprogs to https
This prevents

  warning: redirecting to https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/
2022-05-25 12:17:37 +02:00
Norman Feske
7cf1a39b99 News item for Sculpt 22.04 2022-05-25 12:17:37 +02:00
Christian Helmuth
0768185fea depot: update recipe hashes 2022-04-28 11:52:06 +02:00
Josef Söntgen
3e45b8aace pc_wifi_drv: implement kmem_cache_free_bulk
So far this dummy was only triggered on AX devices after the driver
has been used for a few hours.

Issue #4488.
2022-04-28 08:02:33 +02:00
Josef Söntgen
481b4fde25 pc_intel_fb_drv: fix Shuttle DS57U
When using the framebuffer driver on this machine the
'cpu_latency_qos_request_active' dummy is triggered. Removing the
trace-and-stop call makes the driver usable.

In addition, 'cpu_latency_qos_remove_request' is changed as well
although it is guarded by 'cpu_latency_qos_request_active'.

Fixes #4489.
2022-04-28 08:02:33 +02:00
Norman Feske
6cab572b8f sculpt: increase lowest-possible font size
This patch fixes rare freezes of menu view instances, which could happen boot
time whenever the leitzentale GUI happens to get initialized before the display
driver finished setting up a reasonable mode. In this case, the resolution-
dependent font size can temporarily get almost zero, tripping up the glyph
renderer.
2022-04-28 08:02:33 +02:00
Norman Feske
df789b943c Update Sculpt documentation to version 22.04 2022-04-28 08:02:33 +02:00
Josef Söntgen
952c2f2f8b gpt_write: alloc packet with proper alignment
The component wrongly ignored the advertised requst aligment of the
block provider.

Fixes #4486.
2022-04-28 08:02:33 +02:00
Josef Söntgen
b8e2b780e3 nvme_drv: reject requests with unaligned offset
Since the driver relies on all requests being Nvme::MPS_LOG2 aligned
as advertised in its Block::Info the added check will reject any
misaligned requests (using 'gpt_write' led to an IOMMU write fault).

Issue #4486.
2022-04-28 08:02:33 +02:00
Sebastian Sumpf
8d00af1d7b gems/decorators: adjust resources for WQHD displays
2560x1440 resolutions require more RAM resources. Additionally, make
sure that the decorator 'init' receives enough CAPs to service the
decorator configuration.

fixes #4485
2022-04-28 08:02:33 +02:00
Josef Söntgen
754d35244f pc_wifi_drv: do not reset call result
Issue #4983
Issue #4455
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
2df0bbf387 pc_usb_host_drv: implement sysfs dummy function
Due to changes in the lx_emul USB driver, a further function
sysfs_delete_link gets called.

Ref genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
af0531398a lx_emul: cleanup URBs in USB driver in release
* Claim and release USB interfaces
* Collect URBs in flight in anchor list
* When releasing interfaces, wait until all
  anchored URBs finally got killed successfully

Fix genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
4b983f92c5 lx_emul: support execution till condition applies
In rare cases it is necessary to execute Linux contributed code
until certain work is finished, e.g. when in a synchronous RPC call,
a session construction or destruction a result is needed. Therefore,
we introduce a new lx_emul function called lx_emul_execute_kernel_until.

Ref genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
8ca2c597e0 os: extend USB C-API with claim/release
To signal that a device gets used and released by a session
introduce claim, release, and release all callbacks in the
USB interface of the C-API.

Ref genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Josef Söntgen
2e9e5c37b5 pc_usb_host_drv: supress '__printk_ratelimit' 2022-04-28 08:02:33 +02:00
Josef Söntgen
2fd2b7d628 lx_kit: map I/O mem with proper offset
In case multiple devices shared the same memory-mapped I/O page
we have to take the offset into account. This commit fixes the
'pc_usb_host_drv' on the Thinkpad X201 where the two EHCI host
controller share the some I/O memory page.

Fixes #4477.
2022-04-28 08:02:33 +02:00
Sebastian Sumpf
396cc53020 libc: update download url to archive repo
FreeBSD 12.0 was moved to archive url:
http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/12.0-RELEASE/

fixes #4478
2022-04-25 14:42:43 +02:00
Alexander Boettcher
240ec72086 nova: handle invalid SVM exit correctly
With issue #4391 a regression was introduced, which makes VMs on AMD SVM non
working.
2022-04-25 14:40:04 +02:00
Alexander Boettcher
0d163915d0 nova: avoid hangs on AMD with IOMMUs
With the new usb driver #4399 and usage of the updated dde_linux lx_eml/lx_kit
approach a much higher rate of IRQ session construction/destruction and signal
handler assignment (irq->sigh) are caused. This trickles down to the kernel,
which causes an hang of the AMD IOMMUs due to not setting reserved bits
adequately. The commit fixes the root cause in the kernel and add a guard
into core's to limit such driver behaviour.

Fixes #4482
2022-04-23 22:53:03 +02:00
Johannes Schlatow
260d7aa701 sculpt: fix clipboard routing in deploy/example
Fixes genodelabs/genode#4475
2022-04-13 16:29:19 +02:00
Christian Helmuth
b66650c2e8 lx_emul: remove forward declaration in clocksource 2022-04-13 15:17:49 +02:00
Martin Stein
25eb24299c machine.vbox6: add audio enabledIn/Out options
The file listed only enabled="false" in the audio adapter tag. However,
setting only this option to true isn't sufficient for guest audio to work.
One has to set also enabledIn respectively enabledOut in the same tag. The
new default vbox6 file reflects this.

Fixes #4476
2022-04-13 15:01:46 +02:00
Norman Feske
25ae54223a os/part_block: simplify split block-I/O handling
Issue #4474
2022-04-13 14:08:46 +02:00
Norman Feske
b3678f44b7 libports/fatfs: handle split block I/O jobs
Issue #4474
2022-04-13 14:08:40 +02:00
Norman Feske
68af13bb34 os/vmm: handle split block I/O jobs
Issue #4474
2022-04-13 14:08:34 +02:00
Norman Feske
7d6c592417 vfs/rump: handle split block I/O jobs
This patch fixes a potential data corruption issue that could occur when
issuing large I/O requests to vfs/rump, which don't fit into the default
block I/O buffer of 128 KiB. Note that we haven't observed the problem
in practice (Sculpt hosts vfs/rump in a dedicated vfs server, which
fragments requests) but spotted the issue while reviewing the code. We
could trigger problem by explicitly changing the I/O buffer size to 32
KiB.

Issue #4474
2022-04-13 14:08:25 +02:00
Norman Feske
d815322efe os: simplify split block operations
This patch changes the meaning of the 'offset' parameter of the
'produce_write_content' and 'consume_read_result' hook functions.
The value used to reflect the absolute byte position but in practice,
a job-relative byte offset is desired.

Issue #4474
2022-04-13 14:08:15 +02:00
Christian Helmuth
8ece236635 depot: update recipe hashes 2022-04-13 11:54:46 +02:00
Christian Helmuth
a45aabe68c usb_block: handle block requests in Signal_handler only
Before this commit, the block-request handler was implemented as
Io_signal_handler and, additionally, the USB driver called the
block-request handler on request completion directly on I/O level. This
is generally a bad idea because I/O handlers should avoid to have direct
global side effects. In contrast, application logic should be
implemented in way that it consumes atomic state changes after I/O
completed. Now USB I/O completion locally submits a signal to the
block-request Signal_handler.
2022-04-13 09:29:06 +02:00
Alexander Boettcher
2ec6a8249a pc: intel display driver: avoid sysfs related hang
Issue #4450
2022-04-13 09:29:06 +02:00
Sebastian Sumpf
2a47379ab5 vbox6: display cause of error on failed 'initFromSettings'
Use 'ErrorInfoKeeper' to retrieve current error from XPCOM service and
log message.

fixes #4473
2022-04-13 09:29:06 +02:00
Christian Prochaska
f91ece78e0 dde_rump: move periodic sync into rump kernel thread
Issue #4459
2022-04-13 09:29:06 +02:00
Christian Prochaska
d8211b65a5 dde_rump: fix clock functions
Issue #4459
2022-04-13 09:29:06 +02:00
Christian Prochaska
95aba3feef dde_rump: dispatch I/O signals in Timed_semaphore
Issue #4459
2022-04-13 09:29:05 +02:00
Christian Prochaska
af80ecb651 dde_rump: check blocking condition right before blocking
Issue #4459
2022-04-13 09:29:05 +02:00
Christian Helmuth
2da57613bf depot_deploy: support usb service provider
Now, Usb sessions can be effectively routed to the black-hole component
in Sculpt.

Issue #4419
2022-04-13 09:29:05 +02:00
Norman Feske
4dbe1588a6 sculpt: relax heartbeat rate
This patch reduces the response time of supposedly stuck situations like
an unresponsive part_block component. First, it reduces the heartbeat
rate from 1 to 2 seconds to make it consistent with the frequency of
state reports. Second, it allows up to four skipped heartbeats until
regarding the situation as stuck. With those changes, the prolonged
initialization sequence of a USB ZIP drive succeeds with Sculpt.
2022-04-13 09:29:05 +02:00
Christian Helmuth
02693734d3 black_hole: increase RAM quota in test-black_hole
Issue #4419
2022-04-13 09:29:05 +02:00
Martin Stein
b9141f98af test/black_hole: fix "packet alloc failed"
The Uplink_test used to end in an uncaucht exception about a failed packet
allocation on several x86_32 platforms.

* Destruct and re-construct the corresponding TX packet allocator during a
  link-down-up step in the Uplink test. Fixes the exceptions but results in a
  never ending test.
* Decouple the link-down-up steps from the handling of packet stream signals
  by simply triggering it with a local periodic timeout of 1 sec period.
  This prevents that the Uplink_test never finishes because it destructs the
  Uplink connection too often.
* The test finishes not before at least 3 link-down-up steps were executed.
* Replace the Allocator_avl's used for the TX packet allocators of the Nic
  and Uplink Connection with the better suited Nic::Packet_allocator.

Ref #4419
2022-04-13 09:29:05 +02:00
Martin Stein
6a61b60a5d black_hole: serve real USB sessions
* The server now answers session requests with a session instead of an
  exception#
* The test expects a session but doesn't access it so far

Ref #4419
2022-04-13 09:29:05 +02:00
Alexander Boettcher
40a5eabf88 pc: shadow schedule_timeout in intel_fb_drv
Issue #4450
2022-04-13 09:29:05 +02:00
Christian Helmuth
db90656483 vbox6: sync capslock state on boot / LED change
Thanks to Peter for the initial patch.
2022-04-13 09:29:05 +02:00
Alexander Boettcher
9965b2b72a pc: disable dsb unit in intel_fb_drv (gen12)
The error message
"Command buffer creation failed" in intel_dsb.c repeatedly appears
during connector hotplug. Since the driver works also without this DMA offload
optimization, disable the functionality.

Issue #4450
2022-04-13 09:29:05 +02:00
Martin Stein
ecd4006514 black_hole: initial support for Usb service
The service is merely announced but trying to request a session always causes a
Service_denied exception. This helps in scenarios where the client is
won't open a session anyway but expects the service to be available. This is
considered a temporary solution.

Ref #4419
2022-04-13 09:29:05 +02:00
Norman Feske
78d7a08618 wm: hide child views if top-level view vanishes
This patch handles the corner case of switching virtual desktops while
child views are visible. Examples of such child views are tool tips,
pull-down menus, or the graph of the top-view utility. The switch to
another virtual desktop would implicitely turn the child views into
top-level views of the root nitpicker GUI server until switching back
to the original virtual desktop.

The patch implements the expected behavior of hiding all child views
that belong to a disappearing top-level view.
2022-04-13 09:29:05 +02:00
Christian Helmuth
d21464399f vfs_rump: use dynamic_cast for safe downcasts
As it stands, the implementation requires minimal reflection measures to
implement correct cleanup procedure. static_cast<> cannot be used as it
does not implement runtime type casting as dynamic_cast<> does.
2022-04-13 09:29:05 +02:00
Christian Helmuth
8a4f4fcea9 vfs_rump: reflect resource shortage as return values
The function Vfs::Directory_service::watch() is not expected to throw
Out_of_ram/Out_of_caps but use dedicated Watch_result errors.
2022-04-13 09:29:05 +02:00
Christian Helmuth
eb895975e2 lib/vfs: clear BUILD_ARTIFACTS in dummy targets 2022-04-13 09:29:05 +02:00
Norman Feske
79279b93fb vfs server: fix dangling alloc on watch failure
This patch reverts the vfs-watch-handle creation whenever the subsequent
allocation of the VFS server's 'Watch' object fails. This can happen
when the session RAM or cap quota is depleted.

Fixes #4472
2022-04-13 09:29:05 +02:00
Christian Helmuth
df1767b784 vbox6: tidy up devxhci poweroff
The issue came apparent with Windows Guests and USB passthrough of
smart-card readers. If the VM is powered off, PDMR3Term cleans up all
devices incl. (first) acpi and (later) devxhci. The latter used a
dangling reference to ACPI structs in a indirect call to
apicIsLogicalDest() from xhciR3Destruct().

  VMMR3_INT_DECL(int) PDMR3Term(PVM pVM)
      virtualbox6/src/VBox/VMM/VMMR3/PDM.cpp:817

      "apic" (pDevIns->pReg->szName)

          static void apicR3TermState(PVM pVM)
              virtualbox6/src/VBox/VMM/VMMR3/APIC.cpp:1235

      "qemu-xhci" (pDevIns->pReg->szName)

          static DECLCALLBACK(int) xhciR3Destruct(PPDMDEVINS pDevIns)
              repos/ports/src/virtualbox6/devxhci.cc:431

          void usb_detach(USBPort *port)
              <qemu-usb>/src/lib/qemu/hw/usb/core.c:70

          static void xhci_port_notify(XHCIPort *port, uint32_t bits)
              <qemu-usb>/src/lib/qemu/hw/usb/hcd-xhci.c:2592

          static DECLCALLBACK(void) pciSetIrq(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)
              virtualbox6/src/VBox/Devices/Bus/DevPCI.cpp:398

          static bool apicIsLogicalDest(PVMCPUCC pVCpu, uint32_t fDest)
              virtualbox6/src/VBox/VMM/VMMAll/APICAll.cpp:797

The fix removes our Qemu library reset from xhciR3Destruct() and
registers xhciR3Reset() as PowerOff hook.

Thanks to Raphael for the thorough investigation.
2022-04-13 09:29:05 +02:00
Christian Helmuth
e345b56719 vbox6: remove redundant ahci/serial patches
The issue alleviated by the patches was fixed by

  5fed1641a4 virtualbox6: reduce 'Vm_connection' priority

Issue #4361
2022-04-13 09:29:05 +02:00
Norman Feske
ddc83df4b6 sculpt: support leitzentale GUI on 2560x1440
The quota adjustments prevent the leitzentrale's decorator from running
out of RAM, and allow the nitpicker GUI server to preserve buffer
content during resize (reducing flickering artifacts) when using a
screen resolution up to 2560x1440.
2022-04-13 09:29:04 +02:00
Alexander Boettcher
daa6195732 pc: report all modes by intel display driver
Issue #4450
2022-04-13 09:29:04 +02:00
Norman Feske
0c5d8f1156 depot: exclude plugins from vfs src archive
This fixes the following warning when building the binary archive:

  Library-description file vfs_capture.mk is missing
  Library-description file vfs_tap.mk is missing
2022-04-13 09:29:04 +02:00
Sebastian Sumpf
7a06a6ac59 legacy_platform_drv: update quotas on 'attach_dma_mem'
'Platform::Device_pd::attach_dma_mem' may lead to insufficient resources
for meta data, which is reflected to the client via 'Out_of_caps' or
'Out_of_ram'. In case the client upgrades its session the quotas need to
be passed to core as done by
'Platform::Device_pd::Expanding_region_map_client::attach'.

issue #4451
2022-04-13 09:29:04 +02:00
Sebastian Sumpf
abc0bf3220 gpu/intel: account resources using 'avail_' not'used_'
Use 'avail_caps' and 'avail_ram' for resource guards because 'used_caps'
and 'used_ram' do not account for resources given to the platform
driver. This lead to incorrect resource accounting by the GPU
multiplexer.

issue #4451
2022-04-13 09:29:04 +02:00
Christian Helmuth
fd9648f919 vfs/block: correct transfer size allocation
The calculations of packet_size and packet_count in the block_io() did
not consider rounding errors. This resulted in diverging values over
several bisecting operations (/= 2) and wrongly-size packet allocations
as well as memcpy operations.

Related to #2263 (comments about partial block accesses and
_block_io()).

Fixes #4471
2022-04-13 09:29:04 +02:00
Christian Helmuth
dedcd0e294 vbox6: silence debug log in runtime 2022-04-13 09:29:04 +02:00
Josef Söntgen
2e47eb6fb9 dde_linux: use new wifi driver in uplinks test
Issue #4455.
2022-04-13 09:29:04 +02:00
Martin Stein
ef8c98cb71 nic_router: merge packet stream signal handlers
The NIC router used to handle each type of packet-stream signal with a distinct
method in the Interface class. However, merging those methods has advantages.

It ensures that sent packets that were already acknowledged by the counter side
are always released before handling received packets. This frees packet stream
memory which facilitates the potential allocation of response packets while
handling received packets. Furthermore, it simplifies the code and reduces the
number of entry points into the router.

This commit also removes the installation of signal handlers at packet streams
for events that are of no interest for the router (TX-ready-to-ack /
RX-ready-to-submit at NIC sessions and RX-ready-to-ack / TX-ready-to-submit at
Uplink sessions).

Fixes #4470
2022-04-13 09:29:04 +02:00
Christian Helmuth
7e2cfc30f0 sculpt: version 22.04 2022-04-13 09:29:04 +02:00
Christian Helmuth
520a08b205 Remove pkg runtime for pc_wifi_drv/legacy_pc_wifi_drv
Both runtimes were broken due to missing requirement for "Uplink"
service and thus unused.

Issue #4455
2022-04-13 09:29:04 +02:00
Josef Söntgen
b6471a83aa ports: use new wifi driver in netperf
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
dd09e900c0 sculpt: use pc_wifi_drv
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
e7e7893f22 pc: update wifi driver
The driver falls in line with the previous 'legacy_wifi_drv' component
where the ported wireless LAN stack and device driver is encapsulated
in a library. This library in return is used by the 'Libc::Component'
providing the necessary environment for the 'wpa_supplicant'.

In constrast to the old driver a 'wifi' VFS plugin is in charge of
initalizing the 'Lx_kit::Env' prior to executing any static
constructors.

Fixes #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
8056811b4f Rename wifi_drv to legacy_wifi_drv
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
0bd1a53326 dde_linux: add linux-firmware port
Move 'linux-firmware' portion from 'dde_linux' into its own port,
while it is used by the upcoming new WLAN driver keep it in place
for the legacy one.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
838bae964b pc: update framebuffer/intel for new Linux config
This is needed because now 'kobject_uevent.c' pulls netlink related
code in.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
c9d9ec0d63 pc_linux: add wlan stuff to config
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
0a6baff26d pc: extended pc_linux api archive for wifi driver
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
56427da393 wifi: add interface query functions
Various libraries, like libnl and wpa_driver_nl80211, used hardcoded
values for the interface index (ifindex) and name (ifname).
To accomdate the legacy as well as the upcoming new driver we add
functions to query these information where at least the index differs.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
c1fea8c002 wpa_supplicant: remove hard lx_printf dependency
Not needed and breaks 'pc_wlan_drv'.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
447f3fcb35 libnl: use MSG_DONTWAIT
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
f5eddce1d1 wifi/socket_call: add MSG_DONTWAIT
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
24c0bb95ef pc_lx_emul: allow for being used in a library
The location of the used 'source.list' file is hard-coded and will not
work when the ported driver is implemented as a shared library. For
this use-case provide means to set the location differently.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
7cd8285251 pc_lx_emul: use page alloc shadow implementation
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
b2e11f1e9e pc_lx_emul: add __put_user
Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
edb08770dc lx_emul: initialize task members needed by network
Those members are access via static inline functions in the network
core code and from certain protocols, e.g. AF_NETLINK.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
77cdceabaa lx_emul: add additional atomic64 functions
Needed by the WLAN driver on x86_32.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
0c617366e5 lx_emul: get pid from task
Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
4b43b5c1c1 lx_kit: handle %hu specifier in console
Prevent '<warning unsupported format specifier>' when encountering
'%hu'.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
ffea0bf857 lx_kit: remove execution of static ctors
In case where the ported driver or protocol stack is executed from
an already managed environment, e.g. the libc, the execution
of the static constructors will be performed at the appropriate
time.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
aa7303f19f nic_router: drop ARP requests when unconfigured
Whenever the nic_router encounters ARP requests on an interface
that does not have a valid IP config it will ignore them. However,
When increasing the verbosity of the component for diagnostic
purposes the resulting 'Bad network protocol' message is misleading.

Issue #4455.
2022-04-13 09:29:03 +02:00
Christian Prochaska
80f85a854c qt5: fixes and improvements for WebRTC support
Fixes #4453
2022-04-13 09:29:03 +02:00
Christian Prochaska
6c2ac345fd Add 'webcam_vfs' run test
Issue #4458
2022-04-13 09:29:03 +02:00
Christian Prochaska
6a874498f7 vfs: implement plugin for 'Capture' session
Fixes #4458
2022-04-13 09:29:03 +02:00
Martin Stein
9de4ecf8b6 run/nic_router_dhcp: DHCP RENEW and some fixes
* Test DHCP RENEW by the test client in the unmanaged variant.
* Add event IDs to log output of test client in order to prevent false positive
  result in the managed variant.
* Let managed and unmanaged variant have separate string patterns for
  'run_genode_until' because they already had different output and it will
  differ even more as we don't want to test DHCP RENEW with the managed
  variant.
* Delay first test client DHCP in order to fix unexpected sporadic initial IP
  config.
* Remove some unnecessary code from the run script

Fixes #4460
2022-04-13 09:29:03 +02:00
Martin Stein
7fc20e9ae8 NIC router: update IP config on DHCP RENEW/REBIND
The NIC router did update the IP config of a domain on a completed DHCP
REQUEST but not on completed DHCP RENEW or DHCP REBIND. Thus, it didn't adapt
to "real" DHCP servers (not NIC router servers) that got restarted with a
changed configuration by the means of RENEW/REBIND. The commit fixes this.
Note, that testing this is complicated as we don't have the necessary
infrastructure (we cannot simply use the DHCP server of the NIC router as this
would apply a link down/up sequence in order to let the client restart DHCP)

Ref #4460
2022-04-13 09:29:03 +02:00
Sebastian Sumpf
f085fc9dd2 libdrm/iris: free objects in Drm_call destructor
Make sure to remove all buffers, sync objects, and contexts during
destruction.

Fixes #4466
2022-04-13 09:29:03 +02:00
Sebastian Sumpf
d4390adb68 mesa: use 'strdup' for driver names
The 'iris' and 'etnaviv' strings are freed using 'free' by mesa.

issue #4466
2022-04-13 09:29:03 +02:00
Sebastian Sumpf
da1ef67064 base: Allocator_avl cleanup meta data
After reverting unused ranges during allocator destruction
'_meta_data.free_empty_blocks' may lead to more unused ranges because
meta data blocks maybe freed where the meta data for the blocks is
managed by other meta data blocks. This leads to dangling allocation
warnings which are caused by meta data. Therefore, we call
'_revert_unused_ranges' and 'free_empty_blocks' until no more ranges
can be freed.

issue #4466
2022-04-13 09:29:03 +02:00
Christian Helmuth
f704a50e9f prepare_ports: prevent regeneration of aclocal.m4
Related to #4350
Fixes #4467
2022-04-13 09:29:03 +02:00
Christian Helmuth
904c8e3636 vbox6: disable asseertions in depot pkg
Issue #4464
2022-04-13 09:29:03 +02:00
Alexander Boettcher
6994354b8f platform(x86): avoid multiple assignment messages
The new ported linux drivers multiple times trigger this assignment,
whereby exactly one time is sufficient.

Issue #4416
Issue #4450
Issue #4455
2022-04-13 09:29:03 +02:00
Josef Söntgen
1dc92c49ed genode_c_api/usb: report iface class and protocol
Enrich the device report with interface class and protocol information
for the current active setting of the device.

Fixes #4463.
2022-04-13 09:29:03 +02:00
Alexander Boettcher
664676a2b4 intel/gpu: support 64bit pci bars
by using the io_mem RPC of the platform session instead of parsing the
bar resources manually. This commits avoids and breakage on systems where
the Intel graphic cards just uses 64bits with addresses above 4G.

Issue #4450
2022-04-13 09:29:03 +02:00
Johannes Schlatow
e955444302 ports/coreutils: ignore inodes when copying
genodelabs/genode#4461
2022-04-13 09:29:03 +02:00
Johannes Schlatow
410099df70 base/memset: speedup implementation
Compared to the bytewise memset, a wordwise memset (or even multi-word)
achieves a speedup of ~6.

On Zynq-7000/Cortex-A9:
317 MiB/s -> 2040 MiB/s

On base-linux x86_64:
3580 MiB/s -> 23700 MiB/s

genodelabs/genode#4456
2022-04-13 09:29:03 +02:00
Johannes Schlatow
9409f814a4 memcpy (x86): implement memcpy_cpu
By changing the bytewise copy into a wordwise copy, we get a speedup of
~3 (on base-linux x86_64).

genodelabs/genode#4456
2022-04-13 09:29:02 +02:00
Johannes Schlatow
0104a74028 memcpy (arm): cache align and use pld for speedup
Preloading a few cache lines ahead brings a significant speedup in
memcpy throughput. Note, the particular (optimal) value was empirically
determined on a Cortex-A9 (Zynq-7000) SoC @ 666Mhz. It is best combined
with L2 prefetching enabled (including double linefills and prefetch
offset 7). Yet, even without L2 prefetching this seems to be the sweet
spot.

genodelabs/genode#4456
2022-04-13 08:08:01 +02:00
Johannes Schlatow
4dcc095e5e memcpy (arm): remove unused vfp implementation
The implementation is not in use any more. Furthermore, on typical ARM
cores such as the Cortex-A9, the cached read appears to be the
bottleneck rather than instruction density. On a Zynq-7000 SoC, the vfp
implementation performed significantly worse than the standard load/store
multiple implementation with preloading.

genodelabs/genode#4456
2022-04-13 08:08:01 +02:00
Johannes Schlatow
052c33fc8c test/cache: refine test pattern
- run multiple access patterns (touch words, touch lines, memcpy)
- add make file for linux

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
5a0e22eb98 test/memcpy: tweak test timing
add some log calls to give run script a bit more time to catch the next
output

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
92bcc50c0a test/memcpy: test with a more consistent alignment
On some platforms, the page index affects the measurements.

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
07736d1689 test/memcpy: fix optimistic results on Linux
When executed on Linux, the test was impaired by the copy-on-write
optimisation since the source buffer was never initialised. By default,
Linux only maps a zeroed page until the first write access to the page
occurs. Since the source buffer was never written, the corresponding
page was always present in the physically-indexed data cache. In
consequence, the test merely measured write performance (similar to memset).

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
62f37c5b1b test/memcpy: disable Thumb when compiled on linux
genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
85daf1b3b2 cpu_bench: disable Thumb when compiled on linux
genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
d372afd81e base-hw: add bitfield to pl310
Enabling double linefills improves memcpy throughput.

genodelabs/genode#4456
2022-04-13 08:08:01 +02:00
Christian Helmuth
d1f9434fd5 qemu-usb: send usb ctrl transfers with timeout
Send usb ctrl transfers with one second timeout as some devices (e.g.,
smartcard readers) do not response to certain control transfers.

Thanks to Peter for the investigation.
2022-04-13 08:08:00 +02:00
Alexander Boettcher
00479aea29 lx_emul(x86): shadow cpu_relax to advance jiffies
The i2c code has a busy loop (see commit for the location), which expects that
the jiffies advances without a cooperative scheduling decision.

Issue #4450
2022-04-13 08:08:00 +02:00
Christian Helmuth
18c5f1e90d tool/run: improve disk image size automatic
Set disk size to 1.5 times the run folder size and shrinked later to
real content.

Thanks to Roland for the patch.
2022-04-13 08:08:00 +02:00
Christian Helmuth
108fe84f5a Remove SIGNAL/CAP/RAM services from run scripts
Related to #2407
2022-04-13 08:08:00 +02:00
Christian Helmuth
77b572f36a platform: distinct USB4 from other USB PCI devices
Our usb_host driver supports UHCI, OHCI, EHCI, and XHCI host
controllers. The USB4 host interface / Thunderbolt is currently not
supported and must therefore not be passed to the USB host driver.
2022-04-13 08:08:00 +02:00
Christian Helmuth
1b4cd93dc2 lx_kit/x86: clamp PCI interrupt PIN to 1
If any PCI device reports 0 as interrupt PIN, drivers may try to force
MSI setup (e.g., xhci). So, we clamp the interrupt PIN to 1 to let
drivers finish initialization and don't bother the platform driver.
2022-04-13 08:08:00 +02:00
Josef Söntgen
afe02efb8f pc_usb_host: implement 'dma_pool_destroy'
Encountered on the Fuji5 where for reasons currently unknown the
first xHCI HC (0:0d.0) could not be initialize due to incomplete
interupt informations. The other HCs appear to work fine (tested
with a USB low-speed mouse).
2022-04-13 08:08:00 +02:00
Josef Söntgen
c6cc43f0e4 lx_kit/x86: use virtual information for PCI
This commit removes all physical notions from the information given
to the Linux kernel regarding PCI BARs.

With the exception for the host bridge that needs to be located at
'0:00.0' as required by the Intel FB driver, all other devices are
announced at the PCI BUS in an ascending order.

Additionally the MMIO regions start at 1 GiB and are capped at 32 bit
to prevent unnecessary access to 64 bit addresses.
2022-04-13 08:08:00 +02:00
Christian Helmuth
1c79c95868 acpi_drv: skip tables outside predefined region
With this fix, the driver no longer aborts on the Tigerlake notebook and
just skips the out-of-region ACPI table. Issue #4452 is not fixed by
this commit, but in this specific case the table is not used anyway.
2022-04-13 08:08:00 +02:00
Sebastian Sumpf
49b8232ebd libdrm: simplify resource accounting
Upgrade to the well known worst cases by the GPU multiplexer. Do not
keep track of resources locally, in case resources are exceeded the
remain so anyway.

issue #4451
2022-04-13 08:08:00 +02:00
Sebastian Sumpf
105e82ad84 gpu/intel: check resources before any operation
Check if there are a least 4 caps + 2MB (heap) + possible buffer size
available before any resource allocation. Only account resources that are
actually used.

issue #4451
2022-04-13 08:08:00 +02:00
Christian Helmuth
7f0403c8c1 tool/run: multiple attempt for AMT SOL connection
Some devices do not answer connection attempts timely, which leads
amtterm to time out (after 60s). Using multiple attempts in 500 ms
intervals results in timely connection and complete boot logs.

Issue #4429
2022-04-13 08:08:00 +02:00
Christian Helmuth
c1c94d37d7 microcode_intel: update to version 20220207 2022-04-13 08:08:00 +02:00
Alexander Boettcher
c0560ab0cb pc: update intel display driver
Fixes #4450
2022-04-13 08:08:00 +02:00
Alexander Boettcher
7813fca946 gpu/intel: report all devices via next_device
The former implementation relied on the behaviour of how the old
intel fb driver requested the pci devices. The new lxkit however actually
really want to have all available pci devices.

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
2548830140 pc_linux: add ACPI config
required by the upcoming update of the intel display driver. Make this addition
explicit, because it triggers adjustment also on the new pc_usb_host_drv.

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
6d924d3285 lx_kit(x86): restrict usb heuristics to usb
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
cda0fafbd1 lx_emul: remove sw_width/height from common_dummies
required by the new upcoming intel display driver. Make the step explicit,
because it needs adjustment on the new usb driver as well.

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
b6c1b7806b lx_kit: io_mem_map with write combined support (x86)
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
6f64917e8f lx_emul: add ioremap_cache/_wc to shadow/asm/io.h
used by intel_fb for write combined allocation

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
8dbcda9943 lx_emul: x86_32 shadow header adaptations
required for upcoming intel display driver in 32bit

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
7c3f010cd6 lx_emul: shadow asm/uaccess_32/64.h
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
cdf1b39c5e lx_emul: shadow asm/special_insns.h
wbinvd is not supported in user mode

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
88a6a9d628 lx_emul: add missing fpu/api.h to shadow pgtable.h
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
279f038b9e lx_emul: shadow asm/cpufeature and asm/page_64
Issue #4450
2022-04-13 08:07:58 +02:00
Josef Söntgen
fd8df3a623 lx_emul: handle page refcount 2022-04-13 08:07:58 +02:00
Alexander Boettcher
4474460377 lx_emul: __alloc_pages support in shadow/mm/page_alloc.c 2022-04-13 08:07:58 +02:00
Alexander Boettcher
a222df31ba platform_drv(x86): avoid exception in alloc_dma
If size is zero, the platform goes out of service by:

[init -> platform_drv] Error: Uncaught exception of type 'Genode::Ram_allocator::Denied'
[init -> platform_drv] Warning: abort called - thread: e

Issue #4450
2022-04-13 08:07:58 +02:00
Alexander Boettcher
dd10e5d977 intel_fb: move to legacy_intel_fb
Move the depot recipe and consistently name the old drivers with a legacy_
prefix as done with the old usb_host driver.

Issue #4450
2022-04-13 08:07:58 +02:00
Christian Helmuth
42fed1a16c tool/run: retry with optional timeout utility
Issue #4429
2022-04-13 08:07:58 +02:00
Christian Helmuth
2723614d58 tool/run: restrict close to amtterm spawn_id
Issue #4429
2022-04-13 08:07:58 +02:00
Christian Helmuth
fec5c03612 tool/run: option to skip AMT SOL availability test
Issue #4429
2022-04-13 08:07:58 +02:00
Christian Helmuth
1a2677ebe6 dde_ipxe: update Intel NIC support list from upstream
Also, the repository URL was adapted to the permanent redirect to github
to prevent the following warning.

  dde_ipxe  download http://git.ipxe.org/ipxe.git
  dde_ipxe  git Cloning into 'src/lib/dde_ipxe'...
  dde_ipxe  git warning: redirecting to https://github.com/ipxe/ipxe/
  dde_ipxe  update src/lib/dde_ipxe
2022-04-13 08:07:58 +02:00
Christian Helmuth
ad4fb2b088 nova: fix IOTLB flush for global mode
Issue alex-ab/nova#6
2022-04-13 08:07:58 +02:00
Christian Helmuth
c56ac3e909 nova: support extended addresses in FADT
Issue alex-ab/nova#5
2022-04-13 08:07:58 +02:00
Martin Stein
50fc2aa251 black_hole: provide Gpu service
Ref #4419
2022-04-13 08:07:58 +02:00
Martin Stein
046ebc3d34 black_hole: provide ROM service
Ref #4419
2022-04-13 08:07:58 +02:00
Norman Feske
bb26a986e6 sculpt: add trace_logger as optional launcher
This patch adds the trace-logger utility to the default set of packages
along with an optional launcher. With this change, only two steps are
needed to use Genode's tracing mechanism with Sculpt:

- Add 'trace_logger' to the 'launcher:' list of the .sculpt file

- Either manually select the 'trace_logger' from the '+' menu,
  or add the following entry to the deploy configuration:

    <start name="trace_logger"/>

By default, the trace logger is configured to trace all threads
executed in the runtime subsystem and to print a report every 10
seconds. This default policy can be refined in the launcher's <config>
node. Note that the trace logger does not respond to configuration
changes during runtime. Changes come into effect not before restarting
the component.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
3394f97f86 trace_logger: make output format more concise
This patch changes the output format of the trace logger to become
better suitable for human consumption. For example, when instrumenting
the VFS server in Sculpt using the GENODE_TRACE_TSC utility, the
trace logger now generates tabular output as follows.

  Report 4

  PD "init -> runtime -> arch_vbox6 -> vbox -> " ----------------
   Thread "vCPU"           at (0,0)  total:12909024 recent:989229
   Thread "vCPU"           at (1,0)  total:5643234  recent:786437

  PD "init -> runtime -> ahci-0.fs" -----------------------------
   Thread "ahci-0.fs"      at (0,0)  total:910497   recent:6335
   Thread "ep"             at (0,0)  total:0        recent:0
    71919692932: TSC process_packets: 8005M (4998 calls, last 4932K)
    71921558516: TSC process_packets: 8006M (4999 calls, last 1596K)
    71922760220: TSC process_packets: 8007M (5000 calls, last 1006K)
    71929853586: TSC process_packets: 8009M (5001 calls, last 1840K)
    71931315246: TSC process_packets: 8011M (5002 calls, last 1253K)
    72127999920: TSC process_packets: 8016M (5003 calls, last 5606K)
    72129568198: TSC process_packets: 8018M (5004 calls, last 1345K)
    77161908178: TSC process_packets: 8029M (5005 calls, last 11349K)
    77643225736: TSC process_packets: 8029M (5006 calls, last 217K)
    89422100594: TSC process_packets: 8035M (5007 calls, last 5656K)
    89422123632: TSC process_packets: 8035M (5008 calls, last 1342)
   Thread "signal handler" at (0,0)  total:36329    recent:3001
   Thread "signal_proxy"   at (0,0)  total:51838    recent:13099
   Thread "pdaemon"        at (0,0)  total:97184    recent:332
   Thread "vdrain"         at (0,0)  total:1266     recent:286
   Thread "vrele"          at (0,0)  total:1904     recent:516

  PD "init -> runtime -> nic_drv" -------------------------------
   Thread "nic_drv"        at (0,0)  total:34044    recent:897
   Thread "signal handler" at (0,0)  total:369      recent:142

  ...

Subjects that belong to the same PD are grouped together. The formerly
optional affinity and activity options have been removed. Those
information are now unconditionally displayed. The trace entries
belonging to a thread appear as slightly indented.

The patch also updates the coding style, avoiding excessively long
lines.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
f7270c44cb trace_logger: omit inactive subjects by default
This patch reduces repetitive log output by omitting inactive trace
subjects from the log output. The information about all subjects can
still be dumped by setting 'verbose="yes"'.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
ceb91732bf trace_logger: update state after adding subjects
This patch splits the creation and updating of monitor objects into two
stages. The creation of a monitor object changes the state of the
associated trace subject. The patch ensures that the new state is
captured by the update of the monitor object.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
be0a1742ac base: distinct TRACED from ATTACHED trace subjects
This patch makes the trace-subject state as reflected to the trace
monitor more accurate.

Until now, a subject could be in UNTRACED or TRACED state. In reality,
however, there exists an intermediate state after the trace monitor
called 'trace' for the subject but before the subject locally activated
the tracing (done when passing a trace point). This intermediate state
was reflected as UNTRACED. Consequently, threads that never pass a trace
point (e.g., just waiting for I/O) would remain to appear as UNTRACED
even after enabling its tracing by the trace monitor. This is confusing.

This patch replaces the former UNTRACED and TRACED states by three
distinct states:

  UNATTACHED  prior any call of 'trace'
  ATTACHED    after a trace monitor called 'trace'
              but before the tracing is active
  TRACE       tracing is active

Fixes #4447
2022-04-13 08:07:58 +02:00
Norman Feske
f3984ba5a9 base: declare build artifact for core
This is a generalization of the recent commit "base-hw: declare build
artifact for core".
2022-04-13 08:07:58 +02:00
Norman Feske
34a3209e9b base/log.h: add GENODE_TRACE_TSC
The new macros GENODE_TRACE_TSC and GENODE_TRACE_TSC_NAMED complement
the existing GENODE_LOG_TSC and GENODE_LOG_TSC_NAMED macros to simplify
TSC measurements at a low overhead of the trace mechanism.
2022-04-13 08:07:57 +02:00
Norman Feske
232a45bc14 os: add util/formatted_output.h utilities
The utilities of the new util/formatted_output.h header complement the
existing base/output.h with the text-formatting support needed to
produce tabular output.

Fixes #4449
2022-04-13 08:07:57 +02:00
Norman Feske
a5c9830706 Minor doc fixes in the release notes 2022-04-13 08:07:57 +02:00
Christian Helmuth
bde3be787e qemu-usb: fix device endpoint update
First, the endpoint update has to comply with the current alternate
settings of all interface, which are stored in USBDevice::altsetting[]
(one value per interface). Second, a SET_INTERFACE control request via
Packet_type::ALT_SETTING must update USBDevice::altsetting for the
interface.

Now, USB devices with multi-setting interface like the Joulescope JS110
with mixed bulk/isochronous endpoints are supported.
2022-04-13 08:07:57 +02:00
Christian Helmuth
49efff1fef Remove tool/create_sdk
Fixes #4446
2022-04-13 08:07:57 +02:00
Christian Helmuth
c5f9e61d3a driver_manager: adapt config attributes for usb_host 2022-04-13 08:07:57 +02:00
Norman Feske
26acd6c65a sculpt: suppress non-critical warning 2022-04-13 08:07:57 +02:00
Norman Feske
33c71d1d2c usb_host: change error to warning message
An insufficient session quota as offered by a USB client is not an
erroneous situation of the USB driver.
2022-04-13 08:07:57 +02:00
Norman Feske
b4aa0a20dd os: refine default USB session quota
This commit adjusts the value such that USB sessions requested by
VirtualBox6 on Sculpt OS can get established on the first try without
invoking the session-retry mechanism. This reduces the number of
diagnostic log messages like:

 Error: Insufficient 'ram_quota',got 6296372 need 6297928
2022-04-13 08:07:57 +02:00
Norman Feske
fa5f8dbd55 sculpt: reduce NIC driver CPU quota
The value of 50% as assigned by commit "sculpt: add basic support for
i.MX8 Quad EVK" leaves too little room for other components of the
runtime subsystem. With the adjustements of commit "sculpt: assign CPU
quotas" the sum exeedcs 100%. Hence this commit tunes down the value to
sensible 10%.
2022-04-13 08:07:57 +02:00
Norman Feske
a9022d8451 sandbox: improve CPU-quota accounting
The existing assignment of CPU quotas did not anticipate the dynamic
reconfiguration of init. It merely tracked the available CPU quota by
deducing the consumed amount from a global variable but never
replenished the value. This worked for static scenarios but failed in
situations where components are dynamically re-started.

So far this deficiency remained detected because CPU quotas were not
used in highly dynamic systems like Sculpt OS. However, this has
recently changed by commit "sculpt: assign CPU quotas".

The patch improves the accounting by mirroring the existing handling of
RAM and cap quotas. Note that the CPU-quota accounting is still rather
limited. In particular the dynamic rebalancing is not yet supported.

Issue #4445
2022-04-13 08:07:57 +02:00
Christian Helmuth
d182b20705 build: ensure rules with pipes might fail
.SHELLFLAGS is extended by option pipefail to make pipes fail if any pipe
element fails. As .SHELLFLAGS is exported into sub-make instances it
must be unexported before calling third-party build systems recursively.
2022-03-21 13:43:13 +01:00
Christian Helmuth
7da691b52a pc/usb: defer startup until config is available
The commit also adds lx_kit/initial_config.h as utility.
2022-03-21 13:42:17 +01:00
Norman Feske
e3706837b9 VFS server: foster batching of acknowledgements
With the consolidation of the file-system session's signal handlers
implemented by commit "file_system_session: merge ack and submit sigh",
we can now change the VFS server to produce batches of acknowledgements
before explicitly waking up the client. (in contrast to the traditional
'acknowledge_packet', the new 'try_ack_packet' triggers no signal)

Issue #4388
2022-03-21 13:42:17 +01:00
Johannes Schlatow
f4d0f1624a test/trace: use for_each_new_entry
genodelabs/genode#4434
2022-03-21 13:42:17 +01:00
Johannes Schlatow
c763890f04 trace_buffer: partition trace buffer
Split the trace buffer into two partitions in order to prevent overwriting
of entries when the consumer is too slow. See file comment in buffer.h.

genodelabs/genode#4434
2022-03-21 13:42:16 +01:00
Johannes Schlatow
edc46d15f8 trace_buffer: revise trace buffer implementation
This commit simplifies the current implementation by overloading the
length field with a padding indicator in addition to the zero-length
head entry. This simplifies the iteration semantics as it eliminates
the need for determining whether a zero-length entries is the actual
head of the buffer or a padding at the buffer end.

genodelabs/genode#4434
2022-03-09 12:08:02 +01:00
Johannes Schlatow
d24552f5e2 trace/policy: fix event size in log_output
Returning 0 for max_event_size() can lead to writing out of buffer bounds.

Fixes genodelabs/genode#4435
2022-03-09 12:04:44 +01:00
Stefan Kalkowski
e95f0a409d lx_emul: add implementation for Genode's USB C-API
Fix #4444
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
9713014130 dde_linux: add virt_linux lx_emul flavor
To support device-less protocol-stacks only ports, we can use a
Virt I/O Linux kernel flavor, and export the lx_kit/lx_emul parts
not depending on platform API and devices.

Ref #4397
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
35cf8aada4 lx_emul(x86): fill zero page with zeroes
Ref #4397
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
13c4abf4ad lx_emul: add static_cpu_has macro to shadow header
Ref #4397
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
0fa695dbd7 lx_kit/lx_emul: make memory backend configureable
* Drivers have to use lx_kit/memory_dma.cc
* Protocol-stacks use lx_kit/memory_non_dma.cc
* Moreover the device-dependent lx_emul parts get removed
  from the common lx_emul import rules

Fix #4443
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
d473bed4b7 platform api: export dma buffer capability
Ref #4443
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
5c71a8d74d lx_emul: extract common lx_emul import makefile
Fix #4442
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
b80146a6f7 genode_c_api: unify shared dataspace callbacks
* Unifies the declaration of callbacks which manage driver/client
  shared dataspaces
* Move the Linux driver-specific callback implementation to the
  lx_emul library from the PC's USB host driver

Fix genodelabs/genode#4439
2022-03-09 10:55:16 +01:00
Norman Feske
b1e2e654a9 sculpt: support uplink and event service providers
This patch enhances Sculpt with the ability to route uplink and event
sessions to the optional black-hole component.

Issue #4419
2022-03-08 15:48:53 +01:00
Christian Helmuth
a941dfe7b2 gpt_write: adapt to changed packet stream blocking semantics
Issue #4390
2022-03-08 15:37:04 +01:00
Robin Eklind
1142ef91df base-linux: fix build (BOARD=pc)
Fix a few build errors related to required type conversions
and handling of references.

Fixes #4440
Fixes #4441
2022-03-08 14:23:28 +01:00
Norman Feske
4056fb9127 pc/usb: fix ret value of handle_altsetting_request
The logic got accidentally reversed during the transition from the
legacy USB driver.

Since the function drops error details, this patch adds a diagnostic
message with the error code as returned by the Linux driver.
2022-03-08 12:46:11 +01:00
Norman Feske
0325be0827 virtualbox6: service lib target has no artifacts
This patch declares that the pseudo target virtualbox6/services/ does
not produce any build artifact. This allows the adding of virtualbox6
to Sculpt's 'build:' list.
2022-03-08 10:51:19 +01:00
Christian Helmuth
29e6537939 pc: fix dependency to generated crc32table.h 2022-03-07 16:43:12 +01:00
Stefan Kalkowski
600997d8d6 usb_hid_raw: don't use deprecated qemu option
* Use -device instead of deprecated -usbdevice
* Use the same xhci model as in usb_hid_reconnect
2022-03-07 16:43:12 +01:00
Josef Söntgen
67f797abf2 pc: enable UHCI driver in usb_host
Fix genodelabs/genode#4438
2022-03-07 16:43:12 +01:00
Stefan Kalkowski
2a35c8f9e7 lx_emul: add page macros to x86 shadow headers
* Add page_to_phys and dummy macro for pgprot_device

Original commit provided by Josef Soentgen

Ref genodelabs/genode#4438
2022-03-07 16:43:12 +01:00
Josef Söntgen
2760b67902 lx_kit/lx_emul: add I/O port support
Ref genodelabs/genode#4438
2022-03-07 16:43:12 +01:00
Stefan Kalkowski
57aab46fc3 platform: introduce I/O ports in API
* Introduces Platform::Device::Io_port client utility
* Implements I/O ports as common device resources in platform driver

Fix genodelabs/genode#4436
2022-03-07 16:42:56 +01:00
Stefan Kalkowski
8a4cbe3cc9 io_port_session: make default ram quota explicit
Ref genodelabs/genode#4436
2022-03-02 15:04:18 +01:00
Roland Bär
d45b60ceeb sntp_client.run: redundant aritfacts in image build
The run script uses core, ld.lib.so, and init from depot packages, thus
these cannot be integrated in the image explicitly from the build
directory.

Also, removed special build of report_rom, which is not subject of the
test.

Fixes #4437
2022-03-02 07:56:20 +01:00
Christian Helmuth
4591d501b4 version: 22.02 2022-02-28 15:47:43 +01:00
Norman Feske
36957cb4d3 News item for version 22.02 2022-02-28 15:43:17 +01:00
Norman Feske
8b2247e21b Release notes for version 22.02 2022-02-28 15:43:17 +01:00
Norman Feske
cdb2f624de Update doc/components.txt 2022-02-28 15:43:17 +01:00
Christian Helmuth
2b3370c8d8 depot: update recipe hashes 2022-02-28 11:46:35 +01:00
Christian Prochaska
88dec4cc94 dde_rump: support blocking I/O operations from non-ep threads
Issue #4433
2022-02-28 11:45:19 +01:00
Martin Stein
87c5f91a74 test/black_hole: test link-state change at uplink
Ref #4419
2022-02-28 11:45:19 +01:00
Martin Stein
fa3a195077 test/black_hole: split-up test classes
Ref #4419
2022-02-28 11:45:18 +01:00
Martin Stein
4f640dacab test/black_hole: fix failing packet allocation
* The problem occured only on OKL4, seL4, and L4/Fiasco
* The test used to continue submitting packets regardless of how many were in
  flight
* This commit limits the in-flight packets at the Uplink/Nic connections to 40
  each

Ref #4419
2022-02-28 11:45:18 +01:00
Christian Prochaska
351439b4ab Add vfs_gpu.lib.so to Qt5 run scripts and recipes
Issue #4380
2022-02-28 11:45:18 +01:00
Norman Feske
44282da30d Add vfs_gpu.lib.so to Mesa run scripts
This follow-up commit to "vfs_gpu: VFS plugin that handles GPU
completions" is needed to excute the mesa-gears.run script.

Issue #4380
2022-02-28 11:45:18 +01:00
Norman Feske
668258746b Update expat to version 2.4.6
The tar.gz archive of version 2.4.1 vanished from sourceforge.
2022-02-28 11:45:18 +01:00
Norman Feske
ca9460aead event_filter: touch/press untouch/release sequence
This commit changes the touch-click filter to adhere the following
sequence:

  touch         (physical)
  press         (artifically generated)
  release       (artificially generated)
  release_touch (physical)

This order is important because nitpicker's focus handling takes
press/release events into account. If the release-touch event appears
before the release event, nitpicker subsumes the release-touch event
to the sequence that started with the press event, instead of handling
it as a free-standing event.

Issue #4332
2022-02-28 11:45:18 +01:00
Norman Feske
55492fbe5b sculpt: assign CPU quotas
By assigning CPU budgets, base-hw's priorities come into effect.
Even though the chosen values are rather guessed than informed, they
yield a visibly improved responsiveness on the Pinephone.
2022-02-28 11:45:18 +01:00
Norman Feske
a084f6c835 sculpt: suppress log_kernel on Pinephone
The log_kernel component exists only for NOVA.
2022-02-28 11:45:18 +01:00
Norman Feske
e162317afa sculpt: add nitpicker domain for touch keyboard
Issue #4432
2022-02-28 11:45:18 +01:00
Norman Feske
ac3069ebfa sculpt: launcher for touch_keyboard
Issue #4432
2022-02-28 11:45:18 +01:00
Norman Feske
620a274c82 Touch-screen keyboard
Fixes #4432
2022-02-28 11:45:18 +01:00
Johannes Schlatow
e35837e14b trace_buffer: fix wrap condition
When committing a new entry, the buffer wrapped if the last entry fit
perfectly into the buffer. Otherwise, the length field of the next entry
was set to 0 to mark the new head. Yet, if there was still some padding but not
enough to hold the length field of another entry, we ended up with a
headless buffer.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Johannes Schlatow
91b6032a71 trace_buffer: eliminate race
Since the head of the buffer is marked by a zero-length entry, we must
only write the length field if a new head was set. Otherwise, the
consumer might already read the new entry and not find the new head as a stop
condition.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Johannes Schlatow
b57ccf3517 trace_buffer: fix wrap corner case
If the functor reading the first entry after wrap-around returned false,
the wrapping was not applied successfully.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Johannes Schlatow
44aefc8777 trace_buffer: fix out-of-bounds read
The calculation in next() actually checked whether the current entry
fitted into the buffer, not if another one fitted.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Johannes Schlatow
d7c4265089 trace_buffer: add test pkg for depot_autopilot
genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Norman Feske
b39c124628 base-okl4: remove non-critical error message 2022-02-28 11:45:18 +01:00
Stefan Kalkowski
b5b958c276 hw: unify architectural kernel interface header
Fix genodelabs/genode#4345
2022-02-28 11:45:18 +01:00
Stefan Kalkowski
b5e327e3e9 platform_drv: do not return cap of device twice
When a device got already acquired by a platform session client, do not
return the same capability again, even if the same platform session
client requested it. Therefore, make doubtful behaviour of client components
visible, and do not have to struggle with Platform::Device instances
instantiated multiple times, which care of the lifetime of the device
capability internally.

Fix genodelabs/genode#4379
2022-02-21 15:47:51 +01:00
Piotr Tworek
e595b0b782 base-hw: Make sure MMU is initially disabled on ARMv8.
Genode code already expects MMU to be disabled when starting the
kernel. It is enabled eventually in Bootstrap::Platform::enable_mmu,
after setting up translation tables. Unfortunately nothing ensures
this is actually the case. If MMU happens to be enabled when entering
the kernel things go downhill pretty fast after we start messing with
TTBR.

This patch ensures MMU is disabled for EL1, EL2, EL3 dependent on the
exception level of the CPU core, which is entering the kernel.

This should allow base-hw to start correctly on Quartz64 A board.
2022-02-21 15:47:51 +01:00
Stefan Kalkowski
0c67d0838a hw: restrict page-table lookup to rw-pages
The `lookup_translation` function got introduced and is used only in the
context to proof whether a cache maintainance function can be executed
safely by the kernel. Unfortunately, it did not checked write permissions,
which can lead to permission faults. This commit restricts the lookup
function to only succeed when the target page is writeable. Consequently,
the lookup function gets renamed to `lookup_rw_translation`.

Fix genodelabs/genode#4348
2022-02-21 15:47:51 +01:00
Stefan Kalkowski
e1a2b5c8d4 pc: build lx_emul and linux driver code with -O2
Ref genodelabs/genode#4416
2022-02-21 15:47:51 +01:00
Stefan Kalkowski
14d1ca17a9 Use new pc_usb_host_drv in all recipes and tests
* Switch from the legacy usb_host driver to the new PC version
  in recipes and automated tests
* Update documentation snippets
* Remove outdated, unused usb_rndis run-script

Fix genodelabs/genode#4416
2022-02-21 15:47:50 +01:00
Stefan Kalkowski
a30c4281d2 genode_c_api: report usb config on demand
Do not only report devices, but the current configuration of the driver too,
as long as the `report` node in the configuration states it.

Ref genodelabs/genode#4416
2022-02-21 15:47:50 +01:00
Stefan Kalkowski
938ac716a8 genode_c_api: make usb devices report configurable
To stay consistent with the configuration of the legacy usb_host_drv
and other components as well, do not report USB devices by default,
but when the following XML node is set within the component's
configuration:

  <report devices="yes"/>

Ref genodelabs/genode#4416
2022-02-21 15:44:23 +01:00
Stefan Kalkowski
a04d0b9a0f usb_session: increase default ram quota
The new usb_host driver for PC by default needs more RAM quota in contrast
to the old one. To minor warnings and repeated attempts to open a USB
session from a client, this commit increases the default RAM quota by one
page.

Ref genodelabs/genode#4416
2022-02-21 15:44:22 +01:00
Stefan Kalkowski
3c07bf4e86 genode_c_api: support to handle empty usb session
Adds a function to the USB part of the Genode's C API, to enable
usb_host drivers to acknowledge USB request in client's packet buffer
although they are not assigned to an USB device. The requests are
marked with a "no device" error.

This commit fixes a regression originally solved in genodelabs/genode#4149

Ref genodelabs/genode#4416
2022-02-21 15:44:22 +01:00
Norman Feske
c2efa5406e xml_node: support backslash as attribute value
XML allows attribute values like <node attr="\"/>. The XML parser
wrongly reflects this case as 'Invalid_syntax'. This behavior stems from
the implicit use of the 'end_of_quote' function, which considers the
sequence of '\"' as a quoted '"' rather than the end of a quoted string.

The patch solves this problem by making the 'end_of_quote' part of
the tokenizer's scanner policy.

The patch removes the 'end_of_quote' function from 'util/string.h'
because it is not universal, and to avoid the ambiguity with
'SCANNER_POLICY::end_of_quote'.

Fixes #4431
2022-02-21 15:44:22 +01:00
Stefan Kalkowski
494f881f27 core: don't use frame 0 for managing_system pd
When a PD owns the right to ask for a RAM dataspace's `dma_addr` it is
concurrently constrained to use allocations of a specific physical RAM area.
This commit further limits this area by removing RAM page frame zero.
Otherwise the return value of `dma_addr` for such a dataspace would be
erroneously interpreted as a fault, because zero is currently the error
return value of `dma_addr`.

Fix genodelabs/genode#4428
2022-02-21 15:44:22 +01:00
Norman Feske
429d078de7 log_core.run: RAM-quota adjustment for sel4
Issue #4400
2022-02-21 15:44:22 +01:00
Norman Feske
ef732f480f mk: pass KERNEL as environment variable
This is a follow-up fix for "mk/ld.mk: trigger kernel-dependent
ld.lib.so build", which alleviates the need to specify the KERNEL at the
build-system command line. Thanks to Piotr Tworek for reporting.

Issue #4320
2022-02-21 15:44:22 +01:00
Norman Feske
4769e05626 mk: abi does not depend shared-lib dependencies
This patch cuts the superfluous dependency of abi.so files from the
library dependencies of the corresponding lib.so file. ABIs depend
only on symbol files.

Prior this patch, the second step of the following sequence would
wrongly re-build the abi.so file.

  arm_v6$ make init
  arm_v6$ make init KERNEL=hw

As the KERNEL argument does not affect the ABI, the abi.so should
better not be created twice.

Issue #4408
2022-02-21 15:44:22 +01:00
Johannes Schlatow
019cacf07e vfs_tap: VFS plugin for Uplink/Nic session access
This plugin emulates a `/dev/tapX` device as found on FreeBSD. See
README for more information.

genodelabs/genode#4394
2022-02-21 15:44:22 +01:00
Johannes Schlatow
19958eafcf vfs: add notify_read_ready() to Single_vfs_handle
The Single_file_system now forwards the
`File_io_service::notify_read_ready` method to the
handle as it already did for most of the other methods.

genodelabs/genode#4394
2022-02-15 17:14:34 +01:00
Johannes Schlatow
f33916e2dc vfs: remove check_unblock from File_io_service
genodelabs/genode#4394
2022-02-15 17:14:34 +01:00
Christian Helmuth
1d5af600cc test-init: increase LOG server cap quota for sel4 2022-02-15 17:14:34 +01:00
Sebastian Sumpf
8edb7b28a0 sculpt_manager: initial mode for 'Managed_config'
Do not set '_mode' per default to MANANGED. Check if a manual config ROM
is present during construction and set '_mode' to MANUAL in case it is.

issue #4369
2022-02-15 16:33:38 +01:00
Norman Feske
14b93c5ff3 run: handle empty create_tar_from_depot_binaries
This patch works around 'tar' erroring out when faced with an empty list
of files:

  tar: Cowardly refusing to create an empty archive

This can happen when using sculpt.run for a scenario with only a runtime
but no deploy or launcher configuration.

Issue #4369
2022-02-15 16:13:54 +01:00
Sebastian Sumpf
300cdc435d expanding_report: make expandable for XML node generation
'generate(Xml_node node)', as used by the Sculpt manager, calls this
function instead of the lambda version. The 'report' function of the
'Genode::Reporter' does not throw an exception in case there is not
enough backing storage for the 'generate' request. Therefore, we have to
check this condition in a loop and call '_increase_report_buffer' in
case size limits are reached.

Patch by Norman Feske.

issue #4369
2022-02-15 16:13:53 +01:00
Piotr Tworek
dd1596aa53 base: Don't produce .gnu.hash tables for Genode.
Genode linker does not support .gnu.hash tables so they will never be
used. Tell the linker not to bother producing them. This should reduce
the size of Genode ELF files a tiny bit without loosing anything
important in the process.

Fixes #4423
2022-02-15 15:32:20 +01:00
Martin Stein
3e460211c8 black_hole: provide Uplink service
Ref #4419
2022-02-15 15:28:58 +01:00
Piotr Tworek
bade0a85e7 base-hw: Implement CPU core identification for Cortex-A55.
According to ARM Cortex-A55 Core Technical Reference Manual r1p0 the
lowest 8 bits (Aff0) of MPIDR register represent thread IDs within a
multi-threaded core. The actual core identification bits are in Aff1.
This layout can be identified by checking the MT bit of MPIDR register.
Basically, if MT=1 core id is in Aff1, if MT=0 core id is in Aff0.

Without this change Genode will identify all CPU cores on A55 as primary
(0) core.

Its worth to mention that Cortex-A55 by itself is not a multi-threaded
CPU. Aff0 values are always expected to be 0 for pure A55 cores. A55
cores can however be paired with cores that are multi-threaded. To
support such big.LITTLE CPUs in Genode we'd probably need to add a
different mechanism for mapping MPIDR values to logical, contignous
core IDs which Genode expects.

Ref:
https://developer.arm.com/documentation/100442/0100/register-descriptions/aarch64-system-registers/mpidr-el1--multiprocessor-affinity-register--el1?lang=en
2022-02-15 15:27:29 +01:00
Johannes Schlatow
c265218ba8 netperf: output more metrics
* use netperf omnitest output selectors to acquire more metrics
* remove packet_size argument that was not interpreted by netperf

genodelabs/genode#4427
2022-02-15 15:25:56 +01:00
Norman Feske
8b7067d289 sd_card_bench.run: assign 'managing_system' role
Issue #2243
2022-02-15 15:18:04 +01:00
Norman Feske
649647538b depot: update recipe hashes 2022-02-15 10:23:59 +01:00
Johannes Schlatow
70bf0cbe84 vfs/lwip: add missing signal handlers
Note, without batching from the Nic server this may slow down the
throughput a bit.

genodelabs/genode#4427
2022-02-15 10:23:59 +01:00
Piotr Tworek
58e0b24006 base: Ignore empty constructors array.
This does not affect default Genode builds as far as I can tell. There
is always at least one global static CTOR which seems to be coming from
one of the GCC runtime libs bundled in the toolchain. The problem became
visible for me only after I've replated GCC runtime with LLVM based
one. In such setup I often see binaries that do not have any static ctors.
Such binaries end up crashing Genode ld.lib.so.

Make sure the code does handle empty constructors array.

Fixes #4422
2022-02-15 10:23:58 +01:00
Piotr Tworek
05e4993d2e gems: Avoid flexible array member in Cached_font.
Switch the code to 0 lengh array instead. The code in
Lru_cache::element_size calls sizeof on this structure. This works in
gcc, but fails when using clang. Even for GCC however the documentation
states:

  "Flexible array members have incomplete type, and so the sizeof operator
   may not be applied. As a quirk of the original implementation of
   zero-length arrays, sizeof evaluates to zero."

Basically its an implementation quirk that clang does not support. Both
GCC and clang do support zero sized arrays however so using them here
allows both compilers to process this code.

Ref: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
c1a566ce63 gems: Remove unused lambda capture in vfs/ttf.
Clang complains "this" captured by the lambda is not used. Remove the
capture to make it happy.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
ec7d0efddf os: Drop unused Net::Dhcp_client::_alloc member.
This reference member is not used anywhere in the code. This prompts
clang to complain about it. Eliminate the member and all the plumbing
associated with it to silence the warning.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
15c8cac78b os: Don't use char as array subscript.
Clang really doesn't like char subscripts. I can't say I blame it. Fix
the warning by an explicit cast to unsigned.

include/nitpicker_gfx/tff_font.h:230:53: error:
    array subscript is of type 'char' [-Werror,-Wchar-subscripts]
Tff::Vertical_metrics const m = _vertical_metrics['m'];
                                                 ^~~~
Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
9dd04ad268 os: Drop unused lambda captures in VFS code.
Clang likes to complain when lambdas capture parameters without
actually using them. This patch fixes a couple of such problems in VFS
related os module code.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
14c36efbab os: Disambiguate Genode::destroy in route_model.h
Clang can't figure it out on its own. I can't blame it for this to be
honest. Lets be clear which destroy method we're talking about here.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
f1f3b423ec os: Disambiguate friend Avl_node.
It seems clang does not take "using namespace Genode" statement in
Driver namespace into account when parsing those friend Avl_node
lines.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
5e93a5806b base-hw: Use softfp ABI on virt_qemu ARMv7.
The soft ABI implies purely software floating point implementation.
This is not the case for Genode however. For example core's
exception_vector.S uses vmsr instruction. This builds fine with with
GCC based toolchain, but clang with integrated-as complains:

src/core/spec/arm/exception_vector.S:122:2: error: instruction requires: VFP2
 vmsr fpexc, r1
 ^

Fix this by passing softfp to mfloat-abi command on ARMv7. This allows
usage of FP HW, but implies soft-floating point ABI.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
4ae78639f5 base-hw: Fix invalid structure alignments.
According to C++11 reference:

  "If the strictest (largest) alignas on a declaration is weaker than
   the alignment it would have without any alignas specifiers (that is,
   weaker than its natural alignment or weaker than alignas on another
   declaration of the same object or type), the program is ill-formed:"

https://en.cppreference.com/w/cpp/language/alignas

The code requests 4 byte alignment for Genode::Arm_cpu::Context.
The Context structure inherits Genode::Arm_cpu::Fpu_context which
has minimum alignment requirement of 8 bytes, due to uint64_t d0_d31
member. This makes the 4 byte value in Context's alignas specifier
invalid (smaller than allowed minimum).

Similar situation takes place in Arm_64 case. The claimed minimum
alignment of Context is 8 bytes, but the fpu_state member imposes 16
bytes alignment (explicitly specified in Fpu_state declaration).

In both cases the code builds fine with GCC 8.3.0, but fails with
clang which claims that "requested alignment is less than minimum
alignment of X for type", where X is 8 on ARM and 16 on AArch64.

Ref: https://eel.is/c++draft/dcl.align#5

Issue #4421
2022-02-15 10:23:58 +01:00
Martin Stein
468057638b black_hole: provide Nic service
Ref #4419
2022-02-15 10:23:58 +01:00
Stefan Kalkowski
3edec0c6ca pc: new usb host driver based on Linux 5.14.21
Original commit by Josef Soentgen.

Ref genodelabs/genode#4416
2022-02-15 10:23:58 +01:00
Stefan Kalkowski
e72f39b484 Provide pc specific lx_emul API
This commit contains:

* Minimal Linux kernel target: pc_linux
* Library to generate a Linux build directory, config, generated headers
* API depot package

The actual work was provided by Josef Soentgen.

Ref genodelabs/genode#4416
2022-02-15 10:23:58 +01:00
Norman Feske
33b038e8a7 Consistent spelling of "writeable"
Fixes #4425
2022-02-15 10:23:58 +01:00
Norman Feske
0d48b74bec Remove Dataspace::phys_addr RPC function
The official way to obtain DMA addresses for RAM dataspaces is
the RPC function 'Pd_session::dma_addr' now. User-level device drivers
should not call this function directly but use the 'Platform_session'
interface of the platform driver instead.

Fixes #2243
2022-02-15 10:23:58 +01:00
Norman Feske
84435662aa os/block: Remove use of Dataspace::phys_addr
Issue #2243
2022-02-15 10:23:58 +01:00
Norman Feske
de6c65c453 sd_card/pl180: remove unused code 2022-02-15 10:23:16 +01:00
Martin Stein
7945bcb353 black_hole: add config.xsd
Ref #4419
2022-02-15 10:23:16 +01:00
Martin Stein
ca49e94a87 black_hole: test recipe for the depot_autopilot
* Creates sessions to all supported services of the black hole component
* Test-drives the Event and Capture session with dummy input
* Adds the test to the default list of depot_autopilot.run
* Test-driving the Audio_in and Audio_out sessions is still missing and should
  be added via a dedicated commit

Ref #4419
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
3966d6f16f usb_host_drv: move it to legacy_usb_host_drv
To make room for the re-newed usb_host_drv basing on Linux 5.14 and
the re-newed lx_kit/lx_emul we have to move the depot recipe and
consistently name the old drivers with a legacy_ prefix.

Ref genodelabs/genode#4416
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
17f3e7a38f Introduce pc repository for PC board support
Fix genodelabs/genode#4415
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
da55425114 lx_emul: finalize support for x86_32 and x86_64
Original commit by Josef Soentgen.

Fix genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
5a48f8ab0f lx_kit/lx_emul: support for executing PCI fixups
Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
2515196b82 lx_kit: add Platform session wrapper for x86
The x86 platform driver uses a different API than the one for ARM for
which the lx_kit glue code was designed. Since the x86 platform driver
will eventually adopt a similar interface we implement a wrapper that
encapsulates the old interface.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
77ab7bf68b lx_emul: add PCI config space handling
Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
c851b189c5 lx_emul: add wake_q_add/wake_up_q in shadow impl.
The function within this commit were taken verbatim from the
original Linux implementation.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
0f70212139 lx_emul: import shadow sched.c from allwinner repo
Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
96ca806e0d lx_emul: fix conversion warnings on 32bit
This change is necessary for also supporting 32bit platforms.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
7809b9e8ad lx_emul: move arm_64 specifics, add x86 specifics
Split in between x86 and arm code. Move arm-specifics away from
generic include pathes.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
d7963be212 lx_emul: update to linux kernel 5.14 as default
Until now, the lx_emul layer addressed a 5.11 Linux Kernel port,
now that we add new architectures it is better to update the default version
first. There are especially changes in the task_struct code,
and the signature of some functions in the paging subsystem changed.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
742c40a60a dde_linux: add linux kernel 5.14.21 port
Ref genodelabs/genode#4411
2022-02-15 10:23:15 +01:00
Stefan Kalkowski
1e41c6daa4 lx_kit: move setjmp/longjmp away from legacy
We use the architecture-specific setjmp/longjmp implementation without
modification in the newer lx_kit implementation as well. There is no
need for a duplication.

Ref genodelabs/genode#4411
2022-02-15 10:23:15 +01:00
Stefan Kalkowski
ed1b8fb3f9 sculpt_manager: increase ram quota of nic driver
When running Sculpt OS on i.MX8 MW EVK or MNT Reform 2 the NIC driver
is far more hangry with respect to memory usage.

Fix genodelabs/genode#4407
2022-02-15 10:23:15 +01:00
Martin Stein
fcb3e32fee black_hole: provide Event service
Fixes #4419
2022-02-15 10:23:15 +01:00
Norman Feske
53dea7e623 Move exec_terminal to genode-world
This is a leftover of issue #4258.
2022-02-15 10:23:15 +01:00
Norman Feske
f9f79af5bd tool/tool_chain: fix condition of ali2dep build
Thanks to Tomasz Gajewski for reporting this issue and suggesting the
fix.

Fixes #4365
2022-02-15 10:23:15 +01:00
Martin Stein
6f571a1e80 port/cbe: update to newest version
The new version fixes a bug that led to the regular attempt of encrypting
invalid block encryption keys at the crypto back-end.

Ref #4355
2022-02-15 10:23:15 +01:00
Norman Feske
4f40a607ea Remove ROM prefetcher
Fixes #4418
2022-02-15 10:23:15 +01:00
Johannes Schlatow
392a2cba66 libc: fix page fault in socket_fs_plugin
In the error case of socket_fs_accept() the Unconfirmed utility was
incompletely applied with the result of executing the cleanup routines
in the wrong order.

Fixes #4417
2022-02-15 10:23:15 +01:00
Stefan Kalkowski
50c7104e22 nic_router tests: remove unused platform driver 2022-02-15 10:23:15 +01:00
Christian Helmuth
a9b8b6e6c2 Move lua/moon to genode-world
Issue genodelabs/genode-world#282
Fixes #4414
2022-02-15 10:23:15 +01:00
Christian Helmuth
76dde9d0ec libports: remove ancient unused readline library 2022-02-15 10:23:15 +01:00
Alexander Boettcher
888b89c1c0 nova: avoid pagefault on invalid SVM exit
Fixes #4391
2022-02-15 10:23:15 +01:00
Alexander Boettcher
35489aa708 seoul: move to genode-world
Fixes #4412
2022-02-15 10:23:15 +01:00
Alexander Boettcher
baea48fbec iso9660: move to genode-world
Fixes #4413
2022-02-15 10:23:15 +01:00
Norman Feske
ec559b85e2 Add missing shared-object link dependencies
Issue #4408
2022-02-15 10:23:14 +01:00
Stefan Kalkowski
144cc8ac54 create_dummies: fix detection of out-of-tree build
Fix genodelabs/genode#4410
2022-02-15 10:21:00 +01:00
Norman Feske
59936c22c0 depot: cut kernel dependency from api/base
This patch removes the implicit build of ld-$(KERNEL) by the generic
ld.mk file because the kernel-specific dynamic linker is unreachable
when building a regular binary archive.

Issue #4320
2022-02-15 10:20:59 +01:00
Norman Feske
368730ce0b run: don't build ld at boot-dir stage
With the kernel-specific build of the dynamic linker triggered
automatically at the build stage, the artificial build step at the
boot-dir stage can be skipped.

Issue #4320
2022-02-15 10:20:59 +01:00
Norman Feske
23f92da02f mk/ld.mk: trigger kernel-dependent ld.lib.so build
When 'KERNEL' is specified, let the generic (pseudo) target of
lib/mk/ld.mk trigger the build of the actual dynamic linker named after
the used kernel. This way, we become able to remove the magic
linker-build step from the boot-image stage of the run tool.

Issue #4320
2022-02-15 10:20:59 +01:00
Norman Feske
f2f0711bf4 mk: don't link transitive shared-lib dependencies
This patch applies the existing "privatization" of transitive
shared-library dependencies from static lib dependencies to shared lib
dependencies. It thereby improves the consistency of binaries created in
a regular build directory with binaries created in depot archives.

Issue #4408
2022-02-15 10:20:59 +01:00
Norman Feske
bdc766980e tool/run/boot_dir/linux: improve error message
Also fix white space
2022-02-15 10:20:59 +01:00
Norman Feske
3b8fe1b410 nitpicker: reflect seq number in clicked report
This patch makes nitpicker's "clicked" report useful for the detection
of clicks outside of any client. This is needed in situations where the
dialog should close when clicking outside its screen area. In the new
version, a click outside any client results in a report without a
'label' attribute. Furthermore, the report is augmented by the sequence
number of the click, which allows for freshness checks by the consumer of
the report (i.e., sculpt_manager).

Issue #4398
2022-02-15 10:20:59 +01:00
Norman Feske
616a92a193 test-vfs_stress_fs: adjust cap quota for seL4 2022-02-15 10:20:59 +01:00
Johannes Schlatow
47cb44c6eb os/trace_buffer.h: fix wraparound
If the buffer contains padding at the end, the iteration must continue
in order to restart iteration from the start of the buffer.

genodelabs/genode#4244
2022-02-15 10:20:59 +01:00
Martin Stein
b31bbfe14c jpeg: update hash of downloaded archive
The archive contents are equivalent except the creation date of the
top-level directory.

  -drwxr-xr-x guivol/users      0 2021-01-07 12:54 jpeg-9d/
  +drwxr-xr-x guivol/users      0 2022-01-04 12:02 jpeg-9d/

Fixes #4406
2022-02-15 10:20:59 +01:00
Norman Feske
36162f5ccf Remove fs_log component
Fixes #4400
2022-02-15 10:20:59 +01:00
Stefan Kalkowski
cd0cfc34a3 create_builddir: add imx repository for arm_v7 2022-02-15 10:20:59 +01:00
Norman Feske
d93d3fbfca log_core.run: use terminal_log instead of fs_log
Issue #4400
2022-02-15 10:20:59 +01:00
Norman Feske
51134a6897 cpu_burner: coding style 2022-02-15 10:17:28 +01:00
Norman Feske
26d9bac78f os: remove outdated test/block components
The functionality of the test-block-client, test-block-server, and
test-block-bench components is now covered by the block_tester
application and the vfs_block server.

Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
378e2d9e74 Use block_tester instead of test/block/client
Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
76c090b694 Remove block_cache server
Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
9478c3cc7c Remove http_block server
Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
479f2e0d1f trace_logger: remove false warnings from the log
This patch eliminates warnings that occurred as side effect of using the
'Session_policy' utility ("Warning: no policy defined for label...").
The new version uses the 'with_matching_policy' function instead, which
has the nice side effect of simplifying the error handling.
2022-02-15 10:17:28 +01:00
Norman Feske
6eaeb61d58 os/session_policy.h: add 'with_matching_policy'
This patch makes the server-side policy-matching logic available outside
the 'Session_policy' class. Given that the new 'with_matching_policy'
function does not throw any exception, it gives server implementations
the freedom to avoid the C++ exception mechanism for the policy handling.
2022-02-15 10:17:28 +01:00
Stefan Kalkowski
bb285bf758 Convert virtio to use Platform::Session::dma_addr
Issue #2243
2022-02-15 10:17:28 +01:00
Norman Feske
7e26d3ef3f Give diagnostic aid to callers of 'dma_addr'
If the platform driver lacks the 'managing_system="yes"' attribute,
requests for DMA addresses return 0. This patch is meant to help
diagnosing such configuration issues.

Issue #2243
2022-02-15 10:17:28 +01:00
Norman Feske
cbe3e49c7f os: Input::Event:Axis event type
This event type can be used to propagate analog values such as joypads.

Issue #3669
2022-02-15 10:17:28 +01:00
Norman Feske
50c2b0066f Remove 'Env::reinit' and 'Env::reinit_main_thread'
Fixes #4404
2022-02-15 10:17:28 +01:00
Norman Feske
62b4871c5c Remove gems/magic_ring_buffer.h
Since its introduction four years ago, the utility remained
largely unused.

Fixes #4403
2022-02-15 10:17:28 +01:00
Christian Prochaska
d4d875f2e6 libusb: handle 'ack_avail' signals in a VFS plugin
Issue #4392
2022-02-15 10:17:28 +01:00
Stefan Kalkowski
cf0d007fd4 os: remove imx53 specific platform api and fb_drv
Fix #4402
2022-02-15 10:17:28 +01:00
Stefan Kalkowski
fe009fd66d usb_hid_raw: add configuration for rpi_platform_drv
Ref #4396
2022-02-15 10:16:52 +01:00
Norman Feske
51479e6be0 Convert drivers to use Platform::Session::dma_addr
This patch eliminates several calls of 'Dataspace::phys_addr'.

Issue #2243
2022-02-15 10:16:52 +01:00
Norman Feske
90a6f55f88 os: add platform_session/dma_buffer.h
The new 'Dma_buffer' utility simplifies the allocation of DMA-capable
RAM by device drivers.

Issue #4401
2022-02-15 10:16:52 +01:00
Norman Feske
997a24e91a dde_rump: remove use of Dataspace::phys_addr
This patch removes dead code. The Rump kernel does not need to know any
physical addresses of allocated memory.

Issue #2243
2022-02-15 10:16:52 +01:00
Norman Feske
e4f62380d7 base: Pd_session::dma_addr, Pd_session::attach_dma
This patch enhances the PD-session interface with the support needed for
user-level device drivers performing DMA. Both RPC functions are
intended for the direct use by the platform driver only. If invoked for
PDs that lack the managing-system role, the operations have no effect.

The 'dma_addr()' RPC function allows the platform driver to request the
DMA address of a given RAM dataspace. It is meant to replace the
'Dataspace::phys_addr' RPC function.

The 'attach_dma' RPC function adds the given dataspace to the device
PD's I/O page table. It replaces the former heuristics of marking DMA
buffers as uncached RAM on x86.

With this patch, the UNCACHED attribute of RAM dataspaces is no longer
used to distinguish DMA buffers from regular RAM dataspaces.

Issue #2243
2022-02-15 10:16:52 +01:00
Johannes Schlatow
db3a647c6d allocator_avl: use Attempt for size_at
Fixes ambiguous interpretation of returned 0.

genodelabs/genode#4393
2022-02-15 10:16:51 +01:00
Johannes Schlatow
5aa0fea29b base: pass lambdas by reference in util/attempt.h
genodelabs/genode#4393
2022-02-15 10:16:51 +01:00
Johannes Schlatow
b821776b0d base: add == operator to util/attempt.h
This simplifies testing for early return conditions for which the use of
lambdas would be quite noisy.

genodelabs/genode#4393
2022-02-15 10:16:51 +01:00
Norman Feske
024b987e4c os: change Input::Touch_id from int to unsigned
There no sensible meaning for negative touch IDs.

Issue #3669
2022-02-15 10:16:51 +01:00
Norman Feske
8e9cabf819 sculpt_manager: touch-screen compatibility
This patch makes Sculpt's leitzentrale GUI able to respond to touch events. It
formerly assumed that click/clack events are always preceded by hover reports
that identify the clicked-on widgets. For touch events, however, the most
up-to-date hover information referred to the previous click because there is no
motion without touching. So the GUI tended to identify the wrong widgets as
click targets.

The patch solved this problem by testing the freshness of the hover information
at the time of the click. If the hover information is older than the click, the
action is deferred until up-to-date hover information becomes available.

Fixes #4398
2022-02-15 10:16:51 +01:00
Norman Feske
cdbb929125 nitpicker: forward Input::Seq_number events
Issue #4398
2022-02-15 10:16:51 +01:00
Norman Feske
a824632d95 menu_view: report input seq number in hover info
Issue #4398
2022-02-15 10:16:51 +01:00
Norman Feske
4dfa7902db os: Input::Event:Seq_number event type
The new event type allows for the propagation of sequence numbers as a means to
validate the freshness of input handling. E.g., an menu-view-based application
can augment artificial sequence numbers to the stream of motion events supplied
to 'menu_view'. Menu view, in turn, can now report the latest received sequence
number in its hover reports, thereby enabling the application to robustly
correlate hover results with click positions.

Issue #4398
2022-02-15 10:16:51 +01:00
Stefan Kalkowski
c99ca21649 rpi: remove drivers for platform, fb and sd_card
Fix #4396
2022-02-15 10:16:51 +01:00
Stefan Kalkowski
00f7819623 rpi_gpio_drv: remove dep from rpi board header
Ref #4396
2022-02-15 10:11:11 +01:00
Stefan Kalkowski
10d7741a26 Add board-specific rpi repo to .gitignore
Ref #4396
2022-02-15 10:11:11 +01:00
Christian Prochaska
f773c46b5d libusb: adapt to changed packet stream blocking semantics
Issue #4390
2022-02-15 10:11:11 +01:00
Norman Feske
ad2c5fe4b4 sculpt: check XML syntax of ingredients
Issue #4369
2022-02-15 10:11:11 +01:00
Norman Feske
a8667a55bd test/framebuffer/intel: use VFS, not of fs session
This patch updates the intel_fb_controller test component to use the VFS
API instead of interacting with an file-system session directly.

Issue #4390
2022-02-15 10:11:11 +01:00
Norman Feske
22cce07ec8 fs_log: remove blocking call of get_acked_packet
This patch replaces formerly blocking packet-stream operations by
the explicit use of 'wait_and_dispatch_io_signal' for blocking.
It also removes a misleading comment that promised a fire-and-forget
behavior whereas the implementation relied on blocking I/O anyway.

Issue #4390
2022-02-15 10:11:11 +01:00
Norman Feske
480c0a7dee base-fiasco: silence recv_and_wait error messages
Errors during IPC receive-and-wait can occur at the server side when
a client is killed. This condition is not an error from the server's
perspective. We used to print a message nevertheless, since the
condition is rather exceptional. However, when printed during the
test-sequence test, the messages interfere with the pattern matching of
the depot_autopilot, flagging the successful test as an error.
2022-02-15 10:11:11 +01:00
Norman Feske
df2e7fa842 vfs_block_file_system: remove Signal_receiver
The VFS block plugin used to depend on the blocking semantics of the
packet stream's 'get_acked_packet'. This patch replaces this dependency
by the use of 'wait_and_dispatch_one_io_signal'. However, in order to
implement this change, the custom instance of a 'Signal_receiver' had to
be removed as well.

To keep this patch as little invasive as possible, it does not touch the
direct use of the block session's packet stream, which should better be
replaced by the 'Block::Connection::Job' API.

Issue #4390
2022-02-15 10:11:11 +01:00
Johannes Schlatow
7aa9cf9b37 uplink_client_base: add handlers for zynq_nic_drv
The zynq_nic_drv follows a zero-copy approach and thus uses the packet
buffers as DMA memory. In order to know when the RX DMA memory can be used
for another packet, a custom ack_avail_handler is needed.
Similarly, packets received from the Uplink session are not copied to a
DMA buffer but to directly passed on as DMA memory. For this purpose,
a a custom packet_avail handler is needed.

genodelabs/genode#4384
2022-02-15 10:11:11 +01:00
Norman Feske
ac691eb229 file_system/util.h: remove packet-stream helpers
The 'read' and 'write' utilities are from a time before the VFS API
as os/vfs.h was available. They rely on the (now removed) blocking
semantics of the packet-stream interface.

The only remaining legitimate use case of the direct interaction with
the file-system session without VFS is the back end of gcov, which needs
a way to exfiltrate the statistical data using a channel that is
independent from the libc or the VFS.

Issue #4390
2022-02-15 10:11:10 +01:00
Norman Feske
0f56e76e7a rom_to_file: use VFS instead of fs session
This patch replaces the former direct use of a file-system session by
the use of the VFS API.

Issue #4390
2022-02-15 10:11:10 +01:00
Norman Feske
84f8305cdf usb_report_filter: use VFS instead of fs session
This patch replaces the direct use of a file-system session via the
'file_system/util.h' helpers by the VFS using the os/vfs.h API. This
makes the component more flexible while removing the dependence from
read and write utilities of file_system/util.h, which happen to rely on
the (now removed) blocking packet-stream semantics.

Issue #4390
2022-02-15 10:10:03 +01:00
Norman Feske
911ff31709 dde_rump: use Block::Connection::Job API
This patch replaces the direct interaction with the packet stream of
the block session by the use of the 'Block::Connection::Job' API,
removing the reliance on blocking packet-stream semantics.

Since I/O signals can now occur during 'Backend::submit', the patch
conditions the periodic calls of 'rump_sys_sync' by taking the backend
state into account.

Issue #4390
2022-02-15 10:10:03 +01:00
Norman Feske
7605101665 fatfs: use Block::Connection::Job API
This patch removes the use of blocking packet-stream calls from the
backend of the fatfs library.

Issue #4390
2022-02-15 10:10:03 +01:00
Norman Feske
2b0e64e061 os: remove blocking semantics from packet stream
Fixes #4390
2022-02-15 10:10:03 +01:00
Norman Feske
59ca8f2489 block_request_stream.run: use valid length value
Since the change "block_tester: limit batching in sequential test", the
sequence test blocks infinitely when encountering a length value smaller
than the block size.
2022-02-15 10:10:02 +01:00
Norman Feske
f7ee1f64a9 block_tester: warn on wrong length argument
When specifying a low value, the tester won't spawn any job but stay
silent. The message helps diagnosing such configuration problems.
2022-02-15 10:10:02 +01:00
Norman Feske
64af1d2d84 test/fs_packet: don't block
This patch takes precautions against the use of blocking packet-stream
operations like 'submit_packet'.

With the change of issue #4388, the ready-to-submit signals are no
longer implicitly handled. Hence, a call of submit_packet to a
saturated submit queue blocks infinitely.

Issue #4390
2022-02-15 10:10:02 +01:00
Norman Feske
7e3828b726 test/fs_packet: coding style 2022-02-15 10:10:02 +01:00
Norman Feske
11622fa038 file_system_session: merge ack and submit sigh
Fixes #4388
2022-02-15 10:10:02 +01:00
Christian Prochaska
2591c61e7d libusb: guard USB session packet allocator
Fixes #4389
2022-02-15 10:10:02 +01:00
Norman Feske
e98760a3d5 cpu_sampler.run: increase timeout
The previous timeout sometimes triggered with nova and foc on x86_32.
2022-02-15 10:10:02 +01:00
Norman Feske
ab0cba8ead base-hw: improve comments in kernel/interface.h 2022-02-15 10:10:02 +01:00
Norman Feske
90c446e565 base-hw: remove throw from ipc_reply_wait
Even though the use of the C++ exception mechanism (and the implicit use
of the cxx heap) is not a problem at the server side, this patch
nevertheless replaces the exception-based return-value handling to make
the code consistent with the ipc_call path.

Issue #3612
2022-02-15 10:10:02 +01:00
Norman Feske
3e4af3a567 base-hw: remove throw from ipc_call code path
This eliminates the dependency of the IPC-call operation from the cxx
heap.

Fixes #3612
2022-02-15 10:10:02 +01:00
Johannes Schlatow
0bb2e61e9e Allow derived classes of Genode::Array
genodelabs/genode#4382
2022-02-15 10:10:01 +01:00
Christian Helmuth
41a579e978 vbox6: fix warnings on disabled assertions 2022-02-15 10:10:01 +01:00
Sebastian Sumpf
299a35d943 libdrm/iris: check if VFS '<gpu/>' is present
On startup check if '/dev/gpu' is present and issue an error in case it
is not.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
cd4d00f31a gpu/intel: remove deadlock during session destruction
* use 'Id_space::apply_any' instead of 'for_each' to destroy session local
  buffer objects
* save session capability in session because 'cap()' is not valid in
  'Session_component' destructor because it was dissolved before calling
  'Root::_destruct_session', the cap is necessary to remove owned
  buffers from the EP

issue #4380
2022-02-15 10:10:01 +01:00
Stefan Kalkowski
7248957553 rpi_fb_drv: avoid alignment fault by own blit func
Fix #4331
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
4cb8c91b08 libdrm/iris: import GPU buffers lazy optimization
Do not import a freshly allocated buffer to all contexts eagerly.
Instead check buffer list in context's 'exec_buffer' call and import
only buffers needed and not present before GPU execution. This leads to
improved performance for applications that use many OpenGL contexts
(e.g., VirtualBox 6).

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
3c97fdbc0e libdrm/mesa/iris: Don't use Genode::Env any more
'vfs_gpu_env' handles this now for all applications.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
a3976f0468 vfs_gpu: offer 'vfs_gpu_env' call
* retrieve Genode::Env from plugin, this way no mesa applications need to
  be changed.
* add 'vfs_gpu' api
* remove when all required functionality is implemented within the plugin.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
b98e07ed34 vbox6: basic 3D support
Implement GLX and X functionality through Mesa's EGL interface. This
requires multiple OpenGL contexts and in turn GEM context support in
libdrm/iris, as implemented in libdrm and intel_gpu_drv.

Update recipes and machine.vbox6 files accordingly,

issue #4380
2022-02-15 10:10:01 +01:00
Christian Helmuth
27883c976c vbox6: 3D support skeleton
files required for VBox6's VMSVGA/VBoxSVGA with 3D accelaration
(accelerate3D="true").

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
c35d2aff45 libdrm/iris: add gem context support
Retrieve multiple GPU sessions from VFS plugin, take advantage of buffer
import/export functionallity in order to implement gem context support.
Multiple contexts share all GPU buffers, but use different GPU sessions
and thus, differnt page tables and hardware contexts.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
7cc1741611 gpu/intel: buffer import/export support
Implement the import/export functionality of GPU buffers.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
a900594978 gpu_session: add import/export of buffers
Add 'export_buffer'/'import_buffer' calls in order to support buffer
sharing between GPU sessions.

Reduce CAP costs for Gpu::Connection from 256 to 32.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
567b9dfa39 libdrm/iris: use VFS/GPU plugin
Synchronize GPU completion by calling 'read' of the vfs_gpu plugin. This
enables pthreads to wait for GPU completions instead of the main EP.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
b3e12dcece vfs_gpu: VFS plugin that handles GPU completions
When a <gpu> node is present in the VFS, the plugin opens a
Gpu::Connection for each open call to the 'gpu' node and installs a
completion signal handler. A read only to the fd returned only comes
back if a completion signal has been received between two read
transctions to the fd.

For now the Gpu::Connections can be retrieved by calling the
'vfs_gpu_connection(unsigned long id)' function. The id can be obtained
using 'stat' on the 'gpu' device and is located in the inode (st_ino)
field of the stat buffer.

issue #4380
2022-01-19 15:01:26 +01:00
Sebastian Sumpf
b7d25636e5 mesa_gpu-iris: iris is linked into mesa already
* remove from library dependency

issue #4380
2022-01-19 15:01:24 +01:00
Sebastian Sumpf
ce409a2438 libdrm/iris: map PPGTT buffers lazy + lseek
* let iris handle buffer management, this implies that BOs are mapped to
  the PPGTT during buffer execution and unmapped by iris later, for this
  to work buffers need to be unmapped when allocating cached BOs
  (vma_free) which requires a patch

* support lseek (drm_lseek for now) for determining object size

issue #4380
2022-01-19 15:01:22 +01:00
Sebastian Sumpf
96ab58691a gpu/intel: PPGTT allocation optimization
Use range allocator as cache for page mappings instead of allocating
from platform driver for each page table.

issue #4380
2022-01-19 15:01:19 +01:00
Josef Söntgen
94405e9280 libdrm/iris: remove tiling short-cut
Instead of ignoring the request, we store the tiling information and
apply them when the buffer is mapped via 'MMAP_GTT'.

issue #4380
2022-01-19 15:01:11 +01:00
Josef Söntgen
e77a54614d libdrm/iris: introduce session resource accounting
Track RAM and CAP resource usage locally and upgrade the session quota
on demand.

issue #4380
2022-01-19 15:01:05 +01:00
Josef Söntgen
83cc36ef0b gpu/intel: account session resources
Account RAM and CAP resources for GPU sessions and trigger client
upgrades before allocating resources at the multiplexer. This prevents
the multiplexer from running out of resources.

issue #4380
2022-01-19 15:00:47 +01:00
Alexander Boettcher
3a39cb86e9 nova: read out more accurate tsc frequency
on newer CPUs.

Fixes #4336
2022-01-19 14:16:53 +01:00
Martin Stein
94121e7cd7 uplink_client_base: no deref of invalid connection
Imagine receiving the signal for an available TX ack or an available RX packet
at the Uplink connection but a later received signal for a link-state change
(to link state "down") at the same connection is handled first and destructs
the Uplink connection before the handling of the former signals. In this case,
the methods 'Uplink_client_base::_conn_tx_handle_ack_avail' and
'Uplink_client_base::_conn_rx_handle_packet_avail' must be guarded against an
unconstructed '_conn' member, but they weren't so far.

Fixes #4384
2022-01-19 14:13:48 +01:00
Martin Stein
83626b18f0 uplink_client_base: remove unused code
So far, the generic Uplink connection code considered NIC drivers to transmit
connection RX packets in three different manners. Most of the drivers follow
the "normal" way of transmission with only one driver callback from generic
code. The monolithic USB NIC-driver, however, used to send in a "burst" mode
that required a dedicated path with multiple driver callbacks in the generic
code. And then there were drivers that had a fully custom function for doing
transmissions.

Also for handling connection TX acks, there was a "normal" and a
"custom handler" way.

Today, all NIC drivers in the Genode repos and the Genode-World repo follow the
"normal" way. Therefor, the unused code can be removed.

Ref #4384
2022-01-19 14:13:38 +01:00
Christian Helmuth
65284b29f8 depot: update recipe hashes 2022-01-19 12:38:13 +01:00
Christian Helmuth
36b46f30f5 Add board-specific allwinner repo to .gitignore 2022-01-19 12:38:13 +01:00
Norman Feske
388a29b299 Road map for 2022 2022-01-19 12:38:13 +01:00
Sebastian Sumpf
f16c1b5ea8 usb_host: handle full packet stream correctly
Thanks to Peter for the fix!

Fixes #4383
2022-01-19 12:38:13 +01:00
Christian Helmuth
a80b2ee6e2 Increase cap quota of drivers_nic-imx6/7 for sel4 2022-01-19 12:38:13 +01:00
Christian Helmuth
02eea3ecf0 More robust output parsing in ieee754 test
Only parse output of the test programs one-by-one and ignore log
messages from other components not starting with '[init -> test$number]'.

Fixes sporadic failures on KERNEL=sel4 due to the following warning from
core.

  Warning: flush page table entries - mapping cache full - PD: init -> test1
2022-01-19 12:38:13 +01:00
Christian Prochaska
d3adadf4cf virtualbox6: adapt watchdog timer interval dynamically
Issue #4381
2022-01-19 12:38:13 +01:00
Christian Prochaska
95d9c15607 libc vfs: open OSS 'info' file only once
Issue #4372
2022-01-19 12:38:13 +01:00
Christian Prochaska
8ced0f184e vfs: add 'with_xml_file_content()' and 'with_raw_file_content()'
Fixes #4372
2022-01-19 12:38:13 +01:00
Christian Prochaska
8fd2847a48 Audio_out::Stream: initialize members
Issue #4373
2022-01-19 12:38:12 +01:00
Christian Helmuth
b7cf316f24 mesa: exclude .git directory from src archive 2022-01-19 12:38:12 +01:00
Christian Prochaska
2143bea176 virtualbox6: add 'Audio_in' session requirement to pkg
To actually receive audio input in a particular VM, it also
needs to be enabled in the vbox file:

<AudioAdapter controller="HDA" driver="OSS" enabled="true"
              enabledOut="true" enabledIn="true"/>

Fixes #4377
2022-01-19 12:38:12 +01:00
Christian Prochaska
3f656bcf84 black_hole: provide 'Audio_in' and 'Capture' sessions
Fixes #4376
2022-01-19 12:38:12 +01:00
Christian Prochaska
33402e407f vfs_oss improvements
Fixes #4375
2022-01-19 12:38:12 +01:00
Christian Helmuth
a1cac9b837 Fix warnings in test/audio_in 2022-01-19 12:38:12 +01:00
Christian Prochaska
7f8a94bb70 Audio_in::Stream: add 'queued()' function
Fixes #4374
2022-01-19 12:38:12 +01:00
Christian Prochaska
7b40ccea85 audio_in: fix compile errors with strict warnings enabled
Fixes #4373
2022-01-19 12:38:12 +01:00
Norman Feske
3ba316b015 base-hw: declare build artifact for core 2022-01-19 12:38:12 +01:00
Stefan Kalkowski
bed7f13008 create_builddir: add rpi and allwinner repos 2022-01-19 12:38:12 +01:00
Josef Söntgen
713c841965 vfs/rump: enable update mtime
Although support was added some time ago (#1784) the commit missed
executing the code from the 'Vfs::File_system' interface.

Fixes #4371.
2022-01-19 12:38:12 +01:00
Stefan Kalkowski
426f52068b hw: avoid 'cps' instruction in ARM hyp mode
On some boards or emulators a CPU might be executing in hyp mode
when entering Genode's bootstrap code. In that mode the 'cps' instruction
is not defined. Therefore, we change the way the boot cpu is identified.

Ref #3415
2022-01-19 12:38:12 +01:00
Stefan Kalkowski
6bd7f167a4 hw: remove rpi1/3 board support
The code moved to https://github.com/skalk/genode-rpi

Ref #4363
2022-01-19 12:38:12 +01:00
Tomasz Gajewski
f79d5d640f hw: irq controller and timer improvements for Rpi
* renamed rpi pic to Bcm2835_pic
* renamed rpi3 pic to Bcm2837_pic
* added bcm2837 control for setting prescaler value (to fix timer_accuracy)
* changed handling of all interrupts for rpi3 by cascading to bcm2835 pic
* rpi3 irq controller base address made consistent with rpi
* added usb controller memory region for pic on rpi3 (for SOF interrupts)

Ref #3415
2022-01-19 12:38:12 +01:00
Stefan Kalkowski
7db602faec os: deprecate platform API for x86, rpi, imx53
* Move platform APIs to "legacy/" subdirectory
* Rename old pc, imx53, and rpi platform_drv
  to "legacy_*_platform_drv"

Fix #4359
2022-01-19 12:38:12 +01:00
Norman Feske
622ddb5b49 base-linux: declare build artifact for lib/ld
This enables the run tool's new [build_artifacts] function to return the
correct binary name for 'build lib/ld'.
2022-01-19 12:38:11 +01:00
Norman Feske
813731a1e0 base-linux: permit rt_sigreturn on 64-bit ARM 2022-01-19 12:38:11 +01:00
Norman Feske
ab9b75236d base-linux: remove residual use of 'which' command
This is a follow-up commit for "Remove dependency from 'which' utility".

Issue #4319
2022-01-19 12:38:11 +01:00
Sergey Platonov
ef130a027b libc: fix type handling on socket creation
The socket type (in the lower bits) maybe ORed with SOCK_CLOEXEC and
SOCK_NONBLOCK options (in the higher bits). Currently, supported values
are SOCK_STREAM (1) and SOCK_DGRAM (2), so just take the lower 2 bits.

This fixes treating `SOCK_STREAM` sockets as UDP if additional flags
were set.

Fixes #4370
2022-01-19 12:38:11 +01:00
Norman Feske
b723b11b30 Modularize Sculpt OS image creation
This patch equips Sculpt with the ability to customize the system image
in very flexible ways.

All customizable aspects of the image have been relocated from the
former sculpt.run script and the accompanied gems/run/sculpt/ directory
to a new location - the sculpt/ directory - which can exist in any
repository. The directory at repos/gems/sculpt/ serves as reference.

The sculpt directory can host any number of <name>-<board>.sculpt files,
each containing a list of ingredients to be incorporated into the
Sculpt system image. The <name> can be specified to the sculpt.run
script. E.g., the following command refers to the 'default-pc.sculpt'
file:

  make run/sculpt KERNEL=nova BOARD=pc SCULPT=default

If no 'SCULPT' argument is supplied, the value 'default' is used.

A .sculpt file refers to a selection of files found at various
subdirectries named after their respective purpose. In particular, There
exists a subdirectory for each file in Sculpt's config fs, like
nitpicker, drivers... The .sculpt file selects the alternative to use
by a simple tag-value notation.

  drivers: pc

The supported tags are as follows.

*Optional* selection of /config files. If not specified, those files are
omitted, which prompts Sculpt to manage those configurations
automatically or via the Leitzentrale GUI:

  fonts
  nic_router
  event_filter
  wifi
  runtime
  gpu_drv

Selection of mandatory /config files. If not specified, the respective
'default' alternative will be used.

  nitpicker
  deploy
  fb_drv
  clipboard
  drivers
  numlock_remap
  leitzentrale
  usb
  system
  ram_fs

Furthermore, the .sculpt file supports the optional selection of
supplemental content such as a set of launchers.

  launches: nano3d system_shell

Another type of content are the set of blessed pubkey/download files
used for installing and verifying software on target.

With the new version, it has become possible to supply a depot with the
the system image. The depot content is assembled according to the 'pkg'
attributes found in launcher files and the selected deploy config.
The resulting depot is incorporated into the system image as 'depot.tar'
archive. It can be supplied to the Sculpt system by mounting it into the
ram fs as done by the 'ram_fs/depot' configuration for the ram fs.

It is possible to add additional boot modules to the system image. There
are two options.

  build: <list of targets>

This tag prompts the sculpt.run script to build the specified targets
directly using the Genode build system and add the created artifacts
into the system image as boot modules.

  import: <list of depot src or pkg archives>

This tag instructs Sculpt to supply the specifid depot-archive content
as boot modules to the system image. This change eliminates the need for
board-specific pkg/sculpt-<board> archives. The board-specific
specializations can now be placed directly into the respective .sculpt
files by using 'import:'.

To make the use of Sculpt as testbed during development more convenient,
the log output of the drivers, leitzentrale, and runtime subsystems
can be redirected to core using the optional 'LOG=core' argument, e.g.,

  make run/sculpt KERNEL=linux BOARD=linux LOG=core

The former pkg/sculpt-installation and pkg/sculpt-installation-pc
archives have been replaced by pkg/sculpt_distribution-pc, which
references the generic pkg/sculpt_distribution archive. Those pkgs are
solely used for publishing / distribution purposes.

Fixes #4369
2022-01-19 12:38:11 +01:00
Norman Feske
fcc96a2c46 tool/run: way to obtain list of build artifacts
The new function 'build_artifacts' returns a list of artifacts created
by the Genode build system. The list can be supplied as argument to
the 'build_boot_image' function.

Note that the list covers only program targets and shared libraries.
Other artifacts created as side effects of custom rules are not covered.

Fixes #4368
2022-01-19 12:38:11 +01:00
Norman Feske
0eee5d5fc1 mk: record build artifacts in progress.log
Issue #4368
2022-01-19 12:38:11 +01:00
Norman Feske
93d431a831 tool/run: skip build if build-target list is empty
This patch prevents the run tool from issuing 'make' in the build
directory if no build targets are specified, which prompts the build
system to build everything.
2022-01-19 12:35:49 +01:00
Norman Feske
410cd9cfc4 run: avoid superfluous call of depot auto update
If only versioned archives are supplied to a depot function like
'create_tar_from_depot_binaries', the depot/create tool is called
with zero arguments, resulting in a help message. The patch detects
this case and skips the call.
2022-01-19 12:35:49 +01:00
Norman Feske
48f0307234 create_builddir: remove 'linux' option
Since unifying the build directories accross architectures, the special
case of the 'linux' platform is no longer needed. Linux can be targeted
from regular CPU-architecture-specific build directories via:

  KERNEL=linux BOARD=linux

Fixes #4366
2022-01-19 12:35:49 +01:00
Norman Feske
88ca8d1a72 base: fix potential memory leak in allocator_avl
When used by the 'Allocator_avl' the slab allocator's backing store is
dynamically disabled and re-enabled while adding/freeing ranges.
However, during those operations, slab entries can be freed. This,
in turn, can result in the release of a slab block (when the freed slab
entry happens to be the last entry of the block). In this corner case,
'Slab::_release_backing_store' operation has no effect because no
backing-store allocator is set. As a result, the block is no longer
referenced but not physically freed.

The patch fixes the problem by skipping '_free_curr_sb' whenever
no backing store is defined. So the completely empty block remains
in the working set.

Thanks to Peter for reporting and fixing this issue!

Fixes #4367
2022-01-19 12:35:49 +01:00
Tomasz Gajewski
3bbe7d9d07 tool/depot/create: typo fix 2022-01-19 12:35:49 +01:00
Christian Prochaska
8e252f79f8 Remove mutex from 'Genode::Trace_output'
Fixes #4356
2022-01-19 12:35:49 +01:00
Christian Helmuth
e6c5e5e8b9 dde_bsd: update mirror URL
OpenBSD 6.6 disappeared from fau.de, so we switch to ftp.openbsd.org.
2022-01-19 12:35:49 +01:00
Norman Feske
ce53d88235 sculpt: support base-linux
- Consider 'sdl' as source of input events in the event-filter
  configuration as generated by the sculpt manager

- Supply an artificial 'platform_info' ROM as requested by the
  sculpt manager to obtain the affinity-space information

- Substitute 'fs_rom' for 'cached_fs_rom' as a workaround for the
  lack of support for managed dataspaces on Linux

Fixes #4362
2022-01-19 12:35:49 +01:00
Norman Feske
fd105e16aa tool/run: add install_boot_module function
This function largely alleviates the need to manually open/close files
in run scripts such as sculpt.run.
2022-01-19 12:35:49 +01:00
Alexander Boettcher
46c9927294 foc: disable thread execution time readout
Issue #4357
2022-01-19 12:35:49 +01:00
Alexander Boettcher
4ac553e5ff cpu_balancer.run: disable testing on foc
Due to some kernel issue the test will not finish, see #4357

Fixes #4357
2022-01-19 12:35:49 +01:00
Norman Feske
f1b46c3205 Move depot keys to repos/gems/sculpt/depot
This change keeps the version-controlled 'pubkey' and 'download' files
separate from files generated via depot/create or downloaded via
depot/download. So one can remove the entire depot/ directory without
interfering with git.

Furthermore, depot keys can now be hosted in supplemental repositories
independent from Genode's main repository.

Fixes #4364
2022-01-19 12:35:49 +01:00
Norman Feske
03cbf435e5 base-linux: increase global cap limit to 20000
This is a prerequisite for executing sculpt.run on Linux.

Issue #4362
2022-01-19 12:35:49 +01:00
Norman Feske
2134792e4c tool: remove obsolete download_sigver/hashver
Those scripts are a left-over from the time before the introduction of
the tool/ports mechanism.
2022-01-19 12:35:49 +01:00
Christian Prochaska
5fed1641a4 virtualbox6: reduce 'Vm_connection' priority
Fixes #4361
2022-01-19 12:35:49 +01:00
Piotr Tworek
d610f9f4f1 Fix some signed/unsigned implicit conversions.
Fix some trivial cases where the signedness of the constant value does
not match the signedness of type the code expects to see. GCC can be
asked to warn about those by passing Wsign-covnersion flag.

Issue #4354
2022-01-19 12:35:48 +01:00
Piotr Tworek
f2dab083f6 os: Properly initialize File_system::Watch_handle.
This comes up when building the code with clang 13. It happens due to
recently enabled Wconversion warning, which in case of clang also
enables implicit-int-conversion warning. The warning reads:

  fs_file_system.h:937:44: error: higher order bits are zeroes after
  implicit conversion [-Werror,-Wimplicit-int-conversion]
                        ::File_system::Watch_handle fs_handle { -1U };
                                                    ~~~~~~~~~   ^~~

This can be fixed by properly specifying fs_handle value to be of
unsigned long type.

Issue #4354
2022-01-19 12:35:48 +01:00
Piotr Tworek
27b798fa4f base: Make int to access_t conversion explicit.
As far as I can tell this is not raised by any released GCC versions.
Clang 13 on the other hand warns about it due to implicit-int-conversion
warning which is automatically enabled together with Wconversion. The
problem is relatively simple, shifting access_t value does not always
produce result which is also of access_t type. For example, if access_t
is uint16_t, shifting it will produce integer result. This can be
observed even with GCC. Building the following C++ example will fail:

  #include <type_traits>
  #include <stdint.h>

  int test() {
      uint16_t a = 0xabcd;
      static_assert(std::is_same_v<decltype(a<<1), uint16_t>);
      return 0;
  }

Changing uint16_t in the static_assert to int, will allow the code to
build.

Make such int to access_t implicit conversion explicit to allow the code
to be compiled with both GCC and clang.

Issue #4354
2022-01-19 12:35:48 +01:00
Alexander Tormasov
b3f8b49873 mk: add golang as target for compilation
Fixes #4358
2022-01-19 12:35:48 +01:00
Alexander Boettcher
507e5ac776 vmm_x86: fix sporadic test failures on x86_32 nova
Explicitly configure wanted exits instead of using the "random" primary
ctrl value.
2022-01-19 12:35:48 +01:00
Sergey Platonov
81acd46518 libc: nameserver file in configured socket directory
The path for the `nameserver` file was fixed to `/socket/nameserver`.
So, if the socket directory was configured differing from `/socket`, DNS
did not work. Now the default path for the `nameserver` takes into
account the path configured in the `socket` libc config attribute.

Fixes #4318
Fixes #4343
2022-01-19 12:35:48 +01:00
Johannes Schlatow
2e1a1c199e lwip plugin: support large backlog values
iperf, e.g., uses INT_MAX as backlog argument to the listen() call

Fixes genodelabs/genode#4341
2022-01-19 12:35:48 +01:00
Sebastian Sumpf
79e69a5549 nic_loopback: Adjust to packet allocator changes
Remove '_expected_offset' check on round trip test from RX packet,
because allocators between RX/TX can have different allocation
strategies. Rely on 'pattern' check for RX packets only.

In loopback server alloc size must match actual packet size.

issue #4312
2022-01-19 12:35:48 +01:00
Josef Söntgen
94a7c32fb4 libports: remove FUSE fs run script snippet
This file is only needed by the FUSE-based file system servers in
the world repository.

Fixes #4353.
2022-01-19 12:35:48 +01:00
Christian Helmuth
18e00c7772 depot_autopilot: enable riscv 2022-01-19 12:35:48 +01:00
Sebastian Sumpf
08c1e69d71 nic/packet_allocator: align allocations to 2 bytes
Override 'try_alloc/free' because ethernet frame headers are 14 bytes
(src/dst mac (12) + ethertype (2)) causing the IP header to be 2 byte
aligned, leading to problems on platforms that require load/store
operations to be naturally aligned when reading, for example, 4 byte IP
addresses. Therefore, we align the allocation to 2 bytes, so the IP
header is aligned to 4.

issue #4312
2022-01-19 12:35:48 +01:00
Norman Feske
5611fd2355 depot: update recipe hashes 2021-12-17 15:06:38 +01:00
Norman Feske
d658648a09 test/block_cache: tweak RAM quota for base-nova 2021-12-17 15:06:38 +01:00
Norman Feske
3cc6df3116 base: tighten affinity handling
This patch improves the robustness of the CPU-affinity handling.

- The types in base/affinity.h received the accessors
  'Location::within(space)' and 'Affinity::valid', which alleviates
  the fiddling with coordinates when sanity checking the values,
  in init or core.

- The 'Affinity::Location::valid' method got removed because its
  meaning was too vague. For sanity checks of affinity configurations,
  the new 'within' method is approriate. In cases where only the x,y
  values are used for selecting a physical CPU (during thread creation),
  the validity check (width*height > 0) was not meaningful anyway.

- The 'Affinity::Location::from_xml' requires a 'Affinity::Space'
  as argument because a location always relates to the bounds of
  a specific space. This function now implements the selection of
  whole rows or columns, which has previously a feature of the
  sandbox library only.

- Whenever the sandbox library (init) encounters an invalid affinity
  configuration, it prints a warning message as a diagnostic aid.

- A new 'Affinity::unrestricted' function constructs an affinity that
  covers the whole affinity space. The named functions clarifies
  the meaning over the previous use of the default constructor.

- Core's CPU service denies session requests with an invalid
  affinity parameter. Previously, it would fall back to an
  unrestricted affinity.

Issue #4300
2021-12-17 15:06:38 +01:00
Christian Helmuth
e21ca736b8 fetchurl: remove duplicate from used_apis in recipe 2021-12-17 15:06:38 +01:00
Christian Helmuth
a80a22c819 recipes: don't declare implemented API in used_apis
Prevents "*** detected duplicates in REPOSITORIES" on recipe build.
2021-12-17 15:06:38 +01:00
Norman Feske
4f820cf1e5 prepare_ports: prevent execution of automake
This patch discharges the dependency of Makefile.in from Makefile.am
files whenever both files are present in a downloaded archive.

Being based on make, the trigger of running automake is based on the
timestamps for the extracted archive content. However, since we reset
the timestamps (via 'tar -m') at extraction time, no assumptions about
the timestamp relations between the extracted files can be made. In the
event automake is triggered, we are faced with the tool dependency from
a specific automake version on the host.

The patch enforces the unconditional use the 'Makefile.in' version
supplied by the archive.

Fixes #4350
2021-12-17 15:04:49 +01:00
Christian Helmuth
c8a3497662 build: detect duplicates in REPOSITORIES 2021-12-17 15:04:49 +01:00
Sebastian Sumpf
7dcd9a9f8d vfs_trace: remove Trace::Session::subject_info
issue #4349
2021-12-17 15:04:49 +01:00
Norman Feske
d370f56a77 Remove obsolete Trace::Session::subject_info RPC
Issue #3610
Fixes #4349
2021-12-17 15:04:49 +01:00
Sebastian Sumpf
43da93bb6f noux: add RISC-V gnu build support
issue #4312
2021-12-17 15:04:49 +01:00
Stefan Kalkowski
6dbdb966fc virtio: remove bitfield in Index template
Eliminates note of GCC about bitfield as parameter semantic change.

Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
609af0037f liblzma: silent some warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
f6dd1c96f6 libdrm: silent warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
793a667872 gmp: silent warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
1779cc7a2f freetype: silent some warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
86df5b1285 jitterentropy: fix if condition, fix warning
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
f5193874c8 e2fsprogs: eliminate warnings, fix strncat bug
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
2c569953d0 base: replace ELF flags bitfield with booleans
Instead of using a bitfield for storing rwx and skip boolean value,
take a boolean instead. This fixes a note giv]en by GCC 9.1 about
changes semantics of bitfields given as parameter by value on ARM.

Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
b11731d6b2 dde_linux: silent warning in fork
When initializing a task_struct within the lx_emul library
we have to temporarily use a big object on the stack.

Ref #4344
2021-12-17 15:04:48 +01:00
Josef Söntgen
f9e0548d0c sculpt_manager: integrate GPU device access
Similar to other devices allow for selecting a graphics device as
well. This is currently only useful on iMX8-based systems like
iMX8Q-EVK and MNT Reform2 where the driver is explicitly started
from a pkg.

Fixes #4342.
2021-12-17 15:04:48 +01:00
Piotr Tworek
1a9fad4022 virtio_nic: Tweak default buffer sizes.
After VirtIO::Queue refactoring buffers no longer share the same
dataspace as VirtIO rings. This makes optimal buffer calculations a lot
easier. In this case 64 buffers 2kB each will need precisely 128kB of
RAM. Previous value of 2016 will just waste 768b.

Fixed #4347
2021-12-17 15:04:48 +01:00
Piotr Tworek
643747b912 os: Refactor VirtIO::Queue implementation.
The key changes in this patch are:
* Buffer allocation is moved into a separate Buffer_pool helper. The
  implementation of the buffer allocation strategy does not change.
  The helper allocates a single RAM dataspace and splits it in multiple,
  equally sized chunks.
* Management of main descriptor ring is enacapsulated in Descriptor_ring
  helper class.
* Use separate RAM dataspaces for descriptor rings and buffers.
  Previously both of them were packed into a single dataspace. This
  might have been more RAM efficient, but IMO it made the code uglier and
  harder to understand.
* All of the VirtIO::Queue members are now initialized on the class member
  initializer list. This is possible due to previously listed changes.
* Since all VirtIO::Queue members are initalized on member initalizer
  list, some additional ones can be marked as const, ex _avail, _used ring
  pointers.
* Move descriptor writing code into a common method used by both
  write_data and write_data_read_reply members. This avoids some code
  duplication between those methods.
* Get rid of request_irq argument that most public VirtIO::Queue methods
  accept. None of the existing drivers use it and I doubt this will
  change any time soon.
* Use Genode namespace by default in Virtio.

This patch also fixes at least one bug that I discovered while working
on VirtIO block device driver. Namely, when chaining descriptors only the
first descriptor in the chain should be exposed in the available ring.

Issue #4347
2021-12-17 15:04:48 +01:00
Norman Feske
aaf9e992da run: remove residual use of 'which' command
This is a follow-up commit for "Remove dependency from 'which' utility".

Thanks to John Karcher for reporting.

Fixes #4319
2021-12-17 15:04:48 +01:00
Christian Helmuth
e4ee30abf1 Add board-specific repos to .gitignore 2021-12-17 15:04:48 +01:00
Sebastian Sumpf
75509d77b5 base-hw: Remove 'riscv_qemu' and move to 'genode-riscv'
issue #4312
2021-12-17 15:04:48 +01:00
Sebastian Sumpf
0fc2db50f0 ieee754: add test for riscv
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
ee5d300f72 stdcxx: riscv support
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
a4d67c3262 libm: riscv support
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
7c976a83e0 libc: riscv support
libc-gen, libc-setjmp, task startup

issue #4312
2021-12-17 15:04:47 +01:00
Norman Feske
890842dce2 base-hw/lib/mk/spec/cortex_a8/core-hw.inc (usb_armory) 2021-12-17 15:04:47 +01:00
Norman Feske
63f78b6255 ports: avoid implicit conversions
Issue #23
2021-12-17 15:04:47 +01:00
Norman Feske
dea467f692 libports: avoid implicit conversions
Issue #23
2021-12-17 15:04:47 +01:00
Norman Feske
8a1675e12e gems: avoid implicit conversions
Issue #23
2021-12-17 15:04:46 +01:00
Norman Feske
5bd8fa9678 dde_linux: avoid implicit conversions
Issue #23
2021-12-17 15:04:45 +01:00
Norman Feske
1aa4f29300 demo: avoid implicit conversions
Issue #23
2021-12-17 15:04:45 +01:00
Norman Feske
04cf6ea3ab os: avoid implicit conversions
Issue #23
2021-12-17 15:04:45 +01:00
Norman Feske
03047009b1 base: avoid implicit conversions
This patch is a prerequisite for compiling the code with
the warnings -Wconversion enabled.

Issue #23
2021-12-17 15:04:44 +01:00
Norman Feske
c79a59655d Add -Wconversion to strict build mode 2021-12-17 15:04:43 +01:00
Johannes Schlatow
b1bbd72e84 net: fix tail size calculation in Ethernet_frame
The const-variant of the data() method contained an erroneous
calculation of the tail size. This led to the size guard throwing
exceptions when trying to parse TCP packets that only contained the
TCP header.

Fixes genodelabs/genode#4340
2021-12-17 15:04:43 +01:00
Norman Feske
162ddb1fdb virtio: fix len calculation
Thanks to Piotr Tworek for the fix and his explanation as follows:

The basic idea is to try to fit payload data into the descriptor used to
send the header. If there is no payload, or the payload fits exactly
into the remaining space in the header decriptor, len should be 0 and
only one descriptor should be used. In such case the "next" and "flags"
members of the descriptor structure should be set to 0.

In case there is some extra payload data to send, but its size is
bigger than the remaining free space in the descriptor used to send the
header, len should contain the remaining size of the payload that
can't be sent via the header descriptor. The code will then chain
additional descriptors to handle this remainder.

With the len variable shadowing, the code will never queue the remaining
data.

Issue #4327
2021-12-17 15:04:43 +01:00
Stefan Kalkowski
6cc6047962 platform_drv: introduce clocks, power, reset
Share datastructures for clock, power and reset related configurations
per device. In the generic platform driver component these structures
are kept empty. Driver derivates can fill the clocks settings, power and
reset switches with life. The former Driver::Env gets removed.

Fix #4338
2021-12-17 15:04:39 +01:00
Stefan Kalkowski
f11d2b5b54 autopilot: automated stress test for platform_drv
Fix #4330
2021-12-17 14:56:53 +01:00
Stefan Kalkowski
132e4fe815 platform_drv(arm): robust re-configuration support
This change of the inner working of the platform driver for ARM allows
clients to have permanent open sessions, as long as a policy node matches
the client. If devices disappear from the policy resp. from the set of
available devices (hotplug), the devices ROM of the session gets updated,
and a corresponding device session gets closed. If the device remains
untouched in the configuration but other devices appeared/disappeared, the
device session is not affected.

Ref #4330
2021-12-17 14:56:46 +01:00
Norman Feske
6d231597b4 allocator_avl.h: remove debug feature 2021-12-02 10:03:26 +01:00
Norman Feske
a0a1f6455a base/string.h: avoid fallthrough cases 2021-12-02 10:02:48 +01:00
Christian Helmuth
4188427596 version: 21.11 2021-11-30 14:34:09 +01:00
Norman Feske
ea6f90ec17 News item for version 21.11 2021-11-30 14:32:17 +01:00
Norman Feske
c528cd7819 Release notes for version 21.11 2021-11-30 14:32:17 +01:00
Christian Helmuth
92b7be4d11 depot: update recipe hashes 2021-11-30 12:08:54 +01:00
Christian Helmuth
13dab699b1 base: invalidate entire range on VM-session detach
The requested guest-physical memory range may comprise multiple attached
dataspace regions, which must all be detached. This is not required for
the current vbox5 implementation, but for vbox6 as the current API
suggests these semantics.

This commit can be seen as intermediate fix as a real fix should change
the API to prevent long-running detach loops in core that may lock out
requests by other components.
2021-11-29 15:11:53 +01:00
Stefan Kalkowski
7eb3da71b5 base-hw: check managing_system property for SMC
* When issuing a secure-monitor-call on behalf of a PD session client
  first check the permission via the 'managing_system' property.

Fix #4321
2021-11-29 15:11:53 +01:00
Stefan Kalkowski
14de84fae6 base: be more restrictive with 'managing_system'
* Only give managing_system permission when all parent nodes of the
  corresponding component agree in doing so.
* Move the physical memory constrains heuristic from sandbox library to core

Fix #4335
2021-11-29 15:11:53 +01:00
Johannes Schlatow
916683b6d6 platform_drv(arm): fix cap and memory leaks
* Track all caps and ram quotas of the sub-sessions properly
* Release DMA buffers, it is not done implicitely when destroying
  the Constrained_ram_allocator
* Do not replenish quota before really releasing memory from
  the allocator

Issue #4330
2021-11-29 15:11:53 +01:00
Johannes Schlatow
e256969489 platform_drv(arm): fix destruction order
The Session_component must be destroyed before updating the device
model because the Session_component must also release all previously
acquired devices. If the device model is updated before, the devices
might have been removed.

Issue #4330
2021-11-29 15:11:53 +01:00
Johannes Schlatow
7a2826a2fe base: fix use after free in Genode::Heap
Fixes genodelabs/genode#4334
2021-11-29 15:11:53 +01:00
Alexander Boettcher
45cebd774d cpu_balancer: avoid dynamic policy allocation
Pre-allocate all possible type of policy objects as part of the thread meta
state to avoid increased memory consumption due to different policy object
sizes. The cpu_balancer accounts the memory per client and can't forward
potentially occurring out-of-ram exceptions during config-ROM update phases.

Fixes #4333
2021-11-29 15:11:53 +01:00
Alexander Boettcher
1f58b05255 cpu_balancer: limit mem increase on config update
The commits avoids reading in and allocating memory for all potentially
threads, which are potentially currently not existent (but configured in the
policy beforehand). Instead the policy is read in and evaluated when a thread
is created and policy changes are solely applied to existing/running threads.
By this the commit avoids the increase of memory consumption during the
evaluation of policies during config ROM updates.

Issue #4333
2021-11-29 15:11:53 +01:00
Piotr Tworek
30b3ad218f virt_qemu: Use VirtIO fb driver instead of ramfb.
This driver should be better suited for VirtIO based board like
qemu_virt.
2021-11-29 15:11:53 +01:00
Piotr Tworek
7c1888644a os: Add VirtIO framebuffer driver.
This implements the necessary bits to provide 2D framebuffer support on
top of VirtIO GPU device as implemented in Qemu. I don't know if any
other implementation of this specific device exists.

Compared to the ramfb driver which already exists in Genode Virtio FB driver
has one major benefit. It allows Qemu window to be dynamically resized at
runtime. The driver will treat this as resolution change and act accordingly.
Ramfb driver can currently only use the hardcoded 1024x768 screen size. Changing
screen resolution might not sound like a big deal, but it is rather useful to
run Genode on Qemu in full screen mode.
2021-11-29 15:11:53 +01:00
Piotr Tworek
2ec9e69fd4 os: Add support for reading VirtIO responses.
Some more advanced devices like VirtIO GPU do expect they can receive
responses to VirtIO commands they issue via VirtIO queue. Such responses
are not sent via a separate device writeable queue. Instead the driver
is expected to queue some additional descriptors and buffers which the
device can then use to provide the reply.

This patch adds support for such write-data-read-response opeartion to
Genode VirtIO::Queue implementation. The implementation is pretty simple
and does not support any fancy features like receiving the response
asynchronously. Instead the operation will use caller provided callback
to wait for the device to process the command. Once this callback
returns the write-data-read-response VirtIO::Queue function will invoke
another callback passing received response as argument.
2021-11-29 15:11:53 +01:00
Christian Helmuth
0bb0ac079a sculpt: version 21.11 2021-11-29 15:11:53 +01:00
Josef Söntgen
fcc236d906 libports: add mesa_gpu-etnaviv recipe
Similar to the existing 'mesa_gpu' pkgs add one for 'etnaviv'
as well.

Issue #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
17da7c88d0 import-libdrm: fix building etnaviv as recipe
Make sure all needed headers are found when building via depot.

Issue #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
4d93187d31 libdrm: introduce Gpu session for etnaviv
* The Gpu session back end translates all DRM API requests of the
  client into matching Gpu session operations.

* Enable ioctl for etnaviv

Fixes #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
645e51dc1d gpu: add information for etnaviv driver
Mesa queries information about the underlying device and this header
denotes the layout of the information. It is also used by the driver
itself to populate the 'info_dataspace'.

Issue #4329.
2021-11-29 15:11:52 +01:00
Josef Söntgen
8155505b41 mesa/etnaviv: guard unmapImage call
We may call this function only in case mapImage was successful.

Issue #4329.
2021-11-29 15:11:52 +01:00
Josef Söntgen
d39af2206c mesa_gpu-etnaviv: etnaviv already part of mesa
Since the parts of the 'etnaviv' library are already part of the
'mesa.lib.so' that is normally loaded along-side remove the
duplication here.

Issue #4329.
2021-11-29 15:11:52 +01:00
Norman Feske
133d21ad38 event_filter: add touch-click filter
This filter bridges the gap between a touchscreen driver, which
generates raw touch events and traditional GUI applications that expect
a pointer (absolute motion, press/release of the left mouse button).

Fixes #4332
2021-11-29 15:11:52 +01:00
Norman Feske
09d020508c depot: recipes for pin-control/state session APIs
Issue #4315
2021-11-29 15:11:52 +01:00
Norman Feske
dc39a8db62 base: introduce Allocator::try_alloc
This patch changes the 'Allocator' interface to the use of 'Attempt'
return values instead of using exceptions for propagating errors.

To largely uphold compatibility with components using the original
exception-based interface - in particluar use cases where an 'Allocator'
is passed to the 'new' operator - the traditional 'alloc' is still
supported. But it existes merely as a wrapper around the new
'try_alloc'.

Issue #4324
2021-11-29 15:11:52 +01:00
Christian Helmuth
9591e6caee vbox6: CPU halt/wakeup via RTSEMEVENTMULTI
The former use of Pthread conditionals did not cover the corner case of
early wakeups just before halting the CPU. These wakeups were simply
lost which resulted in sporadic halts of about 500 ms (the maximum timeout
of all halts in VirtualBox). RTSEMEVENTMULTI preserves early wakeups
and effectively prevents the CPU from halting.

Additionally, we now wakeup the target CPU on VMMR0_DO_GVMM_SCHED_POLL
and, thus, mimic the behavior of the original implementation slightly
better,

Slightly related to #4313
2021-11-29 15:10:53 +01:00
Johannes Schlatow
a65807ff08 rom_filter: optionally skip top-level node
Since the top-level node of the output ROM is always generated by the
rom_filter, there is no way to pass-through the content of an input ROM
without wrapping in an addition XML node.

genodelabs/genode#4326
2021-11-29 15:10:53 +01:00
Josef Söntgen
059c7ed74a dde_linux: prevent debug message in memory backend
The Allocator_avl back end will display diagnostic messages if the
address to be freed is not at the beginning of a block. This happens
regulary when 'struct page' objects are not freed in allocation order.

Issue #4325.
2021-11-29 15:10:53 +01:00
Josef Söntgen
98385a7658 allocator_avl: return 0 for improper size_at call
In case the given address is not the start of a block bail instead of
making improper size assumptions.

Issue #4325.
2021-11-29 15:10:53 +01:00
Josef Söntgen
49bf58a2ae lx_kit: free dataspace interface
Allow for freeing of manually managed dataspaces.

Fixes #4325.
2021-11-29 15:10:53 +01:00
Josef Söntgen
327ec61ee3 lx_kit: get buffer dataspace from virt addr
Introduce a method to access the dataspace capability of the underlying
backing store for a memory allocation. This is necessary for drivers
where the memory is managed manually and the capability needs to be
given to a client.

Issue #4325.
2021-11-29 15:10:53 +01:00
Josef Söntgen
cd7a65a313 dde_linux: extended pgtable header for etnaviv
The 'pgprot_noncached' function is referenced by the driver code.

Issue #4325.
2021-11-29 15:10:53 +01:00
Stefan Kalkowski
23514bf5c2 dde_linux: add runqueues symbol for -O0 build 2021-11-29 15:10:53 +01:00
Christian Helmuth
974627f700 vbox6: adapt to GUI framebuffer size on startup
Explicitly, adapt to current framebuffer/window size after
initialization finished. This ensures the use of the correct framebuffer
dimensions in scenarios without a window manager.

Thanks to Raphael for the patch.
2021-11-29 15:10:53 +01:00
Norman Feske
3b456e0037 test/resource_request: ignore spurious requests
This patch makes the test less dependent on the rate of state updates by
calculating the upgraded quota from the values found in the state report
instead of simply increasing the '_ram_quota' for each incoming report.
2021-11-29 15:10:53 +01:00
Norman Feske
231ac187fe base: introduce Ram_allocator::try_alloc
This patch replaces the 'Ram_allocator::alloc' RPC function by a
'try_alloc' function, which reflects errors as 'Attempt' return value
instead of an exception.

Issue #4322
Issue #3612
2021-11-29 15:10:53 +01:00
Norman Feske
959bcae557 base: add util/attempt.h utility
Fixes #4322
2021-11-29 15:10:52 +01:00
Norman Feske
694dff8a5c base: sort symbols/ld with LC_COLLATE=C 2021-11-29 15:10:52 +01:00
Christian Helmuth
68caa26407 virt_qemu: use "-device ramfb"
Issue #4282
2021-11-29 15:10:52 +01:00
Norman Feske
4cfd954e1e Remove dependency from 'which' utility
Debian declared the 'which' utility as deprecated.

Fixes #4319
2021-11-29 15:10:52 +01:00
Norman Feske
293d545b97 sandbox: use Genode::update_list_model_from_xml
This patch replaces the former local implementation by the function
provided in 'util/list_model.h'.

Issue #4317
2021-11-29 15:10:52 +01:00
Norman Feske
4df7e6adde util/list_model.h: Add update_list_model_from_xml
The new 'update_list_model_from_xml' function template simplifies the
use of the list model utility by alleviating the need for implementing a
custom policy class for each model. Instead, the transformation is done
using a few lambda functions given directly as arguments.

Issue #4317
2021-11-29 15:10:52 +01:00
Norman Feske
449f647e58 dde_linux: lx_emul interface for GPIO pin access
This patch introduces the lx_emul/pin.h interface that enables GPIO stub
drivers to interact with Genode's Pin_control and IRQ sessions via a
simple C API.

Fixes #4316
2021-11-29 15:10:52 +01:00
Norman Feske
f2a627c107 os: Pin_control and Pin_state session interfaces
The new interfaces are meant to gradually replace the existing
Gpio_session interface.

- Each session refers to a single pin.
- The session types distiguish the direction of the signal as input or
  output.
- Pin coordinates can be selected via session labels.
- GPIO interrupts are covered by the regular IRQ session interface.

The interfaces are accompanied by framework utilities and interfaces:

- os/pin_driver.h
- pin_control_session/component.h
- pin_state_session/component.h

These headers relieve GPIO drivers from implementing boilerplate code by
providing device-agnostic portions. The A64 pio driver serves as
reference for using those utilities.

  https://github.com/nfeske/genode-allwinner/tree/master/src/drivers/pin/a64

Fixes #4315
2021-11-29 15:10:52 +01:00
Johannes Schlatow
2ecb09ba7e tool/run: move nic model to qemu_args file
Always instantiating a network device with id `net0`, removes the need to call
append_qemu_nic_args in run scripts unless we want to add forwarding
rules.

genodelabs/genode#4311
2021-11-29 15:10:52 +01:00
Johannes Schlatow
522a1cdc5b tool/run: read board-specific qemu args from file
Allow specifying additional qemu arguments for externally supported boards
(e.g. zynq_qemu) by adding a `qemu_args` file in the board-property directory.

The syntax of the qemu_args file is as follows:
- Arguments can appear in a single line or in multiple lines as the
  lines will be appended (separated by a whitespace) to the global
  qemu_args variable.
- If the line is prepended with a `foobar:` expression. The arguments
  are only added if the foobar spec is present.

Note, that a `-m` argument specified in the qemu_args file will
override the arguments provided by the run scripts.

genodelabs/genode#4311
2021-11-29 15:10:52 +01:00
Johannes Schlatow
c0c2ed2bf5 tool/run: make qemu RAM sanity check more robust
First, the former implementation has only considered the pure numerical
variant of the -m argument. Yet, qemu also allows specifying the amount
of memory by `-m 1G`, `-m size=1G` and more.

Second, the default amount of memory for BOARD=pc was 512M (800M in case of okl4).
Since the depot_autopilot.run also required at least 768M on all
platforms it seems reasonable to take 800M as a default value for BOARD=pc and
thereby remove the special treatment of okl4.

genodelabs/genode#4311
2021-11-29 15:10:52 +01:00
Alexander Boettcher
c774272366 vbox5/6: set ia32_tsc_aux for rdtscp usage
Fixes #4314
2021-11-29 15:10:52 +01:00
Alexander Boettcher
533015b93e nova: support transfer of IA32_TSC_AUX MSR for vCPUs
The 32-bit MSR is returned by rdtscp in ecx register and used to detect
the CPU ID the timestamp was taken on.

Issue #4314
2021-11-29 15:10:52 +01:00
Alexander Boettcher
f4e52863c0 vbox6: exit on rdtsc and rdtscp (intel)
Otherwise Windows 10 shows 50 Ghz frequency in task manager and other
strange things may happen.

Issue #1769
Issue #4314
Fixes #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
7a06633173 nova: FPU handling for vCPUs in VM session
- request FPU state on VM exit in portal config

- transfer FPU state on VM entry

- save fpu state early

  Avoid any FPU instructions (for example during base API calls), which
  use the FPU and overwrite FPU registers holding the guest vCPU FPU
  state.

- don't save fpu state of EP

Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
1a79bf2be2 vbox6: avoid race for NEM state checking
The commit avoids the race between checking for the NEM state and the decision
to notify (poke) the NEM backend (nem.cc).

- ever notify about POKE flag for remote vCPU
- check synchronized for NEM state
- store recheck flag and apply on next switch_to_hw

Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
3701733c8f vbox6: add POKE calls in TM for remote vCPUs
and return to VMM if TM_TIMER flag is set

Issue #4313
2021-11-29 15:10:52 +01:00
Christian Helmuth
5a21431c31 vbox6: check for pending IRQs in sup_vcpu
Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
00eadf9791 vbox6: adjust TPR handling according to HMVMXR0
Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
33bf926b50 vbox6: add SIPI patch improving vCPU startup
Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
4798ffd055 vbox6: initialize more vcpu state in sup_vm.cc
Issue #4313
2021-11-29 15:10:51 +01:00
Christian Helmuth
228d1c27b7 vbox6: fix npt_ept fault calculation
Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
68878ca98a vbox6: implement SUPSemEventMulti*() functions
Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
28db5cadee vbox5: generic - discharge by default
intr_state and actv_state are now charged only if required and with
valid values.

Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
8d5903cba9 vbox6: avoid unintended state transfer on hw enter
intr_state and actv_state are now charged only if required and with
valid values.

Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
74a8a801e4 nova: report vCPU prio & quantum in trace conn
Issue #4313
2021-11-29 15:10:51 +01:00
Stefan Kalkowski
b12b0ed93d imx8q_evk: remove board support from repository
Moved to separate repo at https://github.com/skalk/genode-imx/

Fix #4301
2021-11-29 15:10:51 +01:00
Johannes Schlatow
7917c5d9ec Remove zynq_qemu platform and zynq nic driver
Moved to separate repo at https://github.com/jschlatow/genode-zynq

Fixes genodelabs/genode#4280
2021-11-29 15:10:51 +01:00
Josef Söntgen
6ecae6adb3 qemu-usb: increase USB2/3 root ports to 8 each
In the default setting the number of root ports is set to 4. This
also limits the number of USB host devices that may be attached to
the VM. Since the USB webcam shares the slots, that leaves us with
only 3 available USB2 slots to attach USB host devices. Depending on
the use-case that might not be enough.

This commit statically increases the number of ports to 8 each and
adapts the qemu-usb glue-code accordingly.

Many thanks to Raphael for initial investigation and workaround.

Fixes #4310.
2021-11-29 15:10:51 +01:00
Stefan Kalkowski
6d991313b1 nvme_drv: get I/O resources from platform API only
Do not use the I/O memory service from core directly,
but instead use the I/O resources the platform session
provides to the driver anyway.

Fix #4309
2021-11-29 15:10:51 +01:00
Stefan Kalkowski
43ef9b5a3a platform_drv: do not account IOMEM as ram quota
Accidentally, the size of IOMEM dataspace got accounted within the
implementation of the platform driver for ARM. Instead we should
only account a bit for the metadata and paging of the I/O memory.

Fix #4307
2021-11-29 15:10:51 +01:00
Johannes Schlatow
87bb81cd66 nic: add _custom_conn_tx_ack_avail_handler()
The custom ack avail handler is required for zero-copy nic drivers (e.g.
the zynq nic driver), which must release the corresponding DMA buffers.

Fixes genodelabs/genode#4277
2021-11-29 15:10:51 +01:00
Tomasz Gajewski
332cfb38c1 usb_host: fix MMU fault on rpi2 and rpi3 2021-11-29 15:10:51 +01:00
Norman Feske
275479867d window_layouter: handle decorator margins at start
This patch adds a missing call of '_handle_decorator_margins' at
construction time. Up to commit "report_rom: versioning and explicit
notification" this problem was masked by an unconditional signal, which
implicitely triggered the call.

Issue #4274
Fixes #4306
2021-11-29 15:10:51 +01:00
Piotr Tworek
4f1e9fd256 os: Use VirtIO input drivers for virt_qemu.
This makes Genode's interactive test scenarios run on virt_qemu board
actually interactive.

Issue #4282
2021-11-29 15:10:51 +01:00
Piotr Tworek
80d11ca751 tool: Add keyboard and mouse devices to virt_qemu.
Now that we have appropriate native driver for them add keyboard and
mouse devices to virt_qemu machine. Make sure qemu exposes those new
devices in modern, VirtIO 1.0 mode. At leasts qemu 5.1.0 still uses
pre 1.0 mode in default setup.

Issue #4282
2021-11-29 15:10:51 +01:00
Piotr Tworek
60f1a1a554 os: Add VirtIO input driver.
This component can service Qemu VirtIO mouse, keyboard and tablet
devices. The implementation is based on VirtIO 1.1 device spec. Its
described in section 5.8 "Input Device".

Issue #4282
2021-11-29 15:10:51 +01:00
Josef Söntgen
851d96de8a Fix misleading DosBox snippet in porting-guide
The included 'target.mk' snippet of DosBox suggests to use the contrib
source directory directly to reference source files.

Fixes #4305.
2021-11-29 15:10:50 +01:00
Tomasz Gajewski
ecb1a6187c ssh_terminal: moved to genode world
Fixes #4258
2021-11-29 15:10:50 +01:00
Sebastian Sumpf
d4a6342295 tool_chain: remove Go support from bootstrap compiler
Fixes #4292
2021-11-29 15:10:50 +01:00
Piotr Tworek
a10903a197 libm: fix undefined __isinff / __isinfl symbol references
Those symbols are not satisfied by any code or dependency of libm. As
result calling cprojf function will always crash on Genode. This crash
can be turned into link time error by adding --no-undefined to LD_OPT.

This patch provides the missing symbols by including isninf.c in libm
build.

Fixes #4299
2021-11-29 15:10:50 +01:00
Piotr Tworek
c38c2a6455 cxx: missing operator delete with align_val_t arg
When rebasing my local branch on top of sculpt-21.10 tag I've noticed
two problems.

The code in new_delete.cc does not include new header file. This works
fine with GCC, but fails with clang because std::align_val_t type is
not defined anywhere according to clang. It looks like GCC pulls this
header indirectly somehow.

The second problem can be seen if one disallows undefined symbols in
executables and shared_libraries. This can be seen with both GCC and
clang by adding --no-undefined to LD_OPT. With such change in place core
fails to link due to:

ld.lld: error: undefined symbol: operator delete(void*, std::align_val_t)
>>> referenced by thread.h:448 (/home/tworaz/devel/genode/repos/base-hw/src/core/kernel/thread.h:448)
>>>               thread.o:(Kernel::Core_main_thread::~Core_main_thread()) in archive debug/core-hw-virt_qemu.a
>>> referenced by thread.h:448 (/home/tworaz/devel/genode/repos/base-hw/src/core/kernel/thread.h:448)
>>>               thread.o:(non-virtual thunk to Kernel::Core_main_thread::~Core_main_thread()) in archive debug/core-hw-virt_qemu.a
>>> did you mean: operator delete(void*, unsigned long, std::align_val_t)
>>> defined in: debug/core-hw-virt_qemu.a(supc++.o)

If the code would somehow manage call such undefined symbol it'd crash.
Since I generally prefer link time failures to runtime crashes I link
all genode binaries with --no-undefined.

To fix this problem just add a dummy implementation of missing delete
operator.

Fixes #4298
2021-11-29 15:10:50 +01:00
Piotr Tworek
e748efacd8 reconstructible: Fix alignas specifier placement.
Alignas should be placed before the type. Placing it after it works for
GCC, but fails when building the same codee with clang. The error
message is:

reconstructible.h:48:27: error: 'alignas' attribute cannot be applied to types
    char _space[sizeof(MT)] alignas(sizeof(addr_t));
                            ^
Issue #4298
2021-10-15 15:45:52 +02:00
Christian Helmuth
42ff902576 vbox6: settings version 1.18-genode in machine.vbox6
At least the audio backend depends on the correct .vbox settings version
for VirtualBox 6.1 which is 1.18 as of VirtualBox.xidl.
2021-10-15 12:17:05 +02:00
Norman Feske
7e2716800b News item for Sculpt 21.10 2021-10-14 14:40:08 +02:00
Christian Helmuth
abc9a2f232 depot: update recipe hashes 2021-10-14 13:46:25 +02:00
Norman Feske
0a35e02961 sculpt: documentation update
Issue #4281
2021-10-14 13:22:18 +02:00
Christian Helmuth
98ffa60577 Increase cap quota for system-shell terminal 2021-10-14 11:48:23 +02:00
Josef Söntgen
9980718c92 libyuv: build unoptimized on ARMv8 2021-10-14 11:46:42 +02:00
Josef Söntgen
2e0d9c8521 libdrm: short-cut tiling in iris back end
Apparently the iris driver does not make use of tiling by the kernel, so
we shortcut the 'SET_TILING' call to keep iris happy with this quickfix.

However, tiling information may get lost, if the iris driver ever calls
'MMAP_GTT' and no fence is configured for the buffer. A follow-up commit
should address this shortcoming in the future.

Issue #4284
2021-10-14 11:40:39 +02:00
Norman Feske
31567c8e46 sculpt: curate default index / installation
- CPU-architecture annotations
- Change order of top-level menu, moving Mesa driver to the end
- Add black_hole, recall_fs, file_fault
- Add usb_webcam, test-capture
- Add audio driver and mixer
- Add vbox6, keeping vbox5-nova-sculpt as fallback
- Remove recall_fs launcher, which is obsolete with the recall_fs pkg
- Replace system_clock by system_clock-pc pkg

Issue #4281
2021-10-14 11:02:18 +02:00
Norman Feske
006e807103 sculpt: version 21.10 2021-10-14 11:02:18 +02:00
Norman Feske
4dac2fd008 sculpt: increase RAM of leitzentrale nitpicker
This follow-up commit to "sculpt: avoid flickering of leitzentrale"
allows nitpicker to double-buffer pixels during resize operation on a
screen size of 1920x1200.
2021-10-14 11:02:17 +02:00
Norman Feske
68e8d1fd21 cached_fs_rom: remove diagnostic message
The message "defer transfer..." spams the log on Sculpt OS.

Issue #4281
2021-10-14 11:02:17 +02:00
Norman Feske
6a89f8b19e wm: fix key_cnt consistency glitch
This patch presents all press and release events to the pointer state,
fixing the problem that _key_cnt was decreased but never increased.
However, the inconsistency had no observable effects in practice.

Issue #4176
2021-10-14 11:02:17 +02:00
Norman Feske
ee463b21ae nitpicker: fix interplay of hover with dragging
This patch extends the notion of having only one uniquely hovered client
in the presence of held keys.

If motion occurs once a key is pressed (e.g., while dragging), the
receiver of the key sequence observes the motion events. In this case,
we have to submit an artificial leave event to the originally hovered
client so that no more than one client observes itself as being hovered
at the same time. Once the key sequence is finished, the hovering is
updated again, eventually presenting a motion event to the originally
hovered client and a leave event to the receiver of the key sequence.

Issue #4176
2021-10-14 11:02:17 +02:00
Norman Feske
1088035f8e wm: defer pointer report update
This patch ensures that the pointer report is updated not before all
input events are handled. The change does not solve any observed
practical issue but the potential problem was spotted while reviewing
the code.

Issue #4176
2021-10-14 11:02:17 +02:00
Christian Helmuth
b2ff2a2950 vbox6: configure OSS plugin only once (as /dev/dsp) 2021-10-14 11:02:16 +02:00
Stefan Kalkowski
c976a1d7e0 dde_linux: iterate over device names not types
To clearly identify the correct device use the unique device's name
not the type. Otherwise a driver cannot drive several devices of the
same type.

Fix #4297
2021-10-14 11:02:15 +02:00
Stefan Kalkowski
98400a68c9 os: extend ARM Platform::Device constructor
Enable construction by explicitely naming a specific device,
if more than one device of the same type exist.

Ref #4297
2021-10-14 11:02:15 +02:00
Josef Söntgen
8679f32d0b dde_linux: backport update event ring for usb_host
This commit contains a backport of commit [1] that deals with updating
the event ring dequeue pointer more often to prevent unnecessary
'Event Ring Full' errors.

  [1] 'usb: host: xhci: update event ring dequeue pointer on purpose'
      (dc0ffbea5729a3abafa577ebfce87f18b79e294b)

Fixes #4296.
2021-10-14 11:02:15 +02:00
Stefan Kalkowski
1d1379430a genode_c_api: safeguard session-policy parsing
Fix #4294
2021-10-14 11:02:15 +02:00
Stefan Kalkowski
b7a379546e genode_c_api: delay USB service announcement
Ref #4294
2021-10-14 11:02:14 +02:00
Stefan Kalkowski
873eb687b0 genode_c_api: reduce USB session ram requirements
Ref #4294
2021-10-14 11:02:14 +02:00
Stefan Kalkowski
1508fdc276 usb_block_drv: handle USB state at startup
Fix #4293
2021-10-14 11:02:14 +02:00
Sebastian Sumpf
c79cdc7b39 gpu/intel: use managed dataspace for aperture mappings
Use 'Region_map_client' for aperture mappings through the GGTT instead
of 'Io_mem_connections'.

issue #4284
2021-10-14 11:02:14 +02:00
Norman Feske
440debfc39 depot_query: filter index by CPU architecture
This patch changes the depot_query tool to filter the returned index
data depending on the 'arch' as specified for the query. This way, one
index file can support multiple CPU architectures while allowing
individual entries to be architecture-specific.

Fixes #4295
2021-10-14 11:02:14 +02:00
Norman Feske
28a71f4a73 cpu_balancer.run: adjust caps for sel4/x86_64 2021-10-14 11:02:14 +02:00
Christian Helmuth
4fd2c9c618 libuvc: exclude .git directory from src archive 2021-10-14 11:02:13 +02:00
Norman Feske
96997ead62 sculpt: fix warning during prepare step
This patch adds the missing definition of 'prio_levels' in the prepare
sub init, fixing the warning:

  [init -> runtime -> prepare] Warning: vfs: invalid priority, upgrading from -2 to 0

Issue #4281
2021-10-14 11:02:13 +02:00
Norman Feske
a12168e1bb pkg/mesa_gears: display frames per second 2021-10-14 11:02:13 +02:00
Sebastian Sumpf
d1461f6a72 vbox6: machine power-down support
Use 'StateChange' event to check for machine's 'PowerOff' state, close
Gui connections and submit exit signal to EP which in turns calls exit.

Fixes #4291
2021-10-14 11:02:13 +02:00
Christian Helmuth
c7abc9f983 vbox6: add pkg with webcam capture support
Issue #4281
Issue #4287
2021-10-14 11:02:13 +02:00
Christian Helmuth
d078f7db76 qemu-usb: adapt to webcam capture on/off changes
Issue #4287
2021-10-14 11:02:13 +02:00
Norman Feske
6f1d3862cd base: introduce Env::try_session
The new 'Env::try_session' method mirrors the existing 'Env::session'
without implicitly handling exceptions of the types 'Out_of_ram',
'Out_of_caps', 'Insufficient_ram_quota', and 'Insufficient_cap_quota'.
It enables runtime environments like init to reflect those exceptions to
their children instead of paying the costs of implicit session-quota
upgrades out of the own pocket.

By changing the 'Parent_service' to use 'try_session', this patch fixes
a resource-exhaustion problem of init in Sculpt OS that occurred when
the GPU multiplexer created a large batch of IO_MEM sessions, with each
session requiring a second attempt with the session quota upgraded by
4 KiB.

Issue #3767
2021-10-14 11:02:12 +02:00
Christian Prochaska
d5d7915b4d audio_in: fix compile errors when strict warnings are enabled
Fixes #4290
2021-10-14 11:02:11 +02:00
Christian Prochaska
b337ee2f2b vfs_oss: fix output fragment limit calculations
Fixes #4289
2021-10-14 11:02:11 +02:00
Johannes Schlatow
ef8a43c546 base-hw: cache maintenance
touch each page before flushing to ensure that it's present in the page table

genodelabs/genode#4279
2021-10-14 11:02:10 +02:00
Sebastian Sumpf
350353885e vbox6: add shared folder support
builds virtualbox6-sharedfolders.lib.so from unmodified VirtualBox6
sources.

fixes #4288
2021-10-14 11:02:10 +02:00
Norman Feske
eb80d6ce66 usb_webcam: on/off dependent on capture client
This commit removes the report service from the usb_webcam pkg, which
was used to enable or disable the webcam driver. The on/off state is
instead controlled by the presence of a capture client. That is, once a
capture client appears, the webcam driver is started. Vice versa, once
no capture client exists, the webcam driver is removed automatically.

Internally, the detection of presence of a capture client is based on
nitpicker's 'displays' report, which is consumed as input of the
rom_filter, which in turn generates the configuration of a dynamic sub
init.

Fixes #4287
2021-10-14 11:02:10 +02:00
Norman Feske
bc5a7eb495 rom_filter: support default input values
Fixes #4286
2021-10-14 11:02:10 +02:00
Stefan Kalkowski
cb67d07e61 lx_emul: be compliant to original softirq impl.
Ref #4268
2021-10-14 11:02:10 +02:00
Christian Helmuth
96ebed6c31 vbox6: use configuration from machine.vbox6
There are some subtle incompatibilities in VirtualBox 6 with settings we
used in version 5. Therefore, the vbox6 package uses machine.vbox6 as
configuration file. An example configuration is provided by the
raw/vbox6 package.

Issue #4281
2021-10-14 11:02:10 +02:00
Josef Söntgen
6093f8ad81 gpu/intel: deal with insufficient amount of CAPS
'Out_of_ram' was so far the only exception a client had to deal with
during buffer managment. Allocating memory, however, does not only
consume RAM quota but CAP quota as well.

This commit tries to mitigate that shortcoming by reflecting the
'Out_of_caps' state back to the client. Furthermore it allows for
resource accounting on certain client allocations, e.g. buffers.

Fixes #4284.
2021-10-14 11:02:09 +02:00
Josef Söntgen
f6d845e630 gpu: reflect CAP shortage during buffer management
Allocating and mapping buffers not only consumes RAM quota, it consumes
CAP quota as well. Extended the Gpu session to allow for dealing with
that on the client side.

On a side note, the amount of initial CAP quota needed to establish
a connection is increased to cover the current costs of the Intel
GPU multiplexer.

Issue #4284.
2021-10-14 11:02:09 +02:00
Josef Söntgen
27e55dab3e platform_drv: check quota before allocating buffer
The platform driver uses a 'Constrained_ram_allocator' to allocate
meta-data on behave of a client. It uses the PD session as
'Ram_allocator' back end that in return is implemented via the
'Expanding_pd_session_client'.

Whenever the PD client itselft comes into resource shortage it will
ask its parent unconditionally. However, depending on the integration,
such a request may be left unanswered.

This commit introduces a check to prevent that situation from
occurring. In case the platform driver notices the resource shortage
it will reflect that back to the client.

Issue #4284.
2021-10-14 11:02:09 +02:00
Norman Feske
05b451c563 pkg/mesa_gpu: use cached_fs_rom
By using the cached_fs_rom instead of fs_rom, each client obtains the
same (read-only) copy of the shared library, avoiding a RAM resource
request when running mulitple GPU applications at the same time.
With this patch, Sculpt is able to host at least 3 Mesa applications.

Issue #4263
Issue #4281
2021-10-14 11:02:09 +02:00
Sebastian Sumpf
2604c3cca6 vbox6: add mouse pointer shape support
Implement 'MousePointerShapeChanged' event, retrieve parameters from
COM pointer, and update shape report.

fixes #4283
2021-10-14 11:02:09 +02:00
Norman Feske
8ebc185caf depot: merge rtc_drv into system_clock runtime pkg
This new version of the system_clock pkg does no longer depend on the
presence of an external 'Rtc' service as previously provided by the
Sculpt base system. Instead, it hosts the rtc_drv inside the subsystem.
Because rtc_drv is board-dependent, the system_clock pkg is named
system_clock-pc now.

Issue #4281
2021-10-14 11:02:08 +02:00
Norman Feske
6e32102cc6 depot: add recall_fs runtime pkg
Issue #4281
2021-10-14 11:02:08 +02:00
Norman Feske
42541fcc92 sculpt: limit depot selection
This patch reduces the items of the default depot-selection menu to
users that actively maintain a Sculpt index.

Issue #4281
2021-10-14 11:02:08 +02:00
Norman Feske
7cae324726 sculpt: remove RTC driver from base system
The RTC driver is not needed by the base system and can thereby be
handled as a user-installable component.

Issue #4281
2021-10-13 14:50:46 +02:00
Sebastian Sumpf
1072a91592 qemu-usb: disable remote wake up in config descriptors
Some guests don't handle remote wake up correctly causing devices to
stop functioning. Therefore, we disable the remote wake up bit (5) in
`bmAttributes` of the device configuration descriptor.

Thanks to Peter for the initial fix.

Fixes #4278
2021-10-13 14:50:46 +02:00
Christian Helmuth
07bb3fc1ec Initial update of init-state ROM in init_loop test
ROM clients have to request an initial update of dynamic ROMs explicitly
and should not depend on artificial signals from the ROM session on
signal-handler registration.

Issue #4274
2021-10-13 14:50:46 +02:00
Johannes Schlatow
93583cce3b sequence: immediately stop child on exit
The sequence app should immediately stop the child when it called
parent().exit(). Otherwise, the child will continue execution which
causes a race condition: The child's ld.lib.so will eventually destruct
an Attached_rom_dataspace for the config rom. If sequence destructed the
corresponding service first, we will get an Ipc_error.

genodelabs/genode#4267
2021-10-13 14:50:46 +02:00
Josef Söntgen
e6bd9fd7da libc: implement SNDCTL_DSP_GETFMTS ioctl
This I/O control is used to query the audio format, e.g. AFMT_S16_LE
in our case.

Fixes #4276.
2021-10-13 14:50:46 +02:00
Martin Stein
870c5c7a81 file_vault: GUI control for encrypted virtual FS's
Warning!

The current version of the file vault is not thought for productive use but
for mere demonstrational purpose! Please refrain from storing sensitive data
with it!

The File Vault component implements a graphical frontend for setting up and
controlling encrypted virtual file systems using the Consistent Block Encrypter
(CBE) for encryption and snapshot management. For more details see
'repos/gems/src/app/file_vault/README'.

Fixes #4032
2021-10-13 14:50:46 +02:00
Martin Stein
3e375e4315 cbe tools: log less by default
Previously unconditional calls to Genode::log in cbe init and the cbe trust
anchor VFS plugin were made dependent on a verbosity flag that is set to
"false" by default.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
8dfa586462 vfs/cbe_trust_anchor: fix bug in key decrypt
The plugin used the ciphertext instead of the plaintext buffer for key
decryption which led to bogus ciphertext keys.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
a661aa79de vfs/cbe_trust_anchor: AES-key-wrap private key
Instead of simply encrypting the private key with AES-256 when storing it to
the 'encrypted_private_key' file, wrap it using the AES-key-wrap algorithm
described in RFC 3394 "Advanced Encryption Standard (AES) Key Wrap Algorithm".
This is more secure and enables us to directly check whether the passphrase
entered by the user was correct or not.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
94701eec09 vfs/cbe_trust_anchor: rename secured_superblock
As the file formerly named 'secured_superblock' actually contains the hash of
the superblock that was secured, it was renamed 'superblock_hash'.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
a28ca44101 vfs/cbe_trust_anchor: rename keyfile
As the file formerly named 'keyfile' actually contains the encrypted private
key of the Trust Anchor, it was renamed 'encrypted_private_key'.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
641a738e3d vfs/cbe_trust_anchor: encrypt symmetric keys
By now, the symmetric keys were only XOR'ed with the private key as placeholder
for a real encryption. Now they are encrypted using AES256 with the TA's
private key as key

Ref #4032.
2021-10-13 14:50:46 +02:00
Martin Stein
f41dec67e1 vfs/cbe_trust_anchor: use secure private key
A private key of 256 bits is generated pseudo-randomly using the jitterentropy
VFS plugin on initialization. The private key is stored in the key file
encrypted via AES256 using the SHA256 hash of the users passphrase. When
unlocking the CBE device, the encrypted private key is read from the key file
and decrypted with the hash of the users passphrase.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
75a55b62a3 vfs/cbe_trust_anchor: use hash of passphrase
Instead of using the user passphrase directly, use its SHA256 hash calculated
using libcrypto. The passphrase hash is still stored in the key file to be
used as base for the very primitive way of generating the private key.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
989b7f39e1 vfs/cbe_trust_anchor: use secure symmetric keys
Use the jitterentropy vfs plugin for the generation of new symmetric block
encryption keys in the cbe trust anchor vfs plugin.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
a2d2b874ec vfs/cbe_trust_anchor: sync keyfile-handle close
Closing the keyfile handle after a write operation wasn't synchronised to the
actual end of the write operation.

Issuing a write operation at the back end returns successfull as soon as the
back end has acknowledged that it will execute the operation. However, the
actual writing of the data might still be in progress at this point. But the
plugin used to close the file handle and declare the operation finished at this
point which led to warnings about acks on unknown file handles and leaking
resources. Now, the plugin issues a sync operation directly after the write
operation and waits for the sync to complete. This ensures that the plugin
doesn't declare the operation finished too early.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
42490208c2 vfs/cbe_trust_anchor: fix unlocking
The unlocking operation in the trust anchor was broken wich caused bad keys in
the CBE. This rewrites the whole operation to work as desired. Note that this
doesn't make it more safe! The private key is still almost the same as the
passphrase and stored plaintext.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
95639a7492 vfs/cbe_trust_anchor: close handles correctly
The plugin used to close file handles via the 'vfs_env.root_dir.close'.
However, this lead to resource leaks and apparently isn't the right way to
do it. Other VFS plugins do it by calling 'close' directly on the handle and
doing it in the trust anchor plugin also, fixes the leaks.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
df7de17435 vfs/cbe_trust_anchor: sync hashfile-handle close
Closing the hashfile handle after a write operation wasn't synchronised to the
actual end of the write operation.

Issuing a write operation at the back end returns successfull as soon as the
back end has acknowledged that it will execute the operation. However, the
actual writing of the data might still be in progress at this point. But the
plugin used to close the file handle and declare the operation finished at this
point which led to warnings about acks on unknown file handles and leaking
resources. Now, the plugin issues a sync operation directly after the write
operation and waits for the sync to complete. This ensures that the plugin
doesn't declare the operation finished too early.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
1b4a80ffae vfs/cbe: control/deinitialize file
There were no means for issuing a Deinitialize request at the CBE using the
CBE VFS plugin. The new control/deinitialize file fixes this. When writing
"true" to the file, a Deinitialize request is submitted at the CBE. When
reading the file, the state of the operation is returned as a string of the
format "[current_state] last-result: [last_result]" where [current_state] can
be "idle" or "in-progress" and [last_result] can be "none", "success", or
"failed".

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
88e6991083 vfs/cbe: fix ID argument on discard_snap
When discarding a snapshot, the CBE VFS plugin didn't communicate the ID of
the snapshot to the CBE. Instead it set the ID argument to 0. Therefore the
operation never had any effect.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
9b953e79ba vfs/cbe: support watching the snapshots fs
The snapshots file system couldn't be watched. But it's of interest to watch
for appearing and disappearing snapshots.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
4c1eae97cf vfs/cbe: fix result of SnapshotsFS.num_dirent("/")
The snapshots file system used to return the number of snapshots on
'num_dirent' when called for the root directory although it was expected to
return 1. This confused the tooling ontop of the VFS.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
f051bfa90d vfs/cbe: support watching "rekey" file
The control/rekey file couldn't be watched although it was meant to be used
to watch the current state of the rekey operation.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
4ed45dd303 vfs/cbe: support watching "extend" file
The control/extend file couldn't be watched although it was meant to be used
to watch the current state of the extend operation.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
2d0ac161cb vfs/cbe: mark extend/rekey fs readable
Despite being readable, the files control/extend and control/rekey proclaimed
that they were not when asked. This caused the fs_query tool to not report the
content of the files although it could have.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
34245376ba vfs/cbe: fix size of extend/rekey fs
Stat calls on the control/extend and control/rekey files returned a bogus file
size that led to an error in the VFS File_content tool. The tool complained
that the size of the file determined while reading the content differs from the
one reported by the stat operation. Now, the stat call will always determine
the actual size of what would be read.  However, it isn't guaranteed that this
size doesn't change in the time after the stat operation and before the read
operation.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
bd79f93657 cbe/types: invalid generation, generation string
Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
731df4b037 recipes/src/cbe: build also cbe_init_trust_anchor
Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
d3cc5c9cd2 gems/recipes: api/cbe
Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
ff656401b3 gems: update cbe port
This update fixes a bug when discarding snapshots.

Ref #4032
2021-10-13 14:50:45 +02:00
Christian Helmuth
46ee872b50 vbox6: shared clipboard service
The service is loaded dynamically VBoxSharedClipboard.so at runtime. The
VFS configuration mounts the shared object at /VBoxSharedClipboard.so as
the file is checked by contrib code before loading. An init
configuration in pkg/vbox6/runtime illustrates this and how to re-label
the VBoxSharedClipboard.so ROM to its real name
virtualbox6-sharedclipboard.lib.so.
2021-10-13 14:50:45 +02:00
Christian Helmuth
5aee693f70 vbox6: limit wait for ack to 15 ms in AHCI model
During Windows 10 boot with sequential block requests, the AHCI request
worker finished earlier than the EMT thread signals hEvtProcess and
begins waiting for hEvtProcessAck indefinitely. The timeouts helps to
survive this short phase.

A better solution would use conditional variables, which are not
provided in VirtualBox's runtime.
2021-10-13 14:50:45 +02:00
Josef Söntgen
f21cf3f8b1 mesa: name driver library appropriately
Rename the 'egl_drv' library and the various back ends to 'mesa_gpu_drv'
and 'mesa_gpu-<backend>'.

Fixes #4275.
2021-10-13 14:50:37 +02:00
Norman Feske
32c283d26f os: introduce C API for generating Genode events
This patch introduces a C API to be used by input drivers to generate
Genode events. The initial version is limited to multitouch events only.

Fixes #4273
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
f4cb5cc299 dde_linux: preserve Io_signal_handler for IRQs
Do not construct/destruct signal handlers for interrupts dynamically,
but only the Irq session to prevent a deadlock.

Fix #4272
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
6ae55d490b lx_emul: restrict allocations to minimal alignment
* Use the architecture-dependent minimal alignment for all allocations,
  e.g. on ARM it is necessary to have cacheline aligned allocations for DMA
* Remove the allocation functions without alignment from generic API
* Fix a warning

Fix #4268
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
2ac8620f44 lx_emul: invalidate cache for DMA-read only
After a DMA transaction do only invalidate cachelines from the
corresponding DMA buffers if data got transfered from device to
CPU, and not vice versa. Otherwise it might result in data corruption.

Ref #4268
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
d8c344f6b9 lx_emul: do not block kworkers unconditionally
Ref #4268
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
f8cf0442ed lx_emul: implement lookup of dma-addr to virt-addr
* Use the new Lx_kit::Map as lookup structure for virt-to-dma and vice versa,
  instead of a list-based registry

Ref #4268
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
9bc7ecb605 lx_emul: provide alignment for DMA allocations
Ref #4268
2021-10-13 14:46:54 +02:00
Christian Helmuth
4c4ce2f899 report_rom: versioning and explicit notification
The former implementation did not internally track ROM changes notified
vs. delivered to the client. We adapt the versioning implementation
implemented in dynamic_rom_session.h and enable explicit notification of
the current version.

The feature is used by the clipboard to notify permitted readers of the
clipboard ROM service on focus change via the newly created private
Rom::Module::_notify_permitted_readers() function.

Fixes #4274
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
4803937dd2 os: introduce C-API to provide USB service
Fix #4270
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
6789b86871 base-hw: optimize cache maintainance for ARMv8
* Remove the data-synchronization barrier from the inner-loop
* Instead add a system-wide barrier at the end of the operation

Fix #4269
2021-10-13 14:46:54 +02:00
Martin Stein
9542bcf88c base-hw: reduce includes in board.h
The includes for the address-space-ID allocator and the translation table are
usually specific to the CPU in use. Therefore these includes can be moved from
their current location in the board header to the CPU headers. This reduces the
number of decisions a board maintainer has to make if the CPU model he's aiming
for is already available.

This can probably also be applied for other includes in the board headers but I
intentionally leave it for a future commit as I don't have the time to do it
all now.

Ref #4217
2021-10-13 14:46:54 +02:00
Martin Stein
ad059362d2 base-hw: reduce hardware-specific include paths
For base-hw Core, we used to add quite some hardware-specific include paths
to 'INC_DIR'. Generic code used to include, for instance, '<cpu.h>' and
'<translation_table.h>' using these implicit path resolutions. This commit
removes hardware-specific include paths except for

1) the '<board.h>' include paths (e.g., 'src/core/board/pbxa9'),
2) most architecture-specific include paths (e.g., 'src/core/spec/arm_v7'),
3) include paths that reflect usage of virtualization or ARM Trustzone
   (e.g., 'src/core/spec/arm/virtualization').

The first category is kept because, in contrast to the former "spec"-mechanism,
the board variable used for this type of resolution is not deprecated and the
board headers are meant to be the front end of hardware-specific headers
towards generic code which is why they must be available generically via
'<board.h>'.

The second category is kept because it was suggested by other maintainers that
simple arch-dependent headers (like for the declaration of a CPU state) should
not imply the inclusion of the whole '<board.h>' and because the architecture
is given also without the former "spec"-mechanism through the type of the build
directory. I think this is questionable but am fine with it.

The third category is kept because the whole way of saying whether
virtualization resp. ARM Trustzone is used is done in an out-dated manner and
changing it now would blow up this commit a lot and exceed the time that I'm
willing to spend. This category should be subject to a future issue.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
49b09702b8 base-hw: don't include board.h from hardw. headers
The 'src/core/board/<board>/board.h' header is thought as front end of
hardware-specific headers of a given board towards the generic base-hw Core
code. Therefore it leads to problems (circular includes) if the board.h header
is included from within another hardware-specific header.

If hardware-specific headers access declarations from namespace Board in a
definition, the definition should be moved to a compilation unit that may
include board.h. If hardware-specific headers access declarations from board.h
in a declaration, they should either use the primary declaration from the
original header or, if the declaration must be selected according to the board,
another board-specific header should be introduced to reflect this abstraction.

This is applied by this commit for the current state of base-hw.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
5d74509b2d base-hw: get rid of static perf counter object
It is not necessary to have a class, an object, and a generic header for the
perfomance counter. The kernel merely enables the counter using cpu registers
('msr' instructions, no MMIO) on arm_v6 and arm_v7 only. Therefore this commit
makes the header arm-specific and replaces class and global static object with
a function for enabling the counter.

Fixes #4217
2021-10-13 14:46:53 +02:00
Martin Stein
b817e1977c base-hw: serial output as Main member
Let the kernel's serial-output driver be a member of the one Kernel::Main
object instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
910788313e base-hw: get rid of static variable in Kernel::Pd
Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
02f00a999c base-hw: global IRQ controller as Main member
Let the kernel's driver for the global IRQ controller be a member of the one
Kernel::Main object instead of having it as static variables in the drivers for
the local IRQ controllers. Note that this commit spares out renaming 'Pic' to
'Local_interrupt_controller' which would be more sensible now with the new
'Global_interrupt_controller' class. Furthermore, on ARM boards the commit
doesn't move 'Distributer' stuff to the new global IRQ controller class as they
don't have real data members (only MMIO) and can be instanciated for each CPU
anew. However, the right way would be to instanciate them only once in Main as
well.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
441d137482 base-hw: Address-Space-ID allocator as Main member
Let the kernel's Address-Space-ID allocator be a member of the one
Kernel::Main object instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
0c61b25bcf base-hw: no unmanaged_singleton in kernel thread
The unmanaged-singleton approach was used in this context only because of the
alignment requirement of the Core main-UTCB. This, however can also be achieved
with the new 'Aligned' utility, allowing the UTCB to be a member of the Core
main-thread object.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
b6641eaa25 base-hw: Core PD as Main member
Let the Core protection-domain object be a member of the one Kernel::Main
object instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
d6e347163d base-hw: unnecessary unmanaged-singleton includes
Remove some deprecated include directives for the unmanaged-singleton header.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
5dd8ee5840 base-hw: global IRQ pool as Main member
Let the global kernel IRQ-pool be a member of the one Kernel::Main object
instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
c49db16762 base-hw: don't use boot_info() outside main.cc
It's sufficient to access the boot info only on kernel initialization time.
Therfore, it can remain completely hidden to the rest of the kernel inside
kernel/main.cc in the initialization function.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
b247def09a base-hw: Core main-thread as Main member
Let the Core main-thread object be a member of the one Kernel::Main object
instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
2b89cd66cb base-hw: kernel CPU-pool as Main member
Let the kernel CPU-pool be a member of the one Kernel::Main object instead of
having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
be3d5232c8 base-hw: kernel-data lock as Main member
Let the global kernel-data lock be a member of the one Kernel::Main object
instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
82cf31ac27 base-hw: introduce Kernel::Main class
This commit introduces the Kernel::Main class that replaces the former way of
initializing the kernel (former 'kernel_init' function) and calling the C++
kernel entry handler (former 'kernel' function). These two are now
'Main::initialize_and_handle_kernel_entry' and 'Main::handle_kernel_entry'.
Also reading the execution time of the idle threads was already moved to
'Main'. The one static Main instance is meant to successivly replace all the
global static objects of the base-hw kernel with data members of the Main
instance making the data model of the kernel much more comprehensible. The
instance and most of its interface are hidden in kernel/main.cc. There are only
rare cases where parts of the Main interface must be accessible from the
outside. This should be done in the most specific way possible (see main.h)
and, if possible, without handing out references to Main data members or the
Main instance itself.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
9de43a48b6 base-hw: conform pc board header
Normally, the board header can be found for each supported board under
'src/core/board/<BOARD>/board.h'. This was not the case for the board 'pc'
that was located under 'src/core/spec/x86_64/board.h'. The commit fixes this.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
a9563bfd4c base-hw: rename Core_thread Core_main_thread
The class name Core_thread in Kernel for the object of the first thread of
core is too generic as there can be an arbitrary number of threads in core
besides this one. Furthermore, creating a core thread has its own syscall
'new_core_thread' that isn't related in any way to Core_thread. Therefore
this commit introduces the more specific name Core_main_thread as replacement
for Core_thread.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
693a2b5421 base-hw: get rid of cpu_pool() in platform.cc
The function was only still used for reading the execution time of idle threads
of CPUs. Certainly, it is technically fine and more performant to read these
values directly from the kernel objects without doing a syscall. However,
calling cpu_pool() for it provides read and write access to a lot more than
only the execution time values. The interface via which Core directly reads
state of the kernel should be as narrow and specific as possible.
Perspectively, we want to get rid of the cpu_pool() accessor anyway. Therefore
this commit introduces Kernel::read_idle_thread_execution_time(cpu_idx) as
replacement. The function is implemented in kernel code and called by Core in
platform.cc.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
277adcacb0 base-hw: make Trace_source in Platform() a class
Apparently, there is no need for exposing the data members of Trace_source, so,
we sould better make them private before someone gets the impression that they
are meant to be accessed directly.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
aa6a7db50a base-hw: communicate kernel irqs via boot info
Core used to read the kernel-reserved IRQs from the timer objects in the
kernel's CPU objects and the PIC class (inter-processor IRQ). Besides not
being "good style" to access a kernel object in Core, this becomes a problem
when trying to prevent CPU pool from being accessed via global functions.

As a solution, this commit extends the boot info to also carry an array of all
kernel-reserved IRQs.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
8b69bc96f9 base-hw: separate variants of Kernel_object(...)
For the constructor of Kernel_object<T> there are two variants. One for the
case that it is called from Core where the kernel object (type T) must be
created via a syscall and one when it is called from within the kernel and the
kernel object can be created directly. Selecting one of these variants was done
using a bool argument to the constructor. However, this implies that the
constructor of Kernel_object<T> and that of T have the same signature in the
variadic arguments, even in the syscall case, although technically it would
then not be necessary.

This becomes a problem as soon as kernel objects created by Core shall receive
additional arguments from the kernel, for instance a reference to the global
CPU pool, and therefore stands in the way when wanting to get rid of global
statics in the kernel. Therefore, this commit introduces two constructors that
are selected through enum arguments:

! Kernel_object(Called_from_kernel, ...);
! Kernel_object(Called_from_core, ...);

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
6e4ef43bf0 base-hw: always use 'unsigned' for priorities
At some points in the code, 'signed' was used instead of the more appropriate
'unsigned' type.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
b922dc5c10 base-hw: fix self-include in kernel/types.h
That this header apparently used to include itself didn't cause any problems
so far but still remained bad style.

Ref #4217
2021-10-13 14:46:52 +02:00
Josef Söntgen
cacb83b163 gpu: introduce mapping attributes
The various mapping methods are modelled after the requirements of
the Intel GPUs or rather the Mesa driver back end.

With upcoming support for other driver back ends, we need to
sequeeze their requirements in as well. For now hijack 'map_buffer'
to provide for specifying the kind of attributes the client needs.

For now all buffers mapped in the GGTT for Intel GPUs are treated
as RW.

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
90e151e2c4 gpu: add 'complete' RPC call
This call allows for checking if the given execution buffer has been
completed and complements the completion signal. Initially the GPU
multiplexer always sent such a signal when the currently scheduled
execution buffer has been completed. During enablement of the 'iris'
driver it became necessary to properly check of sequence number.

In case of the Intel GPU multiplexer the sequence numbers are
continous, which prompted the greater-than-or-equal check in the
DRM back end. By hidding this implementation detail behind the
interface, GPU drivers are free to deal with sequence numbers any
way they like and allows for polling in the client, where the
completion signal is now more of a progress signal.

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
e37792ce94 gpu: introduce information dataspace
The current info implementation (as RPC) is limited in a few ways:

  * The amount of data that may be transferred is constrained by the
    underlying base platform
  * Most information never changes during run time but is copied
    nonetheless
  * The information differs depending on the used GPU device and
    in its current implementation only contains Intel GPU specific
    details

With this commit the 'info' RPC call is replaced with the
'info_dataspace' call that transfers the capability for the dataspace
containing the information only. This is complemented by a client
local 'attached_info' call that allows for getting typed access to
the information. The layout of the information is moved to its own
and GPU-specific header file, e.g., 'gpu/info_intel.h'

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
cfb170c719 gpu: move exec sequence number to Gpu namespace
Moving the type definition removes the aritifial linkage to the Gpu
information structure.

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
3b40790e02 gpu: use Buffer_id to identify buffers
Rather than using the dataspace capability directly, let the client
choose its own local identifier that is linked to the underlying
capability.

Fixes #4265.
2021-10-13 14:46:52 +02:00
Stefan Kalkowski
9a80c3a618 depot: suppress error when copying empty package
Instead of failing, ignore empty packages when copying over
depot packages to a run-script environment.

Fix #4271
2021-10-13 14:46:52 +02:00
Josef Söntgen
ba430dfeac libdrm/iris: destroy Buffer_handle object
When the client frees the buffer, destroy the corresponding
Buffer_handle as well.

Fixes #4266.
2021-10-13 14:46:52 +02:00
Piotr Tworek
b157256a2b uplink client: Add missing space in warning message.
Right now the warning about failure to forward packet from driver to
uplink RX connection reads:

  "exception while trying to forward packet from driverto Uplink
   connection TX"

Add missing space between "driver" and "to".

Issue #4264
2021-10-13 14:46:52 +02:00
Piotr Tworek
60980045ea virtio_nic: Increase default TX & RX virtqueue sizes.
32KB is a rather small value. The driver can cope with it now, but
it does not perform as well as it should. This visible especially
in scenarions like nic_router_flood where we still often hit
synchronous wait path. Bump the size to 256kB.

Issue #4264
2021-10-13 14:46:51 +02:00
Piotr Tworek
880cd3a490 virtio_nic: Fix packet transmission handling.
The problem can be seen when running nic_router_flood scenarion on arm
qemu_virt boards. With the amount of data this scenario tries to send
the driver quickly complains it has failed to push data into TX VirtIO
queue. After this warning message is printed nothing really happens and
after a while the test scenario fails.

The fact that we can't write all available data to the device is not
unexpected. VirtIO queue size is slected at initialization time and we
don't change it during driver lifetime. It can be tweaked via driver
config, but this does not change the fact that we'll always be able to
produce more data packets than we have free space in the VirtIO queue.

IMO the expected behavior of the driver in such case should be to:
1. Notify the device there is data to process.
2. Wait for the device to process at least part of it.
3. Retry sending queued packets.

One could expect returning Transmit_result::RETRY from _drv_transmit_pkt
would produce such result. Unfortunately it seems that Uplink_client_base
treats RETRY return value as indication of link being down. It'll retry
sending the packet only after the device notifies it the link is once
again up. This is the reason why nothing happens when running
nic_router_flood on top of virtio_nic driver. The link never goes down
in this case so once we fill the TX VirtIO queue and tell the base class
to retry the send, we'll be stuck waiting for link up change event
which will never arrive.

To fix this problem, when sending a packet to the device fails, do a
synchrnonus TX VirtIO queue flush (tell device there is data to process
and wait until its done with it).

With this fix in place nic_router_flood test scenario passes on both arm
qemu_virt boards.

Issue #4264
2021-10-13 14:46:51 +02:00
Piotr Tworek
b7f66626c2 virtio: Make avail and used ring pointers volatile
The contents of those descriptor rings can be modified by the device.
Mark them as volatile so the compiler does not make any assumptions
about them.

Issue #4264
2021-10-13 14:46:51 +02:00
Christian Helmuth
c0a7696c71 tool/dts/extract: convert regex strings to latin1
The former encoding was UTF-8, which works quite well if LC_CTYPE is
ensured to be an UTF-8 codeset (e.g., en_US.UTF-8 or C.UTF-8 . But, if
LC_CTYPE is set to C or latin1 for example, the Tcl regex library enters
an infinite loop because of unexpected characters used as markers
n the strings (e.g., SECTION SIGN U+00A7).

Therefore, the extract tool was converted to latin1 with the following
commands and now works for LC_CTYPE C and UTF-8 codesets.

   iconv -f utf-8 -t latin1 tool/dts/extract > /tmp/e
   cp /tmp/e tool/dts/extract
2021-10-13 14:46:51 +02:00
Alexander Boettcher
d85a448c52 gpu/intel: provide supported devices as config
Adjust drivers_managed and sculpt accordingly.

Issue #4260
2021-10-13 14:46:51 +02:00
Sebastian Sumpf
d67899be95 gpu/intel: enable 32 bit CPU support
* use Gpu::addr_t (64 Bit) where necessary instead of Genode::addr_t.

issue #4260
2021-10-13 14:46:51 +02:00
Alexander Boettcher
6112c0df6d mesa: rename gpu-* pkg to mesa_gpu-*
for easier linking by user with the Mesa client ROM requests, which will be
mesa_gpu-drv.lib.so. Adjust mesa-gears demo accordingly.

Issue #4263
2021-10-13 14:46:51 +02:00
Alexander Boettcher
367385aed7 gpu/intel: add more supported Intel GPUs
- Lenovo T470p, T490, T490s

Issue #4260
2021-10-13 14:46:51 +02:00
Alexander Boettcher
0f72356570 gpu/intel: use read out gttm size
and don't assume 8M, which leads to Region_conflicts if size is >8M (X201).

Issue #4260
2021-10-13 14:46:51 +02:00
Christian Helmuth
727fa86088 autopilot: support additional repo directories
-a <repo-dir> appends repo-dir to REPOSITORIES in build.conf
2021-10-13 14:46:51 +02:00
Christian Helmuth
32394c0733 hello: fix resource config / add to autopilot list 2021-10-13 14:46:51 +02:00
Alexander Boettcher
5aa3c56e5c mesa: add gears package
Issue #4263
2021-10-13 14:46:51 +02:00
Alexander Boettcher
0c2edce8ac sculpt: add Gpu service support
Fixes #4263
2021-10-13 14:46:51 +02:00
Alexander Boettcher
2d2ef2a763 mesa: add gpu-iris package providing IRIS driver
Issue #4263
2021-10-13 14:46:51 +02:00
Alexander Boettcher
b6beff673a mesa: add gpu-cpu package providing SWRAST driver
Issue #4263
2021-10-13 14:46:51 +02:00
Sebastian Sumpf
07881f90a9 mesa/libdrm: remove signal EP
This is a left over from Mesa-11 and we exchanged it with a
'wait_and_dispatch_one_io_signal' for synchronous signal waits.

issue #4260
2021-10-13 14:46:50 +02:00
Sebastian Sumpf
3daa94ff2e gpu/intel: Add support for Gen9+
This commit contains features and buf fixes:

* Catch errors during resource allocation

* Because Mesa tries to allocate fence (hardware) registers for each
  batch buffer execution, do not allocate new fences for buffer objects
  that are already fenced

* Add support for global hardware status page. Each context additionally
  has a per-process hardware status page, which we used to set the
  global hardware status page during Vgpu switch. This was obviously
  wrong. There is only one global hardware status page (set once during
  initialization) and a distinct per-process page for contexts.

* Write the sequence number of the currently executing batch buffer to
  dword 52 of the per-process hardware status page. We use the pipe line
  command with QW_WRITE (quad word write), GLOBAL_GTT_IVB disabled
  (address space is per-process address space), and STORE_DATA_INDEX
  enabled (write goes to offset of hardware status page). This command
  used to write to the scratch page. But Linux now uses the first
  reserved word of the per-process hardware status page.

* Add Gen9+ WaEnableGapsTsvCreditFix workaround. This sets the "GAPS TSV
  Credit fix Enable" bit of the Arbiter control register (GARBCNTLREG)
  as described by the documentation this bit should be set by the BIOS
  but is not on most Gen9/9.5 platforms. Not setting this bit leads to
  random GPU hangs.

* Increase the context size from 20 to 22 pages for Gen9. On Gen8 the
  hardware context is 20 pages (1 hardware status page + 19 ring context
  register pages). On Gen9 the size of the ring context registers has
  increased by two pages to 21 pages or 81.3125 KBytes as the IGD
  documentation states.

* The logical ring size in the ring buffer control of the execlist
  context has to be programmed with number of pages - 1. So 0 is 1 page.
  We programmed the actual number of pages before, leading to ring
  buffer execution of NOOPs if page behind our ring buffer was empty or
  GPU hangs if there was data on the page.

issue #4260
2021-10-13 14:46:50 +02:00
Sebastian Sumpf
59b23bc7e1 libdrm: Iris - execute batch buffer synchronous
* Wait for for completion before return from 'execbuffer2'. This makes
  buffer execution synchronous.

* Because the Iris driver manages the virtual address space of the GPU
  and creates one GEM context for each batch buffer we have to map/unmap
  all buffer objects before and after batch buffer execution.

issue #4260
2021-10-13 14:46:50 +02:00
Norman Feske
b7bb6869b4 drivers_interactive-pc: remove platform service
The platform driver should better stay internal to the drivers subsystem
to reinforce the consistency with other drivers_interactive packages.
2021-10-13 14:45:24 +02:00
Norman Feske
e6cdaafb20 tool/ports: use current time as modification time
Fixes #4262
2021-10-13 14:02:16 +02:00
Norman Feske
d072c408ab dde_linux: call init_page_count for each page
The lx_emul_virt_to_pages implementation initialized the page ref
counter only for the first page, leaving the remaining elements in
uninitialized state. This, in turn, rendered the Linux page_pool (as
used by the emac network driver) ineffective, ultimately leading the a
memory leak. The fix changes the call of 'init_page_count' to take the
loop variable as argument.

Issue #4225
2021-10-13 14:02:16 +02:00
Johannes Schlatow
4dacac3dbb depot_autopilot: fix test-trace
Increased number of trace subjects since the test sporadically fails on
some platforms.

Also added a sanity check to print an error message in case we run into
the same issue again.

Fixes genodelabs/genode#4261
2021-10-13 14:02:16 +02:00
Norman Feske
914a41a8bd dde_linux: adjustments for Linux 5.14.1
Issue #4259
2021-10-13 14:01:03 +02:00
Tomasz Gajewski
e6c915ae06 libssh port: immediate mode for ssh poll
This patch adds a switch to internal poll function in libssh that
allows to force this function to immediately return without actually
polling for data and in consequence processing this data. This switch
is used to avoid calling callback functions when flushing output
streams which caused locks due to recursive access to internal
ssh_terminal sessions registry.

Issue #4258
2021-10-13 14:01:02 +02:00
Tomasz Gajewski
6ef6f16cb3 libssh port: backported sftp_server_free
sftp_server_free function was added in 0.9 version of libssh and is
required to avoid memory leaks when clients are disconnecting.

Issue #4258
2021-10-13 14:01:02 +02:00
Tomasz Gajewski
f327a40bbb libssh port: required modifications for sftp
This patch allows to replace sftp packet read and write with
completely asynchronous versions needed to properly hook in existing
ssh_terminal implementation.

Issue #4258
2021-10-13 14:01:02 +02:00
Tomasz Gajewski
e34d1550a4 ssh_terminal: added missing include
Issue #4258
2021-10-13 14:01:02 +02:00
Christian Helmuth
77a5cf7fd4 vbox6: enable audio via OSS plugin 2021-10-13 14:01:02 +02:00
Christian Helmuth
2ba5e4a5b1 libc/oss: check argp per ioctl
... as some ioctls do not require a valid pointer.
2021-10-13 14:01:02 +02:00
Christian Helmuth
5c82045170 vbox6: enable mouse wheel reporting 2021-10-13 14:01:02 +02:00
Christian Helmuth
4a87fcc4cf vbox6: fix TPR handling 2021-10-13 14:01:02 +02:00
Christian Helmuth
e5b828ae8f Switch to genodelabs depot in depot_download test 2021-10-13 14:01:02 +02:00
Martin Stein
f1b72d0281 cxx: define delete operator with alignm. arg
Using 'alignas' in declarations might cause GCC to request for an
implementation of 'operator delete(void*, unsigned long, std::align_val_t)'
although it might actually never be called. This commit adds a dummy
implementation to 'cxx/new_delete.cc' that does nothing more than printing an
error to the log that a proper implementation is missing. This approach is
coherent with our treatment of other global delete operators.

Ref #4217
2021-10-13 14:01:02 +02:00
Martin Stein
ebd140cacb reconstructible: respect alignment of payload
If one has an object X that has a minimum alignment requirement specified
through 'alignas' this requirement is normally inherited by objects that have
object X as member, and by those that have objects as member that have X as
member, and so on... . However, this chain used to get silently interrupted
(dropping the minimum alignment requirement to 8 again) at objects that are
managed with Genode::Reconstructible or Genode::Constructible. In order to fix
this, the commit ensures that Genode::Reconstructible (and therefore also
Genode::Constructible) has at least the minimum alignment requirement (using
'alignas') as the object it manages.

Ref #4217
2021-10-13 13:59:57 +02:00
Christian Helmuth
64e2912a2f version: 21.08 2021-08-31 12:02:22 +02:00
Norman Feske
339dda8b43 News item for version 21.08 2021-08-31 12:02:22 +02:00
Norman Feske
397a3e45d1 Release notes for version 21.08 2021-08-31 12:02:22 +02:00
Norman Feske
f8898f3a56 doc: add server/black_hole to components.txt 2021-08-31 12:02:22 +02:00
Christian Helmuth
83c5648d33 depot: update recipe hashes 2021-08-30 15:00:39 +02:00
Martin Stein
7fdebc6a09 nic_router: let DHCP client request domain name
The NIC router parses, stores and forwards DNS domain names from DHCP replies.
Yet the routers DHCP client used to not request DNS domain-name information on
DHCP requests. This caused DHCP servers to skip this information on their
replies although it was available. This commit fixes the issue by adding the
DNS domain name code to the request parameter list of requests from the routers
DHCP client.
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
4782f9376c recipe: Qt5 texedit adjust to new Mesa version
Add dependency to 'libdrm' as it is required by Mesa 21

issue #4254
2021-08-30 15:00:38 +02:00
Christian Helmuth
a362505e8a usb_host: report bInterfaceProtocol too
Thanks to Raphael for the patch.
2021-08-30 15:00:38 +02:00
Christian Prochaska
ece837e8b8 qt5: prepare QtWebEngine sndio backend
Fixes #4257
2021-08-30 15:00:38 +02:00
Christian Prochaska
eedbcf88ec os: add black hole component
The 'black_hole' component provides dummy implementations of common
session interfaces.

At this time, only the 'Audio_out' session is provided if enabled
in the configuration of the component:

<config>
	<audio_out/>
</config>

Issue #3653
2021-08-30 15:00:38 +02:00
Johannes Schlatow
2b0bb6dda0 trace: comment x86 timestamp() implementations
Fixes genodelabs/genode#4243
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
31b049864c qt5_opengl: Disable Vulkan feature
With Mesa-21, Qt5 detects Vulkan to be enabled, even though it is not
supported in Genode. Also add DRM library in Qt5 run script.

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
46be4f1145 mesa_demo: adjust to Mesa 21.0.0
* support argc/argv + double buffering (Alexander Boettcher)
* Route intel/gpu driver to platform driver
* Use Gui session instead of framebuffer session (Josef Söntgen)

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
e4ae817e82 ram_fb_drv: RAM framebuffer driver for Qemu
Enable "-device ramfb" to use in Qemu. Also add drivers interactive
using this framebuffer for the "virt_qemu" platform.

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
38d731bd79 libports: Add Mesa-21.0.0 support
* Switch mesa support from DRI to gallium
  Supported drivers are
    - softpipe (Sebstian Sumpf)
    - iris for Intel GPUs (Alexander Boetcher)
    - etnaviv for Vivante GPUs (Josef Söntgen)

* Mesa's generated files are placed into 'contrib/mesa-<hash>/generated'
  and are cloned per default from a separate Git repo in order to avoid
  hash updates upon package build. In case you need to generate files
  yourself use
  ! prepare_port mesa GENERATE_FILES=1

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
9041567f14 libports: Remove Mesa-11.2.2
issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
b6ec4bdf05 libc/stdcxx ABI: symbols for Mesa-21.0.0
issue #4254
2021-08-30 15:00:38 +02:00
Josef Söntgen
dd90424129 libports: libdrm-2.4.105 update
Support for iris and etnvaviv

* entaviv:
  - libdrm on FreeBSD is not prepared for !PCI (and libc our is missing
    <sys/pciio.h>
  - missing <sys/types.h> include in xf86drmMode.c
  - etnaviv relies on linux header files - dummy in $(INC_DIR)
  - IOCTL FreeBSD ↔ Linux have swapped IO/OUT bit
  - O_CLOEXEC differs between FreeBSD ↔ Linux

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
c26c50e59b libports: remove libdrm 2.4.21
issue #4254
2021-08-30 15:00:38 +02:00
Josef Söntgen
ac9e0947fd libc: add HM_REALMEM sysctl
Used by Mesa in the Gallium etnaviv driver.

issue #4254
2021-08-30 15:00:37 +02:00
Josef Söntgen
fb4d357b59 libc: pull in sys/pciio.h
This header is needed by recent versions of libdrm that feature
FreeBSD support.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
7a4626861e gpu/intel: add w/a for gen9 kabylake a0-b0 stepping
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
bac7381be3 gpu/intel: adjust submit batch to linux 5.13 handling
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
6b1f1794c4 gpu/intel: add gen9 forcewake support
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
eab92f8d6f gpu/intel: add clock gating for kabylake
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
ee283c0d12 gpu/intel: dump more in error case
- show hardware read tail & head pointer of ring buffer

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
c5d8a43418 gpu/intel: sanity check tail pointer alignment
According to spec the tail pointer points to the next qword instructions
which will be used by the software.

p 1354, Doc Ref # IHD-OS-BDW-Vol 2c-11.15

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
cc2363d421 gpu/intel: report slice, subslice, eu via gpu info
used by libdrm & mesa-21 clients

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
b287c4888a gpu/intel: update context inhibit setup
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
66ac2dc635 gpu/intel: avoid one-by-off in ring buffer
during wrap.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
6c7bcdd32e gpu/intel: add gen9 w/a for submit batch
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
b2440a72c3 gpu/intel: add more debug registers
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
8a285a7bee gpu/intel: add more debug registers
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
c9809fde67 gpu/intel: remove unused superpage scratch code
Superpages (2M, 1G) are not supported by now, but partially copied over code
from base-hw was around. Remove unused register definitions and remove
non-working super page code do avoid confusion.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
de8327c11a gpu/intel: add more supported chips
support for Gen > 8

+ determine platform, revision and stepping

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
0aa17661cc gpu/intel: avoid overlapping ggtt range allocation
Size argument of ggtt free range check is ignored, which leads to
overlapping allocations inside, which leads to unavailable IO-MEM exceptions
thrown by core.

issue #4254
2021-08-30 15:00:37 +02:00
Norman Feske
82a51d8eaa build: operate ccache in preprocessor mode
This avoids consistency problems when header files are shadowed.

Fixes #4256
2021-08-30 15:00:37 +02:00
Norman Feske
040628894c build: introduce GLOBAL_DEPS variable
The new varible can be used to trigger the rebuild of the entire target
whenever any of the listed files changes.

Fixes #4255
2021-08-30 15:00:37 +02:00
Johannes Schlatow
b5dd1dd01b trace: consolidate Trace_buffer implementations
Both, trace_logger and vfs_trace had their own trace_buffer.h. This
commit consolidates the existing implementations and provides the
resulting trace_buffer.h at 'include/trace/'. It thereby becomes part of
the trace api archive.

genodelabs/genode#4244
2021-08-30 15:00:37 +02:00
Johannes Schlatow
ffbd26d63f depot: add trace policy api
genodelabs/genode#4244
2021-08-30 15:00:36 +02:00
Johannes Schlatow
1416b2258f Trace_buffer: do not reprocess last read entry
genodelabs/genode#4244
2021-08-30 15:00:36 +02:00
Norman Feske
436d946300 recipes/api/genode_c_api: add src/lib/genode_c_api
The source codes are needed to use the API because they are statically
linked.
2021-08-30 15:00:36 +02:00
Norman Feske
324ad33736 lx_emul: prevent clk_disable_unused
Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
2cb4157211 lx_emul: support IRQCHIP_DECLARE initcalls
Similar to CLK_OF_DECLARE, this patch extends lx_emul with ability to
extend the __irqchip_of_table with secondary interrupt controllers.

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
c95af254f4 lx_emul: sanitize size 0 for __kmalloc
Driver code such as mfd-core.c may pass 0 as argument n to kcalloc,
which eventually results in an allocation size 0.

  res = kcalloc(cell->num_resources, sizeof(*res), GFP_KERNEL);

Since 'res' is checked against NULL for success, kmalloc must not return
a NULL pointer in this case. The patch works around this issue by
forcing an allocation size of 1 byte in this case.

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
29032caf40 lx_emul: support CLK_OF_DECLARE initcall mechanism
Clock providers such as drivers/clk/sunxi-ng/ccu-sun8i-r.c don't use
regular init calls but declare their init functions via CLK_OF_DECLARE,
which fill the __clk_of_table. Linux populates the table statically by
using special sections declared in the linker script. In contrast, we
populate the table by expanding the macro to global constructor
functions.

The __clk_of_table is then processed by the call of of_clk_init(NULL).

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
36af114d78 lx_emul: enhance krealloc implementation
Issue #4253
2021-08-30 15:00:36 +02:00
Christian Prochaska
149bd999f3 vfs_oss: support more commands for VirtualBox 6 and sndio
Fixes #4252
2021-08-30 15:00:36 +02:00
Christian Helmuth
a6fb61dbf2 vbox6: support dynamic framebuffer resolution
Issue #4031
2021-08-30 15:00:36 +02:00
Johannes Schlatow
50cc51f132 tool: support new u-boot FIT image format
Fixes genodelabs/genode#4250
2021-08-30 15:00:36 +02:00
Christian Helmuth
c54473abea vbox6: update to version 6.1.26
Issue #4031
2021-08-30 15:00:35 +02:00
Christian Helmuth
611e93a5f2 vbox6: kick AHCI asynchronous IO thread
Issue #4031
2021-08-30 15:00:35 +02:00
Christian Helmuth
d6bde82894 vbox6: add libyuv to pkg recipe
Issue #4031
2021-08-30 15:00:35 +02:00
Johannes Schlatow
88b3880c77 base: fix shift overflow error in Bitfield::mask()
Fixes genodelabs/genode#4249
2021-08-30 15:00:35 +02:00
Christian Helmuth
7618c9410a depot: update recipe hashes 2021-08-18 15:06:12 +02:00
Johannes Schlatow
5e284bfb35 trace: disable tracing when owner disappears
* Disable trace source and release ownership on subject destruction.
* Note, since the policy module is also destroyed on descruction of the
  session component, the traced component must not access the policy
  module when acknowledging the disabled state (else: page fault).

Fixes genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Johannes Schlatow
81d939f947 test-trace: test destruction of trace subjects
If the trace subjects are not properly destructed when the TRACE client
disappears, enabled sources will be owned by a non-existing client.
In other words, when a TRACE client disappears all sources owned by the
client must be disabled.

genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Johannes Schlatow
9898341d4a depot_autopilot: fix ineffective test-trace
test-trace always passed, although tracing was never enabled because the
trace subject was not within the first 32 subjects.

* increase number of queried subjects
* output error if trace subject was not found

genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Martin Stein
812fdec27c nic_router: propagate dns domain name via dhcp
With this commit, the NIC router DHCP client reads out the first DNS domain
name (DHCP option 15) if any from a DHCP reply that generates an IPv4 config
for a domain and stores the name together with the IPv4 config for that domain.
DNS domain names are reported via the new report tag '<dns-domain>' if the
'config' attribute in the config tag '<report>' is set.

Furthermore, the NIC router DHCP server becomes able to obtain a DNS domain
name from another domain that has a DHCP client dynamically (given the config
attribute 'dns_config_from' is set and no static DNS config is given) or
statically from its configuration (new config tag '<dns-domain>') and propagate
this name with DHCP replies (DHCP option 15).

The 'nic_router_dhcp_*' tests are adapted to test the new feautures.

The commit also gets rid of some mirrored files in
'test/nic_router_dhcp/manager'.

Fixes #4246
2021-08-18 15:06:12 +02:00
Martin Stein
fa64aae7f8 nic_router: config attribute 'dns_config_from'
WARNING: BREAKS CONFIG COMPATIBILITY!

This commit changes the configuration interface of the NIC router in a way that
may break systems that use the component without proper adjustment!

How to adjust:
At each occurrence of the 'dns_server_from' attribute in a NIC router
configuration replace the attribute name with 'dns_config_from'. The attribute
value remains unaltered.

DETAILED DESCRIPTION

The new attribute name 'dns_config_from' reflects that also other aspects of
the DNS configuration of the denominated domain are used by the DHCP server
that holds the attribute. This commit is a preparation for forwarding also the
domain name (DHCP option 15) with the mechanism behind the attribute.

Ref #4246
2021-08-18 15:06:12 +02:00
Martin Stein
1111472af7 nic_router: make Ipv4_config a class
The fact that the IPv4 config was a struct with all data members public was a
mere leftover of an early state of the NIC router. Today, the router
implementation style is to avoid structs and public data members wherever
possible.

This commit slightly changes the behavior of the router regarding log output.
The router used to print malformed IPv4 configurations to the log only if
the 'verbose' config flag was set using this style:

! [my_domain] malformed dynamic IP config: interface 10.0.2.1/24 ...

Now, malformed IPv4 configurations are only printed if the
'verbose_domain_state' config flag is set (like with any IP4v configuration
states) using this style:

! [my_domain] dynamic IP config: malformed (interface 10.0.2.1/24 ...)

Fixes #4242
2021-08-18 15:06:12 +02:00
Martin Stein
9e6f7988c2 nic_router: list dns servers in one dhcp option 6
The NIC router DHCP server used to add an extra option 6 field to DHCP replies
for each DNS server address. This conflicts with RFC #2132 section 3.8 which
states that the addresses should be listed within one option 6 field without
delimiter. The discrepancy is fixed by this commit.

Ref #4242
2021-08-18 15:06:12 +02:00
Johannes Schlatow
80c1459e79 fs_query: catch File::Truncated_during_read
Fixes genodelabs/genode#4241
2021-08-18 15:06:12 +02:00
Johannes Schlatow
0840cfe834 vfs_trace: report correct size for value files
File size must be the same as the number of bytes that can be read from
the file. Otherwise, this will trigger a `Truncated_during_read`
exception.

Fixes genodelabs/genode#4240
2021-08-18 15:06:12 +02:00
Martin Stein
e648e7255a nic_router: optional icmp type 3 on fragm. ipv4
Via a new configuration attribute, the user can decide whether the router
should answer dropped fragmented IPv4 with an ICMP "destination unreachable"
packet and, if so, which value the ICMP code field of this packet should have.
The default is that the router doesn't send such responses (silently dropping
fragmented IPv4). The behavior is tested by the 'nic_router_ipv4_fragm' test.

Fixes #4236
2021-08-18 15:06:12 +02:00
Martin Stein
06a4608f4a nic_router: report dropped fragmented IPv4
If the new attribute 'dropped_fragm_ipv4' of the <report> tag in the NIC router
config is set "yes", the router will report the number of packets that were
dropped per interface respectively domain because fragmented IPv4 is not
supported. The default is not to report the counter. The behavior is tested by
the 'nic_router_ipv4_fragm' test.

Ref #4236
2021-08-18 15:06:12 +02:00
Martin Stein
619474bc90 nic_router: drop fragmented IPv4
The NIC router used to ignore the IPv4 header fields "More fragments" and
"Fragment offset" completely. Therefore higher-level protocols of fragmented
IPv4 were interpreted wrong because each fragment was considered a self-
standing packet, expecting, for instance UDP/TCP headers somewhere inside of
the UDP/TCP data field. Normally, such packets were dropped as soon as the
UDP/TCP checksum check failed because of the misinterpretation. However,
it was also possible for fragmented IPv4 to pass the router although normally
only partially.

IPv4 fragmentation support in the router would introduce some potential
security risks and is presumably not an easy endeavor. So, for now, we settled
on not supporting IPv4 fragmentation. With this commit, the router simply drops
all fragmented IPv4. This is reflected to the log for each fragment as "drop
packet (fragmented IPv4 not supported)" when 'verbose_packet_drop="yes"' is
configured.

The new test 'run/nic_router_ipv4_fragm' is an automated test for this
behavior. The test is added to the autopilot list.

Ref #4236
2021-08-18 15:06:12 +02:00
Martin Stein
b0e558f486 net/icmp: cast from integer to 'Code' enum
Add a function to the header for doing this cast.

Ref #4236
2021-08-18 15:06:12 +02:00
Christian Prochaska
d7a27c448d qt5: implement 'CancelableSyncSocket::Shutdown()'
Fixes #4239
2021-08-18 15:06:12 +02:00
Martin Stein
626b2f9cf2 run/libc_vfs_fs_fat: add to autopilot
Excludes board 'virt_qemu' from the test as we don't have block device drivers
for this board.

Ref #4220
2021-08-18 15:06:12 +02:00
Martin Stein
2533d7b4b6 vfs/fatfs: cleanup implementation
- remove redundant file system factory

- remove dead code block

  The code was guarded by preprocessor directives checking whether the
  contrib code define "_USE_MKFS" is 1. As "_USE_MKFS" is not set one
  for our port of FAT, the code was never executed and can be removed.

- remove uneffective config attributes

  Apparently, the former XML attributes to the plugin 'drive' and
  'codepage' had no effect. I tested them in a scenario with the VFS
  block server on a disk-image boot-module as back end. Regardless of
  the 'drive' value, the block session label was always "0". Regardless
  of the 'codepage' value, the FAT on the disk image succeeded to mount
  when not using '--codepage' for 'mkfs.fat' and failed to mount when
  using '--codepage' to specify a supported but foreign codepage for
  'mkfs.fat' (e.g. "720").

Ref #4220
2021-08-18 15:06:12 +02:00
Martin Stein
60c8369718 lib/fatfs: get rid of global static constructors
There was one global static constructor:

! namespace Fatfs { static Constructible<Platform> _platform; }

This caused applications that used the lib or the <fatfs> VFS plugin to end up
in an uncaught exception due to Genode::Component complaining that method
'construct' returned without executing pending static constructors if they
didn't call Genode::Env::exec_static_constructors().

As the use of Genode::Env::exec_static_constructors() is discouraged in Genode,
this commit rather moves the '_platform' object to the scope of the
initializing function and introduces a global static pointer to the object that
gets set by the initializing function. Although this prevents the exception, it
is, technically speaking even worse than the former solution as the new pointer
isn't checked for validity in contrast to the 'Constructible' object.

However, so far, I don't see a clean solution to this problem without the need
for Genode::Env::exec_static_constructors().

Fixes #4220
2021-08-18 15:06:12 +02:00
Christian Helmuth
b59e2ba677 microcode_intel: archive moved to GitHub finally
As version 20180807a is not provided on GitHub, I updated the port to
the most recent release 20210608.

Issue #2762
2021-08-18 15:06:12 +02:00
Sebastian Sumpf
c3e8c22a6d sculpt: integrate intel_gpu_drv
* the GPU multiplexer now offers the platform service to the Intel
  framebuffer driver (driver_manager)
* ajdusted drivers_managed-pc to hand out resources to the GPU driver
* adjust quotas

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
2fe70f111b intel_fb_drv: Aperture exhaustion and display IRQ patch
* display an error in case the aperture is too small for all
  framebuffers
* handle display engine IRQs only

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
1727de30b7 gpu/intel: free DMA, clear ggtt
* free DMA caps in case platform client's session is closed
* clear GGTT of platform client upon session close

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
6c003a13d2 gpu/intel: add platform service for display handling
The platform services is intented to be used by dde_linux's intel_fb_drv
in order to initlialize displays.

* implement and announce platform session
* limit accessible GTT and aperture of client to 64 MB
* forward display engine IRQs to platform client
* move all PCI resources to 'Igd::Resources' class in order to make them
  accessible by the platform service and the GPU driver
* fix fence register allocation for id zero (return true)

issue #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
11192b18e6 gpu/intel: dump status context register bits
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
fe867765a8 gpu/intel: support multiple exec buffer per client
required for mesa-21

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
ffc89f3edf gpu/intel: let guard page handling up to client
For mesa-21 the client takes care and manages
the virtual address space of the vGPU by itself and the intel/gpu driver
can't add silently a guard page anymore. Move the patch to the drm/ioctl
of the former mesa version.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
067b7d7c67 gpu/intel: deny virtual address above 1 << 48
commit avoids memory corruption in the ppgtt page insertion code

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Josef Söntgen
4b653fbac1 gpu/intel: handle double insertion in PPGTT
As the PPGTT is populated by the client, the client has to account for
guard pages and so forth.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Josef Söntgen
7dc997c8e6 gpu/intel: handle CSB correctly
As it turns out reading both dwords as qword results in mirrored
values, DDTT.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
5d6ea5ef22 gpu/intel: allocate vcpu/engine as part of session
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
a721933771 gpu/intel: move context/ring handling into objects
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
c949e5c90d gpu/intel: remove allocator_guard
Issue #3759 #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
243a9ec3ca gpu/intel: free up context/memory ring
_unmap_dataspace_ggtt requires the cap of Ggtt::Mapping (ring_map, ctx_map)
in order to find the right metadata and to free up the ggtt entries. Also the
pte range is removed already if the metadata was found.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
b3147050cc gpu/intel: add support to report finished batches
- extend gpu multiplexer to report last completed execution buffer
- on client side lookup finished buffers and disable busy state

issue #4233
2021-08-18 15:06:11 +02:00
Martin Stein
f8953de7ac nic_router: replace term "uplink" with "NIC client"
BREAKS CONFIG COMPATIBILITY:
This commit changes the configuration interface of the NIC router in a way that
may break systems that use the component without proper adjustment!

HOW TO ADJUST:
At each occurrence of the '<uplink ...>' tag in a NIC router configuration
replace the tag name 'uplink' with 'nic-client'. The rest of the tag stays the
same.

The term "uplink" for network interfaces in the router that have a NIC session
client as back end was introduced in a time when Uplink sessions didn't yet
exist. Now, they do and, although both an uplink and an Uplink session
normally describe a network session between router and network device driver,
they are based on two different service types (NIC and Uplink). This can easily
cause confusion when integrating the router (the <uplink> is not related to
Uplink sessions) or trying to understand its functioning (an 'Uplink' object
has nothing to do with the Uplink service).

Therefore, this commit introduces the more specific term "NIC client" for an
interface that is based on a NIC session requested by the router. This doesn't
imply any semantic changes at the NIC router. However, the commit also brings a
broader update of the router's README and removes the term "downlink" that was
used only in documentation to refer to interfaces backed by a NIC session
provided by the router. The term was only associated with this meaning because
it is the natural counterpart to an uplink. This isn't appropriate anymore as
the terms for interface types have moved to a more technical level.

The commit adjusts all scenarios in the basic Genode repositories properly.

Fixes #4238
2021-08-18 15:06:11 +02:00
Christian Helmuth
fce525f122 depot: update recipe hashes 2021-07-28 11:27:05 +02:00
Martin Stein
2afae7e7c1 nic_router: uncaught exc. on handling link state
An interface that received a signal for a link-state change accessed its
domain reference without assuming that it could not be attached to a domain
at that moment. This caused the NIC router to crash with an uncaught exception
of type 'Net::Pointer<Net::Domain>::Invalid'. The commit adds a catch
directive for this exception resulting in the handler doing nothing if not
attached to any domain.

Fixes #4222
2021-07-28 11:27:05 +02:00
Martin Stein
d06773b957 run/tz_vmm: remove usb_armory support
The test script failed during preparation of the on-target execution for
USB Armory with the following error:

! can't read "tz_vmm_block_irq": no such variable

Presumably, the script wasn't run anymore since the introduction of the
'tz_vmm_block_irq' variable for i.MX53 QSB. As we do not have infrastructure
for automated testing of the USB Armory and there seems to be not much
interest in using Genode on this platform, this commit simply removes the
support from the script.
2021-07-28 11:27:05 +02:00
Martin Stein
c8a8cbd7be run/tz_vmm: fix deprecated use of board specs
Filtering boards in a run script by specs isn't the right way anymore (the
specs do not exist anymore). Nowadays, we have to use [have_board] instead.

Ref #4229
2021-07-28 11:27:05 +02:00
Martin Stein
00e8e363d8 run/tz_vmm: fix broken network test
For unknown reasons, the former 'wget genode.org' call, that was meant to test
network in the Trustzone guest on imx53_qsb_tz, didn't succeed anymore although
the same call succeeded on my Sculpt VM Linux. However, 'ping 1.1.1.1' still
works, so, the script now uses this as test for networking instead.

Fixes #4229
2021-07-28 11:27:05 +02:00
Martin Stein
8bc861ca71 nic_router: do not re-use ARP request as reply
So far, in order to create an ARP reply, the NIC router merely created a copy
of the corresponding ARP request and modified only those values that differ.
This approach has the disadvantage of re-using bad parameters from a broken
request. The specific use-case that made this visible was an early version of
the Pine board network driver that used to forward ARP requests with a greater
size than required. The ARP replies of the router re-used this size and
confused other network nodes with that. In general, the NIC router should
rely on the data of incoming packets the least possible. Therefore, with this
commit, the router creates a new ARP reply from scratch and uses only those
values required from the corresponding ARP request.

Fixes #4235
2021-07-28 11:27:04 +02:00
Martin Stein
9384e075cb ipv4: get rid of C++ bitsets, add DF/MF flags
The former declaration of the IPv4 packet did not only use the questionable
tool of implementation-defined C++ bitsets but also lacked access to flags
"don't fragment" (DF) and "more fragments" (MF). This commit replaces the
C++ bitsets by using the register framework and introduces accessors for the
missing flags.

Ref #4236
2021-07-28 11:27:04 +02:00
rolandbaer
52011ec034 smbios_decoder: fix timer error message
added timer to run file to fix error message.

Fixes #4237
2021-07-28 11:27:04 +02:00
Alexander Boettcher
908d581a8c qemu-usb/webcam: reset delay packet state
on feature reset initiated by guest

Issue #4078
2021-07-28 11:27:04 +02:00
Johannes Schlatow
b38ec9f238 usb_webcam: correctly enable auto exposure mode
genodelabs/genode#4231
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
9334ec09e2 sculpt: route non-usb block sessions to 'drivers' 2021-07-28 11:27:04 +02:00
Johannes Schlatow
1bfc828826 libuvc: add UVC 1.50 support
genodelabs/genode#4231
2021-07-28 11:27:04 +02:00
Johannes Schlatow
b51b9e1ef3 libusb: fix size of control messages
Fixes genodelabs/genode#4230
2021-07-28 11:27:04 +02:00
Norman Feske
3d36291d7f run/load/fastboot: support 64-bit ARM
This patch lifts the limitation for 32-bit ARM platforms and makes the
parameter --load-fastboot-device optional. If only one device is
present, it can be omitted.

Fixes #4232
2021-07-28 11:27:04 +02:00
Johannes Schlatow
2afb7c5567 nic_router: fix Tcp_packet header fields
data_offset and NS flag were incorrectly read due to missing endianess
conversion. Also fix name of CWR flag.

Fixes genodelabs/genode#4227

genodelabs/genode#4227
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
ee045a68cc os: introduce C-API to Genode services
This commit introduces a C-API to the Uplink session, as well as to
serve as a Block service. It can be used by drivers ported from
C-only projects, like the Linux kernel, or BSD kernels for instance.

Fix #4226
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
1a526e73a3 dde_linux: introduce new lx_emul/lx_kit library
The re-newed approach currently supports ARM 64-bit only.
It depends on the Platform API of the ARM architecture.
It tries to meet the original semantic of the Linux kernel
functions as far as possible. To achieve this, device drivers
using this library should reference the original Linux kernel
headers at foremost. Only the headers in `src/include/lx_emul/shadow`
have to shadow clone the original ones.

Fix #4225
2021-07-28 11:27:04 +02:00
Johannes Schlatow
1aba330ae6 dde_linux: fix packet size calc. of Nic drivers
skb_push() already increases the skb->len by ETH_HLEN, hence adding
ETH_HLEN to the packet_size is redundant.

A too large packet size becomes a problem for large MTUs. With a maximum
MTU of 1500, adding ETH_HLEN twice will lead to a packet size of 1528.
Since this is larger than what we expect for good-old Ethernet (max. 1522),
some clients (e.g. the e1000 model in vbox5) may drop these packets.

Fixes genodelabs/genode#4228
2021-07-28 11:27:04 +02:00
Christian Helmuth
119d72ad94 fetchurl: User-Agent header and HTTP response code
I discovered thinkbroadband.com requires the User-Agent header field and
rejects requests missing it with HTTP response code 403 "access to the
requested resource is forbidden". Now, fetchurl always adds the
User-Agent header fetchurl/LIBCURL_VERSION.

Also the error message now contains the HTTP response code.
2021-07-28 11:25:21 +02:00
Stefan Kalkowski
b16bb82f8b dde_linux: mark lx_emul and lx_kit as legacy
* Move headers in src/include into legacy sub-directory
* Move src/lx_kit to src/lib/legacy/

Fix #4223
2021-07-28 11:25:21 +02:00
Stefan Kalkowski
f939b9ffb5 base-hw: print addr as hex value in cache warning
Ref #4207
2021-07-28 11:25:21 +02:00
Norman Feske
45f5ed173a tool/run: use [board] for naming driver packages
This patch replaces the enumeration of boards in the drivers_nic_pkg and
drivers_interactive_pkg functions by inferring the package names from
the [board] name. This eases the addition of driver packages in external
repositories.

Fixes #4221
2021-07-28 11:25:21 +02:00
Norman Feske
6de19e4a9b tool_chain_auto.run: exercise 'ln -s'
as a regression test for issue #4219.
2021-07-28 11:25:21 +02:00
Norman Feske
5138aeba80 libc: fix nested monitor call in 'symlink'
The symlink implementation wrongly constructed a 'Sync' object within
the context of a monitor call. The 'Sync' constructor indirectly
depended on libc I/O for obtaining the current time, ultimately
resulting in a nested attempt of a monitor call. This could be
reproduced via the base.run script:

  $ cd /home
  $ ln -s a b

The 'ln' command resulted in the following log message:

  [init -> /bin/bash -> 7] Error: deadlock ahead, mutex=0x10ff8c70, return ip=0x500583a7

The patch fixes the problem by splitting the single monitor call into
two monitor calls and moving the construction of the 'Sync' object
in-between both monitor calls, thereby executing the constructor at the
libc application level.

Fixes #4219
2021-07-28 11:25:21 +02:00
Norman Feske
f3908b8283 tool: refine help text of list_dependencies
Issue #4204
2021-07-28 11:25:21 +02:00
Christian Helmuth
fdc4bd2f90 tool/run: absolute source path for load_tftp_inst_cmd 2021-07-28 11:25:21 +02:00
Sebastian Sumpf
4d4cc4fd02 libm: use libm from libc and remove openlibm
- enable libm for x86/arm
- update ieee754 to slightly changed output
- remove openlibm from port

fixes #4213
2021-07-28 11:25:21 +02:00
Sebastian Sumpf
4b10aa94ec base-hw: save/restore fpcr register for ARM_V8
The floating-point (fpcr) control register is user land accessible and
controls, for example, rounding mode.

fixes #3723 and related to #4213
2021-07-28 11:25:20 +02:00
Martin Stein
688379d1ed sel4: fix segmentation fault with CCACHE=yes
Building the elfloader in kernel-sel4.inc has a problem with Genodes CCACHE
make variable. When issuing ...

! ./tool/depot/create mstein/bin/*/base-sel4-* CCACHE=yes

..., building the elfloader used to consume all memory of the host system and
then run into a segmentation fault:

! make[6]: *** [elfloader/elfloader.o] Segmentation fault (core dumped)

This is because the other build system invokes the CCACHE variable as a command
in front of the compiler command. If CCACHE is set to 'yes', the 'yes' command
is called and produces an endless output into some output file. The problem
can be fixed by locally re-setting the CCACHE variable for the
'make ... elfloader' command to 'ccache' (Genode CCACHE==yes) or '' (Genode
CCACHE!=yes).

Fixes #4212
2021-07-28 11:25:20 +02:00
Martin Stein
0074a7c4ac tool/depot: fix forwarding of CCACHE
The depot tool 'build_bin_archive' used to ask only whether CCACHE is empty or
not and, if it wasn't empty, the tool added 'CCACHE := yes' to the build.conf
of the temporary build dir. This caused the sub-build processes to use ccache
even when the top-level CCACHE variable was set to a bogus value.

Also adds documentation of the CCACHE variable to the help message of the
'build' and 'build_bin_archive' tool.

Ref #4212
2021-07-28 11:24:56 +02:00
Martin Stein
388e2a0e6d fec nic driver: fix compiler warnings
Fixes #4178
2021-07-28 11:24:55 +02:00
Christian Prochaska
a856bfb4ab qt5: implement 'SyncSocket' with pipes on Genode
Fixes #4208
2021-07-28 11:24:55 +02:00
Christian Prochaska
3824c0ca5f qt5: ignore 'fcntl(F_SETLK)' error in sqlite3 implementation
Fixes #4194
2021-07-28 11:24:55 +02:00
Robin Eklind
40e2aa6617 builddir/run_x86: add note regarding missing -no-kvm switch
Also, add -enable-kvm notes as commented out QEMU_OPT option.

Updates #500.
2021-06-28 11:38:20 +02:00
Martin Stein
2d017ad7b7 nic_router: guard against exception in free_ip
Adds try-catch-statement with diagnostic errors in Dhcp_server::free_ip in
order to guard against exceptions from the underlying bit allocator. These
exceptions should never happen given that the router is programmed correctly
and always feeds Dhcp_server::free_ip with sane arguments (which it should).
However, should this not be the case, we can assume that the failed IP freeing
indicates that the IP isn't allocated anyway and it's fine to continue using
the router. Furthermore, IP allocations are a mere client service and not
relevant for the integrity or safety of the router.

Ref #4200
2021-06-25 11:57:28 +02:00
Martin Stein
be644098d7 nic_router: fix exc. in Interface::handle_config_3
When Interface::handle_config_3 (third step of applying a new configuration to
interfaces) tried to detach the interface from the current IP config because
the old and new IP config differed, it did so using the new domain. The former
steps of the reconfiguration already installed the new domain reference at the
interface. Therefore, also the DHCP server of the new domain was used. This,
however caused uncaught exceptions because detaching from an IP config
includes dissolving all DHCP allocations. This dissolving of DHCP allocations
now operated on a DHCP server (the one of the new domain) that wasn't related
to the allocations and, in the worst case, caused an uncaught exception
because the IPs were out of its range.

That said, this commit ensures that detaching an interface from an IP config
is always done on the domain from which the IP config originated. Normally,
this is the domain the interface is attached to. But in the case of
Interface::handle_config_3, it is another - the former domain the interface
was attached to.

The commit also adapts the nic_router_dhcp_* tests in a way that they
reconfigure the router in a way that would trigger the uncaught exception
without the fix.

Fixes #4200
2021-06-25 11:57:24 +02:00
Sebastian Sumpf
fd9bc43be1 ldso: Fix RISC-V support with 21.05 tool chain
- force inlining of more functions
- force -O2 for RISC-V (even if -O0 is set globally)
- intialize cxx guard after self relocation

issue #4094
2021-06-25 11:56:22 +02:00
Sebastian Sumpf
a6fe6c90d4 tool_chain: add ENABLE_FEATURE support
default: "c c++ ada go gdb"

This allows to build a subset of the Genode tool chain

issue #4094
2021-06-25 11:55:41 +02:00
Christian Helmuth
ece33d37f8 depot: update recipe hashes 2021-06-25 11:46:37 +02:00
Stefan Kalkowski
e7067050be base: extend cache maintainance functionality
Introduce two new cache maintainance functions:
* cache_clean_invalidate_data
* cache_invalidate_data
used to flush or invalidate data-cache lines.

Both functions are typically empty, accept for the ARM architecture.
The commit provides implementations for the base-hw kernel, and Fiasco.OC.

Fixes #4207
2021-06-25 11:43:41 +02:00
Stefan Kalkowski
ed0cc5330e tool/dde_linux: add list_dependencies utility
Fix #4204
2021-06-25 11:43:41 +02:00
Johannes Schlatow
b83c8f35c6 depot: ffi for x86_32
genodelabs/genode#4201
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
a242bfce48 libports: ffi for x86_32
- Required by glib

issue #4201
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
19a7997734 qemu-usb: consume device report during controller construction
Initially parse the USB devices report after the signal handler is
registered, do not rely on a signal to be triggered (issue #1788).

Fixes #4206
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
a58473dece autopilot: add usb_hid_reconnect run script
- Adjust script to run on Qemu x86 only

fixes #4205
2021-06-25 11:43:41 +02:00
Christian Helmuth
cd25dc4e6a dde_bsd: prevent ‘nonnull’ argument warning
The implementation conflicted with the implicit declaration of bzero:

.../repos/dde_bsd/src/lib/audio/mem.cc: In function ‘void bzero(void*, size_t)’:
.../repos/dde_bsd/src/lib/audio/mem.cc:377:2: warning: ‘nonnull’ argument ‘b’ compared to NULL [-Wnonnull-compare]
2021-06-25 11:41:46 +02:00
Christian Helmuth
c585e008b1 acpica: prevent recursive 'memset()' calls with gcc 10
Thanks to Peter for the patch.

Issue #4125
2021-06-25 11:41:45 +02:00
Norman Feske
5b85bd9602 mk: make LD_SCRIPT_DYN customizable
This way, a target.mk becomes able to override the default linker
script, e.g., for adding custom symbols.
2021-06-25 11:41:45 +02:00
Martin Stein
0dc7084b0f wifi_drv: fix compile warnings with gcc 10
Fixes #4202
2021-06-25 11:41:45 +02:00
Martin Stein
16c4aacf34 vfs/dir_fs: allow opening empty dirs
Adapts Dir_file_system::open_composite_dirs in a way that it returns "success"
when the leaf node of the path is an empty directory but "lookup failed", as
usual, if one of the other directories on the way to the leaf node is empty.

I couldn't find a technical reason why we used to return "lookup failed" when
only the leaf node was empty.

The commit also adds a test for en empty root directory and empty
sub-directories to the fs_query run script.

Fixes #4198
2021-06-25 11:41:45 +02:00
Martin Stein
6bfdddd0b5 fs_query: gracefully deal with missing directories
The fs_query component used to exit with an uncaught exception if a queried
directory didn't exist. Now, fs_query will catch this event and simply skip the
affected query, thereby indicating to the user the inexistence of the
queried directory.

Ref #4032
2021-06-25 11:41:45 +02:00
Johannes Schlatow
026b117a63 separate sandbox api from os
genodelabs/genode#4191
2021-06-25 11:41:45 +02:00
Norman Feske
e5600fea06 dde_linux/extract_initcall_order: support v5.12
This patch adjusts the 'extract_initcall_order' utility to the changed
initcall symbol syntax introduced in Linux by the following commit:

   https://github.com/torvalds/linux/commit/a8cccdd9

It uses an additional sed step to strip away the kmod prefix,
__COUNTER__, and __LINE__ information so that the symbol names match
those of earlier kernel versions.

Issue #4188
2021-06-25 11:41:45 +02:00
Norman Feske
f541668604 dde_linux/create_dummies: show objs for variables
Issue #4188
2021-06-25 11:41:45 +02:00
Norman Feske
bf7500ad7b dde_linux/create_dummies: out-of-tree build dir
This patch enables the tool/dde_linux/create_dummies tool to operate on
a out-of-tree build directory. The Linux source tree is determined by
examining the build directory's Makefile.

Issue #4188
2021-06-25 11:41:45 +02:00
Norman Feske
29b7c5a202 dde_linux/create_dummies: show symbol details
When combining the 'show' command with a defined LINUX_KERNEL_DIR,
each symbol gets annotated with the object file where it is defined.

Issue #4188
2021-06-25 11:41:45 +02:00
Johannes Schlatow
7346defc26 usb_modem_drv: remove nic_server mode
genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
dff1df0b49 usb_modem: do not fail on netif_stop_queue
genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
2c87c68a5d depot: add ffi api and src archives
Fixes genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
52a4293bbc depot: add usb_modem_drv archives
genodelabs/genode#4201
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
ff57bf617b usb_webcam: webcam run script
Run script for quickly testing webcams in Qemu or on target.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
818f1682ee qemu-usb: flush EP improve isochronous handling
- Patch the XHCI model in order to handle frame wrapping correctly. For
  this adjust 'mfindex_kick' to the correct period (same, before, or after
  'mfindex').

- Flush EP when it is stopped, this causes all pending packets for the EP
  to be acked. Correct counting of packets in flight.

- Add BEI patch by Josef.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
eabda8907f usb_host: add support to flush EP transfers
This causes all pending transfers of a EP to be canceled and in turn to
be acked by the raw session.

issue #4196
2021-06-25 11:41:44 +02:00
Alexander Boettcher
4aa99fd1a9 qemu-usb: reduce cpu load by webcam model
if no new frame is available for capturing

Fixes #4078 #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
ff452619e3 vbox5-nova-capture: Set camera to 640x480@30fps
Default to 30fps

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
19a5fee70b depot_deploy: add <capture> session announcement
Announce Capture session if node is present in runtime.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
c66a196f76 usb_webcam: package recipes
- API packages for: libusb, libuvc, and libyuv
- Source packages for: API packages + USB webcam app
- Meta package for USB webcam
- Raw package for USB webcam configuration

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
9165c7601d libyuv: make shared object
- Adjust port to Genode expected layout
- Make shared library
- Adjust dependent infrastructure to change

issue #4196
2021-06-25 11:41:44 +02:00
Martin Stein
ff128df131 dde_linux/fec: fix unsynchronized TX DMA write
Unfortunately, our current implementation of 'wmb()' doesn't seem to do what we
want it to do. On base-hw + imx6q_sabrelite, the write of bdp->cbd_sc seems to
get re-ordered after the write to txq->bd.reg_desc_active in the transmission
path of the contrib code. Due to this, the transmission of the packet is only
triggered the next time a packet is sent. However, we only quick-fix it by
enforcing the execution of the write with a volatile global read as we will
soon update the FEC NIC port with a new DDE approach anyway.

Fixes #4010
2021-06-25 11:41:44 +02:00
Christian Prochaska
747d01e854 qt5: adapt QtWebEngine contrib code for use of nss
Fixes #4192
2021-06-25 11:41:44 +02:00
Christian Helmuth
331844c979 vbox6: support capslock="rom" mode
In ROM mode the global CapsLock state is controlled by the capslock ROM
by virtual KEY_CAPSLOCK events.

Guests are easily confused by spurious KEY_CAPSLOCK input events in
caps="rom" mode. These spurious events may reach the VMM if KEY_CAPSLOCK
is not pressed as first key in a combination and, therefore, is not
filtered as global key. We filter KEY_CAPSLOCK in ROM mode in the VMM
explicitly, but let it pass in non-ROM mode.

Per default RAW mode is used and CapsLock key events are sent unfiltered
to the guest.
2021-06-25 11:41:44 +02:00
Christian Helmuth
434d007dc1 stdcxx: some missing symbols for basic_string
Revealed with -O0 when linking test/lx_fs_notify/file_writer.

Issue #4070
2021-06-25 11:41:44 +02:00
Pirmin Duss
7db6f457d4 lx_fs: enable watch
Enable watching files via the inotify interface of the Linux Kernel.

Delivery of watches to components is staggered in order to prevent an
overflow of the ACK queue in cases when a lot of changes are made to the
file system from the Linux side.

Fixes #4070
2021-06-25 11:41:44 +02:00
Christian Helmuth
37f1873f2e vbox5: drop KEY_CAPSLOCK events on capslock="rom"
Guests are easily confused by spurious KEY_CAPSLOCK input events in
caps="rom" mode. These spurious events may reach the VMM if KEY_CAPSLOCK
is not pressed as first key in a combination and, therefore, is not
filtered as global key. Now, we filter KEY_CAPSLOCK in ROM mode in the
VMM explicitly, but let it pass in non-ROM mode.

Fixes #4087
2021-06-25 11:41:43 +02:00
Christian Helmuth
002037ce15 vbox6: support MAC address overwrite 2021-06-25 11:41:43 +02:00
Christian Helmuth
2a1a47b598 vbox6: update to version 6.1.22 2021-06-25 11:41:43 +02:00
Alexander Boettcher
ab31de0f6a libc_integration: reduce rounds for x86_32
autopilot mode. The test machine is less powerful as the x86_64 one.

Issue #3967
2021-06-25 11:41:43 +02:00
Pirmin Duss
a37ff1d985 lx_fs: enable session quota upgrades
Issue #4070
2021-06-25 11:41:43 +02:00
Pirmin Duss
4053e1628b lx_fs: support for unlink
This is based on the work of @ehmry and @sidhussmann.

Issue #4070
2021-06-25 11:41:43 +02:00
Alexander Boettcher
27004e1fd5 usb: remove monolithic usb driver
+ adjust README files

Fixes #4173
2021-06-25 11:41:43 +02:00
Johannes Schlatow
b09e69a444 ports: change bashrc path
genodelabs/genode#4163
2021-06-04 11:29:04 +02:00
Johannes Schlatow
758c0a21cc depot: add jschlatow download and pubkey
Fixes #4185
2021-06-03 08:23:50 +02:00
Christian Prochaska
60eec251e0 qt5: increase stack size of QtWebEngine render thread
Fixes #4168
2021-06-02 10:36:01 +02:00
Stefan Kalkowski
336350fe60 sculpt: enable support for MNT Reform2 2021-06-01 15:53:48 +02:00
Stefan Kalkowski
8408bf6ac0 fec_nic_drv: remove nic_server mode
Issue #4133
2021-06-01 15:51:22 +02:00
Alexander Boettcher
73d87073af vbox5/6: avoid negative timeouts in xhci model
Fixes #4184
2021-05-31 15:36:53 +02:00
Sebastian Sumpf
cf2527269f qemu-usb: allocate host devices after webcam
Because qemu-usb allocated host devices after 'USB_HOST_DEVICE' in the
object array and 'USB_WEBCAM' is loacated after 'USB_HOST_DEVICE' the
webcam model can overwrite an already allocated pass-through device. As
a solution add the 'USB_FIRST_FREE' to make it clear from where host
devices can be allocated. Also increase the number of supported host
devices to eight.

fixes #4182
2021-05-31 15:19:46 +02:00
Christian Prochaska
520b69ef0d libports: update expat port
Fixes #4183
2021-05-31 15:19:44 +02:00
Christian Helmuth
c0150f97e5 version: 21.05 2021-05-31 13:24:05 +02:00
Norman Feske
5dc7d55cc0 News item for version 21.05 2021-05-31 13:24:04 +02:00
Norman Feske
fd2f137a9b Release notes for version 21.05 2021-05-31 12:41:38 +02:00
Christian Helmuth
1d52bd017d depot: update recipe hashes 2021-05-28 14:16:46 +02:00
Josef Söntgen
e06f3bba27 drivers_managed-imx8q_evk: fix hdmi device node
By now the 'compatible' name is set via the 'type' attribute.

Fixes #4181.
2021-05-28 14:16:46 +02:00
Stefan Kalkowski
1d12755401 depot: add i2c api package
Fixes #4180
2021-05-28 14:16:46 +02:00
Stefan Kalkowski
f2ac341003 depot: add architectural content to os api package
Fixes #4179
2021-05-28 14:16:45 +02:00
Christian Prochaska
f2ff1a6d52 dde_linux: save and restore ARM FPU state in setjmp.S
Fixes #4161
2021-05-28 14:16:45 +02:00
Johannes Schlatow
4383579db6 window_layouter: improve focus history
If no window has ever been focused, next() always returns an invalid
window id. As a consequence, there is no way to cycle through the focus
history without an explicit focus event (e.g. mouse hover).

Instead, next() should return the first window from the focus history if the
currently focused window is not present.

Fixes genodelabs/genode#4164
2021-05-28 14:16:45 +02:00
Christian Helmuth
f0b9549376 wifi_drv: optionally report MAC address
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
aab6f52325 wifi_drv: remove nic_server mode
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
6e85a73a28 ipxe_nic_drv: optionally report MAC address
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
4abc530974 ipxe_nic_drv: remove nic_server mode
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
583ba0e9db ipxe_nic_drv: eliminate static constructors
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
62f83b7198 linux_nic_drv: optionally report MAC address
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
464f0eaf8b linux_nic_drv: remove nic_server mode
Issue #4133
2021-05-28 14:16:45 +02:00
Josef Söntgen
0f72a342f3 wifi_drv: fix setting 'bssid' in config
The wpa_supplicant refuses to set the BSSID in case it is quoted.
Removing the quotes allows for specifying the BSSID in the
configuration.

Fixes #4175.
2021-05-28 14:16:45 +02:00
Alexander Boettcher
3dff399fba netperf_*_usb: fix cap quota for sel4+hw x86
Fixes #4016
2021-05-28 14:16:45 +02:00
Alexander Boettcher
0aa99648d7 run: use usb/hid driver in VM tests
Issue #4173
2021-05-28 14:16:45 +02:00
Alexander Boettcher
6b9fcc9449 drivers_interactive-rpi: use usb host/hid driver
Issue #4173
2021-05-28 14:16:45 +02:00
Alexander Boettcher
f9c7947c45 drivers_interactive-pc: use usb host/hid driver
Issue #4173
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
28189ba77a tool: simplify initcall order extraction
The new tool `extract_initcall_order` generates a header file out of a
Linux kernel build, which provides a sorted array with the initcall function
names of the kernel build. The order states the order in which the initcall
have to be called. It gets extrated out of the Linux kernel System.map.

Fixes #4172
2021-05-28 14:16:45 +02:00
Alexander Boettcher
fc5903c917 themed_decorator: upgrade cap and memory on demand
Issue #4150
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
7f6f710bd2 imx8mq_platform_drv: introduce reset domains
A reset domain can consist of one or several reset-pins
denoted by name that are assigned to a device.
When the device gets acquired via the Platform RPC API,
the pins are de-asserted, and asserted again when the
device gets released.

A configuration looks like the following:

  <device name="mipi_dsi>
    <reset-domain name="mipi_dsi_pclk"/>
    ...
  </device>

Fixes #4171
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
ed7d6c74f4 i2c: extend API to support transactions
Introduces the notion of a transaction that consists of one or more
messages. Whereby a message has a read or write direction and consists
of one or more bytes.

Issue #4170
Fixes #4169
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
9f099bd61c base-hw: use generalized util/array.h
Issue #4170
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
6780cf0790 base: introduce array utility
Fixes #4170
2021-05-28 14:16:45 +02:00
Christian Prochaska
7b197d54ed tool chain: update gdb to version 10.2
Issue #4094
2021-05-28 14:16:44 +02:00
Alexander Boettcher
933de21339 base: add platform_info to microkernel platforms
Add to older platforms also the info ROM to avoid confusion/red messages.

Issue #4016
2021-05-28 14:16:44 +02:00
Alexander Boettcher
509e5aa776 platform(x86): report features via platform_info
Report via platform_info the capabilities of the kernel, e.g. ACPI and MSI.

With the commit the try-catch pattern on IRQ session creation by the platform
driver is avoided.

Issue #4016
2021-05-28 14:16:44 +02:00
Christian Prochaska
e1abd2db4e base-linux: update arm32 seccomp policy
Issue #4136
Issue #3466
2021-05-28 14:16:44 +02:00
Christian Helmuth
faf491ce92 smartcard: replace usb_drv by usb_host_drv 2021-05-28 14:16:44 +02:00
Alexander Boettcher
98f524bb41 qemu-usb/webcam: signal capturing off earlier
based on comment in Linux sources. Reduce fallback off-capturing detection
to 1s.

Issue #4078
2021-05-28 14:16:44 +02:00
Sebastian Sumpf
7fcf9053b9 usb_hid: perform device destruction on unplug signal only
- Do not perform desctruction on report updatea in EP because
  'unregister_device' may block on Led state 'update' (synchronous
  control message) leading to the driver being stuck because no more
  signals are received
- Check if device is present in 'submit_urb' calls

fixes #4166
2021-05-28 14:16:44 +02:00
Sebastian Sumpf
6910b880e7 usb_host: make device creation/destruction robust
- Signal device ready depending on state (ready or not) immediately or
  when "actconfig" is set
- Report new devices when ready
- Drain packet stream in case there is no device present (needed for
  synchronous operations at client side)
- Do not use 'session_device' on device destruction, check pointer
  directly instead

issue #4149
2021-05-28 14:16:44 +02:00
Alexander Boettcher
708b7f4619 cpu_balancer.run: adjust quota for seL4 2021-05-28 14:15:28 +02:00
Alexander Boettcher
921a99bb9b tool/run: option to copy tftp served files (x86)
Fixes #4153
2021-05-28 14:15:28 +02:00
Norman Feske
a13dee8d19 tool/dts: for extracting content from dts files
The new tool eases the inspection and pruning of device-tree source
files.

Fixes #4165
2021-05-28 14:15:28 +02:00
Martin Stein
0069660958 rump: fix compiler warning
Fixes two warnings of this type:

! src/lib/vfs/rump/vfs_rump.cc:214:52: warning: narrowing conversion of
! ‘(s.stat::st_mode & 64)’ from ‘__mode_t’ {aka ‘unsigned int’} to ‘bool’
! [-Wnarrowing]
!
!  214 |                           .executable = (s.st_mode & S_IXUSR) };
!      |                                         ~~~~~~~~~~~^~~~~~~~~~

Fixes #4160
2021-05-28 14:15:28 +02:00
Johannes Schlatow
7b09675236 depot: add less recipe
genodelabs/genode#4162
2021-05-28 14:15:28 +02:00
Johannes Schlatow
4bed825956 depot: add diffutils recipe
genodelabs/genode#4162
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
5135ff2dc2 usb_webcam: An app using libuvc for USB webcams
issue #4158
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
4a56171a77 libports: port of libuvc
by Josef Soentgen

issue #4158
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
ae5b4c9624 libusb: Make USB library more robust
- Add reference count for open/close
- Add cancel transfer support
- Handle packet stream correctly

issue #4158
2021-05-28 14:15:28 +02:00
Josef Söntgen
46c846ef91 libports: add iso handling to libusb
issue #4158
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
c8c589d91a libyuv: enable MJPEG support
issue #4158
2021-05-28 14:15:28 +02:00
Josef Söntgen
5254930930 libports: update jpeg library to v9d
issue #4158
2021-05-28 14:15:28 +02:00
Martin Stein
70797fe879 fs_tool: add <new-file> operation
Adds the <new-file> operation to the fs_tool. When configured, the
<new-file path="...">...</new-file> tag will cause creation or overwriting of
the file given through the 'path' attribute. The file will contain the text
content of the tag.

Ref #4032
2021-05-28 14:15:28 +02:00
Norman Feske
100583e262 os/vfs.h: New_file utility
This patch moves the utility from the app/text_area to os/vfs.h to make
it easier to use by other components. By hosting the 'New_file' as a
friend alongside the 'Directory', we can now pass a 'Directory' as
constructor argument, which is consistent with other utilities such as
'File_content'.

As a further improvement, the new version supports the implicit creation
of the directory hierarchy leading to the new file.

Issue #4032
2021-05-28 14:15:27 +02:00
Norman Feske
57fbd2b658 os/vfs.h: Directory::create_sub_directory
This method can be used to create a directory hierarchy within a
'Directory'.

Issue #4032
2021-05-28 14:15:27 +02:00
Alexander Boettcher
9549eeeca4 ssh_terminal: avoid deadlock during bind callback
Issue #4095
2021-05-28 14:15:27 +02:00
Christian Helmuth
9166a75f2c foc: map uncached normal memory bufferable
Mapping normal memory bufferable restores support for unaligned reads on
DMA memory and prevents the following errors on imx6q_sabrelite.

  KERNEL0: alignment error at 18003061 (PC: 0102e3f8, SP: 401ffb18, FSR: 90000001, PSR: 20000110)

Issue #4094
Issue #4157
2021-05-28 14:15:27 +02:00
Martin Stein
dd587c6712 fs_query: support querying file sizes
By adding an attribute 'size="yes"' to a query, one instructs fs_query to
report also the size of each queried file as attribute 'size' of the
corresponding 'file' node.

Ref #4032
2021-05-28 14:15:27 +02:00
Martin Stein
3ed26e7bb2 fs_query: watch only readable files
The fs_query component used to try watching all files it found resulting in
errors on files that are not watchable. For some files, however, the watch-
feature doesn't make sense as they are not readable (no content, no size).
Now, fs_query will check first whether a file is readable and skip watching
if it isn't.

Ref #4032
2021-05-28 14:15:27 +02:00
Martin Stein
6e900f147c fs_query: read content only from readable files
When configuring fs_query to print the content of files it used to try so for
all files it found resulting in errors on files that are not readable. Now,
fs_query will check first whether a file is readable and skip printing the
content of those that are not.

Ref #4032
2021-05-28 14:15:27 +02:00
Tomasz Gajewski
0507d3f44b ssh_terminal: fixed managing ssh file descriptors
Managing ssh event file descriptors was performed from two different
threads which could cause reallocation of structure used in other thread
in a call to 'poll' function.

Splitted initialization to parts and moved ssh event part into ssh loop.

Issue #4095
2021-05-28 14:15:27 +02:00
Tomasz Gajewski
0b641ba581 ssh_terminal: fixed race condition during startup
Moved creating ssh loop thread after initialization of wake up server
file descriptors to make sure that they will be properly handled even in
first loop run.

Issue #4095
2021-05-28 14:15:27 +02:00
Martin Stein
b3a229eebb vfs_block: write less to the log
Remove calls to the Genode log functions that were done unconditionally or
according to a static verbosity flag.

Ref #4032
2021-05-28 14:15:27 +02:00
Martin Stein
fd0a4e78c8 rump: write less to the log
Remove calls to the Genode log functions that were done unconditionally or
according to a static verbosity flag.

Ref #4032
2021-05-28 14:15:27 +02:00
Stefan Kalkowski
74d826d1ad tool: simplify Linux dummy function generation
The new tool `create_dummies` easily lists missing references,
while porting subsystems of the Linux kernel to Genode, e.g., device drivers.
Moreover it can automatically generate dummy implementations for functions
and global variables.

Fixes #4156
2021-05-28 14:15:27 +02:00
Alexander Boettcher
b6b9801c20 seoul: fix ahci model busy bit handling
A warning, discovered during GCC 10.3 update, got fixed wrongly.

Issue #4097
2021-05-28 14:15:27 +02:00
Stefan Kalkowski
b22d9385f1 imx8mq_platform_drv: enable root clock div setting
Fixes #4155
2021-05-28 14:15:27 +02:00
Stefan Kalkowski
516601b7ba os: add Platform::Device::sigh_omit_initial_signal
Add possibility to register an interrupt handler without triggering
an initial spurious interrupt for ported device driver code.

Fixes #4154
2021-05-28 14:15:27 +02:00
Alexander Boettcher
67a8f29697 rump_ext2.run: increase cap quota for sel4 2021-05-28 14:15:27 +02:00
Josef Söntgen
3e284558a1 drm: account for guard page
This makes the rendering issue with mesa gears disappear.

Issue #4148
2021-05-28 14:15:27 +02:00
Alexander Boettcher
04d8e03ecb mesa: use 32bit RGB in egl platform lib
Fixes distortion in mesa gears i965

Issue #4148
2021-05-28 14:15:27 +02:00
Alexander Boettcher
cfe29b0e52 libc_integration.run: specify random source
After update of stdcxx, either hardware (CPU) random sources are taken
or, if not available/insufficient, /dev/urandom is used.

Issue #3967
Issue #4094
2021-05-28 14:15:27 +02:00
Alexander Boettcher
d4b9be8d44 stdcxx: support /dev/urandom
when cpu does not provide sufficient hardware support. (happens on our
nightly test machine as also build machine).

Issue #4094
2021-05-28 14:15:27 +02:00
Johannes Schlatow
db97af8dec vfs: fix read of large files in fs_file_systems
For fs_file_systems, reads are limited to the size of the packets from the
File_system session. Hence, we cannot read the large files in one go.

This fix is particularly helpful for fonts_fs, as it enables including font
files from a File_system.

genodelabs/genode#4135
2021-05-28 14:15:27 +02:00
Johannes Schlatow
4daf19ec7e vfs_ttf: update glyphs when font file changes
genodelabs/genode#4135
2021-05-28 14:15:27 +02:00
Christian Prochaska
18a43c1afd base-foc: fix assignment in 'Ipc_pager::acknowledge_exception()'
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Helmuth
813f4d976b lxip: allocate skb with properly aligned IP header
Comment in Linux sources:

  Since an ethernet header is 14 bytes network drivers often end up with
  the IP header at an unaligned offset. The IP header can be aligned by
  shifting the start of the packet by 2 bytes. Drivers should do this
  with:

  skb_reserve(skb, NET_IP_ALIGN);

This is ensured when using netdev_alloc_skb_ip_align().

Issue #4094
2021-05-28 14:15:26 +02:00
Sebastian Sumpf
a24224ffc3 usb_host: improve isochronous performance on Intel
This patch takes advantage of block transfer interrupts on Intel XHCI
controllers which is used during isochronous transfers. Because of a bug
in hardware (see usb_host_isoc_bei.patch header), this feature has been
disabled for Intel leading to up to 8000 interrupts/s for isochronous
transfer causing severe CPU consumption on Genode. With this commit we
lower host driver consumption to normal levels.

issue #4149
2021-05-28 14:15:26 +02:00
Sebastian Sumpf
9543161827 usb_host: Move task to device in USB session
A Lx::Task is now associated to a USB device not the session any more.
This implies that a task lives as long as the device making it possible
to gracefully handle outstanding requests (i.e., synchronous) in case
the session has been closed.

issue #4149
2021-05-28 14:15:26 +02:00
Martin Stein
a0517686ca ports/libsparkcrypto: update for GCC 10
The old port version contained '*.ali' files that were build with an older GCC
which led to problems when compiling packages that use the port with the new
GCC 10. The '*.ali' files of the new port version were generated with GCC 10.

Fixes #4145
2021-05-28 14:15:26 +02:00
Sebastian Sumpf
9209dfc9d5 ldso: output loaded objects of 'Shared_object' interface
When loading shared libraries via the 'Shared_object' interface display
all additionaly loaded libraries in case 'ld_verbose' is configured. Up
until now, only the loaded library was displayed. In order to determine
if a dependend library had arlready been loaded prior to loading the
'Shared_object' the reference counter is used.

fixes #4147
2021-05-28 14:15:26 +02:00
Alexander Boettcher
f8d0552d52 libc_integration: fix out-of-bound access
which leads to sporadic pagefaults/segmentation faults.

Fixes #3967
2021-05-28 14:15:26 +02:00
Martin Stein
139a2cfae9 tool: use local LC_ALL=C instead of LC_COLLATE=C
We used to export 'LC_COLLATE=C' for the environment of Genode tools. This was
meant to ensure that sorting is always done C-style and not dependent on the
users locale settings. This is required, for instance, to ensure that the same
archive always yields the same hash.

However, 'export LC_COLLATE=C' is not sufficient. It can be outruled by an
'LC_ALL' setting in the users environment. The manual of 'sort' recommends to
set 'LC_ALL=C' locally if you want reliable results and this is what this
commit does. Furthermore it removes the former 'export LC_COLLATE=C'
directives.

Note that I couldn't find a way to set 'LC_ALL' local to 'exec ... sort' in
TCL. This is why I set it global instead using TCLs 'env' array.

Note that the Make directive '$(sort ...)' and the TCL directive 'lsort',
unlike the Shell directive 'sort', are not affected by the users locale
settings.

Fixes #4144
2021-05-28 14:15:26 +02:00
Alexander Boettcher
1c20ed12c1 qemu: sanity check misconfigured memory for okl4
Issue #4095
2021-05-28 14:15:26 +02:00
Alexander Boettcher
d516544a1f ssh_exec_channel.run: use default Qemu memory size
The default size is on most kernels 512M. On OKL4 we have to use 800M,
because of the statically configured memory ranges in the OKL4 kernel.

By avoiding a specific amount of memory, the default Qemu memory sizes are
used.

Issue #4095
2021-05-28 14:15:26 +02:00
Martin Stein
f8b2fd522b ports/ada-runtime: update to support gcc 10
Fixes #4128
2021-05-28 14:15:26 +02:00
Christian Prochaska
471d34a367 Remove mpc and mpfr ports
These ports are not needed anymore with the 21.05 tool chain update.

Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
d5e4ffd191 sanitizer: update to version 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
4a4b754bf2 gcov: update to version 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
a0f5d34e25 stdcxx: update to version 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
9a3d5dcf21 tool_chain: update ali2dep for gcc 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
9c05cda6e7 tool_chain: update gcc to version 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Sebastian Sumpf
6639261126 binutils: augment equally-named sections again
Revert GNU ld to the old behavior where sections with the same name in multiple
ld scripts are merged. Binutils 2.36.1 creates two sections with the same name.

Fixes #4126
2021-05-10 11:52:27 +02:00
Christian Prochaska
fc902d9e66 tool_chain: update binutils to version 2.36.1
Issue #4094
2021-05-10 11:19:13 +02:00
Christian Prochaska
6a11b78cdf tool_chain: use gcc-provided dependency libraries
Download gmp, mpc and mpfr with the download script provided by the
gcc source tree and let the gcc build system handle the build of these
libraries with the correct compile options. This fixes build issues on
armhf Linux and removes the need to maintain mpc and mpfr ports in
the Genode tree.

Issue #4094
2021-05-10 11:19:11 +02:00
Christian Prochaska
7fd598f0c1 tool_chain: build 'gprbuild' from source
The 'gprbuild' version which is provided by Ubuntu 18.04 has a bug
which prevents it from building 'ali2dep' with gcc/gnat 10. With
this commit, a newer 'gprbuild' version is built from source.

Issue #4094
2021-05-10 11:19:09 +02:00
Christian Helmuth
777923f9bd depot: update recipe hashes 2021-05-10 11:18:12 +02:00
Martin Stein
d2bf565503 nic/zynq: fix packed conversion error with gcc 10
Fixes #4142
2021-05-10 11:17:21 +02:00
Alexander Boettcher
384a8da50b ssh_terminal: use pthread_mutex
to avoid sporadic deadlocks between EP thread and the server loop pthread.

Issue #4095
2021-05-10 11:17:20 +02:00
Alexander Boettcher
b6bdd91cfa nova: avoid unaligned warnings by gcc10
Issue #4126
2021-05-10 11:17:20 +02:00
Christian Helmuth
a5385cebf4 block_cache: explicitly instantiate template function
The explicit instantiation is required because the function is defined
in the compilation unit only but referenced externally.

Fixes #4108
2021-05-10 11:17:20 +02:00
Josef Söntgen
c5c3d7ca98 gpt_write: address unaligned access for name
Turn member into byte array to prevent unaligned memory access.

Fixes #4141.
2021-05-10 11:17:20 +02:00
Norman Feske
d19b751632 nano3d: remove surface-clear optimization
This patch fixes a GCC-10 compile error. Even though the optimization
was quite effective - I measured a speedup of factor 2 - it is not all
that important for the overall application performance. In the nano3d
case, we are talking about 1 vs. 2 percent of CPU time.

Fixes #4140
2021-05-10 11:17:20 +02:00
Christian Prochaska
ff160decec gdb: fix build errors with gcc 10
Fixes #4139
2021-05-10 11:17:20 +02:00
Norman Feske
a4115cfea9 base-linux: discharge timestamp on AARCH64
The kernel-agnostic 'Trace::timestamp' function for arm_64 executes the
'mrs %0, pmccntr_el0' instruction, which is not permitted for user-level
programs on Linux. This patch shadows the generic timestamp.h header
with dummy that returns zero. This return value prompts the timeout
framework to disable the interpolation of time based on timestamps. This
avoid the illegal-instruction abort but comes with two llimitations:

First, time measurements are effectlively limited to a granulariry of 1
millisecond (deliberately constrained by the timer driver).

The quirk is applied when using the base-linux API. Should a generic
application (that uses the base API only) call 'Trace::timestamp'
directly, the illegal instruction is executed.

Issue #4136
2021-05-10 11:17:20 +02:00
Norman Feske
2f9d430c00 base-linux: 64-bit ARM support
This patch adds support for running Genode/Linux on the AARCH64
architecture.

- The kernel-agnostic startup code (crt0) had to be extended to
  capture the initial stack pointer, which the Linux kernel uses
  to pass the process environment. This is in line with the
  existing startup code for x86_32 and x86_64.

- The link order of the host libraries linked to lx_hybrid
  programs had to be adjusted such that libgcc appears at last
  because the other libraries depend on symbols provided by
  libgcc.

- When using AARCH64 Linux as host, one can execute run scripts
  via 'make run/<script> KERNEL=linux BOARD=linux' now.

Issue #4136
2021-05-10 11:17:20 +02:00
Christian Helmuth
718f44ae5b Check max_len before dereferencing pointer in Cstring constructor
Fixes #4112
2021-05-10 11:17:20 +02:00
Martin Stein
66feb939e6 cbe_tester: compile errors/warnings with gcc 10
Fixes #4113
2021-05-10 11:17:20 +02:00
Christian Helmuth
1baf844e20 vfs_stress: fix handling of 'char' in error message
Issue #4112
2021-05-10 11:17:20 +02:00
Martin Stein
5fa2efa745 net/dhcp: print readable message types
When a DHCP packet is printed out, it first tries to determine the most
specific message type from the DHCP options and print its human-readable name
right after the protocol name. If finding the message type fails, the less
specific opcode is printed instead, but also in a human-readable way.

Fixes #4131
2021-05-10 11:17:20 +02:00
Norman Feske
ad847d0543 sculpt: fix glitch in fs-browser back arrow
Fixes #4124
2021-05-10 11:17:20 +02:00
Norman Feske
0b36d81c0c base-linux: separate x86-specific code
By moving core's build-description to a library - a pattern already
employed for the other base platforms - we become able to cleanly split
x86-specific code (I/O-port access) from generic code. This is a
prerequisite for enabling non-x86 architectures such as AARCH64.

Issue #4136
2021-05-10 11:17:20 +02:00
Jean-Adrien DOMAGE
a4727c90a8 lx_fs: add os/run/lx_fs_import.run run script
This new runscript demonstrates how a file can be overwritten by vfs
import with the flag overwrite set to false. This is due to a bug
in lx_fs that is not propagating an ernno EEXIST syscall error.

Issue genodelabs#4104
2021-05-10 11:16:24 +02:00
Jean-Adrien DOMAGE
e65b7f3b82 lx_fs: fix errno EEXIST not propagated
This commit introduces a fix for lx_fs to propagate errno EEXIST error.
This prevents vfs <import overwrite="false"> to overwrite an imported
file, if it already exists, without the overwrite flag set to true.

Issue genodelabs#4104
2021-05-10 11:16:24 +02:00
Josef Söntgen
0f0edc0134 usb_host: implement sg_pcopy_* as TRACE dummies
The former implementation called 'TRACE_AND_STOP' which led to the
'usb_host_drv' to stop whenever such a function was called. Rather
than stopping return '0' and let the contrib code deal with this
situation.

Issue #4116.
2021-05-10 11:16:24 +02:00
Josef Söntgen
d0f084d449 usb_host: backport xhci bounce-buffer fix
This commit backports the Linux upstream commit (d4a6106) [*]
that introduces a check to prevent the sglist from being used
unconditionally.

[*] 'xhci: fix bounce buffer usage for non-sg list case'

Fixes #4116.
2021-05-10 11:16:24 +02:00
Christian Prochaska
c7b2314d23 foc: fix errors with gcc 10 and binutils 2.36
Fixes #4118
2021-05-10 11:16:24 +02:00
Christian Helmuth
eb94f03416 microcode.run: do not twiddle with MAKEFLAGS
Unconditionally setting MAKEFLAGS to just 's' is not nice because other
flags cannot be passed through the run script. What the script desires
is to disable the automatically enabled '--print-directory' for sub-make
instances when calling tool/port/current by declaring
'--no-print-directory'.
2021-05-05 11:55:27 +02:00
Norman Feske
516a9a6925 depot: update recipe hashes 2021-05-05 11:35:31 +02:00
Norman Feske
fdb1a4dd88 base-linux: avoid legacy syscalls
Until now, Genode's Linux system call bindings were based on original
Unix system calls that were later superseded by more flexibile variants.
E.g., 'openat' is a modern version of 'open'. Even though Linux upholds
the compatiblity with the original versions for existing architectures
like x86, the legacy syscalls are absent for the recently added AARCH64
architecture. A good overview of the system calls accross the prominent
architectures can be found at

https://chromium.googlesource.com/chromiumos/docs/+/master/constants/syscalls.md

This patch updates Genode's syscall bindings to avoid legacy versions,
thereby easing the support for AARCH64. The used "modern" versions
were introduced back in Linux version 2 days. So we are fine to rely
on them.

The patch slightly changes the signature for lx_stat because this system
call is merely used to check for the existance of a file and its size.
The new name 'lx_stat_size' draws a closer connection to its use case.
That said, the stat syscall has not been updated to the modern statx
since statx is still a fairly recent addition.

Issue #4136
2021-05-05 11:35:31 +02:00
Norman Feske
d477062c56 base-linux: simplify clone syscall binding
This patch simplifies the use of the clone system call for creating
processes and threads. Until now, the binding used an opaque pointer
argument to pass context information to the newly created process or
thread. However, upon close inspection, this is not a strict
requirement.

A newly created thread accesses its contextual information by
using its stack pointer as key. The pointer argument is not used.

The creation of processes is strictly serialized because the
intermediate stack used in-between clone and execve is a global
variable. Since we rely on the serialization anyway, we can pass the
context information of a new process via a global variable as well.

This change simplifies the syscall binding for the upcoming AARCH64
support, which would otherwise require us to deal with the notion
of TLS on Linux.

Issue #4136
2021-05-05 11:35:31 +02:00
Norman Feske
811009d18b News item about Sculpt 21.03b update 2021-05-05 11:35:31 +02:00
Christian Prochaska
00d13cf304 qt5: fix build errors with gcc 10
Fixes #4132
2021-05-05 11:35:31 +02:00
Martin Stein
49184fb938 net: circumvent stringop-overflow error
With the update to GCC 10, the compiler stopped with an error when compiling
places where a MAC address is copied from outside into a packed object using
the Net::Netaddress::copy method (e.g. in
Net::Arp_packet::dst_mac(Mac_address)):

! error: writing 6 bytes into a region of size 4 [-Werror=stringop-overflow=]

While trying to find a clean solution for this error, I found posts on
gcc.gnu.org and github that stated that the size calculations that cause these
errors are incorrect. Indeed, I could verify that the actual size of the two
regions was static and exactly the same in places were the error occured.

Furthermore, I couldn't find a way of making it more clear to the compiler
that the sizes are the same. By accident, we found that using the address of
the first element of the array that forms the second region instead of the
array address itself, somehow circumvents the error.

Fixes #4109
2021-05-05 11:35:31 +02:00
Martin Stein
52e8c95321 net: fix packed-conversion compiler warning
With the update to GCC 10 the compiler used to warn when using the internet
checksum functions on packet classes (like in
Net::Ipv4_packet::update_checksum):

warning: converting a packed ‘Net::[PACKET_CLASS]’ pointer
         (alignment 1) to a ‘const uint16_t’ {aka ‘const short
         unsigned int’} pointer (alignment 2) may result in an
         unaligned pointer value

Apparently, the 'packed' attribute normally used on packet classes sets the
alignment of the packet class to 1. However, for the purpose of the
internet-checksum functions, we can assume that the packet data has no
alignment. This is expressed by casting the packet-object pointer to a pointer
of the new packed helper struct 'Packed_uint16' that contains only a single
uint16_t member before handing it over to the checksum function (instead of
casting it to a uint16_t pointer).

Ref #4109
2021-05-05 11:35:31 +02:00
Christian Prochaska
9b854e1496 Prevent recursive 'memset()' calls with gcc 10
Fixes #4125
2021-05-05 11:35:31 +02:00
Christian Prochaska
d5e7870532 virtualbox5: fix build errors with gcc 10
Fixes #4106
2021-05-05 11:35:31 +02:00
Christian Prochaska
bc8dbc6b1a bash: fix build error with gcc 10
Fixes #4107
2021-05-05 11:35:31 +02:00
Christian Prochaska
8f23e377d9 lxip: fix build error with gcc 10
Fixes #4102
2021-05-05 11:35:31 +02:00
Christian Prochaska
aebece5110 readline: fix build error with gcc 10
Fixes #4103
2021-05-05 11:35:31 +02:00
Christian Prochaska
82604f2c2b lx_fs: fix build errors with gcc 10
Fixes #4123
2021-05-05 11:35:31 +02:00
Norman Feske
4563baae77 app/text_area: fix build error with gcc 10
Fixes #4098
2021-05-05 11:35:30 +02:00
Christian Prochaska
c4e3d3dbc4 hw: fix build error with gcc 10
Fixes #4115
2021-05-05 11:35:30 +02:00
Alexander Boettcher
eb53f8c113 seoul: adjust to GCC 10.03
Fixes #4097
2021-05-05 11:35:30 +02:00
Christian Prochaska
07649b667b sel4: fix build errors with gcc 10
Fixes #4121
2021-05-05 11:35:30 +02:00
Christian Prochaska
0f679bb35e pistachio: fix build error with gcc 10
Fixes #4119
2021-05-05 11:35:30 +02:00
Christian Prochaska
d6e9d74038 nitpicker: fix build error with gcc 10
Fixes #4110
2021-05-05 11:35:30 +02:00
Christian Prochaska
405e6744fb nova: update kernel for gcc 10
Fixes #4114
2021-05-05 11:35:30 +02:00
Christian Prochaska
fad85c3fd5 virtualbox6: fix build errors with gcc 10
Fixes #4105
2021-05-05 11:35:30 +02:00
Christian Prochaska
49392dfa44 dde_ipxe: fix build error with gcc 10
Fixes #4101
2021-05-05 11:35:30 +02:00
Christian Prochaska
e627f8320f verify: fix build error with gcc 10
Fixes #4099
2021-05-05 11:35:30 +02:00
Christian Prochaska
8196e229b0 netperf: fix build error with gcc 10
Fixes #4096
2021-05-05 11:35:30 +02:00
Christian Prochaska
0a8394c891 depot_autopilot: store signal context capability as copy
Fixes #4129
2021-05-05 11:35:30 +02:00
Christian Prochaska
66e8f8d764 base: increase bss alignment to 8 bytes
Fixes #4127
2021-05-05 11:35:30 +02:00
Christian Prochaska
84e4cbb54c cxx: add 'strchr()'
Fixes #4122
2021-05-05 11:35:30 +02:00
Tomasz Gajewski
23b21812dd Fixes in gdb_monitor_interactive/target_config.run
Fixes #4134
2021-05-05 11:35:30 +02:00
Norman Feske
d66e55ec37 aes_cbc_4k.run: increase timeout
needed for foc/qemu/x86_32
2021-05-05 11:35:29 +02:00
Martin Stein
5dbc9ef244 nic_router: more descriptive port allocator code
This renames some members and local variables in the port allocator in order to
make the code more descriptive.

Fixes #4086
2021-05-05 11:35:29 +02:00
Sid Hussmann
4e822436fc nic_router: use increasing src port for new nat
The NAT feature of the NIC router used to prefer re-using source ports that
have been freed recently. From an external server's perspective, if a client
dies and restarts, chances are high that the new connect arrives with the same
source-IP/source-port as the old connection. The server has to forcefully reset
the connection. If that happens a lot, the server may even start to ignore
further connections from this IP/port combination for a while as a mitigation.

This patch adds a continuous counter feature that makes sure that every new
port allocation will increment and result in a port that hasn't been used for a
long time.

The NAT feature of the nic_router is now more in line with RFC 6056 chapter 4.

Ref #4086
2021-05-05 11:35:29 +02:00
Alexander Boettcher
ce75b25fd4 ssh_exec_channel: adjust cap quota for seL4
Issue #4095
2021-05-05 11:35:29 +02:00
Josef Söntgen
118e8ee6e1 ssh_terminal: flush buffer on Terminal cleanup
Issue #4095.
2021-05-05 11:35:29 +02:00
Alexander Boettcher
f236e99b5c ssh_terminal: avoid deadlock of EP and pthread.0
pthread.0 acquires a write buffer mutex and calls potentially
blocking fs operations. The EP thread handles session requests and tries to
acquire the same write buffer lock. IO progress events for pthread.0 are
handled by the EP thread, which however is blocking on the write buffer mutex.

The commit uses two write buffers, one which is filled by the EP and a second
which is used by pthread.0. The two buffers are swapped protected by a mutex
without invoking blocking fs operations.

Issue #4095
2021-05-05 11:35:29 +02:00
Alexander Boettcher
86e09b60c4 exec_terminal: sandbox errors about unknown node
The exec_terminal generates a config report which is used as input ROM for
sandbox/init, which does not support an "<empty>" node.

An empty config node is empty, without an node.

Issue #4095
2021-05-05 11:35:29 +02:00
Johannes Schlatow
373b45a0f0 depot: fix content.mk of drivers_managed-pc
Was still using the event_filter.config from drivers_interactive-pc
although a dedicated file is present in the raw archive.

The fix is just for consistency reasons, as sculpt manager is generating the
event_filter.config anyway.
2021-05-05 11:35:29 +02:00
Johannes Schlatow
a2491c30b3 event_filter: add new test cases
genodelabs/genode#4069
2021-05-05 11:35:29 +02:00
Johannes Schlatow
d80b2a150a event_filter: add <log> node
genodelabs/genode#4069
2021-05-05 11:35:28 +02:00
Johannes Schlatow
c802de2cf9 event_filter: add <ignore-key> node
Fixes genodelabs#4069
2021-05-05 11:35:28 +02:00
Johannes Schlatow
e86387d557 event_filter: allow remapping of KEY_UNKNOWN
KEY_UNKNOWN is a collective symbols for all unknown keycodes.
Remapping thus requires iterating through all corresponding codes
instead of only applying the policy to the first match.

Issue genodelabs#4069
2021-05-05 11:35:28 +02:00
Norman Feske
f6aabfe233 Sculpt: prevent nitpicker's resize warnings
This patch increases the RAM quota of the top-level nitpicker instance
to 12 MiB so that resize operations can be buffered for resolutions up
to 2560x1080. It mutes diagnostic messages of the form "Warning: Gui
(...) not enough RAM to preserve buffer content during resize" and
improves the window-resize experience.
2021-05-05 11:35:28 +02:00
Norman Feske
8617e5cee0 Sculpt: un-inspect failed USB storage
With this patch, the user is able to re-gain access to the inspect view
by toggling the inspect button of a file system unrelated to the failed
USB storage device.

Fixes #4090
2021-05-05 11:35:28 +02:00
Johannes Schlatow
2db94b8438 platform_drv/x86: support to disable MSI-X
+ disable for wifi driver MSI-X

Issue #4079
2021-05-05 11:35:28 +02:00
Alexander Boettcher
7b9e7361ba vbox5: add capture pkg version
Issue #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
910ea16405 qemu-usb: restrict build to x86
Issue #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
58db8c647a qemu-usb: add usb webcam model
Fixes #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
4826bd82fe qemu-usb: fix spelling
Issue #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
7b90f8f857 libports: add libyuv support
Issue #4078
2021-05-05 11:35:28 +02:00
Johannes Schlatow
bf3ad3baff vbox5/6: pass extra mouse buttons to VM
Fixes #4120
2021-05-05 11:35:28 +02:00
Johannes Schlatow
8a4b52d9e3 vbox: only clear screen if virtual_fb_mode changed
Fixes genodelabs/genode#4085
2021-05-05 11:35:28 +02:00
Johannes Schlatow
a47fd36b9f vbox: fix high VM load after resize
break circle of repeated guest notifications if the guest never
acknowledges a VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST

genodelabs/genode#4084
2021-05-05 11:35:28 +02:00
Christian Prochaska
a2e62db6ec qt5: fix libpng vulnerabilities
Fixes #4089
2021-05-05 11:35:28 +02:00
Alexander Boettcher
7503472ae6 stdcxx: add missing symbols for istream and thread
Issue #3967

triggers using -O0 with test-libc_integration:

libc_integration/main.cc:146: undefined reference to `std::istream::operator>>(unsigned long&)'

contrib/stdcxx-80f380143250d4f951433876698b54fdac32b95f/include/stdcxx/std/thread:67: undefined reference to `vtable for std:🧵:_State'
2021-05-05 11:35:27 +02:00
Johannes Schlatow
1c49da8ce4 terminal: don't overwrite last column until eol
Introduce a new _overflowed state variable to indicate whether the
horizontal boundary was reached already and to omit subsequent character
output.

This state is necessary to maintain a valid cursor position at all
times. The _overflowed attribute is reset once the cursor is moved into
a valid position again.

To harmonise the bounds checking for _cursor_pos modifications, the
`constrain()` method was added.

Fixes genodelabs/genode#4093

Also fixes a bug in `vpa()` and `vpb()` which moved the cursor
horizontally instead of vertically.
2021-05-05 11:35:27 +02:00
Norman Feske
9cb8c37e3a terminal: fix sporadic freeze on font-size changes
The direct execution of application-level code by a watch handler is
troublesome because those handlers are executed at the I/O signal level.
In the concrete case, the watch handler got recursively called because
the handler called _handle_config (application-code), which called the
VFS, which in turn performed a wait_and_dispatch_one_io_signal, which
again invoked the watch handler.

The patch works around the problem by letting the watch notification
trigger the application-level signal for the _config_handler.

Fixes #4091
2021-05-05 11:35:27 +02:00
Pirmin Duss
bb6617ad03 New libc_integration test
I created a test program which stresses the interplay between libc,
pthreads and vfs_pipe and may detect regressions.

The program starts a thread that spawns a bunch of workers, sends and
receives data to them through a pipe. When all data of a worker is
collected, the worker is finished (join()) and a new worker is started.
Both the number of bytes sent to the worker and the size of its
answer are random.

Issue #3967
2021-05-05 11:35:27 +02:00
Tomasz Gajewski
f49ec5b171 tool/run: extract function to copy files
Issue #4073
2021-05-05 11:32:09 +02:00
Tomasz Gajewski
507a7789fb tool/run: avoid error if init.xsd is missing
Issue #4073
2021-05-05 11:32:09 +02:00
Stefan Kalkowski
421d2bed40 platform driver: make device info XML optional
* The device XML information dataspace is only provided,
  when the client's policy states `info="yes"`
* The device XM information gets changed to include the
  physical resource names (I/O memory and IRQ addresses)
  instead of virtual ids and page offset

Fix #4077
2021-05-05 11:31:16 +02:00
Norman Feske
6caa74a18e Remove os/slave.h API
Fixes #3754
2021-05-05 11:21:43 +02:00
Norman Feske
5ac3c335dc Remove pkg/test-dynamic_config_slave
Issue #3754
2021-05-05 11:21:43 +02:00
Norman Feske
e8b97ad684 test/resource_yield: don't use os/slave.h
Issue #3754
2021-05-05 11:21:43 +02:00
Christian Helmuth
3f450a77e1 Fix touchscreen config in usb_hid README 2021-05-05 11:21:43 +02:00
Johannes Schlatow
462bff5aef dde_linux: test subdevice id for device matching
As linux drivers may distinguish device configuration by pci subdevice id in
addition to the pci device id, the former must also be used for finding the
matching entry. Otherwise, e.g., the iwlwifi driver might load the wrong
firmware.

Side note: Add break statement to save superfluous iterations after
match was identified.

Fixes genodelabs#4076
2021-05-05 11:21:43 +02:00
Norman Feske
ace7c9172b Disambiguate Mmio::local_addr
This is a follow-up fix for "Streamline platform-device API on ARM".
There is an ambiguity of the 'local_addr' method between the inherited
'Attached_dataspace' and the local declaration, which results in the
double application of the sub-page Range::start.

Issue #4075
2021-05-05 11:21:43 +02:00
Emery Hemingway
173264ed1e depot: remove ehmry
Fixes #4082
2021-05-05 11:21:43 +02:00
Christian Prochaska
190eafeaa6 base: handle 'unpack_string()' error in 'Arg::string()'
Fixes #4100
2021-05-05 11:21:43 +02:00
Josef Söntgen
ddf6a0c276 os: add invalid path exception to Path_base
In case the path is invalid during import raise the 'Path_invalid'
exception.

Issue #4088
2021-05-05 11:21:42 +02:00
Josef Söntgen
8f30fc993d libc: check path pointer in file I/O functions
Fixes #4088
2021-05-05 11:21:42 +02:00
Alexander Boettcher
33a64f79dc libc: place pthreads round-robin
if the number of threads started exceed configured placement configuration

Issue #3967
2021-05-05 11:21:42 +02:00
Pirmin Duss
7de62734e5 libc: add pipe2 symbol to symbols
Issue #3967
2021-05-05 11:21:42 +02:00
Norman Feske
d73eaaa14c libc: exclude arm_initfini.c
This compilation unit contains a global constructor, which violates our
assumption that the libc is free of global constructors on ARMv7.
Specifically, the graphical terminal fails with the following message:

[init -> terminal] Error: Component::construct() returned without executing
                          pending static constructors (fix by calling
                          Genode::Env::exec_static_constructors())
[init -> terminal] Error: Uncaught exception of type 'Linker::Fatal'

In this case, the libc-less terminal uses the VFS. The VFS mounts the
ttf VFS plugin. The ttf VFS plugin depends on the libc.

The compilation unit 'arm_initfini.c' can safely be excluded because it
merely initializes the global '_libc_arm_fpu_present' variable, which
is not used by the current version of our libc/libm.

Fixes #4080
2021-04-20 12:12:48 +02:00
Norman Feske
efbed6f7bf depot: update recipe hashes 2021-04-20 12:10:58 +02:00
Norman Feske
5ca024ff8b vfs_block.run: adjust cap quota for seL4 2021-04-20 12:10:58 +02:00
Norman Feske
dc8c899c1d Streamline platform-device API on ARM
This API rework eases the access to memory-mapped I/O registers and
interrupts when using the platform driver. It introduces the notions of

- Platform::Device       - one device obtained from a platform session
- Platform::Device::Mmio - locally-mapped MMIO registers of a device
- Platform::Device::Irq  - interface for receiving device interrupts

The patch touches several drivers. Some drivers would require a
significant structural change to adopt the new API (e.g., net/virtio,
dde_linux drivers, imx gpio). In these cases, the patch adds
compatibility shims meant to be temporary. In other cases (e.g., imx
i2c), the adaptation was simple enough to carry through.

Fixes #4075
2021-04-20 12:10:58 +02:00
Stefan Kalkowski
d1cf9c86b8 os: introduce device type in platform driver
* Move "compatible" property value to "type" attribute
* Turn device_by_property helper in Platform::Connection into device_by_type

Fix #4074
2021-04-20 12:10:58 +02:00
Norman Feske
46ca576eac Adjust gcov cap quota for seL4 2021-04-20 12:10:58 +02:00
Norman Feske
70281715c6 ssh_exec_channel.run: fix server IP pattern
This patch adjusts the matching of the IP address such that the external
IP address is used as opposed the the NAT-local address. It is follow-up
fix of the conversion to the uplink session interface.

Issue #3961
2021-04-20 12:10:58 +02:00
Norman Feske
4546148ab7 Adjust test-libc_fifo_pipe cap quota for seL4 2021-04-20 12:10:58 +02:00
Sebastian Sumpf
80cf47d906 ldso: protect object list with mutex
When we allowed symbol resolution during exceptions, we used the shared
object lock to protect ELF object list manipulation (e.g., dlopen,
dclose) when executing exception unwinding code in the linker.
Unfortunately, sometimes libraries that are loaded by 'dlopen' may raise
exceptions in the process, leading to a deadlock within the unwind code.
In order to resolve this, we now protect the object list operations
(i.e., enqueue, removal, iteration) by a separate mutex. This allows
the shared object interface to throw exceptions.

issue #4071
2021-04-20 12:10:58 +02:00
Norman Feske
7c01053842 Adjust test-fault_detection cap quota for seL4 2021-04-20 12:10:58 +02:00
Norman Feske
e28709d54d acpi_drv: use expanding reporter
This makes the driver work on newer machines that produce reports larger
than 16 KiB. E.g., Sculpt OS boots successfully on a Lenovo P53s laptop
now.
2021-04-20 12:10:58 +02:00
Norman Feske
dc89ebf978 core: kernel-agnostic 'Mapping' type
This patch unifies the core-internal 'Mapping' type across all base
platforms.

As one minor downside on seL4, the diagnostic error messages when
observing faults other than page faults no longer print the faulting
thread and PD names.

Issue #2243
2021-04-20 12:10:57 +02:00
Norman Feske
7ae1210531 fs_rom: remove "ROM file is missing" messages
These messages pollute the boot log of Sculpt OS when ROM modules are
requested for files of the config fs before the sculpt manager has
created their first version.
2021-04-20 12:10:57 +02:00
Norman Feske
c9d904df71 vfs/tar: remove "tar archive ..." message
This diagnostic output is a mere debugging artifact. By removing them,
we make the boot of Sculpt less noisy.
2021-04-20 12:10:57 +02:00
Norman Feske
21e9e1840a chroot: forward cap-quota upgrades to the server
Fixes #4072
2021-04-20 12:10:57 +02:00
Norman Feske
4e714d3f3a base: handle cap depletion during session upgrade
When the own cap quota of a client does not suffice for a cap upgrade of
an existing session to a server, the client must issue a cap-resource
request to the parent. This logic was already in place for RAM quota but
was missing for cap quota.

Issue #4072
2021-04-20 12:10:57 +02:00
Martin Stein
2084404aba nic_router: explain state report in README 2021-04-20 12:10:57 +02:00
Sebastian Sumpf
9c9302e51d ldso: allow symbol resolution during dl_itera_phdr
When callback functions of `dl_iterate_phdr` required further jump slot
relocations this lead to a deadlock. Therefore, we allow the resolution
of further symbols from callback functions, but protect the ELF object
list during the iteration, which blocks any dynamic loading (e.g.,
dlopen/dlcose) of shared object by other threads while in program header
iteration.

fixes #4071
2021-04-20 12:10:57 +02:00
Norman Feske
af490bdd5b Revert "sculpt: tweak window motions in leitzentrale"
Apparently the skewed motion timings came from the issue fixed by
"timer: restore semantics of periodic timeout 0". With the current
version of the timer, the original motion parameters work just fine.
2021-04-20 12:10:57 +02:00
Norman Feske
0339318572 platform_session: cache arg for alloc_dma_buffer
This patch extends the 'Platform_session::alloc_dma_buffer' interface
with a 'Cache' argument that corresponds to the argument accepted by
'Ram_allocator::alloc', which is used by the platform driver under the
hood.

Since the x86 platform driver used to be hardwired to allocate DMA
buffers as UNCACHED, I adjusted all drivers by specifying the UNCACHED
argument. Right now, this is needed as a hint for core to steer the
allocation of I/O page tables. Once we eliminate the need for such hints
(by introducing an explicit 'Region_map::attach_dma' operation), we can
revisit the drivers individually because cached DMA buffers should
generally be fine on the x86 architecture.

Issue #2243
2021-04-20 12:10:57 +02:00
Norman Feske
53e44f8bfd x86/platform_session: import Genode namespace
This change avoids many repetetive Genode:: prefixes, making the code
easier to read. The patch also includes a few consistency fixes
regarding include guards and file headers. It also renames
Platform_device::String to Platform_device::Device:name.

Issue #2243
2021-04-20 12:10:57 +02:00
Norman Feske
a839b4f0bb gdb_monitor: adapt to sandbox library changes
Issue #4068
2021-04-20 12:10:57 +02:00
Norman Feske
468e7a825c base/cache.h: rename Cache_attribute to Cache
The short name is better because the type will become prominently
visible at the API.

Issue #2243
2021-04-20 12:10:31 +02:00
Norman Feske
3ed8df9089 x86/platform_drv: add Platform::Session::dma_addr
This patch adds the designated alternative to Dataspace::phys_addr to
the platform-session interface. Under the hood, the platform driver
still calls Dataspace::phys_addr but it should eventuelly become the
only caller before we can abolish this function.

Issue #2243
2021-04-20 12:03:05 +02:00
Norman Feske
97a9ad114c platform_session: bus_addr_dma_buffer to dma_addr
Issue #2243
2021-04-20 12:03:04 +02:00
Norman Feske
f5f5b8c1f1 sandbox/init: route model
This commit optimizes the 'Child::resolve_session_request'
implementation by introducing an internal 'Route_model' for quickly
traversing routing rules instead of parsing XML on each session request.

Fixes #4068
2021-04-20 12:03:04 +02:00
Norman Feske
b661459aca sandbox/init: parse config using 'List_model'
This commit replaces the hand-crafted config processing by the use of
the 'List_model' utility. This has the following advantages:

- The parsing follows a common formalism that makes the code
  easier to maintain and to understand. Several parts of the code
  had to be changed (for the better) to make it fit the list model
  approach. E.g., the child states have become more expressive
  and logical.

- In the common case, the XML data is traversed only once, which
  increases the parsing speed in dynamic scenarios.

- The code becomes easier to optimize. In particular, the patch skips
  the re-evaluation of the session routing if no service is affected
  by the config change.

The patch also revisits the init test by removing overly long sleep
phases and extending a few sleep phases that were too short when
executing the test on Qemu.

Issue #4068
2021-04-20 12:03:04 +02:00
Norman Feske
f925fef17b base: Refine Range_allocator::alloc_aligned
This patch changes the 'alloc_aligned' interface as follows:

- The former 'from' and 'to' arguments are replaced by a single
  'range' argument.

- The distinction of the use cases of regular allocations vs.
  address-constrained allocations is now overed by a dedicated
  overload instead of relying on a default argument.

- The 'align' argument has been changed from 'int' to 'unsigned'
  to be better compatible with 'addr_t' and 'size_t'.

Fixes #4067
2021-04-20 12:03:04 +02:00
Tomasz Gajewski
97d44c5a79 app/menu_view: use CUSTOM_TARGET_DEPS 2021-04-20 12:03:04 +02:00
Tomasz Gajewski
1867cf4967 iwl_firmware: use CUSTOM_TARGET_DEPS 2021-04-20 12:03:04 +02:00
Tomasz Gajewski
f3f8d9a6de build system: support for CUSTOM_TARGET_DEPS 2021-04-20 12:03:03 +02:00
Norman Feske
99f4b3cd07 Debug macros for easy performance profiling
The debug macros 'GENODE_LOG_TSC' and 'GENODE_LOG_TSC_NAMED' allow for
the easy gathering of the TSC ticks consumed by the calling scope.

Fixes #4066
2021-04-20 12:03:03 +02:00
Norman Feske
ac07f9d08e sculpt: skip GUI handling until framebuffer is up
This avoids unneeded activity of the Leitzentrale GUI (e.g., the
decorator) at the early boot phase of Sculpt.
2021-04-20 12:03:03 +02:00
Norman Feske
ed9487b452 rtc_drv: defer init until first use
This patch avoids the RTC driver's aggressive polling during the
(CPU-bounded) boot of Sculpt OS. As the RTC is not needed during bootup,
this patch reduces the boot time (on Qemu) by 2-4 seconds.

Fixes #4065
2021-04-20 12:03:03 +02:00
Norman Feske
729b22f04f rtc_drv/x86: code structure
Give the driver code a proper context in the form of a 'Driver' class.

Adjusted while investigating issue #4065.
2021-04-20 12:03:03 +02:00
Norman Feske
698f6eb86c gdb_monitor: weaken reliance on sandbox internals
GDB monitor re-uses internal parts of the sandbox library. It thereby
relies on the internal detail of how local headers are included (using
"" instead of the now usual practice <>). A seemingly unrelated change
"init/sandbox: avoid repetitive state reports" eventually broke the
build of the GDB monitor.

This patch makes the GDB monitor less reliant on the way of how the
sandbox includes headers internally.

It also fixes a few warnings caused by the double definition of
__GENODE__ (adding an missing include guard and making the #define
conditional).

Related to issue #4064
2021-04-20 12:03:03 +02:00
Norman Feske
73e8d64c34 init/sandbox: avoid repetitive state reports
Fixes #4064
2021-04-20 12:03:03 +02:00
Christian Helmuth
cb9a26f1ed vbox6: sculpt runtime package
Issue #4031
2021-04-20 12:03:03 +02:00
Norman Feske
49481dd3fb timer: restore semantics of periodic timeout 0
The 'Timer::Session::trigger_periodic' RPC function used to accept 0 as
a way to de-schedule the periodic processing. Several components such as
nitpicker relied on this special case. In "timeout: rework timeout
framework", the value of zero was silently clamped to 1, which has the
opposite effect: triggering signals at the maximum rate. This results in
a visible effect in Sculpt where the leitzentrale-nitpicker instance
produces a constant load of 2% CPU time.

This patch restores the original timer semantics by

- Documenting it in timer_session.h,

- Handling the case explicitly in the timer implementation, and

- Replacing the silent clamping of the unexpected value 0 passed
  to the timeout framework by a diagnostic error message.

Issue #3884
2021-04-20 12:03:03 +02:00
Norman Feske
dc8dd3396d base: move Xml_generator::Node::Node behind ABI
Fixes #4063
2021-04-20 12:03:03 +02:00
Christian Helmuth
9ac23a18d4 vbox6: synchronize guest-memory handling 2021-04-20 12:03:03 +02:00
Norman Feske
ae8050bb82 wm.run: let nitpicker request fb and input
This patch restores the ability to launch nitpicker within a gui_fb
window. It is a follow-up fix for "nitpicker: make framebuffer and input
optional".

Issue #3812
2021-04-20 12:03:02 +02:00
Tomasz Gajewski
0a849a1681 prepare_port: cache handling for files with paths
This patch is a follow-up fix for issue #4028 that fixes #4061.
2021-04-20 12:03:02 +02:00
Christian Prochaska
f89414c637 libports: update expat port
Fixes #4060
2021-04-20 12:03:02 +02:00
Christian Helmuth
4cdfeb13e2 vbox6: cleanup code and log output
Issue #4031
2021-04-20 12:03:02 +02:00
Christian Helmuth
1a57a5a959 vbox6: refactor vcpu implementation
Also add recent SVM changes from vbox5.

Issue #4031
2021-04-20 12:03:02 +02:00
Norman Feske
96cc660f95 sculpt: system reset via PS/2 and ACPI
This patch enables sculpt to utilize the CPU reset mechanism via the
PS/2 controller as well as the information provided via the ACPI FADT
information. Whenever the /config/system file is changed to <system
state="reset"/>, both mechanisms are triggered.

Supporting both mechanisms is useful because the PS/2-based reset does
not work reliably on modern machines. The PS/2-based reset is useful in
the case when the FADT reset information refers to the PS/2 command
port. In this case, the platform driver is unable to access this port
because it is already handed out to the PS/2 driver. In this case, the
PS/2 driver kicks in.

Issue #2726
2021-04-20 12:03:02 +02:00
Norman Feske
2c7c7767fc platform_drv: respond to <system state="reset"/>
If 'system="yes"' is specified in the <config>, the platform driver now
monitors the content of the system ROM. Should the value become "reset",
a reset is triggered using information obtained from the ACPI driver.

Related to issue #2726
2021-04-20 12:03:02 +02:00
Norman Feske
9f8c555e7d ps2_drv: respond to <system state="reset"/>
This patch adds the option for monitoring a system ROM to the PS/2
driver and issuing a CPU reset whenever the state becomes "reset".

Issue #2726
2021-04-20 12:03:02 +02:00
Norman Feske
fb9f6812e1 acpi_drv: export ACPI reset info from FADT
The change of the platform driver is needed to avoid a parsing error of
the ACPI ROM when encountering an unexpected <reset> node.

Thanks to Alexander Boettcher for the preventing the regression of #3829
and improving the adherence to the ACPI spec when parsing the reset type.

Related to issue #2726
2021-04-20 12:00:09 +02:00
Christian Helmuth
839183d2b6 vbox6: unify EMT and vCPU entrypoint
Issue #4031
2021-04-20 11:57:19 +02:00
Christian Helmuth
c67e78a7f0 vbox6: update to version 6.1.18
Issue #4031
2021-03-29 15:49:59 +02:00
Christian Helmuth
0ac4d1d411 libc: rename special-purpose pthread creation functions
The functions are used by our VirtualBox ports to hook into thread
creation and, thus, are listed in the ABI symbols.

Issue #4031
2021-03-29 15:48:11 +02:00
Norman Feske
0f9cb72cfa depot: update recipe hashes 2021-03-29 13:46:49 +02:00
Norman Feske
27527bf165 wm: allow clients to upgrade session caps
This patch adds the handling neccessary for clients to upgrade the cap
quota of their GUI session. Until now, the upgrade mechanism supported
only RAM quota.

The limitation became visible once a client - in the particular case the
motif_decorator - attempted the cap upgrade of its GUI session. The cap
quota would arrive at the wm, but the wm would keep it instead of
forwarding the quota to nitpicker. This resulted in an infinite retry
loop at the motif_decorator, ultimatedly depleting all its cap quota.
2021-03-29 13:45:25 +02:00
Norman Feske
f839b3ecba wm: make hover handling robust against input races
The window manager infers the overall state from the intercepted input
events for the decorator and all GUI clients. However, each of those
parties have an independent input-event stream. Whereas the order of
events within one GUI session is strict, the order of events between GUI
sessions is arbitrary. The window manager wrongly relied on a global
event ordering to track the pointed-at GUI session.

The patch removes the assumption of a global event order by tracking the
relevant pointer state for each GUI session independently and evaluating
these states when propagating the pointer position to the decorator.

Fixes #4059
2021-03-29 13:45:24 +02:00
Norman Feske
bfea27a258 Tweak to support delete key in bash
This commit modified bash's builtin mapping of character sequences to
readline-functionality to detect the sequence of the delete symbol as
generated by the terminal.

Fixes #4058
2021-03-29 13:45:24 +02:00
Christian Helmuth
4f91d71cf9 zynq_qemu: disable fb_bench and nic_router_flood tests 2021-03-29 13:45:24 +02:00
Jean-Adrien DOMAGE
32169cd137 add I2c driver for imx8q based platform
This commit introduces a new i2c driver for the imx8q_evk based platform.

Fixes #4052
2021-03-29 13:45:24 +02:00
Norman Feske
eb89b13327 depot: update recipe hashes 2021-03-24 11:32:53 +01:00
Norman Feske
b51c1a0fe3 News item for Sculpt 21.03 2021-03-24 11:32:53 +01:00
Norman Feske
f90cd542cb sculpt: documentation update 2021-03-24 11:32:53 +01:00
Christian Helmuth
dce272ba8f tool/xkb2ifcfg: update README to event_filter 2021-03-24 11:09:08 +01:00
Alexander Boettcher
141af733aa vbox5: remove priority bands from vbox5-* packages 2021-03-24 10:34:55 +01:00
Alexander Boettcher
945b4760ef sculpt: remove vfs.lib and init from common rules
to support packages using own build versions and to detect packages missing
to specify dependency on init.
2021-03-24 10:34:55 +01:00
Alexander Boettcher
53041f4cd8 usb_host: support to disable usb controller types
The commits adds the same configuration values as supported up to now by
the monolithic usb driver. In contrast to the original, by default all drivers
are started. Disabling a controller type is used by Sculpt, e.g. for OHCI if
running Sculpt inside Virtualbox.
2021-03-23 11:50:37 +01:00
Alexander Boettcher
521f61b9e0 usb_hid: disable wacom driver
Issue #3997
2021-03-23 11:32:24 +01:00
Norman Feske
ca50a41d28 depot: update recipe hashes 2021-03-23 11:28:53 +01:00
Norman Feske
b29f1497bf depot_query: sort depot-user scan results
Related to issue #4054
2021-03-23 11:28:21 +01:00
Norman Feske
ca5522d4d9 sculpt: move chargen files to config/keyboard/
The addition of further keyboard layouts would otherwise pollute the
config/ directory too much.

Caution: When updating Sculpt OS, don't reuse your existing
config/event_filter file unmodified! You need to replace the chargen
includes, pointing to the new location, e.g.,

  <include rom="en_us.chargen"/>
  <include rom="special.chargen"/>

must be changed to

  <include rom="keyboard/en_us"/>
  <include rom="keyboard/special"/>

Issue #4055
2021-03-23 11:28:21 +01:00
Norman Feske
36ef41626a sculpt: keyboard-layout selection dialog
This patch extends the settings dialog with the ability to select the
keyboard layout between the options that are included in the sculpt
image. The manual configuration is of course still possible by editing
the /config/event_filter directly.

If both the fonts configuration and the event-filter configuration are
managed manually, the settings button and window are not displayed.

Fixes #4055
2021-03-23 11:28:21 +01:00
Norman Feske
e9ac14ed49 fs_query: report dir content in alphabetic order
By sorting the reported output, all consumers of the reports become able
to rely on a deterministic order. For example, the file browser of
Sculpt OS, the launcher menu items, and the depot-selection items will
appear in a predictable order.

Fixes #4054
2021-03-23 11:28:20 +01:00
Norman Feske
8f1db47c26 sculpt: screen capturing and event injection
This patch adds session-routing options to connect components to the
capture/event interfaces of the global nitpicker GUI server or the
leitzentrale GUI server. It thereby enables the implementation of screen
capturing components, remote management tools, or virtual keyboards.

Since those services are very powerful, they are subsumed under the
"hardware" category of the component graph as opposed to the GUI
category, which guarantees the separation of clients.

Fixes #4053
2021-03-23 11:28:20 +01:00
Norman Feske
d2fc834bfa os: depot recipe for pkg/test-capture
This package allows for experimenting with the capture-session
interface.
2021-03-18 17:36:35 +01:00
Christian Prochaska
3d432331b9 libc: mmap: use VFS handle as reference for shared mappings
Fixes #4050
2021-03-17 16:30:41 +01:00
Christian Prochaska
446df00d0d libc: support 'RLIMIT_DATA' resource in 'getrlimit()'
Fixes #4049
2021-03-16 17:45:40 +01:00
Tomasz Gajewski
2f0898d2a9 dde_linux: fixes in makefiles
Issue #3972
2021-03-16 11:25:25 +01:00
Christian Prochaska
9a0217f21a imx8: use 'snps,dis_u2_susphy_quirk'
Fixes #4048
2021-03-16 11:19:32 +01:00
Christian Prochaska
0cfafa1c8f usb_host_drv: support command timeouts and bool properties
Fixes #4047
2021-03-16 11:19:17 +01:00
Norman Feske
2c85e48a0d Revert "run: tweak CRLF translation in log scripts"
The substitution eats carriage-return characters in some cases such as
the Pine-A64-LTS board connected via an TTL-232R-RPi cable.
2021-03-12 15:08:11 +01:00
Norman Feske
15780a657c sd_card_bench.run: allow timer to reach IO_MEM
This is needed on seL4 on i.MX6 where the user-level timer driver
accesses memory-mapped I/O registers directly.
2021-03-12 12:09:17 +01:00
Norman Feske
5c5b56d1e0 depot: update recipe hashes 2021-03-12 12:08:24 +01:00
Norman Feske
00900d82b5 sculpt: tweak window motions in leitzentrale 2021-03-12 12:01:39 +01:00
Alexander Boettcher
18182b11da base: exit loop on cpu session close
if session can't be closed immediately, e.g. if the service is provided by
a child (cpu_balancer) and not by the parent.

Issue #4029
2021-03-12 12:01:39 +01:00
Norman Feske
8eb514d6b5 sculpt: interactive priority configuration
This patch reworks the resource-assignment dialog to allow the user to
select the scheduling priority in addition to the CPU affinity.

Fixes #4045
2021-03-12 12:01:39 +01:00
Alexander Boettcher
8a8de970a5 sculpt: add system clock package to index
Issue #4046
2021-03-12 12:01:39 +01:00
Sid Hussmann
cae3e447d6 vfs/pipe: fix pagefault during congested pipes
Issue #4030
2021-03-12 12:01:39 +01:00
Alexander Boettcher
f98d10a3f3 depot_deploy: support packages providing Rtc
Fixes #4046
2021-03-12 12:01:39 +01:00
Alexander Boettcher
521663c6de system_rtc: add standalone runtime package
Package contains no rtc driver, which must be provided separately.

Issue #4046
2021-03-12 12:01:39 +01:00
Alexander Boettcher
9b5bedefc7 expanding_pd_session: remove cap warning message
which are caused often when a component runs a bit longer and has dynamic
resource usage, e.g. running Genode's tool chain.
2021-03-12 12:01:39 +01:00
Norman Feske
8ecc258d3f sculpt: introduce runtime priorities
This patch adds 4 priority levels to the runtime subsystem. The highest
priority is used for components that are critical for the operation of
Sculpt, in particular the Leitzentrale GUI. All regularly deployed
components are assigned the lowest priority by default.

With priorities available in the runtime subsystem, this patch flattens
the priority levels at the top-level init to only two levels and
overlays the priority bands of the drivers, leitzentrale, and runtime
subsystems into one priority band. This has three benenfits:

- This change prevents the starvation of the Leitzentrale GUI from a
  spinning high-priority driver (issue #3997).

- The change will also ease the hosting of latency-critical components
  in the runtime subsystem that are prioritized higher than regular
  components, the storage stack, and the network stack.

- The Leitzentrale GUI remains always perfectly responsive regardless
  of the workloads deployed from packages. In the previous version,
  the runtime graph was sometimes stuttering on high system load.

Issue #4045
2021-03-12 12:01:39 +01:00
Sebastian Sumpf
7bbd050f25 riscv: adjust timeout run script to RISC-V
* Limit required memory for RISC-V to 15 MB per buffer

issue #4021
2021-03-12 12:01:39 +01:00
Norman Feske
7e7c10e66c Add sandbox test to depot autopilot
Issue #4044
2021-03-12 12:01:39 +01:00
Norman Feske
d5d3b3c3a4 test.run: support binaries other than init
This change enables the use of runtime pkgs that specify the test binary
directly as attribute in the <runtime> node.
2021-03-12 12:01:39 +01:00
Norman Feske
2baa283d87 vfs_lwip: reduce repeated warnings
This patch avoids the repeated warning "read blocked until lwIP
interface is ready" by printing the message only once. Otherwise,
the log is flooded with those warnings when falkon web browser
is started on Sculpt OS without network connectivity.
2021-03-12 12:01:39 +01:00
Josef Söntgen
4a12b5c653 mixer: fix README with regard to boolean values
Issue #4043.
2021-03-12 12:01:39 +01:00
Josef Söntgen
ba6c4a664f mixer: use audible default settings
In case there is no valid configuration the component used to mute
output by default. This, however, might lead to the assumption that
audio is not working at all. Instead set the master output volume to
50% and the per application volume to 100%.

Fixes #4043.
2021-03-12 12:01:38 +01:00
Norman Feske
9093c293cb sandbox: destroy 'Session_state' of local services
This patch adds the missing destruction of session-state objects of
local services when closing a session. Because of the missing
destruction, those session-state object remained part of the server
ID space. This becomes a problem once the backing store of the session
state object vanishes, that is when the client child gets removed from
the sandbox. Hence, the removal of a child with an open session to a
local service would lead to the corruption of the server ID space.

This patch adds the missing session.destroy() call.

Fixes #4044
2021-03-12 12:01:38 +01:00
Norman Feske
935bb36fe4 base: fix child destruction while close requested
This patch fixes a corner case where a child is destructed while a
asynchronous close request to a sibling server is still pending.

The child immediately discarded the session ID as the end of the
close-session processing, assuming that this ID is never to be needed
again. The session-state continues to exist to handle asynchrous close
protocol with the server.

However, if the child is destructed at this point (before the server
responded to the session request), the destruction of the child would
not cover the discharging of the session state because the session state
was no longer be part of the client's ID space. So once the asynchronous
close response from the server came in, the session state contained
stale information, in particular a stale closed_callback pointer.

The patch fixes the problem by deferring the discarding of the client ID
to the point where the session state is actually destructed. So the
session of a pending close response is covered by the child destructor.

Thanks to Pirmin Duss for reporting this issue along with a test
scenario for reproducing it!

Fixes #4039
2021-03-12 12:01:38 +01:00
Norman Feske
755aed7cb2 dde_linux: don't spin when panicking
Issue #3997
2021-03-12 12:01:38 +01:00
Sebastian Sumpf
6223ae4413 riscv: Interrupt controller support
- Enable the "platform-level interrupt controller" PLIC on base-hw
- The RISC-V specification offers only a register description, but no
  layout for the register set. This implies the layout is platform
  dependent, and therefore, implemented separately for Qemu

issue #4042
2021-03-12 12:01:38 +01:00
Sebastian Sumpf
bebba3876e run boot_dir hw: build debug ELF binaries again
- build debug version of core and bootstrap found under
  _var/run/<runscript>.core_ (.bootstrap). This is a regression when
  switching from object to archive library linkage of core.

fixes #4027
2021-03-12 12:01:38 +01:00
Norman Feske
aa0a98bd43 base-foc/hw: avoid use of placement new operator
Fixes #2106
2021-03-12 12:01:38 +01:00
Josef Söntgen
42f3d2eccd qemu-usb: reset completion pointer
Reset the completion pointer to prevent a double free in case the
packet is processed during ISOC IN request handling.

Fixes #4041.
2021-03-12 12:01:38 +01:00
Josef Söntgen
c03534e355 boot_dir/nova: enable intel_hwp
Instruct bender to enable Intel HWP on supported CPUs unconditionally
to gain more insight by using the feature most prominently in Sculpt.

Fixes #4040.
2021-03-12 12:01:38 +01:00
Norman Feske
1e0d843464 libc: avoid using placement new operator
Issue #2106
2021-03-12 12:01:38 +01:00
Norman Feske
8c7d34ff21 rpi_platform_drv: remove placement new operator
Issue #2106
2021-03-12 12:01:38 +01:00
Norman Feske
d6a312f438 tool/builddir: pass --ccache to run tool
With this patch, the build directory's CCACHE configuration is applied
to the building of depot archives when using the --depot-auto-update
feature.

Note that this is effective only when resetting the hash files before
building so that each depot-auto-update results in the same-named
versions. Otherwise, the include paths (that include the version name as
part of the path) make cache hits impossible.

Issue #4004
2021-03-12 12:01:38 +01:00
Norman Feske
6544cca320 tool/run: add --ccache argument
If this argument is combined with --depot-auto-update, the run tool
enables the use of ccache when invoking the depot/create tool.

Issue #4004
2021-03-12 12:01:38 +01:00
Norman Feske
3d0ed5992d tool/depot/create: add CCACHE=1 option
This commit complements issue #4004 with support for the depot/create
tool. If CCACHE=1 is specified at the command line, the build directory
for building a binary archive is configured with 'CCACHE := yes'.
2021-03-12 12:01:38 +01:00
Norman Feske
366fda0e47 sculpt: release part_block after device discovery
This patch triggers the immediate removal of part_block once the
discovery of a fresh inserted USB stick has completed. Without the
patch, part_block was retained until the runtime was reconfigured the
next time for other reasons (e.g., toggling an inspect view). Until the
next reconfituration, part_block tended to stand in the way of directly
assigning the USB device to a VM.
2021-03-12 12:01:38 +01:00
Christian Helmuth
7ce1f8e92d Enable en_us chargen in drivers_interactive-imx8q_evk
Issue #4038
2021-03-12 12:01:37 +01:00
Christian Helmuth
6e9843bd05 test-libc_fifo_pipe: more cap quota required for sel4/x86_64
Issue #4030
2021-03-12 12:01:37 +01:00
Norman Feske
2ff252360d sculpt: avoid flickering of leitzentrale
This patch increases the RAM quota of the nitpicker instance for the
leitzentrale to make it suffice for the buffering of content during
resize operations. This fixes a flickering artifact when having an
inspect view open while entering a WLAN passphrase. When the connect
button appears or disappears (depending on the number of written
characters), some parts of the inspect terminal would flicker sometimes.
2021-03-12 12:01:37 +01:00
Norman Feske
9de61e7014 base: detect truncated session args
This patch reflects the truncation of session arguments (e.g., by very
long session labels) by denying the session request.

Fixes #4037
2021-03-12 12:01:37 +01:00
Norman Feske
6712eac7e6 platform driver: use same label for all device PDs
Fixes #4037
2021-03-12 12:01:37 +01:00
Martin Stein
25a212aa24 nic_router: fix uncaught bit alloc exception
* catch every possible path of the Bit_allocator_dynamic::Out_of_indices
  exception
* add unconditional log output in the new "catch" directives, so, we will be
  able to debug the problem a bit more in detail next time

Fixes #4036
2021-03-12 12:01:37 +01:00
Alexander Boettcher
89ffc48576 depot_deploy: integrate shim and adapt sculpt
Issue #3837
Issue #4029
2021-03-12 12:01:37 +01:00
Norman Feske
9a5bc9caf0 cpu_balancer.run: use shim for hosting cpu_burner
This way, the redirected env sessions for the CPU burner are no longer
called directly by init. Init stays independent from the behavior of the
CPU balancer.

Issue #3837
Issue #4029
2021-03-12 12:01:37 +01:00
Norman Feske
c0a7565c21 os: shim helper for safe routing of env sessions
This shim component can be used in case where env sessions of child
(i.e., child's PD session) must be routed to another child of init.

Without the shim, init would directly need to interact with these
sessions and would thereby make itself dependent of the server's
behavior. RPC calls to a server hosted as a child lead to all kinds of
problems such as livelock situations, and putting the robustness of init
at the whim of its child.

With the shim, init merely needs to bootstrap the shim component by
routing the shim's env sessions to core as usual. The server is only
used for the sessions for the actual application hosted atop the shim.

Issue #3837
Issue #4029
2021-03-12 12:01:37 +01:00
Alexander Boettcher
a02ec07e49 sculpt_manager: add PD as service
Issue #3837
2021-03-12 12:01:37 +01:00
Alexander Boettcher
1f29055927 depot_deploy: support providing CPU and PD service
Issue #3837
2021-03-12 12:01:37 +01:00
Alexander Boettcher
7af276ac81 cpu_balancer: add support to provide PD service
Issue #3837
2021-03-12 12:01:37 +01:00
Tomasz Gajewski
de62582905 prepare_port: simple cache for downloads
Fixes #4028
2021-03-12 12:01:37 +01:00
Norman Feske
ba567f4ba8 Avoid double slashes in select_from_repositories
Issue #4019
2021-03-12 12:01:37 +01:00
Alexander Boettcher
ee0ed273e6 vm_stress: increase cap quota for 3 & 4 vcpu test
due to changes by

   base: refactor VM/vCPU API

   Issue #3554
2021-03-12 12:01:37 +01:00
Norman Feske
e1bb0e8e15 usb_host: refine class heuristics on device report
This patch is an interim fix for using HID devices that offer a HID
interface as not the first interface. It also supplements the
interface classes as supplemental information to the USB-devices
report.

Fixes #4035
2021-03-12 12:01:37 +01:00
Norman Feske
2e4ccc1459 usb_host: reflect ENOSPC as STALL
Issue #4035
2021-03-12 12:01:37 +01:00
Norman Feske
80522fadf6 usb_hid: don't touch non-HID interfaces
Issue #4035
2021-03-12 12:01:36 +01:00
Norman Feske
2ce4a3b400 sculpt: version 21.03 2021-03-12 12:01:36 +01:00
Norman Feske
c68443e2eb base-hw: support packaging of multi-arch boards
With this patch, the board/<name>/arch property file can have multiple
lines where each line denotes an instruction-set architecture supported
for the board.

Issue #4019
Fixes #4034
2021-03-12 12:01:36 +01:00
Stefan Kalkowski
9685a8b60d drivers_managed-imx8q_evk: add dummy_rtc_drv
Ref #4033
2021-03-12 12:01:36 +01:00
Tomasz Gajewski
23e3079f46 tool/run: option to copy tftp served files
Fixes #3386
2021-03-12 12:01:36 +01:00
Stefan Kalkowski
10b56afff0 rtc_drv: add dummy driver
* Add dummy driver implementation and depot package
* Extend configuration to allow setting an initial RTC value

Fix #4033
2021-03-12 12:01:36 +01:00
Sebastian Sumpf
d4b58b689c base-hw: fix RISC-V duration calculation
Simplify calculation of Timer::_duration, the old implementation caused
the time running backwards sometimes. This makes
'nic_router_dhcp_*' and 'event_filter' run scripts succeed.

issue #4021
2021-03-12 12:01:36 +01:00
Norman Feske
1826ff8a59 sculpt: constrain initial log-window size
This prevents the log terminal from adjusting itself to the whole screen
size before the leitzentrale window layout is applied. This intermediate
size can otherwise exhaust the 8 MiB of RAM quota of the log terminal.

Issue #3970
2021-03-12 12:01:31 +01:00
Christian Helmuth
86ad4ed17f version: 21.02 2021-02-25 11:26:18 +01:00
Norman Feske
1d1b5b88c5 News item for version 21.02 2021-02-25 11:24:28 +01:00
Norman Feske
4f1a3a8000 Release notes for version 21.02 2021-02-25 11:24:28 +01:00
Christian Helmuth
0afd3db894 depot: update recipe hashes 2021-02-25 11:24:23 +01:00
Christian Helmuth
cbe81d35b9 autopilot: disable run script not supported by riscv
Issue #4021
2021-02-25 11:22:59 +01:00
Josef Söntgen
1d551bd967 vbox6: add QEMU xHCI device-model 2021-02-25 11:22:59 +01:00
Alexander Boettcher
812c3599de vbox6: add network backend using the nic session
as used in vbox5 already.
2021-02-25 11:22:59 +01:00
Christian Helmuth
20caac5f3b Port of VirtualBox 6.1.14 2021-02-25 11:22:59 +01:00
Christian Helmuth
a47b374905 vim.run: import clipboard archive only once 2021-02-23 13:22:50 +01:00
Christian Helmuth
7a3dc68f34 vbox5: fix typo 2021-02-23 13:22:48 +01:00
Christian Prochaska
dd92ab126b libc: test TLS support in pthread test
Fixes #4023
2021-02-23 12:19:25 +01:00
Sebastian Sumpf
f68e655312 mk: link core to library archive instead of .o file
Do not link base and core libraries into on large relocatable .o file,
which is linked later to core - causing long link times. Create an
independent library archive out of the base and core libraries that can
be linked faster.

issue #4027
2021-02-23 12:17:04 +01:00
Norman Feske
64165d829e depot: update recipe hashes 2021-02-23 12:07:18 +01:00
Norman Feske
c2feba065f Reduce pointers to doc/ in top-level README
Avoid referencing the content of doc/ for topics that are covered by the
Genode Foundations book.
2021-02-23 12:07:18 +01:00
Christian Helmuth
219809ffed base: refactor VM/vCPU API
Issue #3554
2021-02-23 12:07:18 +01:00
Sid Hussmann
6e8728f2d3 vfs/pipe: use local signal handling
This commit improves the performance of the pipe plugin by using local
signal handling and avoiding sending a signal during write when pipe
buffer is full.

Issue #3583
2021-02-23 12:07:17 +01:00
Stefan Kalkowski
90d9470dfd vmm: add virtio block device model
* Add new virtio device model
* Extend test run-script with vfat block test image
* Add vmm depot src recipe
* Use packages in test run-script

Fix #4025
2021-02-23 12:07:17 +01:00
Stefan Kalkowski
2879aa003b vmm: cleanup virtio model, make it extensible
* Introduce different index types for ring counters and descriptor arrays
  within the Virtio split queue implementation
* Be more accurate in reporting the queue number supported, and raise it
  to 512
* Introduce abstractions for mmio register access, where several values
  are stored at the same place, and selector registers exist.
* Turn Virtio_device into a template to define the Virio queue type,
  and its numbers per device model (needed for e.g., future block model)

Issue #4025
2021-02-23 12:07:17 +01:00
Stefan Kalkowski
83c2309710 run: don't rebuild core/bootstrap when available
Fix #4026
2021-02-23 12:07:17 +01:00
Christian Prochaska
59459e60e7 libc: pthread TLS optimizations
Fixes #4024
2021-02-23 12:07:17 +01:00
Sid Hussmann
8d13121e84 vfs/pipe: refactor read/write synchronization
All pipe-ends were notified at the same time which leads to dead-locks.
This commit mitigates this by having a signal handler for each pipe and
each pipe-end respectively.

Issue #3583
2021-02-23 12:07:17 +01:00
Sid Hussmann
3ff0efd627 vfs/pipe: add fifo feature to pipe plugin
The vfs pipe plugin can now be used as named pipe which anables data
transfer via file handles from one component to another. E.g. if one
would like to send data from component A to stdin of a libc component B,
one can do so by simply writing to that fifo file.

Issue #3583
2021-02-23 12:07:16 +01:00
Norman Feske
10605a6903 Spelling fix 2021-02-23 12:07:16 +01:00
Martin Stein
6937eb7d94 drivers_nic-rpi: use usb_net and usb_host
Ref #3961
2021-02-23 12:07:16 +01:00
Martin Stein
a462a8e741 usb_host: compile errors with DEBUG_LINUX_PRINTK
Ref #3961
2021-02-23 12:07:16 +01:00
Martin Stein
3485282909 drivers/platform/rpi: remove dead code
Ref #3961
2021-02-23 12:07:16 +01:00
Sebastian Sumpf
b6d20b4742 autopilot: disable run script not supported by riscv
- libc and nic driver are currently not available on RISC-V

issue #4021
2021-02-23 12:07:16 +01:00
Sebastian Sumpf
7318ca6084 depot: add 'riscv' to depot spec
issue #4021
2021-02-23 12:07:16 +01:00
Sebastian Sumpf
ca777fe93f riscv: add riscv_qemu base-hw recipe
issue #4021
2021-02-23 12:07:16 +01:00
Sebastian Sumpf
ccd9ba4161 riscv: move CPU header from base-hw to base
issue #4021
2021-02-23 12:07:16 +01:00
Christian Helmuth
954f03257d Update curl to version 7.70.0
Issue #3773
2021-02-23 12:07:16 +01:00
Pirmin Duss
190b4784c5 openssl: do not depend on ARM CPU probing
With this commit libcrypto does not use ARM NEON extension as long as
SPECS includes "neon". arm_v7a does declare "neon" per default while
arm_v8a does.

Issue #3773
2021-02-23 12:07:16 +01:00
Christian Helmuth
f23e302475 Update OpenSSL to version 1.1.1i
Note, OpenSSL now comes as one combined depot archive *openssl* that
replaces the former *libssl* and *libcrypto* archives. The libraries are
still separate binaries for compatibility with legacy software.

Issue #3773
2021-02-23 12:07:16 +01:00
Sebastian Sumpf
f5cd12dcf9 base/base-hw: unify startup library builds
- Use 'select_from_repositories' for crt0.s of startup library
- Move RISC-V crt0.s to base (where the other archs are located)

issue #4019
2021-02-23 12:07:15 +01:00
Martin Stein
ce31c90bc3 run/netperf.inc: fix problem with reused ports
It seems that with the nigthly autopilot the data port (that is choosen by the
client) may stay some time (minutes) allocated after the a test run. This
causes successive tests to fail when trying to reuse the port.

* Use a unique data port for each target platform in the range of 18000-18099.
* Add documentation on how to prepare for running the test on a Linux target.
* Remove Qemu-specific code paths as Qemu isn't supported anymore by the script
  since the introduction of the Uplink session (running with a NIC router on
  Qemu was never supported and now we always need a NIC router).

Ref #3961
2021-02-23 12:02:46 +01:00
Martin Stein
f9c258a372 lwip_lx.run: typo in doc
Ref #3961
2021-02-23 12:02:45 +01:00
Norman Feske
048a4625c5 base: remove stale spec/fpu_vfpv3.mk file 2021-02-23 12:02:45 +01:00
Norman Feske
db3f86d603 base-hw: avoid double slashes in path names 2021-02-23 12:02:45 +01:00
Norman Feske
fa68325a57 base-hw: streamline extraction of depot archives
This patch simplifies the packaging of the base-hw kernel for a given
board, in particular when the board support is hosted as an external
repository such as genode-world. Regardless of where the board-support
is hosted, the content.mk file becomes as simple as:

  include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc

The board name is automatically inferred from the path of the src
recipe. The architecture is determined from board/<name>/arch files,
following the pattern of the image_link_address. The attempt to build a
base-hw-<board> binary archive for the wrong architecture is now
gracefully handled by skipping all targets (using the REQUIRES
mechanism).

Besides the improved convenience, the patch results in depot archives
that are much closer tailored to the actual board by omitting files for
architectures that are not used by the board. E.g., the src/base-hw-pc
archive does not contain any ARM-related content.

The patch also restores the package builds for core/bootstrap object
files as a follow-up fix of "base: remove SPEC variables of boards",
which happened to left 'BOARD' undefined in the src archives.

Fixes #4019
2021-02-23 12:02:45 +01:00
Josef Söntgen
1b77cb3832 qemu-usb: add ring-buffer for ISOCH OUT transfers
Be more in line with the original host implementation in Qemu and
buffer transfers. Having transfers in-flight helps to smoothen playback
in case other components utilize the CPU.

Issue #4018.
2021-02-23 12:02:44 +01:00
Josef Söntgen
19d9409a34 qemu-usb: adapt ISOCH IN handling for audio
Linux as well as Windows guests want queue to a varying number of
transfers, where each transfer only covers one transaction (iso frame).
The best results were obtained by following that behaviour rather
than queuing multiple iso frames per requests (like is done with OUT
transfers).

The number of requests queued is increased to 32 while the number of
packets per reques is decreased to 1.

Issue #4018.
2021-02-23 12:02:44 +01:00
Josef Söntgen
9918a8f88d qemu-usb: update port to 5.2.0
The contrib code is updated from 2.4.1 to version 5.2.0 and the used
device-model is changed to QEMU xHCI. Due to this change older guests
OSes, namely Windows 7, that relied on the NEC xHCI device-model will
not work anymore.

The 'Qemu::Controller' interface was extended by an 'info' method, which
returns the vendor and product ID. This allows for removing the
hard-coded values in the VirtualBox glue code.

Issue #4018.
2021-02-23 12:02:44 +01:00
Josef Söntgen
a6f0b05834 usb_host: properly handle ISOC read requests
* Update the 'packet_size' information with the actual length for
  each isoc frame to be able to handle short reads at the client side.

* Copy the whole transfer buffer because the host controller stores
  the data at the original offsets, i.e., the buffer is not densely
  packed.

Fixes #4018.
2021-02-23 12:02:44 +01:00
Josef Söntgen
b51ae104c2 qemu-usb: use bounce buffer to access DMA memory
The former implemention assumed that the guest physical memory is
mapped continously. This, however, is not true. Writing larger
files to an USB stick with a Windows 10 guest would therefore lead
to data corruption.

The current implementation uses a bounce buffer to copy the data
to and from the guest physical memory and leaves dealing with the
memory mappings entirely up to the VMM.

Fixes #4017.
2021-02-23 12:02:44 +01:00
Martin Stein
23620942bf usb_net: allow calling netif_stop_queue dummy
When the usb_net_drv was introduced in ports/run/netperf.inc, the
netperf_lxip_usb test on x86_64/hw/pc triggered the calling of the
netif_stop_queue dummy at
contrib/<DDE_LINUX>/src/drivers/usb_net/drivers/net/usb/usbnet.c:1464. As
netif_start_queue was also a dummy and allowed to be called, we tried allowing
calls to the netif_stop_queue dummy as well which fixed the
netperf_lxip_usb test on x86_64/hw/pc.

Ref #3961
2021-02-23 12:02:44 +01:00
Norman Feske
a99f6a81b6 libc: clone 'environ' pointer value after fork
The 'environ' pointer is a global variable that must be considered as
part of the application state. It must be copied from the parent to the
child process during fork. Otherwise, a child returning from fork is
unable to access environment variables before invoking execve. The
actual environment variables and their values are already captured
because they reside at the application heap, which is cloned from the
parent. So the copied 'environ' pointer refers to valid data.

Fixes #4015
2021-02-23 12:02:44 +01:00
Sebastian Sumpf
fd0e6685fc riscv: Use Qemu and update to ISA v1.10
- remove Spike/BBL support in favour of Qemu (>=4.2.1)
- add 'riscv_qemu' board, remove 'spike' board'
- update to privileged ISA v1.10 (from v1.9.1)
- use direct system calls for privileged core threads (they call into
  the kernel and don't use mode changing system calls, i.e. 'ecall',
  semantics)
- use 'OpenSBI' semtantics for SBI calls (to machine mode) instead of
  BBL

issue #4012
2021-02-23 12:02:44 +01:00
Alexander Boettcher
18e282ab8a allocator_avl: avoid false dangling warnings
By first removing unused ranges, implicitly meta data allocations are freed
up. This leads to more unused slab blocks and freed up meta data allocations
in the avl tree.

Issue #4014
2021-02-23 12:02:44 +01:00
Alexander Boettcher
1e84b46c3f slab: add option to free empty blocks
explictly by a method

Issue #4014
2021-02-23 12:02:44 +01:00
Martin Stein
19d0142e10 ports/recipes/src: usb_net_drv
Ref #3961
2021-02-23 12:02:44 +01:00
Martin Stein
983a18d06e ports: rename *_usb30.run *_usb.run
Ref #3961
2021-02-23 12:02:43 +01:00
Christian Prochaska
f654e6f02d usb_host_drv: dwc_otg stability improvements
- improve NYET error handling
- use split interrupt transaction hack
- clear TT buffers in error situations

Issue #3247
2021-02-23 12:02:43 +01:00
Sebastian Sumpf
cb2e27f8e4 riscv: Fix link errors for Genode nightly
- add .got filter rule for trace policies, otherwise ld raises a
  segmentation fault
- force soft-float for binary sources (SRC_BIN)

issue #4012
2021-02-23 12:02:43 +01:00
Alexander Boettcher
c58acd0b2b allocator_avl: avoid memory leakage
Fixes #4013
2021-02-23 12:02:43 +01:00
Alexander Boettcher
26506673c4 seoul-auto: limit to one CPU on Qemu
Issue #3965
2021-02-23 12:02:43 +01:00
Norman Feske
df38140ed6 base-pistachio: coding style 2021-02-23 12:02:43 +01:00
Norman Feske
9633a0a524 wm.run: increase RAM quota for wm_backdrop
Overcomes a startup issue of the wm_backdrop component on base-linux:

[init] child "wm_backdrop" requests resources: ram_quota=10855936
2021-02-23 12:02:43 +01:00
Norman Feske
7d568247e3 wm: fix deadlock in destroy-view handling
The deadlock reported in #3236 could be reproduced via the wm.run script
and the modification of test/nitpicker in commit "nitpicker: fix destroy
with invalid handle" by clicking on the testnit entry of the launchpad.

This patch fixes the deadlock by releasing the locked pointer early in
the destruction path, which is legitimate as the wm is single-threaded.

Fixes #3236
2021-02-23 12:02:43 +01:00
Norman Feske
b5fb37ddee nitpicker: invalidate dangling hovered ptr
This patch adds the missing invalidation of the _hovered pointer to
User_state::forget, which is required to cover the situation where the
owner of the hovered view vanishes.

Fixes #4011
2021-02-23 12:02:43 +01:00
Alexander Boettcher
d29b843a0f dde_ipxe: improve throughput for Realtek devices
By increasing the ring descriptor count the throughput increased from
few kB/s to the range of MB/s.

Issue #3939
2021-02-23 12:02:43 +01:00
Alexander Boettcher
8958c769ab dde_ipxe: poll once again on irq without rx packets
This quirk is required for Realtek devices.

Fixes #3939
2021-02-23 12:02:43 +01:00
Christian Helmuth
210f5073e3 platform_drv.inc: check board=pc not spec=x86
Fixes run scripts for Linux/x86.
2021-02-23 12:02:43 +01:00
Martin Stein
ef88d05f2b os: api/net archive
Ref #3961
2021-02-23 12:02:43 +01:00
Alexander Boettcher
d6a5a66623 vbox5: enable 64bit SVM support
Fixes #3965
2021-02-23 12:02:42 +01:00
Alexander Boettcher
d186e4361e Measure TSC variance of CPUs in test-smp
Issue #3965
2021-02-23 12:02:42 +01:00
Emery Hemingway
2acfacb639 genode_dyn.ld: do not emit PHDR segment
Recent versions of binutils check that PHDR segments are covered
by a LOAD segment. In this case the unloaded PHDR segment can be
ommited.

Fix #4003
2021-02-23 12:02:42 +01:00
Alexander Boettcher
696d8f030f libgmp: avoid undefined gmpn_*_2 symbols (x86_64)
__gmpn_addmul_2
__gmpn_mul_2

Fixes #4001
2021-02-23 12:02:42 +01:00
Alexander Boettcher
e3233a4824 ldso: turn deadlock message into Linker message
Issue #3991

[init -> ...] Error: LD: jump slot relocation failed for symbol: 'XYZ'
[init -> ...] Error: deadlock ahead, mutex=0x161860, return ip=0xeb870

turns into:

[init -> ...] Error: LD: jump slot relocation failed for symbol: 'XYZ'
[init -> ...] Error: Uncaught exception of type 'Linker::Not_found'
[init -> ...] Warning: abort called - thread: ep

Fixes #4002
2021-02-23 12:02:42 +01:00
Christian Prochaska
5c5d16f524 ports: add 'vbox5_genode_usb_hid_raw' run script
Fixes #4009
2021-02-23 12:02:42 +01:00
Christian Prochaska
c16611dff2 usb_hid_raw.run: add "Timer" service route
Fixes #4008
2021-02-23 12:02:42 +01:00
Christian Prochaska
33406940f3 usb_hid_drv: stability improvements
Fixes #4007
2021-02-23 12:02:42 +01:00
Christian Prochaska
e1698cf200 dde_linux: fix possible memory leak in wait queue implementation
Fixes #4006
2021-02-23 12:02:42 +01:00
Christian Prochaska
2670ae399b usb_host_drv: improve error handling
Fixes #4005
2021-02-23 12:02:42 +01:00
Christian Helmuth
91a7fb1da7 cxx: localize operator new(unsigned long) in supc++.o
Otherwise, base code in ld.lib.so may accidentally use 'new' without
passing an allocator.
2021-02-23 12:02:41 +01:00
Martin Stein
a9c4ebc9e9 drivers/nic/mode: exception on malformed values
Ref #3961
2021-02-23 12:02:41 +01:00
Norman Feske
e3783b00bb coding_style.txt: initializers, control flow 2021-02-23 12:02:41 +01:00
Norman Feske
493924a35e base-hw: coding style
Improve consistency with the other base repositories, in particular

- Indentation of class initializers
- Vertical whitespace around control-flow statements
- Preferably place control-flow statements (return, break, continue) at
  beginning of a line
- Placing the opening brace of a namespace at the end of line
- Placing the opening brace of a class at a new line
- Removing superfluous braces around single statements
- Two empty lines between methods/functions in implementation files
2021-02-23 12:02:41 +01:00
Norman Feske
cbae9bc1c8 Add ccache support to build system
This patch simplifies the use of ccache with the build system. Up until
now, each developer had to set up the ccache hooks manually, adjust the
PATH variable, and customize the etc/tools.conf in each build directory.
With the patch, ccache can be enabled by un-commenting a single line in
the etc/build.conf file.

Fixes #4004
2021-02-23 12:02:41 +01:00
Norman Feske
8cc2662aac Remove support for the Muen separation kernel
Fixes #3995
Fixes #3994
2021-02-23 11:55:44 +01:00
Christian Helmuth
af9ab9190b sd_card_bench.run: add missing braces
This is a follow-up fix for "base: remove SPEC variables of boards (fix #3971)".
2021-02-23 11:53:59 +01:00
Christian Helmuth
14db22c77c nic_router.run: disable test 2 UDP
Issue #3992 is still pending but has low priority, so disable the test
to reduce the noise and increase the chance to spot independent
regressions.
2021-02-23 11:53:42 +01:00
Martin Stein
691be92046 Don't use the NIC server mode of NIC drivers
Issue #3961
2021-02-23 11:53:41 +01:00
Christian Helmuth
9f3c5d92b3 base: cleanup Noncopyable declarations/coding style 2021-02-23 11:51:57 +01:00
Josef Söntgen
36b55e065a usb_host: check ep pointer before using it
The Usb session allows for submitting packets even when the interface
in question is not yet enabled. Enabling an interface will configure
the udev members properly and is normally done implicitly during
processing of an 'ALT_SETTING' packet.

In case the interface was not enabled this leads to a page-fault in
the USB host-controller driver as 'ep' is NULL.

Fixes #3999.
2021-02-23 11:51:57 +01:00
Alexander Boettcher
6789ce8b83 platform_drv(x86): support dynamic reconfiguration
Fixes #3989
2021-02-23 11:51:39 +01:00
Norman Feske
a981fb864c depot: update recipe hashes 2021-01-25 14:00:43 +01:00
Norman Feske
c4cf9b6e6d base-hw: introduce board-property directories
This patch moves the bootstrap-link-address information from the
tool/run/boot_dir/hw file to board-specific property files that can be
accessed by using the board as key. This eliminates the need to
customize boot_dir/hw when hosting board-support in an external
repository.

Fixes #3998
2021-01-25 14:00:43 +01:00
Norman Feske
4bc9b9a2ef tool/run: coding style 2021-01-25 14:00:43 +01:00
Piotr Tworek
ad4211ae2c os: Make Redistributor class inherit Genode::Interface.
The Vmm::Gic::Gicd_banked::Redistributor is used with Constructible, but
does not have a virtual destructor even though it has virtual methods.
This prompts clang to issue the following warning:

  reconstructible.h:122:4: warning: destructor called on non-final
  'Vmm::Gic::Gicd_banked::Redistributor' that has virtual functions
  but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]

Fix this by inheriting Genode::Interface.

Issue #3984
2021-01-25 14:00:43 +01:00
Norman Feske
ff28ed0f8c base: avoid superfluous postprocessing of ldso
Even though the binary patching of ldso must be performed only once,
this postprocessing step was executed on each run because the
postprocess.tag rule is phony (the tag file is never created).
This patch removes this phony behavior by creating the tag file.

Issue #3974
2021-01-25 14:00:43 +01:00
Tomasz Gajewski
693a4d78dd lib.mk: avoid checking abi on every build
Fixes #3974
2021-01-25 14:00:43 +01:00
Piotr Tworek
8f6b934caa base-hw: Fully define _crt0_start_stack value on arm_64
The _crt0_start_stack label points to a memory location containing the
size of the bootstrap stack. On AArch64 this should be an 8 byte value,
but the code only only defines half of those using asm .long statement.
The other half is expected to be 0, which is true when using GNU as.
This is not the case when using clang's integrated as however. Since
_crt0_stack_size is defined inside .text section clang uses 0xd503201f
value (aarch64 nop instruction) to fill the extra 4 bytes.

Fix this minor incompatibility by explicitly defining both halfs of
this 8 byte quantity.

Fixes #3987
2021-01-25 14:00:43 +01:00
Piotr Tworek
384cf14bee libc: Remove unused variables from Libc::Kernel.
The _dispatch_pending_io_signals and _original_suspended_callback member
variables are not used anywhere in the code. This prompts clang to produce
a warning message about it. Remove both variables to fix it.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
90b20b4daf nitpicker: Fix unsigned long to unsigned int cast.
The "unsigned Nitpicker::Gui_session::layer()" function returns
~0UL. This prompts clang to produce a warning about implicit unsigned
long to unsigned int conversion. Fix it by returning ~0U instead of
~0UL.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
80318b9ae0 libc: Add semicolons after [[fallthrough]]
GCC doesn't care, but clang complains if [[fallthrough]] is not followed
by a semicolon. Existing Genode code is also not consitent in this regard.
This patch adds the extra semicolons since it works in both GCC and
clang.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
fce5c249c2 gems: Drop unused variables from Window_list class
No code in this class uses this private member variable. This prompts
clang to produce a warning message about it. Fix it by dropping the
variable.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
71abfb3b4f libc: Mark Libc::Vfs_plugin class as final.
The class has final destructor, but is not itself final. This prompts
clang to produce the following warning message:

class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
                ~Vfs_plugin() final { }
                              ^
vfs_plugin.h:39:13: note: mark 'Libc::Vfs_plugin' as 'final' to silence this warning

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
395a9b5bf5 libc: Remove unused print function from select.cc.
This static inline function is not used anywhere. GCC does not care,
but clang warns about this. Remove the function to allow the code to
compile cleanly with both clang and GCC.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
53081ac6b3 libc: Dont't use local_addr in try/catch block.
The code in Libc::Cloned_malloc_heap_range initializes its local_addr
member variable by calling Region_map::attach_at. This function can
throw Region_conflict exception. The handler for this exception uses the
local_addr to produce an error message. Such error log is IHMO
useless, or even incorrect since the value of local_addr is undefined
in such case.

Its also worth noting that clang 12 produces the following warning for
this code:
  "cannot refer to a non-static member from the handler of a constructor
   function try block"

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
c6d5b98227 decorator: Remove unused _topped_cnt variable.
This private member variable is not used anywhere in the code. This
produces compilation warning when using clang instead of GCC. Drop the
unused variable.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
c402cc1045 window_layouter: Drop unused code.
The State enum and _state private member variable are not used anywhere.
This produces an extra warning when building the code with clang instead
of GCC. Remove this dead code.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
1edac9730c scout: Instantiate templates in their namespace.
When building the code with clang the following warning message is
prodiced:

  "explicit instantiation of 'Scout::Browser_window' must occur in namespace 'Scout'
   template class Browser_window<Genode::Pixel_rgb888>"

 This happens for several different types. This patch fixes the problem
 by instantiating all those templates using their explicit full name.

Issue #3985
2021-01-25 14:00:14 +01:00
Piotr Tworek
d475015ada launchpad: Fix _spacer member initialization.
The Scout::Spacer constructor requires two arguments. The initialization
of the type in Launchpad_window declaration does not specify them. The
variable is however initialized a second time in class constructor. This is
most likely why GCC accepts this code. Clang on the other hand
complains about it.

Fix this by properly initializing both _spacer and _docview only once at
declaration time.

Issue #3985
2021-01-25 13:58:11 +01:00
Piotr Tworek
ffb931f8b1 nano3d: Fix header guard in sqrt.h
The code fails to build with clang due to the following warning/error:

  error: '_INCLUDE__NANO3D__SQRT_H_' is used as a header guard here,
  followed by #define of a different macro [-Werror,-Wheader-guard]

Fix this by removing the extra underscore from this header guard
definition.

Issue #3985
2021-01-25 13:58:11 +01:00
Piotr Tworek
b4d294f62e os: Drop unused Net::Arp_cache::_init member.
Not used anywhere in the code. Clang 11 complains about this.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
052f678225 os: Add missing override keyword.
The _device_specific_features() implements part of the Virtio_device
interface. Decorate it with override keyword to make this clear and
also satisfy clang which produces warning regarding this.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
3fdf323e6e os: Drop unused Net::Dhcp_client::_alloc member.
Not used for anything so technically a dead code. Clang 11 complains
about this.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
05c36d67ce os: Fix clang constant warning in Port_allocator.
Clang 11 produces the following warning when building port_allocator.cc:

port_allocator.cc:27:21: error: result of comparison of constant 65536 with
expression of type 'const Genode::uint16_t' (aka 'const unsigned short') is
always true [-Werror,-Wtautological-constant-out-of-range-compare]
               (port.value <  (unsigned)(Port_allocator::FIRST +

Basically the code compares Port::value (uint16_t) against a constant
65536 which is larger than UINT16_MAX (65535). This comparison will always
be true.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
ffc2a2f306 os: Disambiguate File_system in ram_file_system.h.
According to clang there are two symbols which File_system can refer to:
1. namespace File_system from ram_fs/chunk.h.
2. Vfs::File_system class from  vfs/file_system.h.
Make it clear we refer to the File_system namespace in this case.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
fc089a1673 nic_dump: Remove unused Net::Interface::_alloc
This private member variable is not used anywhere in the code. This
breaks builds using clang instead of GCC. Drop the variable.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
428de89f9a nic_dump: Disambiguate "Interface" in component.cc.
Clang 12 complains that Interface can both refer to Genode::Interface
and Net::Interface in this case. Explicitly state the code refers to
the latter.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
30429a5228 nic_flood: Drop Dhcp_client::_alloc member.
This private member variable is not used anywhere in the code. This
breaks builds using clang instead of GCC. Drop it.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
e6a9e06f62 base-linux: Drop parentheses from .cfi_undefined.
According to GNU as manual the syntax of this directive is:
  .cfi_undefined register

The manual does not mention the register should be in parentheses.
This works in GNU as even when those are present, but unfortunately
clang integrated-as does not parse this correctly. Both GNU and
clang's integrated assembler work fine when the extra parentheses
are omitted.

Fixes #3986
2021-01-25 13:58:10 +01:00
Piotr Tworek
8b172bf22e base: Explicitly state ELF segment flags
The code in base-hw/src/bootstrap/platform.cc uses segment flags for
identification purposes. Based on this information the code decides
what to do with each segment. Unfortunately the linker script does
not actually ensure the flags for a specific named segment match
expectations. The code relies on implicit linker behaviour.
This implicit behaviour can vary between linkers. This breaks
arm_v7a base-hw builds linked with LLVM's lld linker. The segment
named "ro" ends up having writeable flag set when using LLD.

This patch ensures that all ELF segments in genode.ld have their
required perimssion flags set explicitly.

Fixes #3988
2021-01-25 13:58:10 +01:00
Piotr Tworek
80e8cf99e2 base: Make Genode::List clang friendly.
Clang is generally fine with Genode::List and compiles code using it
without emitting any warnings. There is however one exception. Clang
fails hard when building base-hw/src/core/kernel/object.cc.
This is due to a call to Genode::List::remove made from
Object_identity::invalidate function. The error message clang
produces is:

  list.h:96:33: error: 'Genode::List<Kernel::Object_identity_reference>::Element::_next'
  is not a member of class 'const Kernel::Object_identity'
                              _first = le->List::Element::_next;
                                           ~~~~~~~~~~~~~~~^

When we look at the declaration of the Kernel::Object class on which
the remove method is called. as expected it does inherit Genode::List:

using Object_identity_list
	= Genode::List<Kernel::Object_identity>;

class Kernel::Object : private Object_identity_list
{
...
}

Given the error message we see that List::Element should be resolved to
Genode::List<Kernel::Object_identity>::Element, and not
Genode::List<Kernel::Object_identity_reference>::Element. But how does
clang manage to figure out we're talking about Object_identity_refecence
list here? Well, I admit I don't know the exact steps it takes to arrive
at this conclusion, but it is not entirely wrong. If we take a look at
what Kernel::Object_identity is we'll see:

class Kernel::Object_identity
: public Object_identity_list::Element,
  public Kernel::Object_identity_reference_list
{
...
}

Where as one can guess Object_identity_reference_list is defined as:

using Object_identity_reference_list
	= Genode::List<Object_identity_reference>;

Long story short Kernel::Object has Genode::List of both Kernel::Object_identity
and Kernel::Object_identity_reference in its inheritance chain and clang
is not really sure to which of those the code refers to in
Genode::List::remove method by using List::Element::.

The fix for this is relatively simple, explicitly state the full type of
the base class the code intends to refer to. Replacing List::Element,
with List<LT>::Element makes the code buildable with both clang and GCC.

Fixes #3990
2021-01-25 13:58:10 +01:00
Alexander Boettcher
9d239957bc libc: update seek state on opening O_APPEND fds
If a fd is opened in append mode and just is to be used (so never written by
the parent component) for the to be forked child, the seek state was not
pointing to the end of the file.  The wrong seek value then was used in
File_descriptor_allocator::generate_info().

Issue #3991
2021-01-25 13:58:10 +01:00
Alexander Boettcher
5fa91c573b libc: update O_APPEND fds on joined child
The fds in O_APPEND state may have changed by the child. The local seek
state needs to be valid/current for the next to be forked child, which seek
state is set by File_descriptor_allocator::generate_info().

Issue #3991
2021-01-25 13:58:10 +01:00
Norman Feske
9bfd812a88 tool/run: search repos for run-tool plugins
This patch allows for supplementing the existing run-tool plugins with
additional plugins hosted inside a repository. E.g., it enables the run
tool to find world/tool/run/boot_dir/hw automatically.

Fixes #3993
2021-01-25 13:58:10 +01:00
Norman Feske
1ccf8a280c base-hw: simplify board support in external repo
Avoid use of REP_DIR in *.mk files to simplify the use of these files as
templates for a board hosted in a separate repository.

Use REP_INC_DIR for searching headers, thereby considering headers
hosted in an external repository.

Issue #3168
2021-01-25 13:58:10 +01:00
Stefan Kalkowski
f034f560be create_builddir: remove deprecated platforms
Fix #3996
2021-01-25 13:58:10 +01:00
Martin Stein
f45aa85e9f nic_router.run: fix redundant IPv4 subnets 2021-01-25 13:58:10 +01:00
Norman Feske
84443d6548 os: div_zero trace policy
This trace policy can be used as a fault-injection mechanism.
Once installed, the next time the traced thread passes a trace point
(e.g., RPC call, RPC request, ...), the policy produces a divide-by-zero
exception.
2021-01-25 13:58:10 +01:00
Norman Feske
a6a923c31b driver manager: restart intel_fb when frozen
This patch introduces heartbeat monitoring and automated restarting
of the intel framebuffer driver.
2021-01-25 13:58:10 +01:00
Norman Feske
f687d4824b sculpt: set lower bound for font size 2021-01-25 13:58:10 +01:00
Norman Feske
0a478dac7f pdf_view: tweaks for showing 16:10 slides
- Shave off two pixels on right, which are rendered white for no reason.
- Adjust resolution to make the slides fit vertically by default.
2021-01-25 13:58:10 +01:00
Norman Feske
5905e0a4a0 Road map for 2021 2021-01-25 13:58:09 +01:00
Martin Stein
d0ac8a6036 cbe_tester.run: use /tmp for image on autopilot 2021-01-25 13:58:09 +01:00
Stefan Kalkowski
bdd923406f base: remove SPEC variables of boards (fix #3971)
* Remove SPEC declarations from mk/spec
* Remove all board-specific REQUIRE declaratiions left
* Replace [have_spec <board>] run-script declarations with have_board where necessary
* Remove addition of BOARD variable to SPECS in toplevel Makefile
* Move board-specific directories in base-hw out of specs
2021-01-25 13:58:09 +01:00
Stefan Kalkowski
5a123e37c9 run: introduce have_board helper function
The new helper function returns a boolean value analoque to 'have_spec' if the
BOARD variable corresponds to the given value. It shall replace [have_spec <board>]
declarations in run-scripts.

Ref #3971
2021-01-25 13:58:09 +01:00
Christian Helmuth
6cfaac182a Remove Cpu_session::Native_cpu definition from API
This type can be a forward declaration in the public API because its
definition is required only in kernel-specific code.

Related to #3979
2021-01-25 13:58:09 +01:00
Christian Helmuth
3e73d8d7b6 drivers_nic-muen: permit Timer access in platform_drv 2021-01-25 13:58:09 +01:00
Pirmin Duss
a4d5687510 base-hw: allow out of tree imx8 platforms
Issue #3911
2021-01-25 13:58:09 +01:00
Alexander Boettcher
2b0170fb6a base-hw: ack thread capability on construction
Fixes #3982
2021-01-25 13:58:09 +01:00
Martin Stein
2d21d04c76 cbe_tester.run: raise timeout to 6 minutes 2021-01-25 13:58:09 +01:00
Martin Stein
f6d195a9de nic drivers: provide optional Uplink-client mode
In order to perform a smooth transition from NIC drivers that act only as NIC
session clients to NIC drivers that act only as Uplink session clients, this
commit introduces an intermediate state in which all NIC drivers support both
modes. That said, a NIC drivers mode is now statically determined through a new
optional 'mode' attribute in the drivers <config> tag that can be set to either
'nic_server' (default value) or 'uplink_client'. Reconfiguring this attribute
at a driver doesn't have any effects. Whithout this attribute being set, all
NIC drivers will behave the same as they did before the commit. When set to
'uplink_client', however, instead of providing a Nic service, they request
an Uplink session whenever their network interface becomes "UP" and close the
session whenever their network interface becomes "DOWN".

Ref #3961
2021-01-25 13:58:09 +01:00
Martin Stein
1d2649b49a nic_router: act as "Uplink" server
Let the NIC router provide an Uplink service besides the Nic service that it
already provided. Requests for an Uplink session towards the NIC router are
assigned to Domains using the same <policy> configuration tags that are used in
order to assign Nic session requests. The MAC addresses of Uplink session
components are _NOT_ considered during the allocation of MAC addresses for NIC
session components at the same Domain. The task of avoiding MAC address clashes
between Uplink session components and Nic session components is therefore left
to the integrator. Apart from that, Uplink session components are treated by
the NIC router like any other interface.

Ref #3961
2021-01-25 13:57:43 +01:00
Martin Stein
cf72d1aac3 os: introduce new "Uplink" session
Adds new Uplink session interface, the corresponding client side (Client,
Connection), and the corresponding API archives. An Uplink session is almost
the same as a NIC session with the difference that the roles of the end points
are swapped. An Uplink client is the one that provides a network interface
(for instance, a NIC driver) whereas an Uplink server is the one that uses
that network interface (for instance, a networking stack).

Therefore, in contrast to the NIC session, MAC address and link state come from
the Uplink client. The link state is reflected through the lifetime of an
Uplink session: The client requests the session only when the link state is
"UP" and closes it whenever the link state becomes "DOWN" again. The MAC
address is transmitted from the Uplink client to the Uplink server as an
argument of the session request.

Ref #3961
2021-01-25 13:48:09 +01:00
Martin Stein
9222463565 run/ping: support running manually on Linux
* Adds documentation how to prepare and finalize a Linux for running the
  scenario ontop of it
* Adds consideration of env variable 'ON_LINUX_WITH_DST_IP' that, if set,
  adapts the run script to running on Linux with the given ping destination IP

Ref #3961
2021-01-25 13:48:09 +01:00
Norman Feske
8ff75346dd sticks_blue_backdrop: inherit roms from backdrop
This patch moves the <content> <rom/> ... </content> declarations that
refer to pkg/backdrop to the runtime file of pkg/backdrop.

Issue #3981
2021-01-25 13:48:09 +01:00
Norman Feske
cae5d380c4 depot_query: inherit pkg rom content from deps
This patch relaxes the need to specify the rom content of all pkg dependencies
in each runtime file. Whenever a dependency features a runtime file, the
contained <content> <rom/> ... </content> nodes are implicitely included.

Fixes #3981
2021-01-25 13:48:09 +01:00
Alexander Boettcher
14d8627186 platform_drv: avoid using Register in Bdf type
Issue #3963
2021-01-25 13:48:09 +01:00
Alexander Boettcher
f358fcbda6 nova: flush Intel IOMMU caches
- when memory is detached

Issue #3963
2021-01-25 13:48:09 +01:00
Alexander Boettcher
b185f3fac1 platform_drv: add support to power PCI devices
- depending on available PCI power cap power off and on
- save and restore PCI bars if required
- reset PCI devices after power on if supported

Fixes #3963
2021-01-25 13:48:09 +01:00
Alexander Boettcher
5f7fe7498f platform_drv: add mmio delayer support
required after power on and function level reset

Issue #3963
2021-01-25 13:48:08 +01:00
Alexander Boettcher
c89864c830 platform_drv: add typesafe PCI config access
using Register_set && Register. It is derived from Genode::Mmio, however uses
as backend the Config_access implementation which is still used widely in
the platform driver.

Issue #3963
2021-01-25 12:51:54 +01:00
Alexander Boettcher
59fafac4d6 platform_drv: increase readability
by adding convenience functions to make code easier readable

Issue #3963
2021-01-25 12:51:54 +01:00
Alexander Boettcher
ebf7f8f599 platform_drv: introduce structured PCI BDF type
Replace explicit usage of bus, device, function arguments to methods or
variables all over the code by a single data type. It eases the reading of and
shorten the code.

Issue #3963
2021-01-25 12:51:54 +01:00
Norman Feske
f57519397b Remove Pd_session::Native_pd definition from API
This type can be a forward declaration in the public API because its
definition is required only in kernel-specific code.

Fixes #3979
2021-01-25 12:51:54 +01:00
Christian Helmuth
5ca3847c89 cbe_tester requires x86_64 currently 2021-01-25 12:51:53 +01:00
Norman Feske
eee8f64fd4 sculpt: fix dialog sizes with manual fonts config
Fixes #3976
2021-01-25 12:51:53 +01:00
Alexander Boettcher
0a5741f076 acpica.run: add acpi_hid evaluation support
Evaluate acpi_hid report in acpi_event

Showcase feature in acpica.run for FUJITSU FUJ02E3 and KEY_FN_F4.
2021-01-25 12:51:53 +01:00
Alexander Boettcher
1147f35972 acpica: add limited support for FUJ02E3 ACPI dev
The keys, mute, touchpad toggle (Fn-F4) and rfkill may be reported by some
Fujitsu machines via the ACPI FUJ02E3 ACPI device. With this commit limited
support to detect the 3 keys are added and will be reported as Genode report.
2021-01-25 12:50:55 +01:00
Norman Feske
d698e0876d window_layouter/decorator: drag-state corner cases
This patch complements the commit "nitpicker: defer hover changed while
dragging" with fixes of the window layouter and motif decorator.

- Handling of empty pointer model (after unhovering a decoration)
  instead of not updating it.

- Re-applying the hover model to the window layout when leaving the
  drag state. This addresses the corner case that the hover model
  changed during the drag operation (which is rightfully not handled
  while dragging).

- Letting the window layouter enter the drag state only if a dragged
  window is defined.

Issue #3973
2021-01-25 12:50:55 +01:00
Tomasz Gajewski
98798f18b5 Fix minor inconsistencies in mk files
Fixes #3972
2021-01-25 12:50:54 +01:00
Christian Helmuth
8bed4c1d54 base: support hexa-decimal values in ascii_to(long)
This aligns the behavior of ascii_to(long&) with the behavior of
unsigned integer types, e.g., when parsing XML nodes into signed long
variables.
2021-01-25 12:50:54 +01:00
Norman Feske
72801975cd nitpicker: defer hover changed while dragging
When holding at least one key or button, the hovering should never
change. In the previous version, this invariant was not enforced,
but the symptoms for eventual inconsistencies were masked by two
checkes: one when generating the hover report, and one when submitting
the leave event. This patch enforces the invariant by suppressing any
change of 'User_state::_hovered' while in dragged state.

Fixes #3973
2021-01-25 12:50:54 +01:00
Norman Feske
7266f29491 decorator: disable sync handling when idle
When idle, the decorator still consumes a bit of CPU time when triggered
by the GUI session's sync signal. This patch installs the sync handler
each time the decorator goes idle.
2021-01-25 12:50:38 +01:00
Norman Feske
2c82636a98 terminal: respond to font-size changes
Issue #3970
2020-12-23 13:38:39 +01:00
Norman Feske
d47f87a768 terminal: use GUI session directly
Issue #3196
Fixes #3970
2020-12-23 13:38:31 +01:00
Norman Feske
887fcecf63 base-linux: disable initramfs build on 32-bit
The build tries to access the host header asm/unistd.h, which is
apparently not present on 64-bit hosts (in particular our CI).
2020-12-18 09:11:25 +01:00
Christian Prochaska
0428e5e8b9 qt5: improve quickcontrols2 module support
Fixes #3968
2020-12-18 09:11:25 +01:00
Alexander Boettcher
0359ee6a76 sandbox: fix position scaling in affinity filter
During position scaling use the location width/height which is the permitted
dimension within the child space, instead of using the whole possible
child space. (Fixup for "init: scale affinity location" Issue #1412)

Thanks to the report by Peter.
2020-12-18 09:11:25 +01:00
Christian Helmuth
1bef11accf depot: update recipe hashes 2020-12-18 09:10:52 +01:00
Alexander Boettcher
c5de2acf57 vm_session(x86): support cstar register
Fixes #3964
2020-12-09 14:02:12 +01:00
Norman Feske
9189342b77 base-okl4: coding style 2020-12-09 14:02:11 +01:00
Norman Feske
abd688097a base-fiasco: coding style 2020-12-09 14:02:11 +01:00
Norman Feske
6930372d55 base-foc: remove stale README content 2020-12-09 14:02:11 +01:00
Martin Stein
a124f5b88d nic_router: support and show-case disabling arp at a domain
* Introduce 'use_arp' configuration flag at the NIC router in order to disable
  requesting IP-to-MAC address resolutions via ARP for domains.
* Add automated run/nic_router_disable_arp test to the autopilot that tests
  the effect of the new flag
* Document the new flag and the new test in the NIC router README

Fixes #3935
2020-12-09 14:02:11 +01:00
Sebastian Sumpf
0beda6bca4 dde_linux: USB MBIM modem driver support
Thise driver supports USB LTE modems for Huawais' ME906s through MBIM
and provides a traditional Nic session. The "control" interface is a
Terminal session, which can be used via libmbim/mbimcli.

issue #3822
2020-12-09 14:02:11 +01:00
Norman Feske
a0fb944721 Propagate session diag flag to core
This commit restores the diag feature for selecting diagnostic output of
services provided by core. This feature became unavailable with commit
"base: remove dependency from deprecated APIs", which hard-wired the
diag flag for core services to false.

To control this feature, three possible policies can be expressed in a
routing target of init's configuration:

* Forcing silence by specifying 'diag="no"'
* Enabling diagnostics by specifying 'diag="yes"'
* Forwarding the preference of the client by omitting the 'diag'
  attribute

Fixes #3962
2020-12-09 14:02:11 +01:00
Sebastian Sumpf
36eeab6df2 dde_linux: usb support extra data and zero config
- Vendor devices add addtional data to the config descriptor, read and
  added to the usb session
- allow '0' configuration within the usb session

issue #3822
2020-12-09 14:02:11 +01:00
Sebastian Sumpf
537472e9af libports: ffi for ARM_64
Required by 'glib'

issue #3822
2020-12-09 14:02:10 +01:00
Christian Helmuth
496dc5508f usb_hid: support for Apple HID devices
Issue #3953
2020-12-09 14:02:10 +01:00
Christian Helmuth
2a659cb750 usb_hid: support for Holtek-based mice fixups
This enables USB mice based on the Holtek chipsets, which need USB
descriptor fixups. An example mouse is the Sharkoon Drakonia.

Issue #3953
2020-12-09 14:02:10 +01:00
Alexander Boettcher
b097e598f1 usb_hid: use heap instead of dma/mem allocator
The usb_hid driver does not need to distinguish between
normal memory and DMA capable memory, since all requests are routed via the
USB raw session to the usb host driver. The default Malloc implementation
implements this distinction, however exposes restrictions on the size of
allocations. As seen now by several USB HID devices, the size of device
driver allocations depend on read out hardware features and can be
larger than we support with our specialized default Malloc implementation.

Since we don't need this functionality, switching to an well
tested allocator (Heap) which can cope with varying sizes of allocation,
we can mitigate the size restriction.

Fixes #3953
2020-12-09 14:02:10 +01:00
Alexander Boettcher
2c639169fd dde_linux: use linux memory primitives in impl/usb
Issue #3953
2020-12-09 14:02:10 +01:00
Martin Stein
bad8caee3f nic_router: support multiple DHCP option 6 entries
* The NIC router now considers, memorizes, and, if configured, reports
  multiple DHCP option 6 entries from DHCP replies that it received as DHCP
  client
* A DHCP server at the NIC router can now be configured statically with
  multiple DNS server addresses to propagate
* The 'dns_server_from' attribute of the DHCP server of the NIC router now
  supports the forwarding of multiple DNS server addresses
* The automated run/nic_router_dhcp test tests all the above mentioned new
  functionality and reconfiguring it at runtime. The test was added to the
  autopilot.
* All run scripts were adapted to fit the new NIC router configuration
  interface

Fixes #3952
2020-12-09 14:02:10 +01:00
Emery Hemingway
306466fc60 libc: always set argv and envp to valid arrays
The arrays passed to main(…) must always be valid null-terminated arrays.

Fix #3955
2020-12-09 14:02:10 +01:00
Martin Stein
063e4bd072 remove remnants of 'virtualbox_nic_router' test
Ref #3952
2020-12-09 14:02:10 +01:00
Martin Stein
e14b58a82c net/dhcp.h: more specific include guards
Ref #3952
2020-12-09 14:02:10 +01:00
Martin Stein
8d8edaea5d nic_router: fix link state on dhcp server reconfig
When reconfiguring the NIC router modifies the information that DHCP clients
received through a DHCP server of the NIC router, the link state of the
correspodning interface has to do a "down-up" sequence. This provides a signal
to the DHCP clients to redo DHCP, receive the new information and update
accordingly.

Fixes #3931
2020-12-09 14:02:10 +01:00
Martin Stein
b0327d0544 nic_router: preserve session link state until read
See the NIC router README paragraph "Behavior regarding the NIC-session link
state" for further information.

Ref #3931
2020-12-09 14:01:42 +01:00
Martin Stein
a7b878cbb5 nic_router: allow for config values of 0 seconds
Ref #3931
2020-12-09 14:01:42 +01:00
Martin Stein
7ac6f93838 nic_router: clean up init of configuration members
Ref #3931
2020-12-09 14:01:42 +01:00
Norman Feske
70ff3d9c90 base-foc: coding style
- Cosmetic adjustments according to
  https://genode.org/documentation/developer-resources/coding_style

- Replace manual inclusion of kernel headers by one new compound
  header foc/syscall.h

- Rename namespace Fiasco to Foc
2020-12-09 14:01:42 +01:00
Norman Feske
0209a2465d base-foc: update cap_integrity.run 2020-11-28 19:37:15 +01:00
Alexander Boettcher
b6408cec1c ssh_terminal: close terminal fd in pthread context
Issue #3682
2020-11-27 14:40:41 +01:00
Christian Helmuth
3fac8b106d version: 20.11 2020-11-27 14:01:47 +01:00
Norman Feske
5c27270b17 News item for version 20.11 2020-11-27 13:57:55 +01:00
Norman Feske
3f15d18392 Release notes for version 20.11 2020-11-27 13:57:54 +01:00
Christian Helmuth
f2e0c164c2 depot: update recipe hashes 2020-11-27 09:21:06 +01:00
Norman Feske
d672e95090 doc: update components.txt 2020-11-27 09:19:09 +01:00
Norman Feske
98211db63d doc: move release notes to sub directory
This keeps the doc/ directory tidy and neat.
2020-11-27 09:19:09 +01:00
Sebastian Sumpf
722254f864 dde_rump: Set '-fcommon' for rump host tools
GCC 10 has `-fno-common` as default which leads to multiple definitions of
of symbols.

Fixes #3960
2020-11-27 09:19:09 +01:00
Stefan Kalkowski
b907629341 sculpt: add basic support for i.MX8 Quad EVK
* Introduce CPU quota for driver subsytem (needed by sd_card_drv)
* Introduce CPU quota for runtime subsytem and nic_drv (needed by fec_nic_drv)
* Increase CAP quota for inspect terminal slightly
* Add sculpt packages for imx8q_evk

Fix #3958
2020-11-27 09:19:09 +01:00
Stefan Kalkowski
22852f2e50 sculpt: move pc-specifics away from generic part
* Introduce sculpt-[board] specific package
* Move rtc driver into managed drivers sub-system
* Name nic_drv in a generic fashion in sculpt_manager
* Copy over pc-specific config files only when building for PC

Ref #3958
2020-11-27 09:19:09 +01:00
Christian Prochaska
e22e2540ee qt5: add Qt5Xml library
Fixes #3959
2020-11-27 09:19:09 +01:00
Alexander Boettcher
78ab3c8db5 usb: avoid memset on failed memory allocation
Issue #3953
2020-11-27 09:19:09 +01:00
Alexander Boettcher
ffdd49f9ce platform_drv: free ever non PCI devices on close
Fixes #3957
2020-11-27 09:19:09 +01:00
Stefan Kalkowski
0cbd1d1b7c os: adjust sd_card_drv to use platform API
Fix #3956
2020-11-27 09:19:09 +01:00
Stefan Kalkowski
f4ac642f64 platform_drv: reset pointer when releasing device
Ref #3956
2020-11-27 09:19:09 +01:00
Martin Stein
955afd8837 ada runtime: support image of enums
Ref #3937
2020-11-27 09:19:09 +01:00
Norman Feske
9b544787bd base: make Affinity::Space::location_of_index const 2020-11-27 09:19:09 +01:00
Alexander Boettcher
774b1f4277 base: remove Thread_deprecated
Fixes #3954
2020-11-27 09:19:08 +01:00
Josef Söntgen
dbcb1ff480 ssh_terminal: flush before closing connection
Originally the outgoing buffer was flush when the terminal was
detached. Since we cannot do that at this point, make the flushing
part of the common cleanup procedure.

Issue #3682.
2020-11-27 09:19:08 +01:00
Josef Söntgen
551b17591c ssh_terminal: handle detached term in event loop
Rather than calling 'ssh_disconnect' from within the Terminal session,
flag the detached terminal in the session and let the event loop do the
cleanup. Otherwise it might happen that the 'ep' (handling the Terminal
session) as well as the 'pthread.0' (executing the ssh event loop) end
up both triggering the cleanup concurrently.

Issue #3682.
2020-11-27 09:19:08 +01:00
Josef Söntgen
51a50ece60 libc: guard select call in socket_fs with monitor
Issue #3682.
2020-11-27 09:19:08 +01:00
Norman Feske
0dcb526ae5 base-linux: coding style 2020-11-27 09:19:08 +01:00
Christian Helmuth
dc016cbd5c ldso: log linker-area info on 'ld_verbose' 2020-11-27 09:19:08 +01:00
Christian Prochaska
e5f442f2d3 qt5: use integrated virtual keyboard in example application
Fixes #3949
2020-11-27 09:19:08 +01:00
Piotr Tworek
5db2971903 base-hw/arm_v7a: Mark r1 as out in Kernel::call64
In case of arm_v7a Kernel::call64 the syscall will use both r0 and r1 as
output registers. Unfortunately the inline asm does not reflect this and
only r0 is explicitly specified as output. GCC manages to produce output
which we'd like to see. Clang on the other hand takes adventage of the fact
r1 should not be touched by swi and produces fewer instructions which do
what the code describes, but not what we actually want.

Basically the code which we want and is generated by GCC is:
  svc     0
  mov     r2, r0
  mov     r0, r1
  mov     r1, r2
  bx      lr

Clang on the other hand generates correct assembly given the code, but
incorrect given what the function is supposed to do:
  svc     0
  mov     r1, r0
  mov     r0, #0
  bx      lr

Both GCC and clang generate the same, expected assembly output when r1
is marked as output register from the inline asm swi call.

Fixes #3951
2020-11-27 09:19:08 +01:00
Alexander Boettcher
aa7f5bc95f os: add cpu balancer component
Issue #3843
2020-11-27 09:19:08 +01:00
Alexander Boettcher
6872fdb0de cpu_burner: utilize all assigned CPUs
Issue #3843
2020-11-27 09:19:08 +01:00
Piotr Tworek
48220dfd9b os: Add missing {} around sub-object initializers.
Clang complains when a sub-object is initialized without {}.

Issue #3950
2020-11-27 09:19:08 +01:00
Piotr Tworek
50ab86cd72 base-hw: Remove unused rdtsc function for x86_64
This function has no callers. Clang warns about this.

Issue #3950
2020-11-27 09:19:08 +01:00
Piotr Tworek
cc7de65c9e nitpicker: Remove unused hover_reported variables
Fix for unused private member variable warning reported by clang.

Issue #3950
2020-11-27 09:19:08 +01:00
Piotr Tworek
cc193a9155 base: drop Trace::Session_component::_parent_levels
Clang correctly asserts this private member variable is not used
anywhere in the code. I'm not sure what the intention of the code is,
might be this is a part of some unfinished feature. This patch just does
the minimum amount of work to allow the code to build with clang. If
required I can also drop the parent_levels constructor argument and
clean up the call sites.

Issue #3950
2020-11-27 09:19:08 +01:00
Piotr Tworek
c0309a634e base: Silence unused arg warning in rpc_server.h
The msg argument in Genode::Rpc_dispatcher::_read_arg is not used. GCC
does not care about this, but clang does and prints a warning regaring
this. Silence it by removing unused argument name.

fixup! base: Silence unused arg warning in rpc_server.h
2020-11-27 09:19:08 +01:00
Martin Stein
30b8f4efc8 gems: import Genode-specific code of the CBE
The CBE repository contained a lot of Genode-specific code despite the fact
that the CBE core logic is not bound to Genode in any way. Therefore the
Genode-specific CBE code is moved to the 'gems' repository to form part of
Genode mainline. The remaining CBE code becomes a port in Genode instead of
being invoked as sub-repository.

The commit combines the following work steps:

* add all files removed from CBE repository
* add CBE port files
* make all CBE libs and targets build again
* make all CBE run scripts succeed again
* make all CBE recipes build again
* make CBE autopilot succeed again
* let CBE autopilot use 'libsparcrypto' contrib dir and Genode build dir
  instead of '.ci' dir in CBE contrib dir (remove '.ci' dir from CBE repo)
* let CBE autopilot always check for all ports
* make CBE autopilot directly executable
* fix license headers in all Genode CBE files
* remove unused VFS replay component
* remove unused CBE test
* remove unused external crypto
* remove unused files in run dir
* remove unused external trust anchor
* add cbe_tester test to autopilot list
* get rid of directories 'include/cbe_*' and 'include/utils'

Fixes #3937
2020-11-27 09:19:08 +01:00
Alexander Boettcher
24181f2bf6 driver_manager: use componentized usb driver
Fixes #3943
2020-11-23 12:03:00 +01:00
Alexander Boettcher
fae3c12366 usb: skip reporting of incomplete init. usb device
Fixes #3944
2020-11-23 12:03:00 +01:00
Stefan Kalkowski
4e90dc4512 dde_linux: adjust fec_nic_drv to use platform_drv
Fix #3947
2020-11-23 12:03:00 +01:00
Alexander Boettcher
a4c7837fb3 Update to bender with optional microcode and HWP
plugin support.

Fixes #3871
2020-11-23 12:03:00 +01:00
Christian Prochaska
764ab3be20 qt5: use libc 'posix_memalign()' in qtwebengine
Fixes #3916
2020-11-23 12:03:00 +01:00
Alexander Boettcher
c6a2e287d0 trace: forward exceptions during construction
The control area is constructed during session creation and the caller can
handle the Out_of_* exception by increasing the quota by the next attempt.

Fixes #3917
2020-11-23 12:03:00 +01:00
Emery Hemingway
d16a1bd922 vfs_lwip: log warning when blocking application
Log a warning when the lwIP VFS plugin queues a read while waiting
for an interface to become ready. By comparision the Lxip plugin
has the same behavior but a more verbose initialization process.

Fix #3920
2020-11-23 12:03:00 +01:00
Alexander Boettcher
b7ba508110 nova: update to kernel supporting AMD IO-MMU
Fixes #3928
2020-11-23 12:03:00 +01:00
Alexander Boettcher
d9cde328cb acpi: support amd iommu detection
Issue #3928
2020-11-23 12:03:00 +01:00
Alexander Boettcher
6b20a6bc7c tool: add hint how to enable vga console in nova
Issue #3928
2020-11-23 12:03:00 +01:00
Alexander Boettcher
95c2e5beb3 run: extend pci test to show more information
Add some more vendors and classcode decoding. Additionally, walk PCI cap
space of each device and decode some of the types.

Issue #3928
2020-11-23 12:03:00 +01:00
Josef Söntgen
194305a8bb dde_bsd: apply HP sense quirk for Fujitsu S398
This quirk is needed for properly switching between the internal and
an external headphone.

Thanks to Peter for the patch.

Issue #3929.
2020-11-23 12:03:00 +01:00
Josef Söntgen
b6912a3d87 dde_bsd: query initial head-phone state
Account for the situation where the driver is started while the HP
is already plugged in and configure the mixer accordingly.

Thanks to Peter for the patch.

Issue #3929.
2020-11-23 12:03:00 +01:00
Josef Söntgen
1b4444ce9e dde_bsd: use right member for iterating mixer set
Due to what seems like a copy-and-paste error, the wrong union member
was used to compare the label. Fortunately, as both structs have the
same memory layout that did not result in any issue.

Issue #3929.
2020-11-23 12:03:00 +01:00
Josef Söntgen
b9869b666a dde_bsd: use bsd_task to handle I/O
Originally, the kernel code should have been executed within the
context of the main task like it is done in dde_linux. The initial
port of the HDA driver, however, did not required doing so and the
session called code directly.

When using USB device, that is no longer possible as we have to
suspend the execution during the execution of the kernel code. So
we pass in the audio data and schedule the kernel.

Fixes #3929.
2020-11-23 12:03:00 +01:00
Josef Söntgen
cd7c99afdc dde_bsd: implemented delayed session announcement
This becomes necessary in case of the USB audio driver where we have
to wait for and query the function first.

That being said, alternatively we could also announce the session but
ignore any request until there is a device we can use.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
2ec398e550 dde_bsd: use timeout framework for time handling
With this commit the timer back-end uses the timeout framework to
schedule any occuring timeouts and for providing the current time.
For now there is only one timeout, the unsolicited azlia codec event
and therefore the timeout queue consists of solely one timeout object.

In addition a timer session is used for implementing 'delay()' where
we have to block until the delay is completed.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
bdb71d94c2 dde_bsd: pull strlcpy in via contrib code
For historical reason the 'strlcpy' implemention was directly pull in
into the emulation environment. There is, however, no reason not to
use the contrib sources in the usual fashion.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
7193902cc0 dde_bsd: properly name PCI audio driver component
Instead of the generic name, call the PCI driver 'pci_audio_drv'.

This is preliminary clean-up work before introducing the USB audio
driver.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
3faf5c43a8 dde_bsd: seperate PCI back end
The supported drivers so far exclusively used PCI and for practical
reasons the emulation environment was to tied to. To make future
addition of drivers that employ other transport busses easier, split
the bus handling into its own backend.

This is preliminary clean-up work before introducing the USB audio
driver.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
6c7f0cb7cc dde_bsd: properly enable recording in run script
* Updating the run script was missed in commit "dde_bsd: remove
    configration attributes".

  * Decrease output and input volume to "more sane" levels.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
54d36a7d1b mixer: apply config on new sessions
Updating the config and using its settings instead of only reporting
the new session allows to apply stored channel settings immediately.

In case of Sculpt this is useful when an existing launcher already
contains a valid config that sets the volume levels appropiately or
the 'recall_fs' is used.

Fixes #3930.
2020-11-23 12:02:59 +01:00
Martin Stein
9b164d20fd vfs directory service: name enum Open_mode
Fixes #3936
2020-11-23 12:02:59 +01:00
Alexander Boettcher
cd8b436566 usb_hid: avoid destruction of used signal handler
Fixes #3945
2020-11-23 12:02:59 +01:00
Piotr Tworek
87e90d640f base-linux: Drop unused member variables
The _root, _gid and _uid private member variables are not used for
anything. GCC does not care, but clang likes to complain about things
like this.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
db71cb8c63 base-linux: Drop ununsed Message::_addr
Not used anywhere in the current codebase. GCC does not care but clang
warns about this.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
a892018926 base-hw: Define Entry function as noreturn.
Right now the code marks specific instance of this function as noreturn.
It then tries to initialize it using a value that has the same type,
except for the noreturn part. GCC does not care, but clang complains this
technically assigns the value of entry from incompatible pointer type.

Fix this by defining Entry function as no return.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
1643d623e4 base-hw: Fix warning about unused lambda capture
The lambda function passed to Board::Vm_page_table_array does not
actually use "this" for anything. GCC does not warn about this, but
clang does. Remove the extra capture to make clang happy.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
9b84a8a402 base-hw: Add semicolons after [[fallthrough]]
GCC doesn't care, but clang complains if [[fallthrough]] is not followed
by a semicolon. Existing code is also not consitent in this regard. Lets
just fix it to make clang happy.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
db17d51ff1 os: Drop unused _tree member in Root_clock_divider
Its not used anywhere in the code. Clang produces warning due to this.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
736b000c19 os: Drop ununsed Main::_id_id variable in ping
The variable is not used anywhere in the code. This produces warning
when building with clang.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
187b8ece27 os: Drop ununsed Virtdev_rom::Root::_env member
Set but not accessed from anywhare. This triggers compilation warning
when building the code with clang.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
93288bccb3 os: Refer to ::Sandbox::Child explicitly.
When compiling this code, clang complains reference to 'Sandbox' is
ambiguous. It can either mean ::Sandbox namespace from
os/src/lib/sandbox/types.h, or Genode::Sandbox declared in
repos/os/include/os/sandbox.h. Since the code refers to ::Sandbox::Child
and its already in ::Sandbox namespace we can just drop "Sandbox" and
refer to just Child, which makes clang happy.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
444bc18fcf base: Drop unused Cpu_root::_md_alloc member
This private variable has no uses in the context of the class. Spotted
when building the code with clang.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
18be6315cb base: Drop unused _ram member variable
Its initialized in constructor but never used. Spotted when building the
code with clang.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
9c3ce58e57 base: Drop unused "verbose" variable
Spotted when building the code with clang. This is not used anywhere in
the file.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
d4a3aa7eda base: explicit copy constructor for Rpc_in_buffer
According to the "rule of three" [1] and C++11 [2] Rpc_in_buffer needs
to have an explicit copy constructor since it also has user defined
copy assignment operator. Both clang and newer versions of GCC complain
about this.

[1] https://en.cppreference.com/w/cpp/language/rule_of_three
[2] https://www.ece.uvic.ca/~frodo/cppdraft/n4659/html/depr.impldec

Issue #3938
2020-11-23 12:02:58 +01:00
Piotr Tworek
8d6ca9556f base: fix clang warning for void cast of retval
This path fixes a void cast used to silence unused return value warning.
Its a common pattern to use void cast to do that. The code uses void *
cast instead. It works for GCC, but clang complains about this.

Issue #3938
2020-11-23 12:02:58 +01:00
Piotr Tworek
81a49bffee base: exception specification for operator delete
Clang is rather picky about this and prints the following warning when
compiling new_delete.cc:

  error: function previously declared with an explicit exception
  specification redeclared with an implicit exception specification
  [-Werror,-Wimplicit-exception-spec-mismatch]

Issue #3938
2020-11-23 12:02:58 +01:00
Piotr Tworek
53a990579b base: Fix UAF in Genode::Pd_session_component::free
This was discovered when building the code with clang instead of GCC. In
this setup the run/ping on base-hw/arm_v8a/virt_qemu would crash
on shutdown due to uncaught Deref_unconstructed_object exception thrown
for Genode::Reconstructible<Genode::Account<Genode::Ram_quota>>. The
specific instance throwing this exception was
Pd_session_component::_ram_account. My investigation exposed the
following problem:

1. The Pd_session_component has a _sliced_heap member backed by
   _constrained_ram_alloc which in turn uses Pd_session_component itself
   as its Ram_allocator.
2. When ~Pd_session_component is called it first destroys _ram_account,
   followed by _signal_broker.
3. The signal broker holds a reference to
   Pd_session_component::_sliced_heap as Signal_broker::_md_alloc.
4. The base-hw implementation of ~Signal_broker destroys some contexts
   and does this by calling Genode::destroy on some slabs using the
   _md_alloc (ref to Pd_session_component::_sliced_heap).
5. The Genode::Slab calls the Ram_allocator::free which ends up calling
   Pd_session_component::free.
6. The Pd_session_component::free can among other things call replenish
   method on Pd_session_component::_ram_account which has already been
   freed at this point.

From my POV calling replenish at this point is basically an undefined
behavior. The Genode::Constructible holding the Genode::Account was
already detroyed at this point. GCC builds happen to somehow manage to
go through the -> operator call without raising any alarms, while clang
builds trip on the _check_constructed() call.

This fix moves the _ram_account a bit higher in class declaration to
ensure its destroyed after _sliced_heap. This seems like the simpliest
solution for this problem.

Fixes #3941
2020-11-23 12:02:58 +01:00
Christian Helmuth
a8d3cd9b15 libc: open socket files early on socket creation
This prevents later file-descriptor shortage when opening files on
demand, which can't be reflected to the application in a sane manner.

The real fix is to open socket files not on libc level but on VFS level
only effectively consume one libc file descriptor for one socket.
2020-11-23 12:02:58 +01:00
Christian Helmuth
5dfca79bcc libc: use pthread mutex in getifaddrs() 2020-11-23 12:02:58 +01:00
Christian Prochaska
ff429a8056 base-linux: build 'lx_iopl()' function on x86 only
Fixes #3934
2020-11-23 12:02:58 +01:00
Christian Prochaska
eafbfb8edf base-linux: socket descriptor caps for RPC (BOARD=pc)
Fixes #3932
2020-11-23 12:02:58 +01:00
Christian Prochaska
b72503e581 base-linux: remove 'lx_ioperm()' function
Fixes #3933
2020-11-23 12:02:58 +01:00
Stefan Kalkowski
429cd8d37a os: enable smp support for ARM vmm
* Fix GIC model to support priority and cpu target settings correspondingly
* Fix semantic of SGIR register for GICv2
* Minor GIC model IRQ state fix
* Introduce synchronization for VirtIO and GIC models
* Enable multiple CPUs in test run-script for ARMv8

Fix #3926
2020-11-23 12:02:58 +01:00
Stefan Kalkowski
6be09a27ca os: minor fix terminal_expect_send test-component
When an empty line was send, it could occur
that a previous line got printed instead.

Ref #3926
2020-11-23 12:02:58 +01:00
Stefan Kalkowski
7298b00013 base-hw: make ARMv7/v8 hypervisor smp ready
* Introduce hypervisor-stack per CPU
* Introduce host world context per CPU
* Mark EL2 translation table memory as inner shareable
* The VMID is not bound to a single VCPU, but to the Vm_session as a whole
* Set affinity of the VCPU accordingly
* Add VMPIDR to VM state

Ref #3926
2020-11-23 12:02:58 +01:00
Stefan Kalkowski
1d826a2c48 base-hw: do direct syscall when run/pause a VCPU
Instead of calling core to run/pause a VCPU, go directly to the kernel.
Apart from the performance win, it would otherwise involve a more complex
protocol, when a VCPU on another core has to be removed from the scheduler.
Core's entrypoint handling those request runs on the boot-cpu only.

Ref #3926
2020-11-23 12:02:58 +01:00
Stefan Kalkowski
40445d7011 base: extend vm_session API with native vcpu cap
To enable the interaction of a VMM with the kernel directly,
a hidden RPC gets introduced. It allows a kernel-specific
base-library implementation of the Vm_session::Client to request
a kernel-specific capability to address a VCPU, e.g., to
run/stop it.

Ref #3926
2020-11-23 12:02:58 +01:00
Alexander Boettcher
11e261ada4 platform_drv(x86): use 32bit writes for MSI-X
Fixes #3927
2020-11-23 12:02:57 +01:00
Christian Helmuth
c93f3a1136 libusb: establish/terminate USB session
Now, the USB connection is established on backend initialization and
terminated on backend exit triggered by high-level libusb code.

Thanks to Peter for the patch.
2020-11-23 12:02:57 +01:00
Christian Helmuth
e339dd542c Prevent warning in test-pthread 2020-11-23 12:02:57 +01:00
Christian Helmuth
3d23c8c419 libports: update curl download location 2020-11-23 12:02:57 +01:00
Martin Stein
89d28c8222 timeout: no volatile stackvars, better warnings 2020-11-23 12:02:57 +01:00
Christian Prochaska
dff3bac441 libc: submit monitor execution signals locally
Issue #3924
2020-11-23 12:02:55 +01:00
Christian Prochaska
798beab30e base: support process-local signal submission
Issue #3923
2020-11-23 12:02:53 +01:00
Christian Prochaska
50e0f3b977 base: don't throw exceptions in 'Signal_receiver::pending_signal()'
Issue #3922
2020-11-23 12:02:49 +01:00
Josef Söntgen
f754e2a7d7 stdcxx: add symbols needed by testsuite
Fixes #3921
2020-10-23 15:12:06 +02:00
Josef Söntgen
1dd1bfe692 stdcxx: add new/delete aligned variants (C++17)
Issue #3921
2020-10-23 15:08:40 +02:00
Josef Söntgen
a74b572e1f stdcxx: force symlinks to allow for re-preparing
Issue #3921
2020-10-23 14:59:56 +02:00
Josef Söntgen
a24911296a stdcxx: adapt header files for testsuite
Issue #3921
2020-10-23 14:59:49 +02:00
Josef Söntgen
563cc07cb0 libports: posix src archive implements posix API
Issue #3921
2020-10-23 14:58:27 +02:00
Josef Söntgen
59f562f627 libc: add symbols needed by testsuite
Issue #3921
2020-10-23 14:58:04 +02:00
Josef Söntgen
4981eb425e ld: add symbols needed by testsuite
Issue #3921
2020-10-23 14:58:01 +02:00
Josef Söntgen
de8411a5e1 cxx: add missing low-level symbols
Issue #3921
2020-10-23 14:56:36 +02:00
Christian Helmuth
5be1c793a5 depot: update recipe hashes 2020-10-23 14:16:38 +02:00
Emery Hemingway
b4076e762c libc: log a message and exit for raise(...)
Fix #3919
2020-10-21 09:14:55 +02:00
Christian Helmuth
6ea628195f dde_bsd: update mirror URL
It seems RWTH Aachen mirrors only ancient versions currently.
2020-10-20 09:14:40 +02:00
Martin Stein
64487ded7c timeout: don't warn "timestamp value too big" too often
Fixes #3657
2020-10-19 14:26:56 +02:00
Christian Prochaska
405955eaef libc: implement 'posix_memalign()'
Fixes #3915
2020-10-15 15:41:55 +02:00
Alexander Boettcher
0aaed47652 nova: re-/store ep fpu state in vm_session
Fixes #3913
2020-10-13 14:42:06 +02:00
Alexander Boettcher
20606bc6de foc: save/restore fpu state in vm_session
Issue #3913
2020-10-13 14:42:03 +02:00
Christian Prochaska
9cd38a6846 libc: rwlock cleanup
Issue #3912
2020-10-13 14:38:43 +02:00
Christian Prochaska
bf4afefaa1 libc: use semaphore in rwlock implementation
Fixes #3912
2020-10-13 08:21:04 +02:00
Christian Helmuth
f09b0dc224 Improve synchronization in lwip.run
The lynx HTTP GET test was started before the HTTP server was up and
therefore failed on Qemu/PBXA9.

Issue #3874
2020-10-09 16:13:14 +02:00
Christian Prochaska
658030ef49 qt5: update port for qtwebengine improvements
- unlink shared memory files
- lower maximum number of socket pool sockets to reduce chance of file
  descriptor exhaustion
- fix a build dependency which caused sporadic parallel build errors

Fixes #3910
2020-10-09 13:51:26 +02:00
Christian Prochaska
4e8bfed5b1 libc: duplicate the file descriptor on shared 'mmap()' mappings
Fixes #3909
2020-10-09 13:50:35 +02:00
Christian Prochaska
5c47fa0d41 libc: reduce file descriptor lookup exceptions in 'select()'
Fixes #3908
2020-10-09 13:48:23 +02:00
Christian Prochaska
058f2e687c libc: make 'mmap()' address alignment configurable
With this commit, the alignment of anonymous 'mmap()' allocations can be
configured like this:

<config>
  <libc>
    <mmap align_log2="21"/>
  </libc>
</config>

Fixes #3907
2020-10-09 13:47:33 +02:00
Josef Söntgen
7d21335ac9 vfs/oss: VFS plugin for Audio_out access via files
This plugin gives access to the Audio_out session by roughly
implementing a OSS pseudo-device. It merely wrapps the session and does
not provide any resampling or re-coding.

Fixes #3891.
2020-10-09 13:44:27 +02:00
Josef Söntgen
3d2b0cab93 libc: implement SNDCTL I/O control handling
In the same vein as the terminal and block I/O controls, the sound
controls are implemented via poperty files and match the OSS
API ([1] features a nice overview while [2] is v3 and [3] gives
in-depth information on the current v4.x API we eventually might want
to implement).

  [1] https://wiki.freebsd.org/RyanBeasley/ioctlref/
  [2] http://www.opensound.com/pguide/oss.pdf
  [3] http://manuals.opensound.com/developer/

The controls currently implemented are the ones used by the cmus OSS
output plugin, which was the driving factor behind the implementation.
It uses the obsolete (v3) API and does not check if the requested
parameter was actually set, which should be done according to the
official OSS documentation.

At the moment it is not possible to set or rather change any
parameters. In case the requested setting differs from the parameters
of the underlying Audio_out session - in contrast to the suggestion in
the OSS manual - we do not silently adjust the parameters returned
to the callee but outright fail the I/O control operation.

The following list contains all currently handled I/O controls.

  * SNDCTL_DSP_CHANNELS sets the number of channels. We return the
    available channels here and return ENOTSUP if it differs from
    the requested number of channels.

  * SNDCTL_DSP_GETOSPACE returns amount of playback data that can
    be written without blocking. For now it amounts the space left
    in the Audio_out packet-stream.

  * SNDCTL_DSP_POST forces playback to start. We do nothing and return
    success.

  * SNDCTL_DSP_RESET is supposed to reset the device when it is
    active before any parameters are changed. We do nothing and return
    success.

  * SNDCTL_DSP_SAMPLESIZE sets the sample size. We return the
    sample size of the underlying Audio_out session and return ENOTSUP
    if it differs from the requested number of channels.

  * SNDCTL_DSP_SETFRAGMENT sets the buffer size hint. We ignore the
    hint and return success.

  * SNDCTL_DSP_SPEED sets the samplerate. For now, we always return
    the rate of the underlying Audio_out session and return ENOTSUP
    if it differs from the requested one.

This commit serves as a starting point for further implementing the
OSS API by exploring more users, e.g. as VirtualBox/Qt5/SDL2 audio
backend or a more sophisticated progam like sndiod.

Issue #3891.
2020-10-09 13:44:14 +02:00
Christian Helmuth
bcf1cc6397 Ensure high priority for timer in test.run 2020-10-09 13:37:17 +02:00
Martin Stein
bff624c75a test/entrypoint: extend timeout interval
At least on some PIT-based platforms (x86_32 + pistachio/okl4/sel4), we run
into trouble with the reworked timeout framework that now proccesses all
pending timeouts before calling their handlers. This order change leads to a
higher rate of handling of short periodic timeouts in the timer driver which
can cause lower prioritized components to starve. Especially, if submitting
signals (from timer to client) isn't cheap (as is the case on qemu + pistachio
for example).

Issue #3884
2020-10-09 13:37:14 +02:00
Martin Stein
512be0a52a test/timer_rate: determine lowest accurate period 2020-10-09 13:37:10 +02:00
Christian Helmuth
91f8281618 depot: update recipe hashes 2020-10-09 13:35:57 +02:00
Christian Prochaska
0e01729d77 libc: handle file descriptor allocation errors
Fixes #3906
2020-10-09 13:35:57 +02:00
Sebastian Sumpf
fe1ee05186 recipe: imx53_qsb_drivers
Do not copy imx53 specfic source code since it has been unified within
the GPIO driver.

follow up for issue #3900
2020-10-09 13:35:57 +02:00
Christian Helmuth
ec957739e9 Adapt some RAM quotas for 2560x1080 screens 2020-10-09 13:35:57 +02:00
Piotr Tworek
8d5005e03a os: add VirtIO nic driver
The driver is faily simple and does not support fancy features like
TCP checksum offloading or vlan filtering, but it is fully capable of
running every Genode network based scenario I've tried. Its currently
known to work on virt_qemu arm platforms and x86_64.

Fix #3825
2020-10-09 13:35:57 +02:00
Piotr Tworek
7fbb245710 os: add VirtIO device helper classes.
To simplify writing native VirtIO drivers for Genode add helper classes
representing VirtIO device and queue. The queue implementation should
be platform independant. The device abstraction however is closely tied
to the VirtIO transport being used (PCI/MMIO). Both PCI and MMIO
implementations expose the same public API so the actual driver logic
should be the same regardless of which transport is used.

Its also important to note that the PCI version of Virtio::Device
currently does not support MSI-X interrupts. Unfortunately my kowledge
about PCI bus is very limited and my main area of interest was to get
VirtIO drivers working on virt_qemu ARM/Aarch64 platform. As such all
the VirtIO drivers I plan to submit will work with PCI bus, but might
not use some extended capabilities.

Ref #3825
2020-10-09 13:35:57 +02:00
Piotr Tworek
9bd548c4bd os: add platform_drv config generator for virt_qemu
The VirtIO device configuration on Qemu is dynamic. The
order and presence of different command line switches affects
base address and interrupt assignment of each device. One could
probably hard-code the necessary switches and resulting XML ARM
platform driver configuration in each run script, but this seems
like troublesome and hard to maintain solution.

This patch explores an alternative approach to the problem.
It implements a ROM driver which probes the address space region
Qemu virt machines assign to VirtIO MMIO devices and exposes the
result as XML via a ROM session. This XML output can be fed directly
as config to the generic ARM platform driver.

Ref #3825
2020-10-09 13:35:57 +02:00
Piotr Tworek
fe0ad0addb tool: Consolidate qemu nic setup.
Right now the same code dealing with nic setup on qemu is duplicated
in many different run scripts. It makes it unnecesarily complex to
change the existing config or add support for new nic types. Lets move
all this common code to qemu.inc.

Ref #3825
2020-10-09 13:35:57 +02:00
Stefan Kalkowski
aa2511e209 platform_drv: make it available for arm_64 generic
Ref #3825
2020-10-09 13:35:57 +02:00
Stefan Kalkowski
3cf3344fa3 sel4 + foc: extend port's tool check rules 2020-10-09 13:35:56 +02:00
Sebastian Sumpf
c79687f5f4 gpio: introduce Pin and '_with_gpio'
- make GPIO server more robust on imx by not throwing exceptions for
  unknown pins, use '_with_gpio' instead
- use 'Gpio::Pin' data type instead of POD 'unsigned'

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
b9bd179e54 gpio_drv: remove specs for imx53 and imx6
Also cleanup run scripts and recipes were gpio driver is not required,
update the ones were it is.

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
6c6deb7e8b dde_linux: add touch to i.MX8 recipe
Add touch screen and event filter to drivers interactive package.

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
d387eba0ba os: driver recipe for i.MX8 drivers
Includes touch and gpio driver

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
96eb83f19a os: Synaptics DSX touch screen driver
Provides touch event service for i.MX8M Quad only

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
89972b11b7 gpio_drv: use platform session for i.MX
This makes the driver work for all i.MX boards. A platform driver with
the board specific configuration is required.

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
664b861f9d imx8_fb_drv: MIPI DSI display support
- support for Northwest Logic MIPI DSI bridge
- support for Radium panel (NXP MX8_DSI_OLED1)
- new 'DSI-1' connector in driver config file

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
27f705bc48 bootstrap: iomux adaptions for i.MX8 MIPI
These settings were obtained with a JTAG debugger from a running Linux
system. They work for MIPI as well as for HDMI.

issue #3900
2020-10-09 13:35:56 +02:00
Alexander Boettcher
325e9cb9fa platform_drv(x86): avoid memory leak 2020-10-09 13:35:56 +02:00
Alexander Boettcher
50b10ef4a5 aes_cbc_4k: extend test and run in autopilot
- to compare crypted text with host openssl

Fixes #3905
2020-10-09 13:35:56 +02:00
Alexander Boettcher
c0f8022a78 aes_cbc_4k: use libcrypto
Issue #3905
2020-10-09 13:35:56 +02:00
Alexander Boettcher
5d808cdc01 platform_drv: extend MSI-X supports
The patch handles the case, that the memory for the MSI-X table is part
of one of the Pci::Resource Memory BARs, which got allocated beforehand already.

With this commit, the platform driver will not fall back to use legacy IRQs or MSI, whereby MSI-X is available actually. Additionally, this patch avoids a lot of red
messages about non available IO-MEM printed by the roottask.

Fixes #3904
2020-10-09 13:35:56 +02:00
Christian Helmuth
abefca500b libc: fix deadlock in pthread_cond_timedwait/signal()
The deadlock occured with three concurrently running threads: two
waiters calling pthread_cond_timedwait() and one signaller calling
pthread_cond_signal().

If waiter W1 hits its timeout, the signaller may have called
pthread_cond_signal(), detected this waiter and posted the internal
'signal_sem' concurrently. Then, the signaller waits for 'handshake_sem'
to ensure the waiter got woken up.

Waiter W1 can't consume the 'signal_sem' post by
'sem_wait(&c->signal_sem)' because another waiter W2 may have consumed
the post already above in sem_wait/timedwait(). Waiting for a post on
'signal_sem' would block the waiter W1 in perfect deadlock with
signaller on 'handshake_sem'. As W1 also owns 'counter_mutex' in this
situation, waiter W2 would block when trying to aquire 'counter_mutex'
and can't resolve the situation.

So, W1 does nothing in this case and we accept the spurious wakeup on
next pthread_cond_wait/timedwait().
2020-10-09 13:35:56 +02:00
Martin Stein
7feea78991 timeout: rework timeout framework
* get rid of alarm abstraction
* get rid of Timeout::Time type
* get rid of pointer arguments
* get rid of _discard_timeout indirection
* get rid of 65th bit in stored time values
* get rid of Timeout_scheduler interface
* get rid of uninitialized deadlines
* get rid of default arguments
* get rid of Timeout::_periodic
* get rid of Timeout::Raw
* use list abstraction
* only one interface for timeout handlers
* rework locking scheme to be smp safe
* move all method definitions to CC file
* name mutexes more accurate
* fix when & how to set time-source timeout
* fix deadlocks

Fixes #3884
2020-10-09 13:35:56 +02:00
Martin Stein
9e5d479d03 timeout: test smp support
Ref #3884
2020-10-09 13:35:56 +02:00
Christian Helmuth
26011a7151 libc: update status for component select handlers
In case of contexts blocked in select() the monitor updates the
file-descriptor status, but if the entrypoint is just blocked for the
select handler, the status must be updated explicitly on
dispatch_select().
2020-10-09 13:35:56 +02:00
Stefan Kalkowski
bbb017dc24 muen: update to Community 2019 toolchain version
Fix #3903
2020-10-09 13:35:55 +02:00
Alexander Boettcher
04d3c9e750 nova: re-enable DMAR super pages in kernel
Fixes #3902
2020-10-09 13:35:55 +02:00
Alexander Boettcher
e5fe9c6fc7 qemu-usb: catch exception on already gone devices
Fixes #3893
2020-10-09 13:35:55 +02:00
Norman Feske
04821b1abc nitpicker: apply focus change w/o input events
This patch fixes the corner case where the keyboard focus is defined
independently from user interactivity, e.g., the activation of a
screensaver or lock screen.

In this case, nitpicker would update its internal focus state not before
the next input event is handled. Should this input event be a press
event, this event would wrongly be delivered to the prior focused
session. Another problematic situation is the initial state before the
very first input event occurs. Since the focus remains undefined until
the first input event is handled, an initial key press event would not
be delivered.

This is a regression caused be the transition to the event-session
interface and the removal of the nitpicker's periodic way of operation.
The patch fixes the problem by applying pending focus changes not only
at the input processing but also on the code path that responds to focus
changes (e.g., focus-rom update).

Issue #3812
2020-10-09 13:35:55 +02:00
Alexander Boettcher
afab15f1a4 linux: round up dataspace to 4k sizes
Issue #3901
2020-10-09 13:35:55 +02:00
Alexander Boettcher
e61f6cfd38 base: add thread migration test
Issue #3842
2020-10-09 13:35:55 +02:00
Alexander Boettcher
90bea1499e core: store new affinity on successful migration
Adjust the base-* platforms to acknowledge new thread location solely if
migration is supported and succeeded. Otherwise the wrong thread
locations are observed via the trace session and utilization time calculation
get wrong.

Issue #3842
2020-10-09 13:33:36 +02:00
Alexander Boettcher
99fa203673 nova: add migration support for global threads
Fixes #3842
2020-10-09 13:33:36 +02:00
Martin Stein
1b41d9db90 base: remove alarm library from base
Ref #3884
2020-10-09 13:33:36 +02:00
Martin Stein
c1d0179194 dde_rump: move private headers to src/include
Ref #3884
2020-10-09 13:33:36 +02:00
Martin Stein
04463806a8 dde_rump: remove unused rump_cgd
Ref #3884
2020-10-09 13:33:36 +02:00
Martin Stein
af01370cc1 run/rump_fat: raise ram quota
Ref #3884
2020-10-09 13:33:35 +02:00
Martin Stein
4eb4bd6f96 trace_logger: warn on multiple buffer wraps
Ref #3884
2020-10-09 13:33:35 +02:00
Christian Prochaska
d2d74cc5fa tool chain: fix build error on Ubuntu 20.04 (GCC 9)
Fixes #3899
2020-10-09 13:33:35 +02:00
Josef Söntgen
f53df495db libc: provide 'sys/soundcard.h' header file
Issue #3891.
2020-10-09 13:33:35 +02:00
Josef Söntgen
f3268cade6 libc: split ioctl method
Use one ioctl method for each type of I/O control because by now the
general method will become increasingly long.

Fixes #3890.
2020-10-09 13:33:35 +02:00
Josef Söntgen
1a54ee895e vfs: use compound ioctl in Block-VFS plugin
Instead of using the old 'ioctl' Vfs::File_io_services API implement
the I/O control functionality in a buch of files. This is similar to
the terminal-VFS plugin.

Fixes #3889.
2020-10-09 13:33:35 +02:00
Josef Söntgen
27d4cb871f libc: use property files for block ioctl
Like already done for terminal I/O controls use collect the information
by reading property files instead of using the old VFS ioctl interface.

Fixes #3888.
2020-10-09 13:33:35 +02:00
Josef Söntgen
2312ad35dd libc: match ioctl request type to contrib type
There is a type mismatch as in the FreeBSD contrib code the type of the
request is 'unsigned long'. So far, only I/O controls where the request
falls into the signed range where used and this was not a problem.

Some of the SNDCTL requests, however, have the bit set.

Fixes #3887.
2020-10-09 13:33:35 +02:00
Christian Prochaska
85a84f5042 qt5: generate enter events related to popup menus
Fixes #3894
2020-09-18 15:23:45 +02:00
Sebastian Sumpf
0fd979b147 imx8_fb_drv: make 'Capture' constructible
Reconstruct capture connection on config update in order to receive
update of complete screen data from GUI session.

fixes #3878
2020-09-18 15:21:10 +02:00
Christian Helmuth
ad595d2701 sculpt: version 20.09 2020-09-18 15:20:18 +02:00
Christian Helmuth
f6337a6446 depot: update recipe hashes 2020-09-18 14:04:56 +02:00
Stefan Kalkowski
f1b3e826d5 sculpt: update building section of sculpt README 2020-09-18 14:04:56 +02:00
Alexander Boettcher
2afba3c137 driver_manager: provide more memory to boot_fb
Fixes #3896
2020-09-18 14:04:56 +02:00
Norman Feske
e0d9a04f67 libc: resolve circular dependency in fork
This patch is a follow-up for the commit "libc: use monitor for fork".
It removes the use of the monitor mechanism from the
'Local_clone_service::close' RPC function because the fork_ep must stay
responsive for the destruction and creation of 'Child' objects.

Issue #3874
2020-09-18 14:04:56 +02:00
Norman Feske
274f306315 release_notes-20-08.txt: minor style fixes 2020-09-18 14:04:56 +02:00
Christian Helmuth
c59c266afc depot: update recipe hashes 2020-09-17 14:23:14 +02:00
Norman Feske
9aca1ac775 News item for Sculpt 20.08 2020-09-17 14:01:19 +02:00
Norman Feske
3e83b4b39e Update Sculpt documentation for version 20.08 2020-09-17 14:01:19 +02:00
Stefan Kalkowski
d7eb174c88 muen: fix building on modern devel distros
* Use python2 interpreter not available by default explicitely
* Update ada-bfd binding library to meet binutils-dev >= 2.34
2020-09-17 10:14:07 +02:00
Stefan Kalkowski
c48b3ca16f okl4: use python2 explicitely in elfweaver tool
Fix #3892
2020-09-17 10:14:07 +02:00
Norman Feske
951409f14b intel_fb: reinit capture session on mode change
The current version of the driver leaves the screen in a black state
after a mode change, e.g., when connecting an external display.
With this patch, the framebuffer content is fetched for the entire
screen after a mode change. Thanks to Sebastian Sumpf for investigating.

Issue #3878
2020-09-17 10:14:07 +02:00
Norman Feske
2075b119ac sculpt: usability tweaks in popup dialog
- Show "..." for resource-assignment menu entry because it leads
  to a sub menu.

- Avoid dialog changes when clicking on "Add component" while a
  routing or resource dialog is unfolded.
2020-09-17 10:14:07 +02:00
Norman Feske
0d61029d7e depot_deploy: move affinity to <affinity> sub node
The initial implementation of the affinity configuration in
"depot_deploy: support affinity configuration" added the affinity
location attributes to the <start> node of the deploy config. This patch
moves the information into a dedicated <affinity> sub node as done by
the init configuration. So the context of the attributes 'xpos', 'ypos',
'width' and 'height' becomes clear.

It also fixes a usability issue in Sculpt that occurred during testing:
When configuring multiple components with custom affinities, the
resources dialog of later components would wrongly display the state of
earlier components instead of displaying the fresh (default) state. The
resulting configuration would then not match the displayed information.
This is fixed by resetting the dialog state.

As another minor cosmetic change, the patch adds a line break in front
of copied <config> or <heartbeat> nodes.

Issue #3597
2020-09-17 10:14:07 +02:00
Christian Helmuth
2eb8c5e21a net: move ascii_to() into Net namespace
The combination of Net::Mac_address and
Genode::ascii_to(Net::Mac_address) required shaky quirks in several
places because GCC is not able to resolve the ascii_to overload if
base/xml_node.h was included to early. The current solution moves the
several ascii_to overloads "closer" to the Net types by putting them
into the Net namespace, where GCC reliably picks them up.

Hence, co-locating the ascii_to() utility with the overload type in the
same scope/namespace is good practice.

This patch removes the now obsolete <nic/xml_node.h> header file.
2020-09-17 10:13:22 +02:00
Norman Feske
c0f9f2c6d7 sculpt: restore toggleable format button
With the move of the storage-management dialogs to the graph in Sculpt
version 20.02, the ability to unselect the buttons for destructive
storage operations such as format or expand disappeared. This patch
restores the original behavior.
2020-09-17 10:13:21 +02:00
Alexander Boettcher
f0f8d0e0ca base: add affinity to session creation request
Fixes #3838
2020-09-17 10:13:21 +02:00
Norman Feske
5dc8e330b6 sculpt: add button for restarting a component
Fixes #3885
2020-09-17 10:13:21 +02:00
Alexander Boettcher
c9f2847420 foc: make serial esc functional 2020-09-17 10:13:21 +02:00
Stefan Kalkowski
fcb0ca305c dde_linux: don't zero out framebuffer of imx8
* On this platform there is no need to zero out the framebuffer
  dataspace, which is already blanked by core
* But it might happen that the GUI server is sending a capture
  event before the zero out happens. Thereby screen content can get
  lost

Fix #3878
2020-09-17 10:13:21 +02:00
Stefan Kalkowski
fd161cd814 dde_linux: turn imx8_fb_drv into Platform client
* Requests its I/O resources and clock settings from the platform driver

Fix #3877
2020-09-17 10:13:21 +02:00
Stefan Kalkowski
5913cdae89 os: fix clock settings for i.MX 8M platform_drv
* Fixes faulty algorithm in fractional pll rate calculation
* Enables clocks that are set as reference clock to prevent system freeze
* Enables/disables root clocks of gates implicitely

Fix #3876
2020-09-17 10:13:21 +02:00
Norman Feske
8dde14f93e bash: prevent aliasing of libc's 'getenv'
By default, bash brings its own version of 'getenv', named exactly like
the libc function. This becomes a problem in fork/execve scenarios if
the dynamic linker resolves 'getenv' to the bash binary instead of the
libc.

This patch fixes the generate step of the genodians.org scenario.

Issue #3882
2020-09-17 10:13:20 +02:00
Norman Feske
f5dc71ed35 os: remove obsolete single_session_service.h 2020-09-17 10:13:20 +02:00
Christian Prochaska
e0ca250232 libc: support detached pthreads
Fixes #3880
2020-09-17 10:13:20 +02:00
Christian Helmuth
75ba52a52b libc: remove mutex parameter from monitor
Issue #3874
2020-09-17 10:13:20 +02:00
Christian Helmuth
a0a112ffe7 libc: use monitor for fork
Issue #3874
2020-09-17 10:13:20 +02:00
Christian Helmuth
a891b3832c libc: use monitor for pthread join/cancel
Issue #3874
2020-09-17 10:13:20 +02:00
Christian Helmuth
d6f89b285d libc: use monitor for sleep()
Issue #3874
2020-09-17 10:13:20 +02:00
Norman Feske
e9a3f0f095 libc: use monitor for select
This patch simplifies the control flow within the libc kernel by
facilitating the monitor mechanism for the implementation of 'select'.

Issue #3874
2020-09-17 10:13:20 +02:00
Christian Helmuth
52a6cf1412 libc: support creat() 2020-09-09 16:57:34 +02:00
Norman Feske
aeeade53f9 sculpt: don't restart menu view if font changes
This patch enables the menu view's new ability to respond to font-size
changes in Sculpt so that the menu view instanced no longer need to be
restarted whenever the screen resolution or font size is changed.

Fixes #3875
2020-09-09 16:57:34 +02:00
Norman Feske
c05f716478 menu view: respond to font configuration changes
Issue #3875
2020-09-09 16:57:34 +02:00
Norman Feske
4aca94b08b vfs/ttf: support for watching font-size changes
This patch allows the use of the VFS watch mechanism for the glyph file
of the TTF VFS plugin so that clients become able to dynamically respond
to font reconfigurations.

Issue #3875
2020-09-09 16:57:34 +02:00
Norman Feske
3031fd2a7d os/vfs.h: const 'Directory' arg for 'Watch_handler'
The watch mechanism should not require a reference to a mutable
directory.
2020-09-09 16:57:34 +02:00
Norman Feske
7de2b040f8 vfs: deliver ACKs after config change
This is needed to enable VFS plugins to notify VFS clients about file
changes that depend on the plugin configuration, E.g., whenever the vfs_ttf
plugin responds to a font-size change, it generates a watch notification
for the glyphs file. Since the change is independent from I/O, we need
to manually call 'handle_io_progress'.
2020-09-09 16:57:34 +02:00
Norman Feske
0af969543d nitpicker: preserve alpha channel during resize
This patch reduces flickering artifacts that appear during the
resizing of clients that use an alpha channel.

Issue #3812
2020-09-09 16:57:34 +02:00
Josef Söntgen
9e97393e3a os: check path for dataspace in ROM VFS plugin
Fixes #3879.
2020-09-09 16:57:34 +02:00
Norman Feske
be14e68a83 sculpt/vimrc: 'set nowritebackup'
By default, Vim renames a written file to a backup file suffixed with
"~" before writing the current buffer to a new file. Consequently, there
exists an intermediate state when no file exists. Should a client watch
such a file to obtain dynamic configuration info, it observes the empty
state.

Some components have builtin heuristics for such a situation. In
particular, the window layouter falls back to a predefined default
'rules' if no rules are provided as a file. So when interactively
editing window-layouter rules using Vim, it can happen that the manually
maintained rules get overwritten by the default rules.

By setting 'set nowritebackup', we can sidestep this issue by preventing
Vim from producing the bad intermediate state.
2020-09-09 16:57:34 +02:00
Stefan Kalkowski
c1d99630c2 base: reset discarded Alarm object appropriatedly
Fix #3881
2020-09-09 16:57:34 +02:00
Norman Feske
328a4fa644 nitpicker: update hovering on view-stack changes
With the change of nitpicker to the event session interface, the
formerly periodic hovering updates moved to the - now sporadic - input
processing. This has the unfortunate side effect that hovering changes
caused by non-user-input, in particular view-stack changes issued by the
GUI clients that change the view under the current pointer position,
would no longer be reported immediately but only after receiving the
next incoming input event.

This patch reworks the hover handling such that potential hovering
changes due to view-stack operations are evaluated immediately by
those operations, covering the update of the hover report and the
generation of artificial enter/motion events.

Issue #3812
2020-09-09 16:57:34 +02:00
Christian Helmuth
ff82dc1ad5 doc: activate --depot-auto-update in getting_started.txt
Also be more explicit about the command to "execute" if depot archives
are missing in depot.inc.
2020-09-09 16:57:34 +02:00
Norman Feske
17a6318ad6 vfs: process all acks in each iteration
This patch solves a corner case where one long-active job (e.g.,
read-ready request) stays at the beginning of the '_active_jobs' queue
without an ack. In this case, the '_try_acknowledge_jobs' method would
wrongly stop processing the subsequent acknowledgements. In practice,
this can lead to a delayed sending of acknowledgements until new I/O or
client requests occur. In particular, Vim in Sculpt's inspect window
sometimes did not immediately respond to key presses during tab
completion. Here, the read-ready request of the terminal prevented the
acknowledgement for read of directory entry from being delivered until
the next key was pressed.

Fixes #3873
2020-09-09 16:57:34 +02:00
Christian Helmuth
0605180a61 libc: remove legacy kernel functions 2020-09-09 16:57:34 +02:00
Christian Helmuth
ab953a534c libc: remove residues of noux fork support 2020-09-09 16:57:34 +02:00
Christian Helmuth
0977574372 vfs/rtc: return timestamp size on stat() 2020-09-01 16:48:50 +02:00
Alexander Boettcher
99bdfbe36f trace: don't account argument_buffer 2x
The quota for the argument buffer is already accounted by using the
Attached_ram_dataspace _argument_buffer, which uses the Constraint_ram_allocator
_ram, which uses the Ram_quota_guard from the Session_object. Running on
Sculpt with more than 1000 Subject_info objects/trace IDs the memory
waste become noticeable.
2020-09-01 16:48:29 +02:00
Christian Helmuth
f70b02ae3b vbox: remove logger libc plugin
Fixes #3870
2020-08-28 14:48:05 +02:00
Christian Helmuth
574e41119a sculpt: version 20.08 2020-08-28 14:34:22 +02:00
Christian Helmuth
8d31590a66 version: 20.08 2020-08-28 10:31:12 +02:00
Norman Feske
8a5277d53f News item for version 20.08 2020-08-28 10:18:07 +02:00
Norman Feske
fb6549a092 Release notes for version 20.08 2020-08-28 10:18:07 +02:00
Christian Helmuth
c649307720 depot: update recipe hashes 2020-08-28 08:29:12 +02:00
Christian Helmuth
bf0f3b65b4 Replace remaining 'constrain_phys' by 'managing_system' 2020-08-28 08:28:13 +02:00
Norman Feske
b9a21ee3ae nitpicker: updated README 2020-08-28 08:28:13 +02:00
Piotr Tworek
8d790010bf Xml_generator: Remove unused member variable
This triggers a warning when building the code with clang.

Fixes #3868
2020-08-28 08:28:13 +02:00
Stefan Kalkowski
e29485fa59 dde_linux: decouple Lx_kit::Irq and Platform::Device
Follow-up commit to fix the old usb_drv. Under rpi one and the
same irq can be requested several times. Therefore, we've to track
the Irq_connection objects.

Ref #3865
2020-08-28 08:28:13 +02:00
Christian Prochaska
ace172ebf3 qt5: prerequisites for qtwebengine support
Fixes #3867
2020-08-28 08:28:13 +02:00
Norman Feske
bbfda019df vfs/terminal: minor const improvement
Issue #3860
2020-08-25 12:03:31 +02:00
Norman Feske
5cc2adb421 pkg/sculpt: update README
Adaptation to the change of the input filter to the event filter.
2020-08-25 12:02:37 +02:00
Norman Feske
90b3b72a91 doc: update components.txt
This patch adjusts the components.txt to the recent changes of the GUI
stack.

Issue #3812
2020-08-25 12:02:36 +02:00
Christian Helmuth
dd4a3b0263 vbox: direct screen updates via NotifyUpdate() 2020-08-25 12:02:36 +02:00
Norman Feske
7d0cb9620b depot: update recipe hashes 2020-08-25 11:50:41 +02:00
Christian Helmuth
2c29bf5a21 tool_chain_auto: depend on zlib from depot
This prevents run-script failures in case hashes are out-of-date.
2020-08-25 11:50:12 +02:00
Piotr Tworek
80bc1cff5f run: Use Qemu 5.0.0 compatile gic-version param.
It seems Qemu 5.0.0 no longer supports gic_version parameter.
Apparently this only worked due to some compat feature that
was dropped in Qemu 5.0.0. The replacement which works on both
old and new Qemu versions is gic-version.

Fixes #3823
2020-08-25 11:50:12 +02:00
Stefan Kalkowski
a5f6d0f081 dde_linux: use new platform API for usb_host_drv
Introduce a common platform device initialization routine for all
ARM SoCs by using the new platform driver API.

Fix #3865
2020-08-25 11:50:12 +02:00
Stefan Kalkowski
e223be32ce dde_linux: decouple Lx_kit::Irq and Platform::Device
The Lx_kit::Irq abstraction of DDE Linux was always using the very first
interrupt of a Platform::Device stored in it. Instead of handing over the
platform device it is much more flexible and sane to hand over the actual
interrupt capability.

Ref #3865
2020-08-25 11:50:12 +02:00
Stefan Kalkowski
73d3698e2f os: add new platform driver for Raspberry Pi
Fix #3864
2020-08-25 11:50:12 +02:00
Stefan Kalkowski
5f5ad41ad3 hw: unify irq enumeration for Raspberri Pi
By now, the enumeration of peripheral interrupts on Raspberry Pi 1 was
different in between base-hw kernel and Fiasco.OC. Therefore, hacks were
needed in every driver to request the correct interrupt number dependent
on the kernel. Before reproducing the same in the platform driver for rpi,
we can more easily use the same enumeration with base-hw.

Ref #3864
2020-08-25 11:50:12 +02:00
Stefan Kalkowski
7ba31d4447 os: disable initialization of i.MX8MQ platform_drv
This is a temporary workaround to not harm drivers, which aren't
converted yet to request all device resources including power and
clocks from this new platform driver.

Ref #3863
2020-08-25 11:50:12 +02:00
Stefan Kalkowski
224f5907b2 os: add platform driver for i.MX 8M Quad SoC
The new platform driver supports clock and power-domain settings per device.
IOMUX constroller settings are not part of the driver yet.

Fix #3863
2020-08-25 11:50:12 +02:00
Stefan Kalkowski
70f98fcc44 hw: implement Pd_session::managing_system for ATF
To access the ARM Trusted Firmware from the platform driver
fill the new `managing_system` call of the PD session with life resp.
do a SMC call on behalf of the client.

Fix #3816
2020-08-25 11:50:11 +02:00
Stefan Kalkowski
06edc0d52b base: extend PD session with managing_system call
Introduce the managing_system privilege for components like the
platform_driver to allow it to call system management functionality
that is reserved by kernel or special firmware, e.g., ARM Trusted Firmware.

The former RAM resource configuration attribute `constrain_phys`,
which enabled to constrain the region of physical RAM to be used,
gets replaced by the new, broader managing_system configuration
attribute of a `start` node. It gets enforced by the sandbox library.

Ref #3816
2020-08-25 11:50:11 +02:00
Christian Prochaska
af6d2a8c54 stdcxx: add abi symbols needed by qtwebengine
Fixes #3862
2020-08-25 11:50:11 +02:00
Josef Söntgen
157f4b1270 pthread: implement condattr setclock
Normally CLOCK_REALTIME is used. However libraries, like glib, want to
use CLOCK_MONOTONIC. To make those users happy add setting the clock.

Note, the pthread_cond implementation uses the POSIX semaphore API
internally that does not have means to set the clock. For this reason,
the private 'sem_set_clock' function is introduced.

Fixes #3846.
2020-08-25 11:50:11 +02:00
Martin Stein
66ff18a53e libc: support pthread mutex type "Adaptive NP"
The initial motivation for enabling support for this pthread mutex type was
that it is required by the Glib test in genode/world.

Fixes #3817
2020-08-25 11:50:11 +02:00
Norman Feske
2a4adc895c Remove dithering from menu_view, themed decorator
With the change from RGB565 to RGB888, the application of dithering has
become obsolete.

Issue #3784
2020-08-25 11:50:11 +02:00
Josef Söntgen
d21bc8268b vfs: add raw option to terminal plugin
When the 'raw' attribute is set to 'yes' the terminal VFS plugin will
ignore control characters. This in necessary for terminal connections
that transport data that contain such characters as part of message.

Fixes #3860.
2020-08-25 11:50:11 +02:00
Norman Feske
8b556a9435 usb_block: fix upper block-number range check
The driver wrongly rejected a block request for the very last block of
the device, which prevented part_block from successfully parsing the
partition table (when attempting to access the GPT backup).

Fixes #3861
2020-08-25 11:50:11 +02:00
Norman Feske
a68a6665ac sculpt: remove part_block upon failure
With this patch, sculpt uses init's heartbeat-monitoring mechanism to
detect the failure of part_block instances during storage disovery.
If part_block gets stuck, the device is released and can thereby
be accessed at the whole-device level.

Issue #3861
2020-08-25 11:50:11 +02:00
Norman Feske
1e7c94759d part_block: spelling fix 2020-08-25 11:50:11 +02:00
Christian Prochaska
9ec2a19cc0 libc: add wrapper function for 'Genode::cache_coherent()'
Fixes #3858
2020-08-25 11:50:11 +02:00
Christian Prochaska
9bc6b8be5a libc: handle 'MAP_SHARED' flag in 'mmap()'
Fixes #3857
2020-08-25 11:50:11 +02:00
Norman Feske
f8f8b665c3 vfs: don't accept new job before old job is acked
Fixes #3859
2020-08-25 11:50:11 +02:00
Christian Prochaska
31397d67ae base: increase linker area size
Fixes #3856
2020-08-25 11:50:11 +02:00
Christian Prochaska
dd8777093d libc: don't treat 'mmap()' address hint w/o MAP_FIXED flag as error
Fixes #3855
2020-08-25 11:50:10 +02:00
Christian Prochaska
2f55ffdf20 libc: zero-initialize anonymous memory from 'mmap()'
Fixes #3854
2020-08-25 11:50:10 +02:00
Josef Söntgen
7c1a4522d6 virtualbox5: enable storage device flushing
The patches disable VBOX_IGNORE_FLUSH and a sanity check in the VMDK
backend. This enables passing an explicit flush request by the guest
down to the VFS.

Fixes #3743.
2020-08-25 11:50:10 +02:00
Norman Feske
3e8824908d system_shell: increase gui_fb quota
With this change, the window can be maximized when using a 1920x1080
resolution with 32 bits per pixel.

Issue #3784
2020-08-25 11:50:10 +02:00
Norman Feske
28714979bd sculpt: drop storage-detect-cancellation feature
Fixes #3853
2020-08-25 11:50:10 +02:00
Norman Feske
658091bfad ttf_font: add sanity check for invalid scale value
The check prevents the Ttf_font from violating the bounding box in the
presence of very small scale values. This can happen during the startup
of Sculpt. Before the framebuffer driver is up, Sculpt bases its dynamic
font-size setting on a screen resolution of 1x1.

Issue #3812
2020-08-25 11:50:10 +02:00
Norman Feske
e8e14ad1bf test-libc_execve: adjust timeout for pistachio 2020-08-25 11:50:10 +02:00
Martin Stein
e544464354 libsparkcrypto: src recipe, contrib alis, mk fixes
* add libsparkcrypto source-recipe
* provide ALI files through a new repository by mstein and add the repo
  download to the libsparcrypto port-file
* remove dependencies to non-existent contrib ADB files from the library make
  files

Fixes: #3852
2020-08-25 11:50:10 +02:00
Norman Feske
969e59c599 terminal: consider border in size calculation 2020-08-25 11:50:10 +02:00
Norman Feske
f2d7f7aa6e sculpt: remove decor frame from panel view 2020-08-25 11:50:10 +02:00
Norman Feske
a59b69758b sculpt: remove deferred GUI initialization
The sculpt manager used to defer the initialization of the GUI until
nitpicker's first display report became ready. This way, Sculpt was able
to run headlessly even if the framebuffer driver failed to start up.
Thanks to #3827, nitpicker no longer depends on a working framebuffer
driver. So the sculpt manager is safe to rely on nitpicker in any case,
simplifying the code.

Issue #3827
2020-08-25 11:50:10 +02:00
Norman Feske
c7d9b2ca92 nitpicker: fix mode change for requested fb
This is a follow-up commit to "nitpicker: make framebuffer and input
optional". It restores the dynamic mode-change support when using
'request_framebuffer="yes"' as needed in scenarios where multiple
nitpicker instances are used in a cascaded way. E.g., Sculpt's
Leitzentrale. The previous version missed to reconstruct the
'_fb_screen' on mode changes.

Issue #3812
2020-08-25 11:50:10 +02:00
Norman Feske
2437d759b6 Xml_node: remove deprecated methods
Issue #3755
2020-08-25 11:50:10 +02:00
Norman Feske
0434cb6fd6 gdb_monitor.run: cap-quota adjustment 2020-08-25 11:50:10 +02:00
Norman Feske
556a5c8086 libc: clean up 'clock_gettime' handling
This patch untangles the dependency of VFS operations that need RTC
information from the 'clock_gettime' libc function that must never be
called from the libc kernel context.

- The 'Rtc' class uses the VFS directly for reading the rtc file instead
  of relying on libc functions.

- The 'Rtc' instance has become part of the 'Kernel' instead of
  being construced as a side effect of the first call of
  'clock_gettime'.

- Changed 'Rtc::read' to return a timespec value, which has a higher
  precision than the formerly used time_t value.

- The 'Rtc::read' returns a value with the relative 'current_time'
  already applied. The former handling of subsequent rtc-value
  updates has been rewritten to become more logical.

- The 'Vfs_plugin' no longer calls 'clock_gettime' but the new
  kernel-level 'Current_real_time' interface.

Issue #2635
2020-08-25 11:50:10 +02:00
Norman Feske
852ab79359 Move atexit handling from base lib to libc
This patch untangles the interplay of the base library and the libc
during the exit handling.

- The CXA ABI for the atexit handling is now provided by the libc.
  For plain Genode components without libc dependency, __cxa_atexit
  is a no-op, which is consistent with Genode's notion of components.

- The 'abort' implementation of the base library no longer calls
  'genode_exit' but merely 'sleep_forever'. This way, the cxx library
  no longer depends on a 'genode_exit' implementation.

- The libc provides 'atexit' support by storing metadata on the
  libc kernel's heap now, thereby eliminating the former bounded
  maximum number of atexit handlers.

- Shared-library dtors are no longer called via the atexit mechanism
  by explicitly by the dynamic linker. This slightly changes the
  call order of destructors (adjustment of the ldso test). Functions
  marked as destructors are called after the atexit handlers now.

- The libc executes atexit handlers in the application context,
  which supports the I/O operations in those handles, in particular
  the closing of file descriptors.

Fixes #3851
2020-08-25 11:50:09 +02:00
Christian Prochaska
66063e5137 qt5_component: support arguments and environment from config
Fixes #3049
2020-08-25 11:50:09 +02:00
Josef Söntgen
f03917ab7c aes_cbc_4k: api recipe
Fixes #3850
2020-08-25 11:50:09 +02:00
Martin Stein
5ed528a2ad aes_cbc_4k: import file for include directories
Ref #3850
2020-08-25 11:50:09 +02:00
Josef Söntgen
81ae4599ae libsparkcypto: api recipe
For the time being, we put all spec and body files into the recipe although
there might be a (so far to us unknown) way to have only the API relevant files
in it.

Fixes #3849
2020-08-25 11:50:09 +02:00
Martin Stein
82090d2ea1 libsparkcrypto: mark some units pure
* switch to a libsparkcrypto fork of m-stein
* switch to a libsparkcrypto state that makes some units pure that are used by
  the consistent block encrypter, in order that the latter can become
  completely pure

Ref #3849
2020-08-25 11:50:09 +02:00
Martin Stein
2e3b11b354 ada-runtime: add s-expint.ad*
* switch to fork of the Ada runtime provided by m-stein
* switch to a Ada-runtime state that provides the Exp_Int package (exponential
  function on integers)
* adapt spark lib, symbols, and recipes to incorporate the Exp_Int package

Fixes #3848
2020-08-25 11:50:09 +02:00
Martin Stein
f3eaeb08ef ada/spark: all warnings, warn strict, style checks
* enable all common warnings through default value of CC_ADA_WARN
* treat warnings like errors through default value of CC_ADA_WARN_STRICT
* enable almost all style checks through default value of CC_ADA_WARN_STRICT
* style fixes for aes_cbc_4k
* disable strict warnings and style checks for libsparkcrypto and spark lib

Ref #3848
2020-08-25 11:50:09 +02:00
Alexander Boettcher
3f97269988 sculpt_manager: add graphical CPU affinity config
Fixes #3820
2020-08-25 11:50:09 +02:00
Norman Feske
1aed881313 Remove drivers/gpio/spec directory
Issue #2190
2020-08-25 11:50:09 +02:00
Norman Feske
3c78265e66 Remove drivers/framebuffer/spec directory
Thanks to the unification of build directories, the sub directories
(rpi, sdl, imx53) do not depend on SPEC values.

Issue #2190
2020-08-25 11:50:09 +02:00
Norman Feske
fcb21732e0 Move drivers/input/spec/ps2 to drivers/ps2
This simplifies the directory structure.

Issue #2190
2020-08-25 11:50:09 +02:00
Norman Feske
db0e86fa41 Remove drivers/input/dummy pseudo driver
With the transition from the input-session to the event-session
interface, the use case for this component has vanished.

Issue #3827
2020-08-25 11:50:09 +02:00
Norman Feske
2e22498e5a nitpicker: no framebuffer and input by default
This patch prevents nitpicker from requesting a framebuffer and input
session by default because the regular use of nitpicker relies on the
capture-session and event-session interfaces by now.

For supporting the nested use of nitpicker via the gui_fb component, it
is still possible to enable the traditional behavior by explicitely
setting the 'request_input' and 'request_framebuffer' config attributes
to "yes".

Issue #3812
2020-08-25 11:50:09 +02:00
Norman Feske
264f695373 Remove transitionary input_event_client component
With the transition of the input servers to event clients completed,
this helper component is no longer needed.

Issue #3845
Issue #3827
2020-08-25 11:50:09 +02:00
Norman Feske
a2381c7e4c Turn USB HID drivers into event-session clients
Issue #3845
2020-08-25 11:50:09 +02:00
Norman Feske
974118acec Turn PS/2 driver into event-session client
Issue #3845
2020-08-25 11:49:45 +02:00
Christian Prochaska
08ef528577 stdcxx: enable thread features
Issue #2442
2020-08-25 11:49:45 +02:00
Norman Feske
50b367c076 Remove dde_zircon
Fixes #3847
2020-08-25 11:49:44 +02:00
Christian Helmuth
36b6ebc030 libc: process VFS operations in monitor
Fixes #2635
2020-08-25 11:49:44 +02:00
Christian Helmuth
a89d61acf2 base: call Io_progress_handler only in signal RPC
This remove the call to Io_progress_handler::handle_io_progress() from
wait_and_dispatch_one_io_signal() to prevent unexpected nesting
I/O-progress handling in case of custom dispatch loops (e.g., in libc).
The original intention of Io_progress_handler was to inform the
entrypoint just before blocking in the entrypoint loop.

Issue #2635
2020-08-25 11:49:44 +02:00
Norman Feske
9e42a9ac7e Replace server/acpi_input with app/acpi_event
Fixes #3827
2020-08-25 11:49:44 +02:00
Norman Feske
19690193a4 Remove obsolete use of input_session/connection.h 2020-08-25 11:49:44 +02:00
Norman Feske
78047b5bd8 Rename fb_boot_drv to boot_fb_drv
to be consistent with the naming of the other drivers.
2020-08-25 11:49:43 +02:00
Norman Feske
9662d89cfb Replace input filter with event filter
This commit applies the transition from the "Input" session to the "Event"
session to the event-filtering mechansim. The functionality of the
input_filter is now provided by the event_filter. The event filter
requests only one "Event" session as destination for the filter result,
which is usually routed to the nitpicker GUI server. It provides an
"Event" service to which any number of event sources can connect.

The configuration of the filter chain remains almost the same. Only the
declaration of the <input> nodes is no longer needed. Instead, the
configuration must specify <policy> nodes, which define the mapping of
"Event" clients (event sources) to the inputs used in the filter chain.

The patch adjusts all uses of the nitpicker GUI server accordingly such
that the event filter reports events to nitpicker's event service
instead of having nitpicker request an "Input" session. This dissolves
the dependency of nitpicker from input drivers.

Issue #3827
2020-08-25 11:49:43 +02:00
Norman Feske
bc5b161260 os: event_dump server for printing events
This component takes over the role of the test-input component.

Issue #3827
2020-08-25 11:49:43 +02:00
Norman Feske
c502e1d095 input_filter: prepare for refactorization
This patch brings the input filter into a shape that is easier to
re-mold into an event filter, reversing the client/server roles of
the component.

* The 'Sink &destination' is no longer passed as constructor argument
  to the individual filters but passed as argument to the 'generate'
  method. This way, the final destination does not need to exist at
  the construction time of the filter chain but can be created on
  the fly (clearing the way for using 'Event::Client::with_batch').

* A new 'Source::Filter' interface with the 'apply' method aids the
  cascading of filters during 'generate'. The modules now implement
  the 'Source::Filter::filter_event' interface instead of the
  'Source::Sink::submit_event' interface.

* Since the 'Sink &destination' is no longer a member of the filter
  modules, character-repeat events can no longer be emitted in an
  ad-hoc way. Instead, the character-repeat mechanism now invokes
  a new 'Trigger::trigger_generate' hook that prompts the execution
  of the regular 'generate' mechanism by the main program.

This patch is supposed to leave the semantics of the input filter
unchanged (validated by the input_filter.run script).

Issue #3827
2020-08-25 11:49:43 +02:00
Norman Feske
6c4ce86a34 event_session: make Session_client::Batch abstract
This way, there can exist multiple implementations of the interface such
as event filters.

Issue #3812
2020-08-25 11:49:43 +02:00
Norman Feske
7bac1ec7e5 Adapter for connecting input and event servers
This is an intermediate helper component for the transition of input
servers into event clients. It works analogously to the
input_event_bridge but it connects servers instead of clients.
In particular, it can act as glue between a traditional input driver
that provides an input service and the event filter that provides an
event service. Thanks to this component, each driver can be migrated to
the event-client interface individually.

Issue #3827
2020-08-25 11:49:43 +02:00
Norman Feske
7932c76d85 nitpicker: add event service
Issue #3812
2020-08-25 11:49:43 +02:00
Norman Feske
66c520cdae Remove stale virtualbox_nic_router.run script
The run script is not regularly tested and thereby has become
nonoperational since a long time.
2020-08-25 11:49:43 +02:00
Christian Helmuth
9453287a6b libc: move current working directory into kernel 2020-08-25 11:49:43 +02:00
Christian Helmuth
40e936911f libc: remove unused member from Errno 2020-08-25 11:49:43 +02:00
Christian Helmuth
d9121e50c3 libc: translate file-descriptor exhaustion into EMFILE
Fixes #3841
2020-08-25 11:49:43 +02:00
Christian Helmuth
cb15f40028 Remove remnants of libc_lxip
Issue #2960
2020-08-25 11:49:42 +02:00
Alexander Boettcher
ce1d0464b8 ssh_terminal: destroy libc fd within user context
Fixes #3840
2020-08-25 11:49:42 +02:00
Alexander Boettcher
bed531b604 libc: initialize tv struct in pselect
Fixes #3839
2020-08-25 11:49:42 +02:00
Christian Helmuth
257b3b6775 libc: cleanup monitor implementation
- Explicit types for function and monitor execution results
- Remove pending flag and mutex (pending flag was moved to kernel)
2020-08-25 11:49:42 +02:00
Christian Helmuth
420ed91480 linux_nic_drv: stop receiver thread on congested queue
Otherwise, the thread spins on and drops packets.
2020-08-25 11:49:42 +02:00
Christian Prochaska
c6b17be744 vfs/lwip: clear the packet queue in '~Udp_socket_dir()'
Fixes #3836
2020-08-25 11:49:42 +02:00
Christian Helmuth
d266f44ef3 libc: free resources on socket creation failure
Issue #3766
2020-08-25 11:49:42 +02:00
Christian Helmuth
5a2ac73b69 vfs/lwip: prevent pbuf leakage on ENOTCONN
Issue #3766
2020-08-25 11:49:42 +02:00
Christian Helmuth
7996fc45f3 vfs/lwip: signal ENOTCONN via EOF on remote file
Issue #3766
2020-08-25 11:49:42 +02:00
Alexander Boettcher
a03a37b1d9 vfs/lwip: avoid leaking of pbuf objects
Issue #3766
2020-08-25 11:42:37 +02:00
Christian Helmuth
76ac94f4f2 vfs/lwip: fix pbuf slab-block size
Issue #3766
2020-08-25 11:42:37 +02:00
Alexander Boettcher
f4d3231034 cpu_sampler: handle all quota upgrades
Beforehand cap_quota upgrades got ignored which leads to non working clients.

Issue #3826
2020-08-25 11:42:37 +02:00
Alexander Boettcher
b7ffeb51aa cpu_sampler: avoid spinning on unavailable state
Fixes #3826
2020-08-25 11:42:37 +02:00
Alexander Boettcher
ed15a46ca4 base: construct child process only once
Fixes #3821
2020-08-25 11:42:36 +02:00
Alexander Boettcher
c55a499009 base: remove delayed dispatch from Rpc_entrypoint
Fixes #3833
2020-08-25 11:42:36 +02:00
Alexander Boettcher
d1be1281bc os: use whole memory in Packet_allocator 2020-08-25 11:42:36 +02:00
Christian Prochaska
377dadd461 libc_getaddrinfo.run: fix run script
Fixes #3832
2020-08-25 11:42:36 +02:00
Christian Prochaska
353baa9251 libc: add pthread alias functions with underscore
The libc calls pthread functions with underscore internally.

Issue #725
2020-08-25 11:42:36 +02:00
Alexander Boettcher
60106ac2c8 base: avoid deadlock and page fault
Fixes #3830
2020-08-25 11:42:29 +02:00
Christian Helmuth
de7d4a5523 Replace libc_pipe plugin by VFS pipe plugin 2020-07-30 08:49:24 +02:00
Christian Prochaska
9b6cc75f1c tool/seccomp: allow 'restart_syscall' on x86_64
Fixes #3831
2020-07-30 08:49:23 +02:00
Christian Helmuth
18b26ff595 vfs/pipe: never report read_ready on pipe/out handle 2020-07-30 08:49:23 +02:00
Christian Helmuth
e44ffa02c9 libc: remove redundant dummies (fstatat, stat) 2020-07-30 08:49:23 +02:00
Christian Helmuth
5122917d62 os: declare Path::max_len() const 2020-07-30 08:49:23 +02:00
Alexander Boettcher
3639a1af80 acpi_drv: avoid out-of-bound access to FADT table
Fixes #3829
2020-07-30 08:49:23 +02:00
Alexander Boettcher
851b842033 vbox5-generic: use pthread_cond_timedwait for halt
use similar implementation as introduced for vbox5-nova

vbox5-nova: avoid Blocking_canceled exception

Related to #3810
2020-07-30 08:49:23 +02:00
Alexander Boettcher
072a00ba18 vbox5: remove ubuntu 14_04 test 2020-07-30 08:49:23 +02:00
Alexander Boettcher
7e0b66835b vbox5: show serial for ubuntu VMs during autopilot 2020-07-30 08:49:23 +02:00
Alexander Boettcher
73e671893b nova: remove obsolete local vcpu case
Seoul was the last user of Vcpu_same_pd
2020-07-30 08:49:23 +02:00
Christian Prochaska
fd682cd470 hw: check descriptor validity in LPAE lookup
Fixes #3828
2020-07-30 08:49:23 +02:00
Norman Feske
bfd94d64ba pbxa9_drivers: add blit api
This is a follow-up fix of "Turn framebuffer drivers into capture
clients".

Fixes #3813
2020-07-30 08:49:23 +02:00
Piotr Tworek
d8539af412 platform_session: Add missing include.
The code uses Genode::Attached_dataspace but fails to include header
defining this type.

Fixes #3824
2020-07-30 08:49:23 +02:00
Norman Feske
cd7a6fc9fe pkg/drivers_interactive-muen: use capture session
This is follow-up commit to "Turn framebuffer drivers into capture
client".

Issue #3813
2020-07-30 08:49:23 +02:00
Alexander Boettcher
41380ff769 base: remove Cancelable_lock
- base/cancelable_lock.h becomes base/lock.h
- all members become private within base/lock.h
- solely Mutex and Blockade are friends to use base/lock.h

Fixes #3819
2020-07-30 08:49:23 +02:00
Alexander Boettcher
0ed7367c97 vbox5-nova: avoid using semaphore used by Lock
Issue #3819
2020-07-20 15:59:47 +02:00
Alexander Boettcher
eab09a2f7c nova: avoid Blocking_canceled exception in timer
Issue #3819
2020-07-20 15:59:47 +02:00
Norman Feske
de795b1a6e depot: update recipe hashes 2020-07-13 11:33:53 +02:00
Alexander Boettcher
73546a135a seoul: increase VMM memory for vm_stress*
The memory was not sufficient if more than 2 vcpus are used. The test starts
up to 4 vCPUs.
2020-07-13 11:33:15 +02:00
Alexander Boettcher
c888d856ee vbox5*.run: disable in autopilot usb usage
to avoid to spam the log with usb messages about our usb dongle sending
regularly input events
2020-07-13 11:33:15 +02:00
Norman Feske
c81af531a3 Turn framebuffer drivers into capture clients
This patch replaces the use of the "Framebuffer" session interface by
the new "Capture" session interface in all framebuffer drivers. Thanks
to this change, those drivers have become mere clients of the nitpicker
GUI server now, and are no longer critical for the liveliness of the GUI
server.

The patch touches the following areas:

- The actual driver components. The new versions of all drivers have
  been tested on the respective hardware. Generally, the drivers
  have become simpler.

- The drivers_interactive packages for various boards. The drivers
  subsystem no longer provides a "Framebuffer" service but needs a
  valid route to the "Capture" service provided by nitpicker.

- The driver manager of Sculpt OS.

- This patch changes the role of the test-framebuffer component from a
  framebuffer client to a capture server so that drivers (capture clients)
  can be directly connected to the test component without the nitpicker
  server.

- Framebuffer driver no longer support the unbuffered mode.

- The fb_bench.run script is no longer very meaningful because it
  interplays solely with nitpicker, not with the driver directly.

- All run scripts for graphical scenarios and the related depot
  archives got adapted to the change.

Fixes #3813
2020-07-13 11:33:15 +02:00
Norman Feske
6743669ab8 nitpicker: report no mode smaller than 1x1 pixels
Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
320387db89 nitpicker: improve GUI client resize handling
This patch replaces meta-data allocation during the resize handling by a
new 'Resizeable_texture' type that has all meta data preallocated.
It also replaces the use of pointer return values with the
'Resizeable_texture::with_texture' method.

Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
4cad1a87df nitpicker: make framebuffer and input optional
Nitpicker used to unconditionally request a framebuffer and input
session. With the transition to the new capture/event session
interfaces, this built-in policy does no longer suffice.

This patch introduces the attributes 'request_framebuffer="yes"' and
'request_input="yes"' (with the default values shown) to nitpicker's
<config> node. If setting those attributes to "no", nitpicker won't
request a "Framebuffer" and "Input" session respectively.

Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
22cb6dded7 nitpicker: add capture service
Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
537b317273 nitpicker: handle failed try_alloc_texture
Fixes #3782
2020-07-13 11:33:14 +02:00
Norman Feske
795a817a33 nitpicker: remove dirty_rect state from view stack
In the presence of potentially multiple output back ends, this
dirty_rect state must be maintained individually per back end. Instead
of storing the dirty_rect as view-stack member, the view stack now calls
a new 'Damage::mark_as_damaged' interface, which allows nitpicker to
propagate this information to multiple back ends. Unfortunately, the
patch must remove the per-view dirty_rect state.

Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
067a7ad7e9 nitpicker: internal cleanup
This patch simplifies the internal naming of the nitpicker GUI server as
a preparatory step for adding support for the capture session interface.

Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
3863de9589 Input-event-bridging service
The sole purpose of this service is the migration path from the use of
input session interface to the event session interface.

Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
443d3c98dd Event session interface
Issue #3812
2020-07-13 11:33:13 +02:00
Norman Feske
602def9bdd Simple example for using a capture connection
Issue #3812
2020-07-13 11:33:13 +02:00
Norman Feske
3d1d1b439d Capture session interface
Issue #3812
2020-07-13 11:33:13 +02:00
Josef Söntgen
49e907e5f6 libc: remove trailing slash in lstat and stat
Fixes #3814.
2020-07-13 11:33:13 +02:00
Alexander Boettcher
c4a8c6798b top: react on too small trace argument buffer size
Issue #3811
2020-07-13 11:33:13 +02:00
Alexander Boettcher
21e48a8e12 trace: extend for_each_subject_infos return value
Fixes #3811
2020-07-13 11:33:13 +02:00
Norman Feske
a7d170adda os: add blit/painter.h
This utility eases the application of the 'blit' function when using the
'Texture' and 'Surface' types.
2020-07-13 11:33:13 +02:00
Norman Feske
91b71f7a9f run: add drivers_interactive for panda and arndale 2020-07-13 11:33:13 +02:00
Alexander Boettcher
641679f7e7 vbox5-nova: avoid Blocking_canceled exception
using pthread primitives to implement block/wakeup of EMT thread

Fixes #3810
2020-07-13 11:33:13 +02:00
Christian Helmuth
ed4594c76b Fix success/failure detection in cpu_bench testsuite
Issue #3785
2020-07-13 11:33:12 +02:00
Alexander Boettcher
997a77b3de foc: use Mutex
Issue #3809
2020-07-13 11:33:12 +02:00
Alexander Boettcher
6fa4307005 foc: keep core internal pager state separately
beforehand the Lock object and more was accessible
via FOC native cpu thread RPC

Fixes #3809
2020-07-13 11:33:12 +02:00
Alexander Boettcher
f3efbe50bb base: remove deprecated cancel_blocking() support
for threads.

Fixes #3806
2020-07-13 11:33:12 +02:00
Alexander Boettcher
ce6f4dffe5 linux: use Mutex
Fixes #3807
2020-07-13 11:33:12 +02:00
Norman Feske
a0b0892df3 UEFI/boot_fb: constrain Qemu to 1920x1080
Fixes #3808
2020-07-13 11:33:12 +02:00
Christian Helmuth
e163055f6a ram fs: Release node mutex on unlink
This is needed if an open file is unlinked.

Fixes #3800
2020-07-13 11:33:12 +02:00
Alexander Boettcher
7acc34b48b dde_zircon: use Mutex
Fixes #3805
2020-07-13 11:33:12 +02:00
Alexander Boettcher
a9827c662e dde_ipxe: use Mutex
Issue #3805
2020-07-13 11:33:12 +02:00
Alexander Boettcher
9a8a42e819 dde_rump: use Mutex/Blockade
Issue #3805
2020-07-13 11:33:12 +02:00
Alexander Boettcher
5516dbcb1f dde_linux: use Mutex/Blockade
Issue #3805
2020-07-13 11:33:11 +02:00
Alexander Boettcher
b7cdb5840a dde_bsd: remove unused Lock
Issue #3805
2020-07-06 14:43:05 +02:00
Alexander Boettcher
61d798c629 launchpad: use Mutex
Fixes #3804
2020-07-06 14:43:05 +02:00
Alexander Boettcher
973fbc98be nitlog: use Mutex
Issue #3804
2020-07-06 14:43:05 +02:00
Alexander Boettcher
3d634df34d gems: remove report_rom_slave.h
Fixes #3803
2020-07-06 14:43:04 +02:00
Alexander Boettcher
ad284491e6 mixer_gui_qt: use Blockade
Issue #3803
2020-07-06 14:43:04 +02:00
Alexander Boettcher
f946de4450 tcp_terminal: use Mutex
Issue #3803
2020-07-06 14:43:04 +02:00
Alexander Boettcher
377c6ed0ce ssh_terminal: use Mutex
Isse #3803
2020-07-06 14:43:04 +02:00
Alexander Boettcher
1609d8a92f gdb_server: use Mutex
Fixes #3802
2020-07-06 14:43:04 +02:00
Alexander Boettcher
169cad6059 seoul: use Mutex
Issue #3802
2020-07-06 14:43:04 +02:00
Alexander Boettcher
bba4790002 virtualbox5: use Mutex/Blockade
Issue #3802
2020-07-06 14:43:04 +02:00
Alexander Boettcher
c943e26913 lib/drm: use Blockade
Fixes #3801
2020-07-06 14:43:04 +02:00
Alexander Boettcher
7d1fd0b0a3 lwip: use Mutex
Issue #3801
2020-07-06 14:43:04 +02:00
Alexander Boettcher
6d653b3c0f qemu-usb: use Mutex
Issue #3801
2020-07-06 14:43:04 +02:00
Alexander Boettcher
5936d00b5e acpica: use Mutex
Issue #3801
2020-07-06 14:43:04 +02:00
Christian Prochaska
5af4552511 qt5: build Qt libraries and applications with qmake
Fixes #3795
2020-07-03 13:48:55 +02:00
Norman Feske
0310c733d5 base-linux: let seccomp permit 'read'
This is needed for using the 'wait_for_continue' debug mechanism.

Fixes #3798
2020-07-03 11:58:31 +02:00
Christian Helmuth
0e6c32f75e libc: use Mutex/Blockade
Fixes #3796
2020-07-03 11:16:20 +02:00
Christian Helmuth
93ab972ddc tool/seccomp: allow sigreturn on x86
Fixes #3799
2020-07-03 11:15:33 +02:00
Norman Feske
35c3acdf05 depot: update recipe hashes 2020-07-03 11:13:59 +02:00
Alexander Boettcher
103236fdca nitpicker: fix memory accounting during realloc
Fixes #3794
2020-07-03 11:11:24 +02:00
Christian Prochaska
62848b1a68 mk: set soname in abi libraries
Fixes #3793
2020-07-03 11:11:23 +02:00
Alexander Boettcher
64ef651d4d libc: handle MSG_WAITALL in socket_fs_plugin
Fixes #3774
2020-07-03 11:11:23 +02:00
Emery Hemingway
1a620acc17 libc: add newlocale and freelocale dummies
Fix #3777
2020-07-03 11:11:23 +02:00
Christian Prochaska
6e71208db3 libc: fix timeout calculation in 'ppoll()'
Fixes #3791
2020-06-30 09:15:53 +02:00
Christian Helmuth
8e205e0324 sel4: assignment of BOARD as effective override
Issue #3792
2020-06-30 09:11:57 +02:00
Christian Prochaska
9578fadae2 libc: handle nullptr timeout in 'ppoll()'
Fixes #3790
2020-06-29 16:59:35 +02:00
Alexander Boettcher
1ec823bf5e libc: support manual pthread configuration
Fixes #3787
2020-06-29 16:56:47 +02:00
Alexander Boettcher
2471410fe5 libc: provide number of CPUs for sysctl&sysconf
Fixes #3786
2020-06-29 16:55:56 +02:00
Alexander Boettcher
3fb5ae4fdc vm_stress: fix resource request by seoul-debian32
+ increase VM RAM to same size as used by vbox5
2020-06-29 16:54:43 +02:00
Norman Feske
4450b37ff5 depot: update recipe hashes 2020-06-29 14:25:28 +02:00
Alexander Boettcher
309597bbda timeout fw: be robust against past _timestamp()
_timestamp() returns CPU local values which may not be in sync with _ts
taken from another CPU. Be robust and don't produce wraparound/negative
timeout values.

Issue #3657
2020-06-29 14:25:27 +02:00
Norman Feske
7dbf836217 Move stubby to genode-world
Fixes #3789
2020-06-29 14:25:27 +02:00
Norman Feske
5249f3358f Move Solo5 to genode-world
Fixes #3761
2020-06-29 14:25:27 +02:00
Stefan Kalkowski
1f91fd3f7d hw: scale imx8q_evk cpu to 1.5 GHz 2020-06-29 14:25:27 +02:00
Alexander Boettcher
01676717e2 tool: remove outdated tianocore image
It is known to work up to Qemu 2.9 solely.

Instead use ovmf package provided by Linux distributions.

Issue #3784
2020-06-29 14:25:27 +02:00
Stefan Kalkowski
1cfb1af56e os: automate cpu_bench testsuite
* Differentiate in between different architectures with assembler routines
  for correct measures
* Automate first step measuring of 10G bogomips across different hardware

Fix #3785
2020-06-29 14:25:27 +02:00
Norman Feske
ef741ef80d Change pixel format to 32 bits per pixel
Until now, Genode's framebuffer session interface was based on the
RGB565 pixel format. This patch changes the pixel format to 32-bit
XRGB where the X part is ignored. It adapts all graphical applications
and device drivers accordingly.

The patch also adjusts the users of the drivers_interactive packages,
assigning 64 MiB RAM and 1500 caps to the drivers subsystem, which is
sufficient for covering high resolutions at 32 bits per pixel and to
accommodate multi-component USB HID input stacks.

Fixes #3784
2020-06-29 14:22:29 +02:00
Alexander Boettcher
6119e03081 grub2: avoid hardcoding boot disc
see alex-ab/g2fg#1
2020-06-29 14:22:28 +02:00
Josef Söntgen
6d945e6a61 os: remove rom_block server component
This component is superceeded by vfs_block.

Issue #3781.
2020-06-29 14:22:28 +02:00
Josef Söntgen
6fc7ed55cf Replace 'rom_block' with 'vfs_block'
Issue #3781.
2020-06-29 14:22:28 +02:00
Josef Söntgen
8b590e2330 os: remove ram_block server component
This component is superceeded by vfs_block.

Issue #3781.
2020-06-29 14:22:28 +02:00
Josef Söntgen
ec711b008e Replace 'ram_block' with 'vfs_block'
Issue #3781.
2020-06-29 14:22:28 +02:00
Josef Söntgen
e5b00d89fb depot_autopilot: test case for vfs_block
Issue #3781.
2020-06-22 09:50:51 +02:00
Josef Söntgen
be55f080e4 os: add test-vfs_block pkg recipe
Issue #3781.
2020-06-22 09:50:51 +02:00
Josef Söntgen
e1aab829ca os: Block session server backed by VFS library
The 'vfs_block' component will give access to a VFS file through a
Block session. For more detailed information please look at its
README.

(On a technical note, the server currently only allows for one
active session and has only one pending back end request but can
easily be extended in the future.)

Fixes #3781.
2020-06-22 09:50:51 +02:00
Josef Söntgen
e56dd15a4b vfs: extend <zero> fs to limit amount of zeros
Setting the 'size' attribute will restrict a reader to consume
0s up to the specified amount per VFS handle. The attribute is
parsed as 'Number_of_bytes', which will limit the amount to the
maximum of the addressable memory on the platform.

This addition comes in handy when needing to provide a synthetic
empty file with a fixed size.

Issue #3781.
2020-06-22 09:50:51 +02:00
Josef Söntgen
103ae9df4a block_tester: limit batching in sequential test
So far the condition whether to spawn a new job or not depended on
the amount of data already processed. This could lead to spawning
more jobs than necessary if batching is used and in return could
result in creating invalid requests in case the tested block session
is not large enough.

In addition to checking the amount of data the test now stores the
number of the last block and checks if the current request is in
range. This properly limits the total amount of requests.

Issue #3781.
2020-06-22 09:50:51 +02:00
Josef Söntgen
b5f0c07eb3 os: add block_tester src recipe
Issue #3781.
2020-06-22 09:50:51 +02:00
Norman Feske
eb3a81a874 depot: update recipe hashes 2020-06-22 09:39:41 +02:00
Martin Stein
1e96510815 server/vfs: set seek offset before executing write
The seek offset has to be updated on partial writes according to the
current write position. Otherwise writes will override the content
at the initial offset.

Fixes #3780.
2020-06-22 09:39:40 +02:00
Stefan Kalkowski
04d8c859d8 hw: enable branch predictor on rpi
* Z-bit was never enabled for rpi1
* Write buffer, and TCM bits are deprecated in this processor generation
  so do not use them

Ref #3247
2020-06-22 09:39:40 +02:00
Stefan Kalkowski
b11da67679 usb_hid: introduce cpu quota
Ref #3247
2020-06-22 09:39:40 +02:00
Norman Feske
c8322ffd2a decorator: fix cap-upgrade handling
This commit fixes the 'Out_of_caps' handling. The previous version
mistakenly upgraded the RAM instead the caps as response. The problem
could be triggered by the 'decorator_stress.run' script.
2020-06-22 09:39:40 +02:00
Norman Feske
f63713694c api/blit: package arch-specific optimizations
The blit API archive missed the CPU-architecture-specific variants of
the blit library such that all depot binaries worked with the generic
(slow) fallback implementation. This patch adds the missing pieces to
the blit API archive.
2020-06-22 09:39:40 +02:00
Norman Feske
7a97cd70aa Rename nit_fader to gui_fader
Issue #3778
2020-06-22 09:39:40 +02:00
Norman Feske
48b4891f6e Rename nit_fb to gui_fb
Issue #3778
2020-06-22 09:39:40 +02:00
Norman Feske
5d40c0c1ce Rename 'Nitpicker' namespace to 'Gui'
Issue #3778
2020-06-22 09:39:40 +02:00
Norman Feske
e8f5706382 Rename <nitpicker> in runtime files to <gui>
Issue #3778
2020-06-22 09:39:39 +02:00
Norman Feske
98f39c698f Rename "Nitpicker" service name to "Gui"
Issue #3778
2020-06-22 09:39:39 +02:00
Norman Feske
c6eda9bd80 Rename include/nitpicker_session to gui_session
This patch also renames the depot api archive accordingly.

Issue #3778
2020-06-22 09:39:39 +02:00
Alexander Boettcher
87b08d6c7f libc: support pthread placement configuration
Up to now all pthreads get placed on one CPU.

The patch adds support to evaluate a libc pthread configuration specifying
a placement strategy.

The default strategy is now to use all available CPUs as imposed by Genode's
affinity configuration for the pthread application.

The old behaviour, putting all pthreads on one single cpu can be still
configured by:

<libc>
 <pthread placement="single-cpu"/>
 ...
</libc>

Fixes #3775
2020-06-22 09:39:39 +02:00
Alexander Boettcher
5f7e670ebc release_notes: fix Sculpt ARM 64 topic branch link 2020-06-22 09:39:39 +02:00
Josef Söntgen
e8fec3eed6 terminal_log: remove session size check
The amount of RAM required by the session object is already accounted
for by the Root_component.

Fixes #3776.
2020-06-22 09:39:38 +02:00
Emery Hemingway
dc8b4eeb40 cached_fs_rom: diagnosis of delivered ROM sessions
To enable logging of ROM session deliveries, set the "diag" on
session routes:

<route>
  <service name="ROM" label_prefix="/bin/">
    <child name="cached_fs_rom" diag="yes"/>
  </service>
  …
<route>

Fix #3772
2020-06-22 09:39:38 +02:00
Christian Helmuth
4f87fbd5ae Support linux and mod_openssl in lighttpd test 2020-06-22 09:39:38 +02:00
Christian Helmuth
df3f7dc1bc Support linux in manual fetchurl test 2020-06-22 09:39:38 +02:00
Christian Helmuth
8e85d889f1 libc: generate osreldate.h 2020-06-22 09:39:38 +02:00
Norman Feske
f687b0f3b9 News item for Sculpt 20.05 2020-06-22 09:39:38 +02:00
Christian Helmuth
5b87f68900 version: 20.05 2020-05-28 11:59:30 +02:00
Norman Feske
7221199f74 Release notes for version 20.05 2020-05-28 11:50:55 +02:00
Christian Helmuth
6006051fb9 depot: update recipe hashes 2020-05-27 11:56:47 +02:00
Christian Helmuth
63048fb89f doc: replace http by https in links where possible
This also fixes some mixed content pages on genode.org and, thus,
removes the ugly browser warning, e.g., on
https://genode.org/documentation/release-notes/17.05.
2020-05-27 11:56:47 +02:00
Norman Feske
a90aa78c6e doc: update components.txt 2020-05-27 11:56:46 +02:00
Stefan Kalkowski
70acd4b2d5 os: pl050, pl11x, lan9118 use ARM platform driver
Make the framebuffer driver for pl11x chipsets,
the ps2 input driver for pl050, and the lan9116 NIC driver independent from
the pbxa9 board by using the newly introduced common ARM platform driver API.

Ref #3299
2020-05-27 11:56:46 +02:00
Stefan Kalkowski
1a80f166c5 os: introduce common platform driver for ARM
Ref #3299
2020-05-27 11:56:46 +02:00
Stefan Kalkowski
935dcf8b18 usb_drv: include specific rpi platform_session API
The rpi_usb_drv uses the rpi-specific variant of the platform_session API.
Therefore, it has to include it excplicitly.

Ref #3299
2020-05-27 11:56:46 +02:00
Stefan Kalkowski
b915b0adc4 Annotate irq session interface with RAM_QUOTA
Ref #3299
2020-05-27 11:56:46 +02:00
Stefan Kalkowski
6e6b671a66 Annotate io_mem session interface with RAM_QUOTA
Ref #3299
2020-05-27 11:56:46 +02:00
Stefan Kalkowski
e1333c9421 os: refactor i.MX53 interactive drivers (ref #3299)
* Remove input driver specific to i.MX53 tablet board from QSB driver pkg
* Move GPIO settings for QSB LVDS backlight out of framebuffer driver into
  GPIO driver config
* Move PWM driver functionality out of framebuffer driver
* Make framebuffer driver configureable, and less dependent on
  platform driver i.MX53 specifics
2020-05-27 11:56:46 +02:00
Norman Feske
ab8ef5750d doc: tweaks for updated Genode Foundations book 2020-05-27 11:56:46 +02:00
Norman Feske
7c20ba84e4 tool/parse_cxx: consider __attribute__((...))
This change is needed to parse the __attribute__((deprecated))
annotations present in 'util/xml_node.h'.
2020-05-27 11:56:46 +02:00
Stefan Thöni
78497c03ca base-linux: enabled seccomp
base-linux uses seccomp to reduce the available system calls
to the minimum set needed to run base-linux. There are still
some syscalls that allow accessing global state which should
be further reduced.

The combination of seccomp and socket descriptor caps should
provide an intermediate level of security for base-linux
thereby enabling base-linux as a migration path from using
the Linux kernel to the use of microkernel-based Genode.

Fixes #3581
2020-05-27 11:56:46 +02:00
Norman Feske
128ba65109 doc: fix autopilot command in release notes 19.08
Fixes #3764
2020-05-27 11:56:46 +02:00
Alexander Boettcher
f80b4b9fd9 vm_stress.run: update numbers
due to script changes to stabilize/minimize variants in runs

Issue #3683
2020-05-27 11:56:46 +02:00
Pirmin Duss
7f6b6d7e13 core-linux: make RAM quota configurable
Add the option to configure the RAM quota for core on base-linux.
The environment variable GENODE_RAM_QUOTA if it exists is interpreted
as number of bytes to provide to the first init.

Issue #3762
2020-05-27 11:56:46 +02:00
Pirmin Duss
51104454aa depot_deploy: copy all attributes of <report> node
This allows the configuration of all report attributes of the <report>
node for the sub init instead of only `delay_ms`.

Issue #3760
2020-05-27 11:56:46 +02:00
Christian Prochaska
2f47bbde30 qt5: use VFS pipe plugin
Fixes #3759
2020-05-27 11:56:46 +02:00
Norman Feske
b078224753 Replace Genode::strncpy by Genode::copy_cstring
- Since Genode::strncpy is not 100% compatible with the POSIX
  strncpy function, better use a distinct name.

- Remove bogus return value from the function, easing the potential
  enforcement of mandatory return-value checks later.

Fixes #3752
2020-05-27 11:56:45 +02:00
Norman Feske
0f27d139bd depot: update recipe hashes 2020-05-18 10:16:59 +02:00
Norman Feske
77a875735a fs_query.run: adjust quota for seL4 2020-05-18 10:16:15 +02:00
Christian Helmuth
32753c3f69 Use HTTPS in fetchurl test
HTTPS is standard today and HTTP the exception.
2020-05-18 10:16:15 +02:00
Christian Helmuth
7d2eb71094 openssl: update to current version 1.0.2u 2020-05-18 10:16:15 +02:00
Norman Feske
0de54cddaa gdb_monitor: hide exceptions during create_thread
This patch is a workaround for the missing implementation of
'Pd_session::transfer_quota' interface by the GDB monitor's PD service.
The missing implementation becomes problematic with the changes of #3750
that enabled the cap-quota accounting for core's CPU service.

In regular scenarios without the GDB monitor, the client of
'Cpu_session::create_thread' deals with Out_of_caps or Out_of_ram by
upgrading the CPU session's cap and RAM quotas. This, in turn, results
in a sequence of 'transfer_quota' operations at the parent.

Since GDB monitor implements a custom PD service, these 'transfer_quota'
calls try to transfer quota between sessions provided by core and those
provided by the GDB monitor. This does of course not work. To fix this
issue, the GDB monitor needs a major overhaul. This patch side-steps
the problem by handing Out_of_caps and Out_of_ram from the debuging
target.
2020-05-18 10:16:15 +02:00
Norman Feske
4002653334 qt5: fix audio driver support on Linux
The lx_hybrid audio driver must be started with the 'ld="no"' argument.
2020-05-18 10:16:15 +02:00
Emery Hemingway
adb48b5c9e Libc: MSG_PEEK support
As discovered by Johannes Kliemann, peeking at buffered socket data
using 'recv' and 'MSG_PEEK' is not supported. Read a "peek" control file
from the socket directory to attempt to peek into buffers at the
socket_fs. Support for every feature of POSIX sockets cannot be
expected, but this one is trivial to implement.

Fix #2875
2020-05-18 10:16:15 +02:00
Emery Hemingway
7f928a6573 LxIP "peek" file
Add a control file for peeking at socket buffers.

Ref #2875
2020-05-18 10:16:15 +02:00
Josef Söntgen
f1427fc02a dde_bsd: remove configration attributes
The driver always opens the audio device in duplex mode, i.e.,
playback and recording. Setting the 'playback' or 'recording' attribute
only influnces the service announcement. Due to changes made in a more
recent OpenBSD release recording must be set enabled explicitly anyway.
Since we already provide the interface that mirrors the one used by
OpenBSD 1:1 in the configuration use that and the remove the additional
config attributes.

Fixes #3757.
2020-05-18 10:16:14 +02:00
Josef Söntgen
8ce798abed dde_bsd: document audio driver configuration
So far the configuration was only document in the commit message that
introduce the change.

Issue #3757.
2020-05-18 10:16:14 +02:00
Norman Feske
dd0c1575f5 Xml_node: mark deprecated methods
Fixes #3755
2020-05-18 10:16:14 +02:00
Norman Feske
4b9c1d8f2b solo5: tolerate use of deprecated Xml_node API
This patch is an interim fix to allow building solo5 despite of the use
of deprecated parts of the Xml_node API.

Issue #3755
2020-05-18 10:16:14 +02:00
Norman Feske
be65c4acd2 Avoid use of deprecated Xml_node methods
Issue #3755
2020-05-18 10:16:14 +02:00
Norman Feske
d22b95ded3 test-fs_rom_update_ram: increase timeout for foc
The timeout triggered on foc/x86_32 in Qemu.
2020-05-18 10:16:13 +02:00
Christian Helmuth
c11d9b7b5c Remove false API dependencies from libc/posix components
Fixes #3720
2020-05-18 10:16:13 +02:00
Christian Helmuth
42fddf8390 Cleanup shared-object support mechanics
The former ldso-startup static library (now called ldso_so_support) is
used to spice each shared object/library with local support code for the
dynamic linker (execution of static constructors and ARM-EABI).
Therefore, the library must be statically linked to each dynamic
library.

As a result recipes for dynamic libraries must always depend on the "so"
API, which makes ldso_so_support.mk and so_support.c available
independent of "base". Additionally, ldso_so_support is also provided in
the libc API to cut the dependency early for libc/posix libraries.

Issue #3720
2020-05-18 10:16:13 +02:00
Christian Helmuth
589b416ca8 Remove misleading "pipe" utility and test
If a "cat" tool as simple as the removed one is needed, it should be
implemented with Goa, only depend on libc/posix (*not* base), and be
named "simple_cat". Up to today, the misleading naming of the removed
tool, tricked me into believing "test-pipe" tests POSIX pipes, which it
did not!
2020-05-18 10:16:13 +02:00
Christian Helmuth
4738d77c88 libc: fix CC_C_OPT in libm 2020-05-18 10:16:13 +02:00
Norman Feske
64bc008c3a core: fix inconsistent state after failed 'trace'
This patch fixes the handling of the corner case where the allocation of
a trace buffer throws 'Out_of_caps' or 'Out_of_ram'. Under this
circumstance, the '_buffer' would still be flagged with the 'size',
which prevented any subsequent allocation attempt. This patch fixes the
problem by initializing the 'size' after the potentially throwing
allocation.

The problem triggered with the test-trace_logger after the accounting of
core's TRACE service (replacing the 'Allocator_guard' by
'Constrained_ram_allocator') became more accurate.

Related to issue #3750
2020-05-18 10:16:13 +02:00
Christian Helmuth
236e02a2dd linux: remove initramfs from base-linux src archive 2020-05-18 10:16:13 +02:00
Norman Feske
cb5b688eb9 Remove <configfile> feature from init
Fixes #3753
2020-05-18 10:16:13 +02:00
Norman Feske
c39a342fe5 Remove use of <configfile> feature of init
Issue #3753
2020-05-18 10:16:13 +02:00
Norman Feske
07502ce6bb Remove Python2
Fixes #3751
2020-05-18 10:16:13 +02:00
Norman Feske
48b2456845 util/token.h: fix possible out-of-bounds read
The 'WHITESPACE' case of the _calc_len method wrongly accessed the
character before checking upper bound of the token. The problem is fixed
by switching the order of both conditions.

Fixes #3756
2020-05-18 10:16:12 +02:00
Christian Helmuth
894c7411e7 Remove obsolete vmm_utils test 2020-05-18 10:16:12 +02:00
Sebastian Sumpf
ea78d85d35 ahci: SYNC with empty NCQ queue only
Fixes #3746
2020-05-18 10:16:12 +02:00
Norman Feske
04aeaa25e5 Remove dead code 2020-05-18 10:16:12 +02:00
Norman Feske
9d67f9fc8e Remove Allocator_guard
This patch removes old 'Allocator_guard' utility and replaces its use
with the modern 'Constrained_ram_allocator'.

The adjustment of core in this respect has the side effect of a more
accurate capability accounting in core's CPU, TRACE, and RM services.
In particular, the dataspace capabilities needed for core-internal
allocations via the 'Sliced_heap' are accounted to the client now.
The same goes for nitpicker and nic_dump as other former users of the
allocator guard. Hence, the patch also touches code at the client and
server sides related to these services.

The only remaining user of the 'Allocator_guard' is the Intel GPU
driver. As the adaptation of this component would be too invasive
without testing, this patch leaves this component unchanged by keeping a
copy of the 'allocator_guard.h' locally at the component.

Fixes #3750
2020-05-18 10:16:12 +02:00
Christian Prochaska
1cc7277996 qt5: don't build webkit-related libraries for arm_v8a
Fixes #3747
2020-05-05 13:53:09 +02:00
Norman Feske
a9f0e47ea3 Remove return value of Log_session::write
Fixes #3749
2020-05-05 13:51:05 +02:00
Norman Feske
bbc21cf063 util/bit_array.h: remove use of memset and memcpy
This makes the code less dependent on functions considered unsafe.

Fixes #3748
2020-05-05 13:30:15 +02:00
Christian Helmuth
f722aa3325 os: src recipe for lx_fs 2020-05-04 15:59:29 +02:00
Norman Feske
eb0a33302a libc: strip trailing '/' for directory operations
Fixes #2686
2020-05-04 15:28:47 +02:00
Christian Prochaska
151828752c vfs: handle read error in fs file system
Issue #3742
2020-04-28 11:43:12 +02:00
Christian Prochaska
6a8fb48c13 vfs server: keep ack packet intact on failure
Issue #3742
2020-04-28 11:42:52 +02:00
Christian Prochaska
07b87f6f1f pthread: initialize static condition variables
Fixes #3741
2020-04-28 11:42:16 +02:00
Christian Prochaska
905b0c4aef libc: remove log2.patch
Fixes #3740
2020-04-28 11:41:38 +02:00
Christian Prochaska
6505ce47ae libc vfs plugin: report non-zero link count in 'stat()'
Fixes #3739
2020-04-28 11:40:58 +02:00
Christian Prochaska
31d7b3eb97 vfs_lwip: guard 'blocked_handles' Fifo
Fixes #3738
2020-04-28 11:37:56 +02:00
Alexander Boettcher
80d89c20fd top: use batched subject_infos of trace session
Issue #3610
2020-04-28 08:58:03 +02:00
Alexander Boettcher
1a94338389 trace: support to request subject infos batched
Optimize requesting the Subject_infos from O(n) to O(1) RPC call.

Issue #3610
2020-04-28 08:57:57 +02:00
Norman Feske
dd899fde29 depot: update recipe hashes 2020-04-24 14:37:57 +02:00
Norman Feske
1bf796d69a Remove Rust support
Fixes #3488
2020-04-24 14:37:57 +02:00
Norman Feske
c12d76686e Move OpenVPN to genode-world repository
Fixes #3737
2020-04-24 14:37:57 +02:00
Stefan Kalkowski
199821a247 os: re-enable drivers_interactive for i.MX53
* Fix IPU hardware structure layout
* Turn Signal_handler into Io_signal_handler
* Eliminate the faulty msleep in I2C initalization sequence
* Fix routes and resources for tablet board (i.MX53 SMD)

Fix #3735
2020-04-24 14:37:57 +02:00
Norman Feske
840f383e46 Remove input_merger component
Fixes #3736
2020-04-24 14:37:57 +02:00
Norman Feske
1459085a4d mk: prevent duplicates in REPOSITORIES definition
Fixes #3731
2020-04-24 14:37:56 +02:00
Norman Feske
6f6340644b Hide binary_ready_hook_for_platform from public
The hook is meant to be internal to the framework. So better keep its
declaration in the framework-internal globals.h header.

Issue #3581
2020-04-24 14:37:47 +02:00
Norman Feske
b134867f31 Remove Rpc_entrypoint::Native_context
This patch largely reverts the commit "base: lay groundwork for
base-linux caps change" because the use of 'epoll' instead of 'select'
alleviated the need to allocate large FD sets, which motivated the
introduction of the 'Native_context' hook.

Related to issue #3581
2020-04-21 16:50:37 +02:00
Norman Feske
01bf32b998 Remove ram_fs server
Fixes #3734
2020-04-21 16:27:07 +02:00
Norman Feske
f14cc2edab Replace use of ram_fs by VFS server
Issue #3734
2020-04-21 16:24:37 +02:00
Norman Feske
f0c4fc1e22 sandbox: defer requests for upcoming server
The sandbox library supports the forwarding of session requests from the
outside to one of the hosted children according to a policy. This patch
introduces the distinction between two cases, which previously triggered
the denial of the session request.

- There exists no matching policy for the requested session
- There exists a matching policy but the referred server child
  does not exist (yet)

Whereas the proper response to the first case is the denial of the
request, the second case can occur in situation where a dynamic init is
used to implement a staged startup, for example via the deploy
mechanism. In such cases, a policy may exist as a static rule while the
server has not been started yet. This patch changes the behavior such
that such requests are stalled.

The patch is accompanied with test cases for exercising both situations.

Fixes #3733
2020-04-21 14:52:29 +02:00
Alexander Boettcher
f891f4c963 vm_stress: change output message for ci scripts
so that it detect it correctly as not available instead of a failure on
normal work days

Issue #3683
2020-04-20 12:36:00 +02:00
Stefan Kalkowski
9f28f4f803 hw: avoid BASE_DIR relative path definitions
Fix #3728
2020-04-17 12:55:13 +02:00
Stefan Kalkowski
0e49336b96 Retire Exynos 5 support (fix #3725) 2020-04-17 12:53:57 +02:00
Stefan Kalkowski
941e918b46 vmm: unify armv7/v8 virtualization
Fix #3638
2020-04-17 12:52:02 +02:00
Stefan Kalkowski
74e75d7fbc hw: enable virtualization support for virt_qemu
Ref #3638
2020-04-17 12:51:53 +02:00
Stefan Kalkowski
58db6542f8 hw: check for security extension support in GICv2
Ref #3638
2020-04-17 12:51:44 +02:00
Tomasz Gajewski
fca2a05adf trace: extend test for log_output
Issue #3714
2020-04-17 12:48:17 +02:00
Tomasz Gajewski
4639978b3a trace_logger: avoid output of empty lines
It avoids output of empty lines in output buffer if traced messages end
with \n (what is common with messages logged from dde_linux).

Issue #3714
2020-04-17 12:48:13 +02:00
Tomasz Gajewski
870d348d77 trace: redirect logs to trace based on policy
If trace is enabled for component than an attempt to put message into
trace buffer is performed using log_output policy. If it succeeds than
message is not put to logs using log service.

Fixes #3714
2020-04-17 12:47:48 +02:00
Tomasz Gajewski
db8ec81e9f trace: log_output policy that redirects logs to trace
Issue #3714
2020-04-17 12:47:35 +02:00
Tomasz Gajewski
1d9a2dce94 trace: extend policy with log_output
Issue #3714
2020-04-17 12:47:19 +02:00
Roman Iten
12ea494477 vfs/File_content: fix end condition in for_each_line
Fixes #3729
2020-04-17 12:45:10 +02:00
Christian Helmuth
b60b591d06 depot: update recipe hashes 2020-04-17 12:40:13 +02:00
Christian Helmuth
9fbc68bda1 libports: icu library moved to GitHub 2020-04-17 12:40:13 +02:00
Norman Feske
132569d12b base-linux: socket descriptor caps for RPC
On Linux, Genode used to represent each RPC object by a socket
descriptor of the receiving thread (entrypoint) and a globally-unique
value that identifies the object. Because the latter was transferred as
plain message payload, clients had to be trusted to not forge the
values. For this reason, Linux could not be considered as a productive
Genode base platform but remained merely a development vehicle.

This patch changes the RPC mechanism such that each RPC object is
represented by a dedicated socket pair. Entrypoints wait on a set of
the local ends of the socket pairs of all RPC objects managed by the
respective entrypoint. The epoll kernel interface is used as the
underlying mechanism to wait for a set of socket descriptors at the
server side.

When delegating a capability, the remote end of the socket pair is
transferred to the recipient along with a plaintext copy of the
socket-descriptor value of the local end. The latter value serves as a
hint for re-identifiying a capability whenever it is delegated back to
its origin. Note that the client is not trusted to preserve this
information. The integrity of the hint value is protected by comparing
the inode values of incoming and already present capablities at the
originating site (whenever the capability is invoked or presented to the
owner of the RPC object).

The new mechanism effectively equips base-linux with Genode's capablity
model as described in the Chapter 3 of the Genode Foundations book.
That said, the sandboxing of components cannot be assumed at this point
because each component has still direct access to the Linux system-call
interface.

This patch is based on the extensive exploration work conducted by
Stefan Thoeni who strongly motivated the inclusion of this feature into
Genode.

Issue #3581
2020-04-17 12:40:13 +02:00
Alexander Boettcher
319d2be1af seoul: add vm_stress script version
Issue #3683
2020-04-17 12:40:13 +02:00
Alexander Boettcher
29911cf114 seoul: update contrib branch
- reactivate vga update, range was to small
- remove diagnostic messages
- add support to ignore machine check MSR MCG CAP

Issue #3683
2020-04-17 12:40:13 +02:00
Alexander Boettcher
8be72b0be1 vbox5: add testing VMs causing load
Issue #3683
2020-04-17 12:40:13 +02:00
Emery Hemingway
6359445a8e Add <exit propagate="…"/> to Init config schema
Fix #3724
2020-04-17 12:40:13 +02:00
Christian Helmuth
c783764d0b Region-map attach/detach stress depot_autopilot test
Issue #3715
2020-04-17 12:40:13 +02:00
Stefan Kalkowski
ff378a8c5b hw: cache maintainance on mapping removal too
Older ARM processors like ARMv6, or Cortex A8 need to write back changes
of the page-tables to physical ram because the MMU does not use the cache.
This naturally needs to be done not only when adding a mapping,
but on removal too.

Fix #3715
2020-04-17 12:40:13 +02:00
Norman Feske
03c3040a1d Remove stale documentation
The topics are either covered by the Genode Founations book for by our
tools, in particular the integration of the prepare_port mechanism with
the run tool.
2020-04-17 12:40:13 +02:00
Christian Helmuth
cc4e21e7a7 Fix some details in run scripts
- don't use 'qemu -serial mon:stdio' anymore as it no longer works as
  expected
- use "bash -l" with [terminal] to read user's profile configuration,
  e.g., PATH settings
- added missing boot modules and cap quotas
2020-04-17 12:40:13 +02:00
Christian Helmuth
bb34aafa45 run: use x-terminal-emulator in [terminal]
The environment variables TERM and COLORTERM do not contain an
executable names.
2020-04-17 12:40:13 +02:00
Norman Feske
6dfd268ef1 base/registry.h: remove misleading comment 2020-04-17 12:40:13 +02:00
Christian Helmuth
838c5ba7de ieee754: enable output check for ARM64
Issue #3723
2020-04-17 12:40:13 +02:00
Christian Helmuth
4ab990ad5b libc: provide C++ runtime symbols in ABI
This commit puts all C++ runtime/support symbols of ld.lib.so in a
dedicated section of base/lib/symbols/ld and mirrors the section to
libports/lib/symbols/libc. So, the libc ABI resolves potential C++
runtime dependencies of base-ABI-agnostic components at link time. The
runtime resolution is done by the linker by symbol lookup in ld.lib.so.

Issue #3720
2020-04-17 12:40:13 +02:00
Alexander Boettcher
13cd25e7b0 vfs/ram: avoid 2x mutex releases in guard
Issue #3612
2020-04-17 12:40:12 +02:00
Alexander Boettcher
2b41323fe6 test-* recipes: fix xmllint errors
config_0.xml.tmp:26: element config: Schemas validity error :
  Element 'config': Character content other than whitespace is
  not allowed because the content type is 'element-only'

Issue #3612
2020-04-17 12:40:12 +02:00
Norman Feske
7bf47b1982 base-linux: boost max open fds to the hard rlimit
This patch increases the default limit of the maximum number of open
file descriptors to the hard limit of the system. This is needed for
complex scenarios, which require more FDs than the default of 1024
at core.

Related to issue #3581

Fixes #3721
2020-04-17 12:40:12 +02:00
Alexander Boettcher
22d71d5a8b os: use Mutex/Blockade
Issue #3612
2020-04-17 12:40:12 +02:00
Alexander Boettcher
3956530634 base: use Mutex/Blockade
Issue #3612
2020-04-17 12:40:12 +02:00
Alexander Boettcher
e87d60ddf7 core: use Mutex/Blockade
Issue #3612
2020-04-17 12:40:12 +02:00
Norman Feske
85a1f91f59 Sanitize Framebuffer::Mode member access
Fixes #3719
2020-04-17 12:40:12 +02:00
Alexander Boettcher
dc90740549 nic_router: accept DHCP reply with missing option
The options are not always set, which throws exception. This leads to not
accepting the selected IP address.

Fixes #3716
2020-04-17 12:40:12 +02:00
Tomasz Gajewski
d111af922a trace documentation: fix reference to events definitions 2020-04-17 12:40:12 +02:00
Norman Feske
40c21b6d0f window layouter: restore screen tiling
This commit fixes a regression introduced by "window_layouter: add
dynamic screen handling", rendering the sub-division of screens in
columns and row unusable. The said commit removed a condition needed
for the correct window placement. This patch restores the condition.

Issues #3646
2020-04-17 12:40:12 +02:00
Norman Feske
4dd110ce5e Remove noux runtime
The feature set of noux is fully covered by the regular C runtime now.

Fixes #3696
2020-04-17 12:39:33 +02:00
Norman Feske
d6bdeed38f report_dump: replace noux by plain bash
This patch also introduces the use of the RTC for creating directory
names and increases the rate of snapshot creation from 10 seconds to
one minute to make sure that directories are named differently when
reading the RTC clock at granularity of minutes.

Issue #3696
2020-04-17 12:39:33 +02:00
Stefan Thöni
e8fb7ad470 report_rom: add package recipe 2020-04-17 12:39:33 +02:00
Stefan Thöni
5b68286e07 fs_report: add package recipe 2020-04-17 12:39:33 +02:00
Stefan Thöni
bb12d79ae9 vfs: add package recipe 2020-04-17 12:39:33 +02:00
Alexander Boettcher
d657b61f1b x86: support msi-x by platform driver
Fixes #3699
2020-04-17 12:39:33 +02:00
Norman Feske
42a77c531a sculpt: remove noux runtime from inspect view
Issue #3696
2020-04-17 12:39:32 +02:00
Norman Feske
5347278136 sculpt: perform prepare step without noux
Issue #3696
2020-04-17 12:39:32 +02:00
Norman Feske
ca5c25ac04 sculpt: replace log-noux instance by stdin2out
Issue #3696
2020-04-17 12:39:32 +02:00
Norman Feske
bb35b997b8 New stdin2out utility as replacement for tail -f
This little utility allows us to remove the noux instance for the log
view of Sculpt OS.

Issue #3696
2020-04-17 12:39:32 +02:00
Norman Feske
9c95e4bb4f sculpt: replace noux-based e2fsprogs by fs_utils
With this patch, Sculpt executes the e2fs file-system utilities
directly instead of hosting them within the noux runtime.

Issue #3696
2020-04-17 12:39:32 +02:00
Norman Feske
e63195a940 e2fsprogs: disable HAVE_GETMNTINFO
This patch avoids calls of '__sys_getstatfs' (indirectly via
'getmntinfo'), which does not return any meaningful values in Genode's
libc. Otherwise, the libc's dummy implementation prompts resize2fs to
back out.

Issue #3696
2020-04-17 12:39:32 +02:00
Norman Feske
0836293d1a libports: src/fs_utils depot archive
The depot archive contains the utilities of e2fsprogs that are needed
for Sculpt OS as standalone components.
2020-04-17 12:39:32 +02:00
Norman Feske
330672e030 libports: mke2fs and resize2fs as standalone apps
This patch makes the e2fsprogs 'mke2fs' and 'resize2fs' available as
standalone components that can be used by Sculpt OS directly without
a Unix emulation environment.
2020-04-17 12:39:32 +02:00
Josef Söntgen
150d143755 os: use Request_stream API in NVMe driver
As a result of the API change the memory handling could be simplified.
Since the Block session dataspace is now directly used for DMA, we
actually only have to provide the memory for setting up PRP lists for
large requests (for the moment more than 8 KiB of data).

As we limit the maximum data transfer length to 2 MiB, we get by with
just a page per request. Those memory is allocated beforehand for the
maximum number of I/O requests, which got bumbed to 512 entries. Since
not all NVMe controllers support such large a maximum data transfer
length and this many entries, especially older ones, the values are
capped according to the properties of the controller during
initialization. (The memory demands of the component are around 3 MiB
due to setting up for the common case, even if a particular controller
is only able to make use of less.)

(Although there are controllers whose maximum memory page size is more
than 4K, the driver is hardcoded to solely use 4K pages.)

In addition to those changes, the driver now supports the 'SYNC' and
'TRIM' operations of the Block session by using the NVMe 'FLUSH' and
'WRITE_ZEROS' commands.

Fixes #3702.
2020-04-17 12:39:32 +02:00
Christian Helmuth
e63c5e6c69 base: rework interplay of signal-proxy and entrypoint
The former scheme left open a race window between
_process_incoming_signals() and wait_and_dispatch_one_io_signal()
resulting in both threads calling block_for_signal() and blocking
forever with one unprocessed signal.

Fixes #3704
2020-04-17 12:39:32 +02:00
Christian Helmuth
69080014b0 depot_autopilot: test case for entrypoint
Test for entrypoint destruction and signalling.

Issue #3704
2020-04-17 12:39:32 +02:00
Stefan Kalkowski
f051065582 Retire OMAP4 support
Fix #2850
2020-04-17 12:39:32 +02:00
Piotr Tworek
585c4b8c69 hw: Add support for Qemu virt arm platforms.
This patch adds support for booting base-hw kernel on qemu-arm virt
machines. The arm_virt machine has 2GB of RAM, 2 Cortex A15 cores and
uses GICv2 interrupt controller. The arm_64_virt machine also has 2GB of
RAM, but has 4 Cortex A53 cores and uses GICv3. Both machines use PSCI
to boot additional CPU cores.

Fixes #3673
2020-04-17 12:39:32 +02:00
Piotr Tworek
dad1de1865 hw: Add interface for making basic ARM PSCI calls.
So far this only exposes two functions allowing the code to turn on
additional CPUs. There is much more functionality defined by PSCI spec
but so far its not needed by Genode.

Fixes #3672
2020-04-17 12:39:32 +02:00
Pirmin Duss
6f1357c6f8 libc: add symbol used by protobuf
Issue #3692
2020-04-17 12:39:32 +02:00
Josef Söntgen
336228f357 os: handle SYNC packet in lx_fs
Call 'fsync(2)' on files and directories.

Fixes #3711.
2020-04-17 12:39:32 +02:00
Josef Söntgen
df553e9360 os: remove catch-all from FS VFS update mtime
Only 'alloc_packet' is supposed to throw an exception, which is already
caught. The 'submit_packet' call does not need further handling.

Issue #3713.
2020-04-17 12:39:32 +02:00
Josef Söntgen
ddc0caa605 os: remove error messages from FS VFS update mtime
The update modification timestamp is implemented as one-shot where
the caller is expected to try again if the first attempt failed (see
current libc implementation). So the message is misleading as further
attempts might succeed.

Issue #3713.
2020-04-17 12:39:32 +02:00
Christian Helmuth
0df358a550 nova: early message on successful boot
This patch fixes a regression with run/log_core introduced by

  2064ffd64b nova: support multidimensional affinity space

The run tool uses a log message 'run_boot_string' to detect successful
boot as well as to detect unexpected reboots. This message should never
be logged twice and, thus, should not be part of the core_log. The patch
mentioned above moved the former run_boot_string after the core_log
initialization.
2020-04-17 12:39:31 +02:00
Pirmin Duss
9da428dccf vfs_import: implement write loop for copy_file
This is required to allow import of large file.

Fixes #3655
2020-04-17 12:37:26 +02:00
Norman Feske
46fa8197a2 depot: update recipe hashes 2020-03-26 11:39:02 +01:00
Christian Helmuth
52d798ff40 init: support heartbeat in config.xsd 2020-03-26 11:39:02 +01:00
Stefan Kalkowski
256b2fa3e1 hw: cortex a9 diagnostic register fixup
This is a follow-up fix for commit 202333c881.
It checks for the diagnostic registers being already setup correctly.
Otherwise on platforms with secure firmware, like Pandaboard it will stuck.

Ref #3639
2020-03-26 11:39:02 +01:00
Norman Feske
d8bcaa4fa4 base-linux: disable ASLR for child processes
ASLR collides with the libc's fork mechanism on 32-bit. In particular,
the tool_chain_auto.run scenario would sporadically fail while mirroring
the parent's address space.

Fixes #3710
2020-03-26 11:39:02 +01:00
Emery Hemingway
7a5841b637 ahci: driver improve diagnostic messages for empty ports
Fix #3709
2020-03-26 11:39:02 +01:00
Tomasz Gajewski
358fdd54b9 run: multiple power-on-command-param values
Fixes #3708
2020-03-26 11:39:02 +01:00
Emery Hemingway
45a74023a7 part_block: support for up to 128 sessions
Allow sessions for each of the 128 sessions supported by GPT.

Fix #3705
2020-03-26 11:38:59 +01:00
Alexander Boettcher
6f3f46c7ba top: support affinity space height up to 4
Issue #3635
2020-03-26 11:38:59 +01:00
Alexander Boettcher
2064ffd64b nova: support multidimensional affinity space
Fixes #3635
2020-03-26 11:38:59 +01:00
Norman Feske
685bd763f9 ldso: place dynamic allocations within linker area
This is needed to execute the tool-chain scenario on base-nova.
Otherwise, the fork mechanism stumbles upon a region conflict
between ldso allocations and the application heap.

Fixes #3706
2020-03-26 11:38:59 +01:00
Norman Feske
0f3ac4cb9f base-hw: let upgrade_cap_slab reflect Out_of_caps
This patch reflects the Out_of_caps exception from core to the client,
in addition to the already covered Out_of_ram exception. It thereby
eliminates a potential abort in core, which I observed with the
tool_chain_auto.run script:

  Kernel: RPC upgrade_cap_slab
  Error: Uncaught exception of type 'Genode::Quota_guard<Genode::Cap_quota>::Limit_exceeded'
  Warning: abort called - thread: entrypoint

In addition to propagating the exception, the patch add the client-side
exception-handling code to the base library.

Fixes #3703
2020-03-26 11:38:59 +01:00
Norman Feske
208294b0d3 Turn pkg/noux-system into pkg/system_shell
The new package does no longer require noux.

Issue #3696
2020-03-26 11:38:59 +01:00
Norman Feske
cf052996d3 Remove pkg/noux-build-x86
Use-case-specific Unix runtimes should better be realized via Goa now.

Issue #3696
2020-03-26 11:38:58 +01:00
Norman Feske
4961c84f12 Remove noux from vbox_share.inc
This snippet is used by the vbox5_win7_64_share.run script.

Issue #3696
2020-03-26 11:38:58 +01:00
Norman Feske
2f598e5680 Remove noux_uname.run script
This run script is outdated and not regularly tested. In fact, the
tested mechanism (obtaining values from a '.sysctl/' directory) is
nowhere to be found, neither in noux nor the libc. The test still
returns success as it merely checks for the completion of the sequence,
not the printed results. Hence, it is not worth preserving.

Issue #3696
2020-03-26 11:38:58 +01:00
Norman Feske
951f484fad Remove noux_gdb.run script
This interactive run script is not regularly tested nor used.

Issue #3696
2020-03-26 11:38:58 +01:00
Norman Feske
c086bba71a Remove noux_fs.run
The test exercised the mounting of an ext2 file system in the noux
runtime. This feature is nowadays routinely stressed by Sculpt OS.

Issue #3696
2020-03-26 11:38:57 +01:00
Norman Feske
5a02b5fd23 Remove noux_fork.run script
This run script is superseded by pkg/test-fork.

Issue #3696
2020-03-26 11:38:57 +01:00
Norman Feske
50a1e540a0 Remove noux_bash.run script
This run script is superseded by the bash.run script.

Issue #3696
2020-03-26 11:38:57 +01:00
Norman Feske
b8738dee90 Remove noux_terminal_fs.run script
This run script tested the terminal VFS plugin as a new feature of noux.
In the meantime, the plugin remains as the only way for the interaction
of command-line-based applications with the terminal session. Hence,
the mechanism is now stressed by many other scenarios.

Issue #3696
2020-03-26 11:38:57 +01:00
Norman Feske
a7e7eeec38 Remove noux from Vim example scenario
Issue #3696
2020-03-26 11:38:57 +01:00
Norman Feske
1d480e3329 Remove noux from tool-chain test
Issue #3696
2020-03-26 11:38:57 +01:00
Norman Feske
3b427824a7 ports/make: avoid aliasing with libc symbols
This patch prefixes a few symbols in the make binary that are offered by
both the libc and the make binary. The clash of symbol names produces
confusing runtime linkage otherwise. This becomes a problem during
fork/evecve.
2020-03-26 11:38:57 +01:00
Norman Feske
3a1f5bc13a tool/check_abi: prevent use of temporary files
Issue #3696
2020-03-26 11:38:57 +01:00
Norman Feske
923c38f7cd libc: allocate errno of main thread statically
The thread-local errno instance for the main thread must not be
allocated on the application heap because it must survive 'execve'.

Fixes #3701
2020-03-26 11:38:57 +01:00
Norman Feske
ee6d38a770 libc: prune session labels of forked processes
This patch reduces the size of session labels for all services other
than LOG, keeping only the last element. This avoids exceeding the
maximum label length in the presence of deep fork hierarchies, e.g., for
running the tool chain.

Fixes #3700
2020-03-26 11:38:57 +01:00
Christian Helmuth
dd524b56fa libc: propagate socket config to child processes
Fixes #3698
2020-03-26 11:38:57 +01:00
Norman Feske
4fe4c9aa63 vfs/pipe: trigger I/O-progress handler on EOF
When the last writer closes the pipe, we must trigger the I/O progress
handler to deliver the final EOF to the client (READ_OK with out count
of 0).

Fixes #3697
2020-03-26 11:38:56 +01:00
Norman Feske
e3bc77c386 Remove noux from SSH exec terminal
This patch replaces the former Noux instance by a sub init that hosts
the combination of VFS + fs_rom + bash. If bash exits, the whole sub
init exits, which implicitly tears down the terminal session used by the
sub init. The latter is expected by the test sequence.

Issue #3696
2020-03-26 11:38:56 +01:00
Norman Feske
cacbad1bd8 Remove noux from ssh_terminal.run
Issue #3696
2020-03-26 11:38:56 +01:00
Norman Feske
cc8552f81e Remove noux_vfs_audit.run
This run script was merely a development vehicle.

Issue #3696
2020-03-26 11:38:56 +01:00
Norman Feske
34a60b56f6 Remove noux from fs_query.run
Issue #3696
2020-03-26 11:38:56 +01:00
Norman Feske
25f7fdcb40 Remove noux from vfs_import.run
Issue #3696
2020-03-26 11:38:56 +01:00
Norman Feske
b6d3063ada Remove noux and cpu_sampler_noux from autopilot
Issue #3696
2020-03-26 11:38:56 +01:00
Norman Feske
c2cf0ae8c6 os/vfs.h: fix possible nullptr dereference
Fixes #3694
2020-03-26 11:38:56 +01:00
Norman Feske
7f5186d489 vfs/tar: return inode numbers of null records
The tar vfs plugin returns an inode value of zero and a type directory
for null records, which wrongly triggers the file-system loop detection
of the find utility. This patch returns the node pointer as inode value
instead, which is a unique value.

Fixes #3695
2020-03-26 11:38:56 +01:00
Norman Feske
e67f389da1 Add fork test to depot autopilot 2020-03-26 11:38:56 +01:00
Norman Feske
4ebc164c11 Add execve test to depot autopilot 2020-03-26 11:38:56 +01:00
Martin Stein
886d0da57c ping_nic_router.run: test dhcp renew
Ref #3681
2020-03-26 11:38:56 +01:00
Norman Feske
2912096f6e vfs: distinguish NO_PERM from NO_ENTRY in unlink
This patch changes the 'Single_file_system' to return NO_PERM only if
the to-be-unlinked file corresponds to the single file. This way, a
<rom> co-mounted with a <ram> file-system does not stand in the way of
unlinking files from the <ram>. The concrete symptom occurred the
following scenario:

  <vfs>
    <dir name="home">
      <ram/>
      <rom name="..."/>
    </dir>
  </vfs>

The following sequence of commands wrongly resulted in "Operation not
permitted":

 $ mkdir -p /home/a/b/c
 $ rm -f /home/a/b/c/d

In this case, rm should not fail (unlink should return ENOENT)

Fixes #3690
2020-03-26 11:38:55 +01:00
Martin Stein
ba55409c86 nic_router: keep dyn IP when updating domain obj
When updating the domain object of interfaces that stay with the same domain
during a reconfiguration, until now, the normal "detach raw" function was used.
This caused the old domain object to discard a dynamic IP config as all
interfaces detached. This caused interfaces also to discard network links
established with the old configuration although it wasn't necessary. Thus, now
we use a dedicated "detach" in case that an interface actually stays with its
domain. This new "detach" doesn't decrease the interface counter of the domain,
so, it'll not discard its dynamic IP config. If, however, during a
reconfiguration, there's no interface calling this function (all interfaces
move to another or no domain), the dynamic IP config is still discarded as
expected.

Fixes #3686
2020-03-26 11:38:55 +01:00
Martin Stein
f3185de7f5 nic_stress: further reduce nr of rounds on sel4
Otherwise, the limit of caps in Capability_space_sel4 in the NIC router is
reached.

Fixes #3684
2020-03-26 11:38:55 +01:00
Martin Stein
c1b6000248 nic_router: don't call DHCP client on requests
Until now, the DHCP client was called also for DHCP requests when an interface
had a domain but yet no IP config. Now, an interface distinguishes between DHCP
requests and replies first and then accordingly calls the DHCP server or the
DHCP client if they're available. This also prevents that the DHCP client has
to handle packet headers other than that of DHCP.

Fixes #3681
2020-03-26 11:38:55 +01:00
Martin Stein
0a468a07a7 nic_router: fix lifetime of DHCP clients
Let the DHCP client be a constructible member of Interface that is constructed
only as long as the interface is attached to a domain with a dynamic IP config.
This prevents DHCP client timeouts from a period with dynamic IP config to
trigger after a reconfiguration to a static IP config. Furthermore, handle
DHCP-reply packets at an interface only when the DHCP client its constructed.
Otherwise drop such packets.

Ref #3681
2020-03-26 11:38:55 +01:00
Stefan Kalkowski
6d48b5484d hw: correct the ARM cache maintainance operations
This commit fixes the following issues regarding cache maintainance
under ARM:

* read out I-, and D-cache line size at runtime and use the correct one
* remove 'update_data_region' call from unprivileged syscalls
* rename 'update_instr_region' syscall to 'cache_coherent_region' to
  reflect what it doing, namely make I-, and D-cache coherent
* restrict 'cache_coherent_region' syscall to one page at a time
* lookup the region given in a 'cache_coherent_region' syscall in the
  page-table of the PD to prevent machine exceptions in the kernel
* only clean D-cache lines, do not invalidate them when pages where
  added on Cortex-A8 and ARMv6 (MMU sees phys. memory here)
* remove unused code relicts of cache maintainance

In addition it introduces per architecture memory clearance functions
used by core, when preparing new dataspaces. Thereby, it optimizes:

* on ARMv7 using per-word assignments
* on ARMv8 using cacheline zeroing
* on x86_64 using 'rept stosq' assembler instruction

Fix #3685
2020-03-26 11:38:55 +01:00
Stefan Kalkowski
3a862334fc depot_autopilot: re-enable test-fs_packet on rpi
Fixes #3249
2020-03-26 11:38:55 +01:00
Alexander Boettcher
cd1c0aace3 nova: remove specific stack area location
and use instead the generic one of base

Fixes #3654
2020-03-26 11:38:55 +01:00
Sebastian Sumpf
6e54cad44c usb_block: switch to Request_stream API
- remove old 'Driver' interface
- implement Request stream front end
- fix some namespacing

issue #3661
2020-03-26 11:38:55 +01:00
Josef Söntgen
a71ef16423 vfs: implement 'sync' in Block VFS plugin
Fixes #3659.
2020-03-26 11:38:55 +01:00
Sebastian Sumpf
2495a86aff block_tester: add 'sync' command to replay
issue #3636
2020-03-26 11:38:55 +01:00
Sebastian Sumpf
5225d12381 ahci: add sync operation support
- implemement 'flush cache ext' for ATA
- enable sync operation for request stream

issue #3636
2020-03-26 11:38:54 +01:00
Alexander Boettcher
e096202b1f hw/x86: use PAT for write combining support
Fixes #3623
2020-03-26 11:38:54 +01:00
Alexander Boettcher
44ace04b95 hw/x86: add cpuid register macro
Issue #3623
2020-03-26 11:38:54 +01:00
Alexander Boettcher
507a34b3d0 hw/x86: implement wrmsr in macro
Issue #3623
2020-03-26 11:38:54 +01:00
Christian Helmuth
677d9abd07 rtc: system_rtc pkg for PC and Linux
This depot package is the runtime for rtc_drv and system_rtc server with
coordinated update of system and hardware RTC via reports. It replaces
drivers_rtc which was never freestanding drivers package and, therefore,
has to be accompanied with a running platform_drv etc.

Fixes #3680
2020-03-26 11:38:54 +01:00
Christian Helmuth
e66726e931 rtc: use depot archives in test
Issue #3680
2020-03-26 11:38:54 +01:00
Christian Helmuth
cda778a94d rtc: recipe for linux_rtc_drv
Issue #3680
2020-03-26 11:38:54 +01:00
Sebastian Sumpf
a799a5f978 os: adjust tests to changed output of block client
issue #3671
2020-03-26 11:38:54 +01:00
Sebastian Sumpf
f5a6d85bc2 os: expand block_tester.run
- use two disks with two partitions each
- one disk uses MBR and one GPT
- connect one 'part_block' to each disk
- run 'block_tester' and 'test-block-client' connecting to one partiion
  on each disk
- x86 uses 'ahci_drv' as disk back-end, Linux 'lx_block'
- on autopilot enable for Qemu only

issue #3671
2020-03-26 11:38:54 +01:00
Christian Prochaska
8535688605 qt5: handle Genode signals as Qt signals in QPA plugin
Fixes #3688
2020-03-26 11:38:54 +01:00
Johannes Schlatow
8788f13e11 Qt5 tool chain: always build without zstd
Fixes #3687
2020-03-26 11:38:54 +01:00
Johannes Schlatow
aee5b59c51 Backport changeset 82268 from virtualbox
Fixes #3689
2020-03-26 11:38:54 +01:00
Christian Helmuth
66a7e749e8 Update URLs in LICENSE
The official AGPLv3 text from https://www.gnu.org/licenses/agpl-3.0.txt
now uses https:// consistently.
2020-03-26 11:38:54 +01:00
Norman Feske
e2b9308b11 lx_hybrid_errno.run: add missing parent services 2020-03-26 11:38:54 +01:00
Alexander Boettcher
97bbad5aea nova: avoid dying thread in platform.run
Avoids timely interference by dying thread.

Fixes #3670
2020-03-26 11:38:54 +01:00
Christian Helmuth
d452094f43 Only rewind next-free pointer in Bit_allocator
Formerly, _next was always updated to the last free'd allocation, which
left large gaps on alloc/free bursts. Now, we try keep allocation
density high from the start of the array and ensure that allocations
happen at the lowest available index in the bit array.

Fixes #3679
2020-03-26 11:38:53 +01:00
Piotr Tworek
139f390317 libc: Expose timespec_get symbol.
The function is exposed in libc headers provided by Genode, the code for
the function is being compiled and actually works, but the symbol is
missing from the symbols file resulting in linking failures. Add it to
the libc symbols file.

Fixes #3676
Fixes #3677
2020-03-26 11:38:53 +01:00
Emery Hemingway
9ee1045aad Remove SVN build dependency from libc port
Fixes #3678
2020-03-26 11:38:53 +01:00
Norman Feske
25c85fab18 sculpt: version 20.03
This patch increases the Sculpt version to avoid the risk of binary
compatibility clashes with index files published for the just-released
Sculpt 20.02 version.
2020-03-26 11:38:53 +01:00
Norman Feske
095a0a6439 News item for Sculpt 20.02 2020-03-10 11:06:10 +01:00
Christian Helmuth
bf36d9eb48 depot: update recipe hashes 2020-03-09 16:02:56 +01:00
Norman Feske
9d24e906a8 text_area: fix interplay of shift with selection
Without this patch, the text area would mistakenly delete the characters
types after placing the cursor with the mouse as soon as shift is used
as modifier.
2020-03-09 15:41:29 +01:00
Norman Feske
44e4d1bd6c Update Sculpt documentation for version 20.02 2020-03-09 15:41:29 +01:00
Norman Feske
ab5770c492 sculpt: improve USB hotplug handling
- Don't reset sculpt partition on USB changes whenever ram fs is
  selected for use.

- Reconfigure runtime immediately when plugging USB devices.
  This prevents the usb-block driver and part_block from
  dangling in the graph. They disappear immediately now.
2020-03-09 15:36:21 +01:00
Norman Feske
a90eab8b9a menu_view: reduce frame transparency
This makes the dialog content better readable.
2020-03-09 15:36:21 +01:00
Norman Feske
e54e4dd532 sculpt: anchor popup position at '+' button
This patch restores the anchoring of the popup menu to the original
behavior, placing the popup to the right of the '+' button. The
anchoring got lost due to the recent structural changes of the GUI,
which affect the hover XML structure.
2020-03-09 15:36:21 +01:00
Sebastian Sumpf
c856ba2a49 ahci: report ports correctly
Only use one report for devices report, not one per device

fixes #3671
2020-03-09 15:36:21 +01:00
Christian Prochaska
1087e3f59e doc: minor tweaks of release notes 20.02
Thanks to Jeroen van Gelderen for the feedback.
2020-03-09 15:36:04 +01:00
Christian Helmuth
cfb49c7316 version: 20.02 2020-02-28 12:19:49 +01:00
Norman Feske
a3fad2e171 News item for version 20.02 2020-02-28 12:19:49 +01:00
Norman Feske
dd5db8484a Release notes for version 20.02 2020-02-28 12:19:49 +01:00
Christian Helmuth
5affd51250 depot: update recipe hashes 2020-02-28 08:59:43 +01:00
Alexander Boettcher
ce27b5ebce tool: support hyphen in depot-user name (depot.inc)
Fixes #3668
2020-02-28 08:58:28 +01:00
Norman Feske
fce9cd8c22 sculpt manager: use runtime state report max of 1M
With complex scenarios, supplementing the <report> node with the
attribute 'requested' or 'provides' can easily result in a report of
more than 64K.
2020-02-27 14:47:00 +01:00
Christian Prochaska
8faa916d93 gdb_monitor.run: increase RAM quota
Fixes #3667
2020-02-27 14:47:00 +01:00
Christian Helmuth
e52802162c libc: reimplement synchronization primitives
The new implementation relieves the main entrypoint from monitor jobs
for contended lock primitives and is based on custom applicant data
structures, per-lock resp. per-semaphore applicant lists, and a
libc-internal blockade with timeouts based on libc kernel primitives.
2020-02-27 14:47:00 +01:00
Josef Söntgen
f3ec246b67 base: remove diagnostic message in destructor
The LOG message in the Signal_handler_thread's destructor is just an
diagnostic leftover.

Fixes #3666.
2020-02-27 14:46:59 +01:00
Christian Prochaska
434c9ceb5d vbox5-nova: document possible 'Blocking_canceled' exception
Fixes #3664
2020-02-27 14:46:59 +01:00
Norman Feske
c3fb81d1a1 window_layouter: improve rules formatting
This is a follow-up patch for "window_layouter: add dynamic screen
handling".

Issue #3646
2020-02-27 14:46:59 +01:00
Norman Feske
c340f57207 Xml_node: skip leading whitespace in with_raw_node
This patch makes the 'with_raw_node' method more useful in situations
where content of an Xml_node is fed into an Xml_generator, i.e., the
rules report/rom mechanism of the window layouter.
2020-02-27 14:46:59 +01:00
Norman Feske
bbe1bf9c3a fs_query.run: increase timeout
This is apparently needed for base-foc on Qemu/x86.
2020-02-27 14:46:59 +01:00
Alexander Boettcher
accda1211b mutex: reinit Applicant state in Mutex::acquire()
The applicant_to_wake_up() member must be initialized to 0 to keep the
same semantic as before the change by

"base: add mutex as derivate of lock"

Issue #3662
2020-02-27 14:46:59 +01:00
Norman Feske
daee1f4cb8 timer/nova: prevent potential division by zero
This case triggered with the leitzentrale.run script on Qemu.
The frequency value must never initialized with zero.

Fixes #3663
2020-02-27 14:46:59 +01:00
Stefan Kalkowski
87cb10c558 sculpt_manager: accept uplink from "local" network
Be less rigid when checking for available network to support
setups where the uplink or depot repositories are provided by
another source than "wired" or "wifi" NIC services,
e.g., a virtual machine with pass-through network device.
2020-02-27 14:46:59 +01:00
Norman Feske
904651ada9 sculpt: version 20.02 2020-02-27 14:46:59 +01:00
Norman Feske
1d3ce93107 sculpt: leitzentrale user-interface redesign
Issue #3650
2020-02-27 14:46:59 +01:00
Sebastian Sumpf
103dcdeea8 vmm: ARMv8 virtio improvements
net:
* increase queue size to 1024 (more stable on Linux)
* use mac address from Nic session instead of random one
* handle data that is larger than rx descriptor correctly (copy less)
* clear descriptor header (12 bytes) on rx

generic:
* always use 'avail_idx' (tx and rx)
* added barriers when reading/writing queues (TMP)

Ref #3620
2020-02-27 14:46:59 +01:00
Sebastian Sumpf
f77531138a vmm: ARMv8 virtio for network and console
Simple console and network implementation of the Virtio protocol.

Fix #3620
2020-02-27 14:46:59 +01:00
Sebastian Sumpf
c8b3b060aa vmm: ARMv8 add 'local_address' to Ram_allocator
Ref #3620
2020-02-27 14:46:59 +01:00
Stefan Kalkowski
7780ee6a34 vmm: do not lock inside VMM
We do not use the VMM with several CPUs until now.
On the other hand there is a dead-lock due to the
generic timer calling the cpu handler function explicitly,
which already holds the lock. For the time-being remove the lock.

Ref #3620
2020-02-27 14:46:59 +01:00
Stefan Kalkowski
2e2625e952 vmm: check ring-buffer capacity in pl011 model
Ref #3620
2020-02-27 14:46:58 +01:00
Stefan Kalkowski
55c3eb7c14 vmm: fix GIC interrupt register bit shifts
Ref #3620
2020-02-27 14:46:58 +01:00
Stefan Thöni
a7a9855493 base: lay groundwork for base-linux caps change
Include the necessary hooks to introduce file descriptor
based capabilities in base linux.

Issue #3581
2020-02-27 14:46:58 +01:00
Norman Feske
5eaaee0dbe text_area: a simple text viewer / editor
The new text_area component is able to view and edit files.
Internally, it employs a menu_view for the graphics output.

Only basic notepad-like text-editing functions are supported.

At the current time, it is solely meant as a companion of the Sculpt
manager.

Issue #3650
2020-02-27 14:46:58 +01:00
Norman Feske
b2bc718c1f fs_query: report 'writeable' attribute for files 2020-02-27 14:46:58 +01:00
Norman Feske
7118ad494c os/vfs.h: add Directory::Entry::rwx accessor 2020-02-27 14:46:58 +01:00
Norman Feske
582e0e718c menu_view: make texture handling more robust
This patch improves the robustness of menu_view when encounting missing
textures, which can happen during development when using styled buttons
and frames. With the patch, menu_view outputs diagnostic messages,
pinpointing the problem.

The patch also updates the texture handling to use the 'File_content'
utility and the VFS for obtaining PNG images.

Issue #3629
2020-02-27 14:46:58 +01:00
Norman Feske
1713583a19 menu_view: basic support for styling labels
This patch allows for the customization of the text color and alpha
value of the label widget by the means of a style-definition file.
The mechanism is exemplified with the new "invisible" label style
that sets the alpha value to zero.

Issue #3629
2020-02-27 14:46:57 +01:00
Norman Feske
38aef49428 menu_view: invisible button style 2020-02-27 14:46:57 +01:00
Alexander Boettcher
a9caf3fbe4 base: avoid wrong warning by Mutex::acquire
A _owner is only valid if lock is actually locked.

Issue #3612
2020-02-27 14:46:57 +01:00
Josef Söntgen
80ff844dc2 depot: update public key for cnuke 2020-02-27 14:46:57 +01:00
Josef Söntgen
c53be5a3fb os: omit size check on payloadless Block packets
The check is already performed in 'packet_valid' where the conditions
for payloadless packets are already considered.

Fixes #3660.
2020-02-27 14:46:57 +01:00
Josef Söntgen
6addd6cf1e os: fix Node_rwx::rwx
Fixes #3658.
2020-02-27 14:46:57 +01:00
Sebastian Sumpf
3995d2f4a2 part_block: switch to Request_stream and Job APIs
- use Job API as block connection back end
- use Request_stream API as front end
- use Mmio framework for gpt and mbr parsing
- implement sync correctly

fixes #3652
2020-02-27 14:46:57 +01:00
Sebastian Sumpf
b95dc611d6 gmp: use architecture specific 'config.h'
Generated a separate 'config.h' for arm, arm_64, x86_32, x86_64 for the
current version (6.1.2) of GMP. This became necessary because
configurations differ for each architecture.

'config.h' generaton on x86_64 host in'gmp-6.1.2' directory:

for x86_64 (native):
! configure

for x86_32:
! configure --host=x86-pc-linux-gnu --build=x86_64-pc-linux-gnu

for arm:
! configure --host=arm-linux-gnu --build=x86_64-pc-linux-gnu \
!  CC=/usr/local/gcc-linaro-arm/bin/arm-linux-gnueabi-gcc ABI=32

for arm_v8:
! configure --host=aarch64-linux-gnu --build=x86_64-pc-linux-gnu \
!  CC=/usr/local/gcc-linaro/bin/aarch64-linux-gnu-gcc ABI=64

issue #3598
2020-02-27 14:46:57 +01:00
Christian Helmuth
4cccf74664 depot: update recipe hashes 2020-02-20 12:11:23 +01:00
Stefan Kalkowski
8cc48d5688 hw: be more accurate in synchronizing ASID/Pages
Fix #3651
2020-02-20 12:11:23 +01:00
Stefan Kalkowski
b76bd57ed1 window_layouter: add dynamic screen handling
This commit adds dynamic switching in between different defined
screens via keyboard shortcuts, or by editing the rules file.
In the window_layouter package it defines per default ten screens,
reachable by pressing the screen key along with numbers 0-9.

Fix #3646
2020-02-20 12:11:23 +01:00
Alexander Boettcher
2afc218767 test/registry: measure time used for iteration
Issue #3612
2020-02-20 12:11:22 +01:00
Alexander Boettcher
5bbaa30655 base: use mutex in registry
Issue #3612
2020-02-20 12:11:22 +01:00
Alexander Boettcher
5440cd4b50 base: use blockade in thread
Issue #3612
2020-02-20 12:11:22 +01:00
Alexander Boettcher
e686ff78e9 base: add blockade as derivate of lock
Issue #3612
2020-02-20 12:11:22 +01:00
Alexander Boettcher
2bd77722c7 base: use mutex in heap
Issue #3612
2020-02-20 12:11:22 +01:00
Alexander Boettcher
00f69bc70d base: add mutex as derivate of lock
The mutex class is more restrictive in usage compared to
Genode::Lock.

- At initialiation time it is ever unlocked.
- No thread is permitted to lock twice. Warn about it
  in case it happens.
- Only the lock onwer is permitted to unlock the mutex.
  Warn about it and don't unlock the mutex in case it happens.

Issue #3612
2020-02-20 12:11:22 +01:00
Stefan Kalkowski
d1609e771a pdf_view: fix typo in pkg runtime requires
Fix #3648
2020-02-20 12:11:22 +01:00
Norman Feske
89f813f113 os: add sandbox lib to api/os 2020-02-20 12:11:22 +01:00
Norman Feske
9b0fbf000e sandbox: support for local state-report handling
Fixes #3647
2020-02-20 12:11:22 +01:00
Stefan Kalkowski
725d16e18e hw: optimize ipc capability allocation
In preparation of ipc receive, by now a bunch of capabilities got
allocated to be ready iin case of capability receiption. After that
unuse slots were freed again. This overhead of senseless (de-)allocations
is replaced in this commit by just restock capability slots that got
used by the last receive.

Fix #3640
2020-02-20 12:11:22 +01:00
Martin Stein
e42a205a51 base-hw: Ada-compliant scheduler method signatures
Ref #3308
2020-02-20 12:11:22 +01:00
Martin Stein
0d5f185267 base-hw: no pointers in scheduler interface
Ref #3308
2020-02-20 12:11:22 +01:00
Martin Stein
c146a215fb base-hw: cpu scheduler without inheritance
Ref #3308
2020-02-20 12:11:21 +01:00
Martin Stein
eef7b5e168 base-hw: double list without inheritance
Ref #3308
2020-02-20 12:11:21 +01:00
Martin Stein
a753b6ce46 base-hw: fix run scripts
Ref #3308
2020-02-20 12:11:21 +01:00
Martin Stein
793e12f8f3 base-hw: no error return codes in signaling
Error return codes are used with non-const functions in the signaling modules.
This would have been impractical for the in-place translation of the module to
Ada in the context of the Spunky project. Besides, it is easy to get rid of
them and it makes the execution flow more clear.

Ref #3308
2020-02-20 12:11:21 +01:00
Martin Stein
751e6430fa base-hw: obsolete Kernel::Thread::_signal_receiver
Ref #3308
2020-02-20 12:11:21 +01:00
Martin Stein
9eb20c2be7 base-hw: no pointer arguments in signaling
Besides reducing the use of pointers in base-hw, this prepares for the in-place
translation of the signaling module to Ada in the context of the Spunky
project.

Ref #3308
2020-02-20 12:11:21 +01:00
Martin Stein
5e460394d2 base-hw: do not inherit Kernel::Object
This prevents the use of Kernel::Object as base class for the specific kernel
objects and instead makes it a member of the kernel objects. Besides
simplifying inheritance hierarchies in base-hw, this prepares for the in-place
translation of the signaling module (and others) to Ada in the context of the
Spunky project.

Ref #3308
2020-02-20 12:11:21 +01:00
Martin Stein
88043e144a base-hw: no virtual functions in signaling
Besides simplifying the execution flow in the signaling module, this prepares
for the in-place translation of the signaling module to Ada in the context of
the Spunky project.

Ref #3308
2020-02-20 12:11:21 +01:00
Martin Stein
3cc7774fe4 base-hw: Ada/SPARK-friendly Ipc_node interface
This prevents the use of C++ features in the public method interface of the
synchronous-IPC module that would be impractical for the in-place
translation of the module into Ada in the context of the Spunky project.

* Get rid of thread accessor.
* Get rid of non-const functions with return values.
* Get rid of pointer return-values.

Ref #3308
2020-02-20 12:11:21 +01:00
Martin Stein
a04243aaf4 base-hw: remove unused Ipc_node accessor methods
Ref #3308
2020-02-20 12:11:21 +01:00
Martin Stein
5a95183c3e base-hw: avoid that Ipc_node inherits
Besides simplifying inheritance hierarchies in base-hw, this prepares for the
in-place translation of the synchronous-IPC module to Ada in the context of the
Spunky project.

Ref #3308
2020-02-20 12:11:21 +01:00
Martin Stein
6a5aa18a7b base-hw: no PD code / virt methods in Ipc_node
This is a simplication of the asyncronous-IPC module of the base-hw kernel.
Besides structuring the code in a cleaner way, it prepares for the in-place
translation of the module into Ada in the context of the Spunky project.

* Get rid of virtual methods in Ipc_node.
* Move all stuff related to protection domains, capabilities, and UTCBs to
  the Thread class. this code might later be moved to a dedicated module, but
  for now it's just fine to have it done by the thread module.

Ref #3308
2020-02-20 12:11:21 +01:00
Christian Prochaska
4b3c40f35b test-tcp_bulk: increase resources
Fixes #3645
2020-02-20 12:11:21 +01:00
Stefan Kalkowski
79fba6c2ac core: add kernel-specific UTCB quota bookkeeping
Fix #859
2020-02-20 12:11:21 +01:00
Tomasz Gajewski
4f217b19a9 hw: add CPU wake up code for rpi3
Moved code waking up processors for Cortex A53 before changing privilege
level because sending events to higher privilege levels is not allowed.

Fixed enable_mmu for Cortex A53 to properly return cpu id.

Fixed starting code for secondary cores to properly initialize stacks.

Added code to wake up secondary cores on rpi3.

Ref #3573
2020-02-20 12:08:17 +01:00
Stefan Kalkowski
202333c881 hw: cortex a9 diagnostic register initialization
We cannot count on the correct initialization of the diagnostic register
of the secondary cores. But the boot core gets initialized by the bootchain,
so we can copy over those values.

Fix #3639
2020-02-20 12:08:17 +01:00
Christian Prochaska
2ce0395fd8 arora.run: fix 'focus' route
Fixes #3637
2020-02-20 12:08:17 +01:00
Emery Hemingway
bbdf181828 core: add support for unlabeled LOG sessions
If the root child requests a LOG service with the label "unlabeled" then
return a LOG session that logs unprefixed messages. This allows a external
test controller to recognize log messages produced by a blessed component.
2020-02-20 12:08:17 +01:00
Norman Feske
0181c6025a menu_view: add <label min_ex=".."> attribute
This new attribute can be used to enforce a minimum width in the unit of
the size of the character 'x'. Furthermore, the patch sets the minimum
height of a label to 0 if no 'text' attribute is present. By combining
both features, the label becomes usable as a horizontal spacer.

Issue #3629
2020-02-20 12:08:17 +01:00
Norman Feske
6eff83c1eb menu_view: invisible frame
Issue #3629
2020-02-20 12:08:17 +01:00
Norman Feske
5aae0f2379 menu_view: support multiple floats within a frame
This patch refines the hover handling such that a float widget never
responds to hovering unless a child is hovered. This way, it becomes
possible to stack multiple float widgets within one frame and still
reach all child widgets.

Issue #3629
2020-02-20 12:08:17 +01:00
Norman Feske
49ae4a834f menu_view: support for displaying text selections
Similarly to the way of how a <cursor> can be defined for a <label>
widget, a selection can be expressed as follows:

  <label ...>
    <selection at="2" length="12"/>
  </label>

Issue #3607
Issue #3629
2020-02-20 12:08:17 +01:00
Norman Feske
5b650434b0 menu_view: unquote label text attribute value
This patch enables the menu view to display '"' characters supplied via
the 'text' attribute of the <label> widget.

Issue #3607
Issue #3629
2020-02-20 12:08:16 +01:00
Norman Feske
e612f7cd7d menu_view: add character position to hover report
When setting the <dialog> attribute 'hover_details' to "yes", the hover
report features the character position of a hovered label.

Issue #3607
Issue #3629
2020-02-20 12:08:16 +01:00
Norman Feske
7cc4aa2a28 menu_view: text cursor support
This patch equips the label widget with the ability to display a text
cursor, as illustrated by the following example:

  <label text="...">
    <cursor at="10"/>
  </label>

Issue #3607
Issue #3629
2020-02-20 12:08:16 +01:00
Norman Feske
60f5d0e34a gems/animated_geometry.h: increase value range
The value range supported by the 'Animated_rect' utility is constrained
to 2^11 by the used 32-bit integer type. The interpolation is performed
on fixpoint numbers with a fractional precision of 10 bits. The
non-linear interpolation as performed by the 'Lazy_value' utility
involves squaring the values. Hence, the interpolated integral values
must not exceed 2^11 (2*11 bits for the square plus 10 bit for the
fractional part require 32 bits). This range is too small for
high-resolution displays. Hence this patch replaces the 32-bit integer
type by a 64-bit integer type.

Fixes #3627
2020-02-20 12:08:16 +01:00
Norman Feske
46c5a90ba1 nitpicker_gfx: Text_painter::Font::index_at_xpos
This method is useful for finding the character under a mouse position.
2020-02-20 12:08:16 +01:00
Stefan Kalkowski
1273c573b6 wm: destroy view before newly creating it 2020-02-20 12:08:16 +01:00
Norman Feske
3a2895af19 wm: reset pointer position on leave event
The wm used to remember the last pointer position when observing a leave
event. With such a stale pointer position, the wm would eventually
wrongly create an artifical motion event when a supposedly hovered
window changes its position (during an animated move). This can lead to
the propagation of the stale pointer position to the wm client, which,
in turn, may interpret the outdated position (e.g., the menu view would
report a wrong hover state).

This patch removes the stale state by resetting the '_pointer_pos' when
observing a leave event.

Fixes #3632
2020-02-20 12:08:16 +01:00
Norman Feske
0bffac6c98 nit_fader: make fading steps configurable
Fixes #3633
2020-02-20 12:08:16 +01:00
Norman Feske
c25de5dba3 backdrop: make width and height customizable 2020-02-20 12:08:16 +01:00
Norman Feske
60edfa4d77 fs_query: add directory entries to listing report
Fixes #3631
2020-02-20 12:08:16 +01:00
Norman Feske
52e582132f os/vfs.h: handle corner case in join function
When specifying "/" or "" as rel_path to the 'Directory' constructor,
the constructed directory should refer to the same directory. The
implementation of the join utility did not consider this corner case. It
occurred during the attempt to use fs_query with "/" given as path.

This patch also adds a Directory::Entry::dir accessor that returns true
if the entry is a directory.

Fixes #3630
2020-02-20 12:08:16 +01:00
Norman Feske
a888041ba4 cached_fs_rom: fix file-handle leak
Fixes #3634
2020-02-20 12:08:16 +01:00
Norman Feske
844af06782 base/buffered_output.h: flush at destruction time
By writing out all dangling characters at destruction time, the
'Buffered_output' utility can be used as a local variable rather
than a long-living object.
2020-02-20 12:08:16 +01:00
Norman Feske
7da3404bd0 pkg/noux-system: increase nit_fb quota
With this change, the window can be maximized on a full-HD screen.
2020-02-20 12:08:16 +01:00
Sid Hussmann
7676f47540 depot_deploy: support heartbeat in deploy config
Issue #3575
2020-02-20 12:08:16 +01:00
Josef Söntgen
9d7a58f6a7 dde_bsd: update audio driver to OpenBSD 6.6
Besides updating to a newer version the update adds the AC97 ICH driver
and addresses shortcomings with the OpenBSD emulation environment:

* Fix 'delay(9)' implementation - it now properly uses 'us' as unit,
  which results on faster initialization of the drivers.

* Fix LOG output that got lost during commit f23579532 and bring over
  the printf implementation from dde_linux for more structured
  printing.

* As said the driver now recognizes the AUICH devices. So far it was
  only tested with the device model in VirtualBox where it produces
  stuttering audio, investigating the cause is still ongoing.

Fixes #3641.
2020-02-20 12:08:16 +01:00
Christian Prochaska
9bd3d2aa5c qt5: use main entrypoint in QPA plugin
Fixes #3644
2020-02-20 12:08:16 +01:00
Christian Prochaska
28e782dda5 qt5: use pthread backend for QThreads
Fixes #3643
2020-02-20 12:08:16 +01:00
Christian Prochaska
597098845c libc: support pthread cleanup handlers
Fixes #3642
2020-02-20 12:08:16 +01:00
Sebastian Sumpf
8a7deae238 ahci: switch to request stream API + structural changes
- Remove dated 'Block::Driver' front end and implement
  'Block::Request_stream' front end
- Remove all dynamic memory allocations but DMA memory allocations
- Remove 'Platform_hba' and implement platform specific functions in
  'spec/<platform>/*'
- Ata and Atapi don't inherit from 'Port' any more, but are a member of
  'Port' as a protocol implementation
- Use platform driver for MMIO mappings (x86)
- Exchange stateful initialization of Ata/Atapi with a sequential
  initialization using 'wait_for_any' and 'retry' patterns
- Fix Atapi initialization by setting the byte count limit
- Set FIS receive base only when Cmd::FRE is disabled and Cmd::FR is 0
- Put everything in namespaces ('Ahci', 'Ata', or 'Atapi')
- Ata decides during read/write operations to use native-command queuing
  or normal DMA requests
- Remove port claiming logic (is now done via 'Constructibles')

fixes #3636
2020-02-20 12:08:16 +01:00
Sebastian Sumpf
73f2c7043c ahci: remove Exynos5 support
Exynos5 support has ceased on Genode

issue #3636
2020-02-10 16:00:41 +01:00
Sebastian Sumpf
de24035066 base: add 'wait_for_any' to 'Register_set'
This is the same as 'wait_for' with the difference that 'wait_for_any'
succeeds when *one* condition is met.

issue #3636
2020-02-10 16:00:40 +01:00
Norman Feske
57ea1dbdd3 depot: update recipe hashes 2020-02-10 14:29:06 +01:00
Christian Prochaska
9f73f09cec tcp bulk test: add VFS server tests
Fixes #3611
2020-02-10 14:21:48 +01:00
Martin Stein
d56b21d329 nic_router: do not change ethernet header as hub
When forwarding domain-local traffic like a hub, the NIC router shouldn't
modify packets at all.

Fixes #3625
2020-02-10 14:21:47 +01:00
Christian Helmuth
8d60bc11b5 vbox: periodic timer based on absolute timestamps
Before timestamps where calculated as durations since current wakeup
which introduces a systematical drift.
2020-02-10 14:21:47 +01:00
Christian Helmuth
604f4c666b Remove Timed_semaphore from libc incl test package
Issue #3550
2020-02-10 14:21:47 +01:00
Christian Helmuth
ff5175ec76 libc: synchronization primitives based on monitor
The libc monitor facility enables the execution of monitor jobs by the
main thread when the monitor pool was charged. In comparison to the
current suspend/resume_all mechanism the main thread iterates over all
job functions in contrast to waking up all threads to check their
conditions by themselves. Threads are only woken up if the completion
condition was met.

This commit is the result of a collaboration with Christian Prochaska.
Many thanks for your support, Christian.

Fixes #3550
2020-02-10 14:21:47 +01:00
Christian Helmuth
6aebd5dd95 libc: append serial number to pthread name
... in pthread_create()

Issue #3550
2020-02-10 14:21:47 +01:00
Christian Helmuth
3d4bed3374 libc: unify semantic of sleep functions
sleep(), usleep(), and nanosleep() now return immediately on
zero-timeout. Also, non-zero timeouts sleep at least 1 ms (the current
minimal timeout in libc), which compensates rounding errors.

Issue #3550
2020-02-10 14:21:47 +01:00
Alexander Boettcher
ee7a77643e depot_deploy: support affinity configuration
Fixes #3597
2020-02-10 14:21:47 +01:00
Alexander Boettcher
646d6c368c core: fixup cpu weight on failed thread creation
Fixes #3613
2020-02-07 14:14:20 +01:00
Alexander Boettcher
d96e14fe16 sandbox: adjust location size scaling
by incorporating session location

Issue #1412
2020-02-07 14:14:20 +01:00
Alexander Boettcher
3a9d450106 trace: avoid page fault on client calling subjects
Fixes #3608
2020-02-07 14:14:20 +01:00
Martin Stein
a73ef9fc06 app/ping: fix destination MAC on ARP replies
The ARP destination MAC was set to the Ethernet source MAC which is not
necessarily the MAC of the other ARP peer. Instead use the ARP source MAC of
the ARP request.
2020-02-04 16:12:04 +01:00
Stefan Kalkowski
3016b64fac mesa: enable ARM-64 port
Fix #3622
2020-02-04 16:10:28 +01:00
Stefan Kalkowski
22498e0b09 os: add backtrace utility for arm_64
Fix #3621
2020-02-04 16:10:22 +01:00
Stefan Kalkowski
79dff674fd gems: add connect facility to tcp_terminal
Instead of listening for new TCP/IP connections only,
the TCP terminal connects to a server when an IP address is
configured in the policy for a terminal client.

Fix #3619
2020-02-04 16:10:09 +01:00
Stefan Kalkowski
56ef7ca9e7 hw: enable ARMv8 performance counter
Fix #3618
2020-02-04 16:05:01 +01:00
Stefan Kalkowski
9db50753f1 libports: add ARMv8 support for libpng
Fix #3617
2020-02-04 16:04:54 +01:00
Stefan Kalkowski
e84e1bbf36 dde_linux: optimize refresh routine in imx8_fb_drv
Fix #3616
2020-02-04 16:03:08 +01:00
Stefan Kalkowski
fda337a1c0 os: increase throughput of blit for ARM 64-bit
Fix #3615
2020-02-04 16:01:35 +01:00
Stefan Kalkowski
f49f91da08 os: increase RAM quota for drivers in fb_bench.run
Enables fb_bench.run script for new imx8 framebuffer driver.

Ref #3615
2020-02-04 15:59:33 +01:00
Christian Helmuth
90535a1401 depot: update recipe hashes 2020-02-04 15:51:10 +01:00
Christian Helmuth
43719b5fd1 libc: fix returned timeout-left value
If the suspend method for the main thread detects that the suspend
condition is false it must return the passed timeout value (not always
0). Otherwise, the caller may incorrectly assume the timeout expired.
2020-02-04 15:51:10 +01:00
Stefan Kalkowski
2a94f8cdb4 depot: update public key for skalk 2020-02-04 15:51:10 +01:00
Christian Helmuth
1e578f1a50 Log key count in input test 2020-02-04 15:51:10 +01:00
Alexander Boettcher
a036d2373a x86/ps2: disable devices during commands
Especially the initial reset ended up with an unusable keyboard in rare
cases before. This commit disables keyboard and mouse handling of i8042
during command sequences according to a note from

  https://www.win.tue.nl/~aeb/linux/kbd/scancodes-12.html
2020-02-04 15:51:10 +01:00
Norman Feske
a2b303e95a Road map for 2020 2020-02-04 15:51:10 +01:00
Alexander Boettcher
7b964fa700 base: add affinity space info to platform info
Issue #3599
2020-02-04 15:51:10 +01:00
Alexander Boettcher
72f5f9d133 sculpt_manager: apply affinity-space to runtime
Issue #3599
2020-02-04 15:51:10 +01:00
Christian Prochaska
186a6bc080 test-tcp_bulk_lxip: increase timeout value
Fixes #3609
2020-02-04 15:51:10 +01:00
Norman Feske
567d9f7910 Xml_node::Unquoted utility for attribute values
The new utility can be used to revert quoted XML attribute values.
Such quoting is needed whenever an attribute value can contain '"'
characters. E.g., in the menu_view's <label text="..."> widget.

Issue #1757
2020-02-04 15:51:10 +01:00
Norman Feske
d70cf314d8 Never throw in 'Attached_rom_dataspace::size'
If the ROM service returned in invalid dataspace, reflect this condition
via a size of zero instead of triggering an exception of type
'Reconstructible<Attached_dataspace>::Deref_unconstructed_object'.

Issue #3606
2020-02-04 15:51:10 +01:00
Norman Feske
c6445da654 vfs: watch support for <rom> file system
Fixes #3606
2020-02-04 15:51:10 +01:00
Norman Feske
96cde52838 vfs: make <rom> fs robust against invalid ROMs
An invalid ROM dataspace can occur, for example, when requesting a ROM
from the report_rom service before the first report was posted. Such a
<rom> node can still be useful if it's dynamic. E.g., it can be watched.
Hence, the corner case of an invalid ROM dataspace should be gracefully
handled instead of causing an abort.

Issue #3606
2020-02-04 15:51:09 +01:00
Norman Feske
c67a0d3dd8 os/dynamic_rom_session.h: support Xml_generator
This patch adds a special variant of a 'Content_producer' called
'Xml_producer', which allows the direct use of an 'Xml_generator'
for generating the ROM-module content.
2020-02-04 15:51:09 +01:00
Norman Feske
78c0e5f6b6 New sandbox library extracted from init component
This patch extracts the child-management functionality from the init
component into a new library called "sandbox". The library API is
located at 'os/include/os/sandbox.h'.

The sandbox API allows for the interaction of the component with the
sandboxed children by providing locally implemented services. This
mechanism is illustrated by the new test at os/src/test/sandbox.

Issue #3601
2020-02-04 15:51:09 +01:00
Norman Feske
f82e7df0ba os/buffered_xml.h: support for generating XML
This patch extends the 'Buffered_xml' utility with a new constructor
that fills the buffer with the output of an 'Xml_generator'. It thereby
presents an easy way to generate XML to be consumed locally.

The patch also add a deprecation mark to the original 'xml' accessor
because copying 'Xml_node' objects (here as return value) is dangerous.
The new 'with_xml_node' method should instead be used to access the XML
content stored in the buffer.

Fixes #3602
2020-02-04 15:51:09 +01:00
Norman Feske
640a001ab6 util/xml_node.h: avoid internal use of exceptions
The XML parser used to rely in C++ exceptions while parsing, which is an
artifact from the initial implementation. This patch reworks the code such
that exceptions are avoided in the common cases.

Fixes #3605
2020-02-04 15:51:09 +01:00
Alexander Boettcher
c5c5f8754c test-init: add test to check for affinity warning
Issue #1412
2020-02-04 15:51:09 +01:00
Alexander Boettcher
5be3bf4f26 init: warn about missing affinity-space
if affinity is set by children

Issue #1412
2020-02-04 15:51:09 +01:00
Alexander Boettcher
d132fc0a73 init: scale affinity location
Issue #1412
2020-02-04 15:51:09 +01:00
Christian Helmuth
285a33c97d dde_linux: add missing white space in log message 2020-02-04 15:51:09 +01:00
Alexander Boettcher
f09ac23144 base: Timestamp type on arm_64 is 64bit 2020-02-04 15:51:09 +01:00
Alexander Boettcher
734752d6b5 base-nova: show size of framebuffer correctly 2020-02-04 15:51:09 +01:00
Christian Prochaska
4fc6c4ff5c test-tcp_bulk_lwip: increase timeout value
Fixes #3604
2020-02-04 15:51:09 +01:00
Christian Prochaska
746d373362 vfs_lxip: classify 'data' file as continuous
Fixes #3603
2020-02-04 15:51:09 +01:00
Alexander Boettcher
2256f5fb4b dde_linux: add dma_wmb/rmb barriers for arm_v6 2020-02-04 15:51:09 +01:00
Christian Prochaska
d8e2c95597 vfs server: ensure retry for stalled session
Fixes #3600
2020-02-04 15:51:09 +01:00
Alexander Boettcher
6506240642 dde_linux: add dma_wmb/rmb barriers for arm_v7
and remove re-defined dma_wmb in fec driver
2020-02-04 15:51:09 +01:00
Sebastian Sumpf
bd284347da libports: fix undefined reference for gmp on arm_v8
* enable native 'invert_limb' implemenation
* disable native 'udiv_qrnnd' implemenation

fixes #3598
2020-02-04 15:51:08 +01:00
Sebastian Sumpf
3813f9772a libports: add '__gmpn_invert_limb' for arm_v7
Implementation was missing.

issue #3598
2020-02-04 15:51:08 +01:00
Sebastian Sumpf
1902d1a06b hw: do not map boot modules in bootstrap
This commit safes virtual address space.
2020-02-04 15:51:08 +01:00
Josef Söntgen
7ecabb25eb ssh_terminal: address ambigouity of return values
Replace return values with appropiate bool and document two-staged
publickey authentication. This fixes a bug where wrong authentication
attempts are not properly denied.

Issue #3590.
2020-02-04 15:51:08 +01:00
Alexander Boettcher
5b633a83df core: dissolve thread object on failed creation
Fixes #3596
2020-02-04 15:51:08 +01:00
Norman Feske
beb8bf498c base-hw: add explicit array-bounds check
This patch rules out out-of-bounds array accesses without inspecting the
caller. It is not a bug fix but adds clarity.
2020-02-04 15:51:08 +01:00
Norman Feske
de764d8490 base-hw/muen: add explicit array-bounds check 2020-02-04 15:51:08 +01:00
Norman Feske
5635c1318c base-hw: explicit bounds check in store_apic_id
Avoid relying on the caller regarding the CPU index argument to ease the
reasoning about the code.
2020-02-04 15:51:08 +01:00
Norman Feske
01713c74f9 base-foc: explicit array-index bounds check
Adding an explicit check clarifies at the first glance that the array
bounds are respected without needing knowledge about MAX_CAPS_PER_MSG
and L4_UTCB_GENERIC_DATA_SIZE (used for dimensioning 'mr').
2020-02-04 15:51:08 +01:00
Norman Feske
9ec66f0594 allocator_avl: simplify structure
This patch changes the code of '_alloc_two_blocks_metadata' to not
leak the result of a partial allocation in the out parameters of
the method. This eases the reasoning about the absence of a
use-atfer-free problem (there was none).
2020-02-04 15:51:08 +01:00
Norman Feske
6947bddd3f base: avoid use of memcpy 2020-02-04 15:51:08 +01:00
Norman Feske
37ec636018 test/smp: add missing destruct call 2020-02-04 15:51:08 +01:00
Norman Feske
9bba6613e7 base/affinity.h: simplify member initialization
This is just a minor style improvement.
2020-02-04 15:51:08 +01:00
Christian Prochaska
d4f246517c depot: recipe for drivers_interactive-imx8q_evk
Fixes #3595
2020-02-04 15:51:08 +01:00
Stefan Kalkowski
5bfebe7a3f depot: recipe for usb_hid_drv
Fixes #3594
2020-02-04 15:47:27 +01:00
Stefan Kalkowski
3df67362b4 depot: recipe for usb_host_drv
Fixes #3593
2020-02-04 15:47:27 +01:00
Christian Prochaska
f1042e7fb1 depot: recipe for imx8_fb_drv
Fixes #3592
2020-02-04 15:47:27 +01:00
Christian Prochaska
b29112efdf dde_linux: framebuffer driver for i.MX8 EVK
Fixes #3591
2020-02-04 15:47:27 +01:00
Stefan Kalkowski
fe899eecc7 base-linux: fix configurable host toolchain
With the '-x' argument of the 'g++' tool the language gets specified,
therefore it has to be 'c++' furthermore, not CUSTOM_HOST_CXX. Moreover,
when import-lx_hybrid.mk gets evaluated first, global.mk is not included
yet, therefore we cannot eagerly evaluate the CXX_LINK_OPT_NO_PIE variable.

Issue #3466
2020-02-04 15:47:27 +01:00
Norman Feske
c2a2ec121f libc-net/resolv: silence warning in 3rd-party code 2020-02-04 15:47:27 +01:00
Norman Feske
e1e1fa23b7 zlib: fix compile warning
This patch includes 'unistd.h' to avoid warnings about the implicit
declaration of the functions ‘read’, 'close', and 'write.
2020-02-04 15:47:27 +01:00
Norman Feske
aee8d35dc4 libcrypto: suppress warning about unused value 2020-02-04 15:47:27 +01:00
Christian Helmuth
4bbbf5d2e3 dde_linux: reduce compiler warnings 2020-02-04 15:47:27 +01:00
Norman Feske
ba7e832c5d ssh_terminal: fix compile warning
server.h:51:12: warning: ‘int write_avail_cb(socket_t, int, void*)’
                declared ‘static’ but never defined [-Wunused-function]

This patch fixes the warning by moving the user of 'write_avail_cb' to
the compliation unit that defines it.
2020-01-03 14:44:31 +01:00
Norman Feske
bbfc092a31 core: avoid use of C array as buffer in Log_root 2020-01-03 14:44:15 +01:00
Norman Feske
de52cf1cdd core: check return value of map.metadata
Even though the call of map.metadata is known to always return a valid
pointer (because the meta data is assigned in the code just above),
better add an explicit nullptr check.
2020-01-03 14:44:15 +01:00
Norman Feske
783c05fd6c uart/exynos: be explicit about unused return value 2020-01-03 14:44:15 +01:00
Norman Feske
6ae98e2e6d base: mark Parent::Close_result with [[nodiscard]] 2020-01-03 14:44:15 +01:00
Norman Feske
ffc099eb54 cxx: add nullptr check in calloc
Even though malloc via the cxx_heap never fails, the implementation of
calloc should better not rely on this assumption.
2020-01-03 14:44:15 +01:00
Christian Helmuth
9321067b68 Remove unused/redundant longlong.h
This was used by an ancient libgmp port - longlong.h is now part of the
GMP sources.
2020-01-03 14:21:41 +01:00
Christian Prochaska
0eaa1f7a08 lx_kit: support enable/disable IRQ and pass IRQ number to handler
Fixes #3589
2020-01-02 15:53:46 +01:00
Christian Helmuth
18f90ca1e3 nova: request stack pointer on page fault
The SP value is part of the Page_fault_info object but was not requested
from the kernel on portal creation.
2020-01-02 15:30:28 +01:00
Christian Helmuth
9a35743df6 Mark packet-stream descriptor head/tail as volatile
`volatile` effectively prevents instruction reordering by the compiler
and fixes an issue with -O3 compiled components.

Note, this commit does not address further arguments regarding memory
barriers and volatile voiced in issue #693.

Issue #693
2019-12-20 14:34:22 +01:00
Christian Helmuth
8d63a3c1f3 Increase timeout of RTC test
It takes its time on sel4 and Qemu.
2019-12-20 14:28:18 +01:00
Alexander Boettcher
1ac33caa90 nova: handle rpc_entrypoint destruction better
Fixes #1921
2019-12-20 11:31:39 +01:00
Alexander Boettcher
1c361bf545 base: add test to destruct entrypoint
Issue #1921
2019-12-20 11:31:27 +01:00
Alexander Boettcher
a41dd48986 nova: avoid invalid capability counting overhead
- handle it the same way as done for other kernels

Fixes #3579
2019-12-20 11:29:21 +01:00
Christian Helmuth
b931b67cba depot: update recipe hashes 2019-12-19 17:01:43 +01:00
Christian Helmuth
24435e9ca1 Run TCP bulk tests on all Qemu platforms
This explicitly includes ARM32/64.
2019-12-19 17:01:43 +01:00
Alexander Boettcher
e54ff599ca base-hw: trace execution time of core threads
Fixes #3572
2019-12-19 17:01:43 +01:00
Sebastian Sumpf
04969b6be0 base-hw: add trace execution time support
This enables the 'top' program on base-hw for debugging issue #3247 on
rpi.

Fixes #3572
2019-12-19 17:01:42 +01:00
Christian Helmuth
1ddf1dbc25 Use ram-block in libc vfs tests on Rpi3 2019-12-19 17:01:42 +01:00
Christian Helmuth
8699f5592f wifi: run wpa_main in pthread 2019-12-19 17:01:42 +01:00
Norman Feske
73d089da36 Quota tweaks for base-sel4 2019-12-19 17:01:42 +01:00
Christian Prochaska
c8cd09e72c qt5: don't build qt5_jscore and qt5_webcore for arm_v8a
Fixes #3585
2019-12-19 17:01:42 +01:00
Christian Prochaska
be1ef01f10 stdcxx: add symbols needed by dosbox
Fixes #3588
2019-12-19 17:01:42 +01:00
Alexander Boettcher
0a1bc1f4b7 nova: add requesting time of killed SCs
Fixes #3587
2019-12-19 17:01:42 +01:00
Alexander Boettcher
bcb7f45201 core: avoid dangling ptr in cpu thread component
if exception is triggered during construction of a thread
2019-12-19 17:01:42 +01:00
Alexander Boettcher
33db0e0d4d base: add uboot for imx8 as port
that contains scripts to download and build uboot

Fixes #3584
2019-12-19 17:01:42 +01:00
Christian Helmuth
504539ad1e vfs/lwip: notify I/O progress on sent packets
Incoming ACK packets for sent data packets may be the only unblocker for
suspended write/send loops. This patch informs VFS users about I/O of
VFS handle on successfully sent packets.
2019-12-19 17:01:42 +01:00
Christian Prochaska
a62fce8dc5 sd_card_drv: i.MX8 support
Fixes #3580
2019-12-19 17:01:42 +01:00
Christian Prochaska
81a78cf1d0 usb_host_drv: fix 'matches->compatible' string access
Fixes #3582
2019-12-19 17:01:42 +01:00
Christian Helmuth
283135c9cd test-libc_getenv: allow unrelated content in log pattern 2019-12-19 17:01:42 +01:00
Sebastian Sumpf
22d4d5c1c1 ldso: update link map during respawn
move binary to front of link map after respawn. This is required by GDB
in order to load symbol files correctly.

issue #3481
2019-12-19 17:01:42 +01:00
Sebastian Sumpf
9c372c36c1 libc: thread local errno support
Store errno in pthread objects, return member upon call to '__error()'.
This became necessary in order to make errno thread-safe.

Note, any call to libc code from a non-pthread (beside the first
entrypoint) is not supported.

issue #3568
2019-12-19 17:01:42 +01:00
Sebastian Sumpf
9767c4db0e vfs_lwip/lwip: Lwip::lock for concurrent access
This is required in case the send and receive of IP packets is
performed by multiple thread because lwip is not thread safe.

issue #3568
2019-12-19 17:01:42 +01:00
Alexander Boettcher
9812799b24 seoul: reduce CPU load in graphic mode
- Stop refreshing if all CPUs go to sleep, also in text mode.
- Any input resets update rate to 100Hz in graphic mode, which gets
  decreased step by step down to 25Hz if no input is available (looking video
  without input by user).

Fixes #3576
2019-12-19 17:01:42 +01:00
Alexander Boettcher
d385749ead seoul: make vmm memory configurable
- document Genode specific configuration option
2019-12-19 17:01:42 +01:00
Christian Helmuth
23ed5d3936 base-linux: configurable host toolchain
This commit uses CUSTOM_HOST_CC/CUSTOM_HOST_CXX instead of hardcoded
commands and introduces HOST_DEV_PREFIX.

Original patch by Roman Iten and Pirmin Duss.

Issue #3466
2019-12-19 17:01:42 +01:00
Christian Helmuth
cebc963396 Cleanup linux_rtc_drv and lx_fs target.mk
Original patch by Roman Iten and Pirmin Duss.

Issue #3466
2019-12-19 17:01:42 +01:00
Norman Feske
0c8ec41c21 vfs/pipe: let num_dirent return 0
This prevents the original value ~0UL from messing up the output
of 'ls -l /dev'.

Issue #3578
2019-12-19 17:01:42 +01:00
Norman Feske
9f7b8c1a17 vfs/log: allow output redirection via '> /dev/log'
Issue #3578
2019-12-19 17:01:42 +01:00
Norman Feske
cd92b32622 libc: close all open FDs on exit
This is important to issue sync requests for written-to files.

As the closing must be performed by an atexit handler, it happens at a
time _after_ libc plugins are destructed. Consequently an FD allocated
by such a plugin results in a close error, which in turn, does not
destruct the FD. We ultimatedly end up in an infinte loop of
re-attempting the close. For this reason, the patch changes 'close' to
be robust against this special case.

This is generally not a problem because libc plugins are phased out.
However, at present, the libc_noux plugin is still important. With the
changed 'close' in place, there occurred an error message "Error: close:
close not implemented" at the exit of each noux program. This patch
removes the error printing from the libc plugin mechansim to avoid this
noise. The error messages are not important anyway because the
deprecation of the libc plugin interface.

Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
5853a68904 libc: silence calls of getpeername w/o socket fs
The getpeername function is provided only by the socket fs.
In the case where the socket fs is not configured, return an appropriate
errno instead probing for a libc plugin (there is none).

Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
ae64830bd5 libc: silence get(e)gid, get(e)uid, getppid
These dummies spam the log when running bash + make, like in the
genodians.org scenario.

Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
e8878eee8a ldso: increase initial heap block
This is needed to enable the fork of 'make' in the genodians.org
scenario on NOVA.

Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
3897ddea03 cxx: don't rely on global ctors
This patch removes the global variable 'blocker', which was expected to
be constructed via the global ctors. This mechanism, however, is not
used for the base library, which resulted in the use of an unconstructed
object. Specifically, the spinlock of the 'Lock' of the 'Registry'
defaulted to the LOCKED state (value 0), which eventually would lead to
a deadlock in the contention case of the cxa guard.

I could observe this deadlock once on during the component startup on
base-linux during the construction of the 'startup_lock'.

This patch fixes the problem by explicitly initializing the registry
of blockers via an init function.

Issue #2299
Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
6858270517 base: disarm atexit handling for signal thread
The signal thread is not supposed to be destructed in any scenario other
than the noux fork mechanism (where no signals occur).

Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
4e57b6eceb core: fix destruction of dependent CPU sessions
Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
298f317f44 core: remove quota-related diagnostic messages
Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
5820ad8309 fiasco: silence ipc_send error messages
These diagnostic messages spam the log but can occur during the regular
component-destruction procedure.

Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
b7fbe65ff2 libc: fork/execve improvements
- Close FDs marked with the close-on-execve flag
  (needed for 'make', which sets the flag for the pipe-in
  FD of forked children)
- Update binary name on execve to use as ROM for subsequent fork
- Enable vfork as an alias for fork (needed by make)
- Purge line buffers for output streams during execve because they
  may be allocated at the allocation heap, which does not survive
  the execve call.
- Consider short-lived processes that may exit while the parent still
  blocks in the fork call.

With these changes, the website generator of genodians.org works without
the need for the Noux runtime.

Issue #3578
2019-12-19 17:00:47 +01:00
Norman Feske
d1cf216384 libc: propagate pipe config to child processes
Issue #3578
2019-12-19 17:00:47 +01:00
Alexander Boettcher
3011dc5876 sculpt: add vbox5 generic package as option
Fixes #3574
2019-12-19 17:00:47 +01:00
Alexander Boettcher
6e99f00f5c usb_hid_raw: enable imx8q_evk for nightly testing
Issue #3571
2019-12-19 17:00:47 +01:00
Alexander Boettcher
beb1e084a6 base: add imx8 evk usb driver to platform config
Issue #3571
2019-12-19 17:00:47 +01:00
Alexander Boettcher
e34b443c29 usb: add imx8q_evk support to usb_host
Issue #3571
2019-12-19 17:00:47 +01:00
Alexander Boettcher
6b17bb647e dde_linux: add barriers to readl/writel
Issue #3571
2019-12-19 17:00:47 +01:00
Christian Helmuth
4299b85cdb base-linux: support invalid dataspace for RM client
This restores behavior introduced in

  commit cb232891bf
  Author: Norman Feske <norman.feske@genode-labs.com>
  Date:   Tue May 10 11:55:25 2016 +0200

    Fix noux.run on base-linux

but removed by issue #2829.

Related to issue #1938
2019-12-19 17:00:47 +01:00
Sebastian Sumpf
6dae147785 libc: limit fd id allocations to FD_SETSIZE
fd > FD_SETSIZE cannot use 'select' or 'poll' within our libc.
Therefore, we added a bit allocator in order to allocate fd < FD_SETSIZE
(1024).

fixes #3568
2019-12-19 17:00:47 +01:00
Sebastian Sumpf
e4255e4c8b vfs/lxip: wait for i/o progress on connect
Since connect is asynchronous, add a waiter during connect

issue #3568
2019-12-19 17:00:47 +01:00
Christian Helmuth
161274f785 pistachio: check for 'ed' tool on port prepare
Some debian systems seems to come without 'ed' in the base installation.
The tool is needed when building the pistachio kernel.
2019-12-19 17:00:47 +01:00
Roman Iten
6145cdcf37 run: close connection to spawned processes on kill
From the man page of expect:

> Both expect and interact will detect when the current process exits
> and implicitly do a close.  But if you kill the process by, say, "exec
> kill  $pid",  you  will need to explicitly call close.

Fixes #3569
2019-12-19 17:00:47 +01:00
Tomasz Gajewski
b57a4c98cf tool/run: run external command plugin for power_on subsystem
Fixes #3385
2019-12-19 16:59:03 +01:00
Emery Hemingway
a3e43aca87 Clang: undeclared identifier __UINT64_C
Issue #3564
2019-12-19 16:59:03 +01:00
Norman Feske
6b6915e304 ttf_font: fix artifacts with large font sizes
This patch is a follow-up fix for "ttf_font: prevent out-of-bounds
access", which produced sporadic single-pixel artifacts with large font
sizes, e.g., with the monospaced font set to 24px in Sculpt.

The artifacts occurred only for some horizontal sub-pixel positions, in
combination with the font cache, and after the rendering of '>'
characters. They were ultimately caused by the missed clearning of the
first pixel of a glyph where x0 is 1 (e.g., the character 'd'). In this
case, a pixel from the previously evicted cache entry (the '>') shined
through. The patch fixes the problem by clearing the glyph starting from
the first, not the x0's, pixel.

Fixes #3567
2019-12-19 16:59:03 +01:00
Alexander Boettcher
3f83ac5580 tool: add imx8_evk board variable hint 2019-12-19 16:59:03 +01:00
Emery Hemingway
7f57de1b74 VFS/terminal: fix clang warning
Variable-sized object may not be initialized.

Issue #3564
2019-12-19 16:59:03 +01:00
Emery Hemingway
648382db74 Align after template expansion
Clang Cannot align template structs. Also, cannot cast void* to addr_t
in constexpr function.

Issue #3564
2019-12-19 16:59:03 +01:00
Emery Hemingway
2c510bb7f9 Remove unused lamba capture to fix clang warning
Issue #3564
2019-12-19 16:59:03 +01:00
Emery Hemingway
23710dff5e Remove dead code
Issue #3564
2019-12-19 16:59:03 +01:00
Emery Hemingway
ff0436357b nic_stress: keep signal-context cap by value
Fixes clang warning about binding reference to stack allocated
parameter.

Issue #3564
2019-12-19 16:59:03 +01:00
Emery Hemingway
091e5157aa vfs server: fix File_system namespace warnings
Issue #3564
2019-12-19 16:59:03 +01:00
Alexander Boettcher
c1e181a407 vbox: handle invalid dataspace exception
Fixes #3566
2019-12-19 16:59:03 +01:00
Stefan Kalkowski
8f71c90ca8 dde_rump: backport aarch64 (Fix #3565) 2019-12-19 16:59:03 +01:00
Norman Feske
f85ec313de os/vfs.h: handle zero-sized files
The 'File_content' class failed to consider zero-sized files.

Fixes #3557
2019-12-19 16:59:03 +01:00
Norman Feske
2aa6471608 test/depot_query: add test for zero-sized archives
This test covers the situation where depot_query evaluates depot content
that is incompletely extracted. In particular, if the 'archives' file
already exists but has a size of zero, depot_query would produce a
page fault. This situation can be manually provoked by deliberately
creating a zero-sized archives file for any otherwise correct pkg.

This patch also fixes the success indicator of the test. It wrongly
matched an early line of the log output.

Issue #3557
2019-12-19 16:59:02 +01:00
Stefan Kalkowski
9814fc5447 libports: enable arm_64 libssl, libcrypto variant
Fix #3563
2019-12-19 16:59:02 +01:00
Martin Stein
3655ea77a3 depot_autopilot: rework log matching
* The log history of a test is stored as a whole for the lifetime of the test.
* Matching of the log history against log patterns is done correctly now
  (previously, a pattern like "AAB" on an input like "AAAB" wouldn't have
  triggered).
* Use memcmp, memcpy, memmove instead of the former character-wise operations.
* Sanitizing of log input and log patterns now works more generic through the
  new Filter class for all replacements/removals.
* Sanitizing is done as soon as a string is available and remains for the
  lifetime of the test.
* Sanitizing doesn't interfer with the matching algorithm.
* Decomposing into small clearly named functions.

Ref #3555
2019-12-19 16:59:02 +01:00
Johannes Kliemann
89d35bc41e tool: boot Genode on bare metal Linux
Fixes #2829
2019-12-19 16:59:02 +01:00
Johannes Kliemann
93639532f0 base-linux: core session support (IO_PORT, IO_MEM, IRQ) 2019-12-19 16:59:02 +01:00
Christian Helmuth
8cf7aaad65 version: 19.11 2019-11-28 11:49:10 +01:00
Norman Feske
25a8ef3b7c News item for version 19.11 2019-11-28 11:44:29 +01:00
Norman Feske
b18a56c2c4 Release notes for version 19.11 2019-11-28 11:44:29 +01:00
Christian Helmuth
9d42e3f69b release notes: fix example in 19.08 input section 2019-11-28 11:44:29 +01:00
Christian Helmuth
11ef8e1ff2 depot: update recipe hashes 2019-11-28 09:06:39 +01:00
Christian Helmuth
1deab4a67f Disable noux_tool_chain_auto on foc/imx7d_sabre
The bootstrapper always fails with

  fatal: could not find free RAM region for modules

in this scenario.
2019-11-28 09:06:27 +01:00
Christian Helmuth
f23c70e068 sculpt_manager: use Codepoint::valid() 2019-11-28 09:06:26 +01:00
Alexander Boettcher
f7c818d303 vbox5: add recipe of kernel independent version 2019-11-25 16:02:40 +01:00
Stefan Kalkowski
7996cf06ab os: remove jitterentropy from fs_packet test
Fixes #3562
2019-11-25 15:44:57 +01:00
Stefan Kalkowski
4800bcf5a0 hw: correct the i.MX6 Sabrelite timer settings
Fix #3561
2019-11-25 15:43:59 +01:00
Christian Prochaska
4c74f4792c ahci_drv: set 'Cmd::St' to 1 before writing 'Sact' register
Issue #3058
2019-11-25 14:15:57 +01:00
Christian Prochaska
57d080d4f8 hw: use correct type on IRQ kernel object destruction
Fixes #3560
2019-11-25 14:15:39 +01:00
Alexander Boettcher
2778debc29 ram_fs: close open nodes on session close
Fixes #3559
2019-11-22 15:59:13 +01:00
Martin Stein
7182c10c90 test/nic_stress: test bad session args
Fixes #3525
2019-11-22 14:16:24 +01:00
Christian Prochaska
7309bcf4b5 gdb_monitor: add platform checks in run scripts
Fixes #3558
2019-11-22 14:12:06 +01:00
Sebastian Sumpf
309bc2083e vbox5: raise rrtimer priority
Make sure timers run at the same priority as component threads, otherwise
no timer progress can be made. See 'rtTimeNanoTSInternalRef' (timesupref.h)
and 'rtTimerLRThread' (timerlr-generic.cpp).
2019-11-22 13:33:15 +01:00
Norman Feske
6e098a9d17 ram_fs: apply session policy to write / mtime ops
This patch extends the distinction between read-only and writeable
sessions to packet-stream operations for WRITE and WRITE_TIMESTAMP.
2019-11-21 16:21:19 +01:00
Norman Feske
573b6d3345 noux: fix condition for mtime update
This is a follow-up patch for "noux: don't update mtimes for read-only
files". It eliminates warning messages during Sculpt's prepare step when
'cp' tries to update the mtimes of the source files.
2019-11-21 16:21:19 +01:00
Norman Feske
077fa355ce pkg/wm: increase RAM quota
This patch avoids a warning during the wm startup in Sculpt.
2019-11-21 15:13:20 +01:00
Norman Feske
e76ce05844 sculpt manager: ignore empty deploy configs
When copying config/managed/deploy to config/deploy, the latter may
temporarily result in an empty configuration. Such an intermediate
state should be ignored to keep the currently running scenario in tact
instead of restarting it.
2019-11-21 15:07:51 +01:00
Norman Feske
4622ddb46f nitpicker: add version attribute in clicked report
This patch addresses a corner case where the nitpicker focus is not
solely defined by mouse clicks or (exclusively) by a window manager, but
by a policy component that takes mouse clicks and other policy (e.g.,
a lock screen) into account. It ensures that each click that follows a
focus change (however initiated) results in a new "clicked" report even
when the report looks the same. To allow the policy component to
uniquely distiguish subsequent reports, the report features a new
'version' attribute.

Fixes #3493
2019-11-21 14:31:52 +01:00
Stefan Kalkowski
972e1893c9 os: introduce vmm component for ARMv8
Fix #3553
2019-11-21 14:29:36 +01:00
Stefan Kalkowski
af29dcf557 hw: introduce virtualization support for ARMv8
Ref #3553
2019-11-21 14:29:36 +01:00
Stefan Kalkowski
f82714f341 vm_session: return vcpu id when creating vcpu
Ref #3553
2019-11-21 14:29:36 +01:00
Stefan Kalkowski
02d68fdb97 hw: move arm virtualization to generic place
Ref #3553
2019-11-21 14:29:36 +01:00
Stefan Kalkowski
065b9fdb46 base-hw: extend syscalls to five arguments
Ref #3553
2019-11-21 14:29:36 +01:00
Stefan Kalkowski
18dbd75860 base: explictly target entrypoint in timer session
Fix #3548
2019-11-21 14:29:36 +01:00
Norman Feske
3ac970ac1d Streamline Timestamp::INVALID values
This is a follow-up patch for issue #1784 that solves two
inconsistencies.

- The Vfs::Timestamp::INVALID matches File_system::Timestamp::INVALID
- The Noux libc plugin tests for Timestamp::INVALID instead of a
  positive value.

The patch fixes the mtime info as shown in directory listings in
Sculpt's inspect window.
2019-11-21 14:26:27 +01:00
Norman Feske
3aaed7188f ram_fs: tie writeable bit to session policy
Related to issue #3507
2019-11-21 14:26:01 +01:00
Norman Feske
ee64e29e77 vfs server: tie writeable bit to session policy
This patch let the VFS server reflect the session policy via the
writeable bit in directory entries instead of merely forwarding the bit
from the respective VFS plugin. This way, all files originating from a
read-only file-system session automatically appear in directory listings
as read-only files.

Related to issue #3507
2019-11-21 14:25:43 +01:00
Norman Feske
cfba429c15 vfs/rump: offer all files as read-writeable
The distinction between read-only and read-writeable is the
responsibility of the front end, i.e., the vfs server.
2019-11-21 14:25:05 +01:00
Josef Söntgen
25aa25c6a0 wifi_drv: enable loading of 9000 series FW
Tested with a 'Intel(R) Wireless-AC 9462' device.

Fixes #3556.
2019-11-20 12:56:10 +01:00
Josef Söntgen
2afc02051c sculpt_manager: increase Rom_name size
The current value of 32 is too short for accessing the
iwlwifi 9000 ucode ROM.

Issue #3556.
2019-11-20 12:56:03 +01:00
Christian Helmuth
ce1b813105 depot: update recipe hashes (vbox, sculpt) 2019-11-19 16:08:19 +01:00
Christian Helmuth
7ed1d7f11d depot: update recipe hashes 2019-11-19 14:54:14 +01:00
Norman Feske
6ccd65bd8e sculpt_manager: invoke mkfs.ext2 with -F
The block-vfs plugin is no longer a special file. So we have to
explicitly discharge the sanity check of the mkfs tool.

Issue #3507
2019-11-19 14:54:14 +01:00
Norman Feske
18b621c2fe sculpt: version 19.11 2019-11-19 14:54:14 +01:00
Alexander Boettcher
cb61a28362 vbox5: use with_libc when call-in into vbox code
required due to pthreads becoming/are an integral part of the libc now.
Commit avoids libc error:

Error: libc suspend() called from non-user context (0xaf5c784) - aborting

Issue #3550
2019-11-19 14:54:14 +01:00
Norman Feske
4d7d208940 test-libc_vfs_fs_chained: fix XML validity error
This problem was spotted by the test.run script.
2019-11-19 14:54:14 +01:00
Sebastian Sumpf
f7509a5b78 libports: libc: extract file name from path in dlopen
'dlopen' causes the ldso to open ROM connections, right now we only
support single file names for these ROM not paths. Therefore, we extract
the file name from path within libc's 'dlopen'

fixes #3551
2019-11-19 14:54:14 +01:00
Christian Helmuth
a54c04d247 libc: return EPIPE on send to shut down sockets
This intermediate fix still lacks the generation of SIGPIPE and return
of EINTR if the MSG_NOSIGNAL flag is not set in the call to send().
2019-11-19 14:54:14 +01:00
Christian Helmuth
e70c04ef86 lwip: shut down TCP sockets return WRITE_ERR_IO on write 2019-11-19 14:54:13 +01:00
Christian Helmuth
6410e88698 netperf: handle EPIPE / silence warnings
This is an intermediate fix to handle sends to sockets shut down by the
peer already. A final fix in the libc would add support for the
MSG_NOSIGNAL send flag, generate SIGPIPE, and return the expected EINTR.
Then this patch is no longer required.

This commit also drops the obsolete patch for missing
sysconf(_SC_NPROCESSORS_ONLN), which is now part of libc.
2019-11-19 14:54:13 +01:00
Christian Helmuth
a3cb9d9897 lwip: prevent pointer-compare compilation warnings 2019-11-19 14:54:13 +01:00
Alexander Boettcher
b2a7ac2996 depot_deploy: support cpu quota configuration
the same as the ram and cap quota
2019-11-19 14:54:13 +01:00
Norman Feske
5f350adb57 vfs/lxip: don't misinterpret EINPROGRESS as error 2019-11-19 14:54:13 +01:00
Norman Feske
1485cd9d24 noux: don't update mtimes for read-only files
The VFS server as reworked in issue #3547 responds to such an attempt
with a failure as acknowledgement, triggering the client-side error
"Error: packet operation=2 failed" at noux.
2019-11-19 14:54:13 +01:00
Norman Feske
65d72fb07a drivers/gpu/intel: upgrade platform session on demand 2019-11-19 14:54:13 +01:00
Norman Feske
4871c7bba0 drivers/gpu/intel: reflect insuff. quota to client
This patch prevents the driver from translating Insufficient_ram_quota
and Insufficient_cap_quota exceptions to Service_denied exceptions at
session-creation time. This enables the client to respond to such a
condition by retrying the session creation with increased session quota.
2019-11-19 14:54:13 +01:00
Norman Feske
97e2968986 pkg/test-tcp_bulk_lwip: remove lwip.lib.so
The lwip library is not shared object.

This change is needed to execute the test with the test.run script.
2019-11-19 14:54:13 +01:00
Norman Feske
eb9a9bf23d bash.run: support using pipes 2019-11-19 14:54:13 +01:00
Emery Hemingway
c51b4b5742 New VFS plugin for emulating POSIX pipes
Add a new plugin for creating pipes between pairs of VFS handles. It is
intended to replace the libc_pipe plugin, one of the last remaining libc
plugins.

In contrast to the libc_pipe plugin, this plugin defers cross-handle
notification until I/O signal handling rather than block and unblock
readers using a semaphore. This is a performance regression in the case
of multiple threads blocking on a pipe, but shall be an intermediate
mechanism pending renovations within the libc VFS and threading layers.
As a side effect, threads blocked on a pipe might not be resumed until
the main thread suspends and dispatches I/O signals.

The "test-libc_pipe" test has been adjusted to use the VFS pipe plugin
and tests both local pipes and pipes hosted remotely in the VFS server.

Merge adaptations (such as EOF handling, adjustment to VFS/libc
interface changes) by Norman Feske.

Fix #2303
2019-11-19 14:54:13 +01:00
Norman Feske
9b7915facb vfs server: redesigned internal control flow
This patch reworks the VFS server to become easier to understand.

- The packet-stream handling is hidden from the node types.

- Introduced the notion of a "job" as an abstraction from the raw packet
  stream.

- The processing of requests is split into three phases:
  (1) accepting new jobs,
  (2) the execution of jobs, and
  (3) the delivery of acknowledgements.

- There is no longer a global fifo of pending nodes. Instead, each
  session has a fifo of "active" nodes, which are nodes that wait
  for the completion of jobs.

- The Io_node type no longer uses virtual functions as hooks for
  the derrived classes. Instead, it provides a number of utility
  functions.

- The control flow of the 'Io_progress_handler' is now the same as
  for the session-local packet-stream handler.

- Removed dependency from 'file_system/node.h', which is a relic
  from the ram_fs.

While reworking the code, the following semantic changes were made
additionally.

- The handling of SEEK_TAIL no longer overwrites the file content at the
  end of the file.

- Removed diagnostic message at session-creation time.

- Write loop for continuous files

Issue #3547
Issue #2303
2019-11-19 14:54:13 +01:00
Norman Feske
f0de187bbb libc: increase default quota of forked processes
This patch reduces the debug noise for the prominent case of executing
bash with coreutils. Without it, the forked process will always ask for
more RAM immediately when starting up.
2019-11-19 14:54:13 +01:00
Norman Feske
539110c0b1 base: make 'Fifo::Element::enqueued' const
Issue #3547
2019-11-19 14:54:13 +01:00
Norman Feske
d7b1a89087 file-system session: use same dirent size as VFS
This change allows for the conversion of directory entries in place
(i.e., in the VFS server) and anticipates the potential future merge of
both types into one.

Issue #3547
2019-11-19 14:54:13 +01:00
Christian Helmuth
c50252fb35 libc: suspend/resume in pthread mutex lock/unlock
Issue #3550
2019-11-19 14:54:13 +01:00
Christian Helmuth
54002e6e6b test-pthread: refactor and cleanup test cases
Issue #3550
2019-11-19 14:54:13 +01:00
Sebastian Sumpf
16994d637b libports: update gcov port
removes bogus include from generated file libgcc_tm.h

issue #3537
2019-11-19 14:54:12 +01:00
Martin Stein
b541a0d448 smbios.h: move to os/include/smbios
Fixes #3489
2019-11-19 14:54:12 +01:00
Norman Feske
d4e0d2f578 libc: defer clone ack after FD initialization
Issue #3478
Issue #2303
2019-11-19 14:54:12 +01:00
Norman Feske
fab2fc874f libc: write loop for continuous files
This patch improves the libc's write operation to iterate on partial
writes to continuous files until the original write count is reached.
The split of large write operations into small partial writes as
dictated by the VFS infrastructure (e.g., constained by I/O buffer
sizes) becomes invisible to the libc-using application.

Issue #3507
Issue #2303
2019-11-19 14:54:04 +01:00
Sebastian Sumpf
54643d6878 base: add entry to .dynanmic section in genode_dyn.ld
Make sure that at least entry is present in the .dynamic section, so the
PT_DYNAMIC segment points to something valid in case there are no
dynamic symbols.

issue #3537
2019-11-19 14:45:40 +01:00
Sebastian Sumpf
2653fad0c4 ports: noux_tool_chain_auto for ARMv8
issue #3537
2019-11-19 14:45:40 +01:00
Sebastian Sumpf
b752d22a77 libports: checkout ARMv8 version of gcov
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf
ad12b42d1c gems: depot autopilot enable gcov for ARMv8
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf
c845a2d943 libprots: libgcov ARMv8 support
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf
b7e06a0b5b recipe: gmp for ARMv8
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf
417dd59b22 libports: gcov for ARMv8
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf
3024720656 ports: update make to version 4.2.1
Required for ARMv8 support

issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf
f23eab735b ports: binutils target for ARMv8
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf
112c32eb54 ports: noux-pkg/gcc_arm_64
Added ARMv8 as a native gcc target. This requires a rebuild of the tool
chain.

issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf
3103ce1fa8 libports: update mpc to 1.1.0
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf
db18fc42fe libports: update mpfr to 4.0.2
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf
d28fe9e938 libports: enable gmp 6.1.2 for ARMv8
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf
31a035a907 libports: update gmp from 4.3.2 to 6.1.2
issue #3537
2019-11-19 14:45:39 +01:00
Norman Feske
91412c6c52 libc: trigger SIGCHLD for when forked child exits 2019-11-19 14:45:39 +01:00
Norman Feske
068324536c libc: eliminate atexit handler for 'Rtc'
We never want to destruct the 'Rtc' because other atexit handlers may
depend on it (e.g., for updating modification times when closing files).
2019-11-19 14:45:38 +01:00
Norman Feske
bb6eb0f6ea libc: local signal delivery via 'kill'
This patch adds the ability to call 'kill' with the own PID to trigger
the execution of the handler of the specified POSIX signal. This is used
by 'bash', e.g., when cancelling the input of a command via control-c.

Related to issue #3546
2019-11-19 14:45:38 +01:00
Norman Feske
c1012e6a45 libc: translate terminal user interrupts to SIGINT
Issue #3546
2019-11-19 14:45:38 +01:00
Norman Feske
23d21d77e9 vfs/terminal: detect user interrupts (control-c)
This patch equips the VFS terminal file system with the ability to
detect user interrupts in the incoming data stream, and propagate this
information via the new pseudo file '.terminal/interrupts'. Each time,
the user presses control-c in the terminal, the value stored in this
pseudo file is increased. Thereby, a VFS client can watch this file to
get notified about the occurrences of user interrupts.

Fixes #3546
2019-11-19 14:45:38 +01:00
Norman Feske
8c44b17e86 libc: shebang handling for execve
Fixes #3545
2019-11-19 14:45:38 +01:00
Norman Feske
636e0f6444 libc: cancel select when POSIX signal occurs
With this patch, Vim running via the 'bash.run' script becomes able to
adopt itself to changed window dimensions.

Issue #3544
2019-11-19 14:45:36 +01:00
Josef Söntgen
fafa409cf9 block_tester: use dynamic shared scratch buffer
The scratch buffer is now allocated from the heap and is shared
between the test as they are executed in a serial fashion. This
change saves memory as the test are constructed at start-up.

Fixes #3539.
2019-11-19 14:44:02 +01:00
Josef Söntgen
dbecceec09 expanding_reporter: configure initial buffer size
Fixes #3543.
2019-11-19 14:44:02 +01:00
Josef Söntgen
60f390ddf8 noux: prevent accessing invalid leaf path in open
Fixes #3542.
2019-11-19 14:44:02 +01:00
Josef Söntgen
c79ebc93a2 libc_noux: try read again on EAGAIN/EINTR
Issue #3541.
2019-11-19 14:44:02 +01:00
Josef Söntgen
55ab694d79 libc_noux: leave write loop on error
Fixes #3541.
2019-11-19 14:44:02 +01:00
Josef Söntgen
f5c5479faa ram_block: use Number_of_bytes to parse block size
Using this helper rather than parsing as size_t directly allows use to
use size suffixes, e.g. K, M, G.

Fixes #3540.
2019-11-19 14:44:02 +01:00
Josef Söntgen
ba9b612c4f libc_noux: close fd on failed O_TRUNC attempt
Fixes #3524.
2019-11-19 14:44:02 +01:00
Norman Feske
7b0771659e libc: trigger SIGWINCH by watching .terminal/info
Issue #3544
2019-11-19 14:43:43 +01:00
Norman Feske
e9762ee25f vfs: 'Rtc_file_system::close' for watch handle
The default implementation of this method throws an exception.
2019-11-19 14:42:23 +01:00
Norman Feske
7549189f88 vfs: watch support for Readonly_value_file_system
This patch adds support for watch notifications for the
'Readonly_value_file_system', which is often used by VFS plugins to
implement pseudo files. It thereby enables VFS clients to respond to
VFS-plugin events (think of terminal resize) dynamically.

Fixes #3523
2019-11-19 14:42:23 +01:00
Oleg Girko
a5bc031cca genode_org: Fix download URL.
As genode.org site is now protected by TLS and unencrypted site
is redirected to enctypted one, download URL should be modified
to reflect this change.

Without this change, wget downloads just index.html file.

Signed-off-by: Oleg Girko <ol@infoserver.lv>

Fixes #3538
2019-11-19 14:42:23 +01:00
Oleg Girko
5cd684997a sntp_client: No need to always limit this scenario to x86.
It runs pretty well on Raspberry Pi, for example.

Leaving this scenario limited to x86 for autopilot runs only.

Signed-off-by: Oleg Girko <ol@infoserver.lv>

Fixes #3536
2019-11-19 14:42:23 +01:00
Christian Helmuth
93d3a0848a Remove unused libm/posix.lib.so from lwip_lx.run
Prevents integration failures like follows if the libraries were not
built already in the build directory.

  Missing boot modules: libm.lib.so posix.lib.so
  Makefile:323: recipe for target 'run/lwip_lx' failed
2019-11-19 14:42:23 +01:00
Christian Helmuth
f1b1dd26cf run: tweak CRLF translation in log scripts
Ideally, I'd like to disable expects's translation here, which does not
work. The current setting is the result of testing all combinations.
2019-11-19 14:42:23 +01:00
Christian Helmuth
cd5e906bd0 imx: do not convert LF to CRLF in UART driver
This is done on higher level already.
2019-11-19 14:42:23 +01:00
Oleg Girko
c589660182 Replace ENV make variable with MKENV.
ENV variable conflicts with Environment Modules.

Signed-off-by: Oleg Girko <ol@infoserver.lv>

Fixes #3535
2019-11-19 14:42:23 +01:00
Stefan Kalkowski
8a8aa85726 hw: initialize iomux, ccm and gpc for i.MX8 EVK
Fix #3534
2019-11-19 14:42:23 +01:00
Stefan Kalkowski
105b2c9b7a hw: fix gicv3 implementation of clear/set regs
In addition use uniformly enums for interupt count in register declarations.

Fix #3532
2019-11-19 14:42:23 +01:00
Stefan Kalkowski
f6435d91fc hw: turn Kernel_object into Genode::Constructible
Fix #3531
2019-11-19 14:42:23 +01:00
Stefan Kalkowski
3e3fb63863 hw: enable Genode::raw for bootstrap
Ref #3531
2019-11-19 14:42:23 +01:00
Oleg Girko
4007cee852 Fix MAC address printing in dde_linux USB net drivers.
Passing array of unsigned chars to Genode::log() function
makes it converted to void pointer, resulting in printing its address.

Wrapping this array into Genode::Cstring solves this problem
and makes it being printed properly as zero-terminaled string.

Signed-off-by: Oleg Girko <ol@infoserver.lv>

Fixes #3530
2019-11-19 14:42:23 +01:00
Christian Helmuth
b622a5a788 vbox: use RTThreadCreate for periodic_gip thread
This prevents the following error message.

  [init -> vbox1] Error: pthread_self() called from alien thread named 'periodic_gip'
2019-11-19 14:42:23 +01:00
Christian Helmuth
ec9e40695d vbox: use PIIX3 instead of ICH9 in VM config
Prevents #3533
2019-11-19 14:42:23 +01:00
Martin Stein
0ad0153626 nic_router: fix broken uplink label on re-config
Uplink labels were stored in the uplink objects as reference. As uplink objects
may be re-used on re-configuration to avoid unnecessary closing and re-opening
of NIC sessions, the label reference could get invalid as the object that
stored the label content didn't get re-used. Thus, the label is now copied to
the uplink object.

Fixes #3529
2019-11-19 14:42:23 +01:00
Martin Stein
cd37bff514 nic_router: do not report while re-configuring
Fixes #3528
2019-11-19 14:42:23 +01:00
Martin Stein
27c2a66bbd nic_router: report link state
This adds two new boolean attributes to the <report> tag of the NIC router
configuration 'link_state' and 'link_state_triggers'. The former decides
whether to report the link state of each NIC interface (downlink, uplinks) at
the NIC router. The other decides whether to trigger reporting each time the
link state of an interface changes.

Fixes #3527
2019-11-19 14:42:23 +01:00
Martin Stein
58247737fd nic_router: free MAC on session-creation exception
If a MAC address was once allocated for a downlink and during the further
creation of the downlink an exception caused the creation to be aborted, the
NIC router didn't free the MAC address again.

Ref #3525
2019-11-19 14:42:23 +01:00
Martin Stein
ebcca179ed nic_router: fix 'catch' paths in session creation
The handling of exceptions during session creation implies freeing and
detaching the RAM DS behind the session env and session component. But this
was done using the session env located in the same RAM DS, which must
lead to problems. Now, the session env from the RAM DS is copied to the stack
and the operations are done on this temporary instance instead.

Ref #3525
2019-11-19 14:42:22 +01:00
Martin Stein
60d37f690c packet_stream_*: fix missing dissolve on exception
When the construction of a member of Packet_stream_*::Rpc_object after
the _cap member threw an exception, the object was not dissolved from
the entrypoint although the Rpc_object vanished at this point. This was
because the call to 'manage()' happened in the initializer list (for the
_cap member instantiation). The destruction of the _cap member then did
not dissolve the object.

This first fix moves the call to 'manage()' into the constructor body
after the instantiation of all other members. A more sophisticated fix
would use some kind of 'Managed_object' life-time guard that manages an
object on construction and dissolves on destruction.

Ref #3525
2019-11-19 14:42:22 +01:00
Martin Stein
0ed5655086 nic_router: do DHCP when re-config to dynamic IP
When re-configuring a domain from using a static IP config to using a dynamic
IP config, attached interfaces didn't react with doing DHCP discover. This bug
is fixed now and the nic_router_flood test was adapted in a way that it tests
the described behavior.

Fix #3518
2019-11-19 14:42:22 +01:00
Stefan Kalkowski
87a6368ba1 hw: implement multi-processor support for rpi3
Fix #3522
2019-11-19 14:42:22 +01:00
Stefan Kalkowski
1cbd77c806 hw: implement multi-processor support for i.MX8
Fix #3520
2019-11-19 14:42:22 +01:00
Stefan Kalkowski
e3f82b09d7 hw: instantiate pic object per cpu
Ref #3520
2019-11-19 14:42:22 +01:00
Christian Helmuth
d4a3db22bd solo5: migrate snapshot archive to genode.org 2019-11-19 14:42:22 +01:00
Christian Helmuth
43f28e0451 stdcxx: add more missing symbols to ABI
Fixes #3506
2019-11-19 14:42:22 +01:00
Norman Feske
d516515c7a vfs/terminal: provide meta info as pseudo files
Issue #3519
Fixes #3521
2019-11-19 14:39:09 +01:00
Norman Feske
7ac32ea60c libc: support for ioctls via ioctl directory
This patch introduces a new scheme of handling ioctl operations that
maps ioctls to pseudo-file accesses, similar to how the libc maps socket
calls to socket-fs operations.

A device file can be accompanied with a (hidden) directory that is named
after the device file and hosts pseudo files for triggering the various
device operations. For example, for accessing a terminal, the directory
structure looks like this:

  /dev/terminal
  /dev/.terminal/info

The 'info' file contains device information in XML format. The type of
the XML node corresponds to the device type. E.g., If the libc receives
a 'TIOCGWINSZ' ioctl for /dev/terminal, it reads the content of
/dev/.terminal/info to obtain the terminal-size information. In this
case, the 'info' file looks as follows:

  <terminal rows="25" columns="80/>

Following this scheme, VFS plugins can support ioctl operations by
providing an ioctl directory in addition to the actual device file.

Internally, the mechanism uses the 'os/vfs.h' API to access pseudo
files. Hence, we need to propagate the Vfs::Env to 'vfs_plugin.cc' to
create an instance of a 'Directory' for the root for the VFS.

Issue #3519
2019-11-19 14:39:09 +01:00
Christian Prochaska
07a40d028a libc: fix and cleanup pthread mutexes
Issue #3503
Fixes #3504
2019-11-19 14:23:57 +01:00
Christian Prochaska
a47adecdcd test-pthread: add mutex tests
Add tests for recursive and errorcheck type mutexes.

Fixes #3503
2019-11-19 14:23:57 +01:00
Christian Helmuth
355d94f5df Use NTP server from pool.ntp.org in sntp_client test 2019-11-19 14:23:57 +01:00
Pirmin Duss
c0789a6c0e depot_deploy: status report
The idea is, that other components may know, when a valid
init.config is available.

Issue #3482
2019-11-19 14:23:57 +01:00
Norman Feske
530144b040 doc/challenges.txt: add Puppet topic 2019-11-19 14:23:56 +01:00
Norman Feske
c85bc38802 Move include/gems/vfs.h to include/os/vfs.h
Fixes #3515
2019-11-19 14:23:56 +01:00
Norman Feske
a8dd7dd2fa Remove rump_fs server component
This patch replaces the use of the rump_fs server by the VFS server with
the Rump VFS plugin.

Issue #3512
2019-11-19 14:23:56 +01:00
Norman Feske
6e86d6d699 Remove server/fatfs_fs and libc_fatfs plugin
Issue #3512
2019-11-19 14:23:56 +01:00
Norman Feske
2954abb58a Simplify qt5_textedit.run
The run script used to be the only user of the fatfs_fs server, which
we're going to remove. This patch removes the components for accessing a
real storage device and file system from the run script. The new version
just uses ram_fs.

Issue #3512
2019-11-19 14:23:56 +01:00
Norman Feske
5bb366513b Remove os/src/app/cli_monitor
Nowadays, we use standard command-line tools like vim to edit init
configurations dynamically, which alleviates the need for a custom CLI.
The CLI-monitor component was too limited for use cases like Sculpt
anyway.

The patch also removes the ancient (and untested for long time)
terminal_mux.run script, which used to be the only remaining user of the
CLI monitor.

Issue #3512
2019-11-19 14:23:56 +01:00
Norman Feske
4bcc75365c Remove gems/src/app/launcher
The graphical launcher remained unused for a few years now. It is not
suitable for systems as flexible as Sculpt OS.

Issue #3512
2019-11-19 14:23:56 +01:00
Emery Hemingway
288f79270d test/vfs_stress: annotate switch label fall-throughs
This test was written for speed, not correctness.

Fixes #3516
2019-11-19 14:23:56 +01:00
Christian Prochaska
3c62a33a25 qt5: add NEON-related files and symbols to qt5_gui lib
Fixes #3517
2019-11-19 14:23:56 +01:00
Piotr Tworek
80a84bef26 Fix ram session quota accounting in lan9118
This driver manually checks if the RAM quota is big enough for the
Lan9118 nic session component. The problem is Root_component::_create
from which Root_component::_create_session gets called does already
check this. No need to account for it twice.

Fixes #3514
2019-11-19 14:23:56 +01:00
Johannes Kliemann
022fac0d37 dde_zircon: use fork by jklmnn
Fixes #3513
2019-11-19 14:23:56 +01:00
Norman Feske
5ab1505d43 file system: enhanced file status info
This patch extends the 'File_system::Status',
'File_system::Directory_entry', and the related 'Vfs' types with
the following additional information:

- Distinction between continuous and transactional files (Node_type)
  (issue #3507)
- Readable, writeable, and executable attributes (Node_rwx),
  replacing the former 'mode' bits
  (issue #3030)

The types 'Node_rwx', 'Node_type' are defined twice,
once for the VFS (vfs/types.h) and once for the 'File_system'
session (file_system_session/file_system_session.h).
Similarly, there is a direct correspondance between
'Vfs::Directory_service::Dirent' and 'File_system::Directory_entry'.

This duplication of types follows the existing pattern of keeping the
VFS and file-system session independent from each other.
2019-11-19 14:23:56 +01:00
Alexander Boettcher
1297a8fb57 trace: skip subject_id 0 in subject id allocator
Issue #3510
2019-11-19 14:23:55 +01:00
Christian Helmuth
732215a83f libc: limit fcntl(F_SETFL) to file-status flags
This fixes unintended (and unpermitted) changes of O_ACCMODE bits.
2019-11-19 14:23:55 +01:00
Christian Helmuth
e11addec7d Cleanup vfs dev directory in vbox5_genode_usb_hid 2019-11-19 14:23:55 +01:00
Christian Helmuth
2166a4b17f dde_linux: prevent warning about 'register' keyword 2019-11-19 14:23:55 +01:00
Christian Helmuth
291587f545 libc: honor poll() event flags POLLRDNORM etc.
Fixes empty read file-descriptor sets in fetchurl_lwip/lxip.

Issue #3499
2019-11-19 14:23:55 +01:00
Christian Helmuth
97df705e53 dde_rump: eliminate global ctors 2019-11-19 14:23:55 +01:00
Josef Söntgen
e281174dae libc: bring back old 'poll()' emulation
Issue #3499
2019-11-19 14:23:55 +01:00
Alexander Boettcher
ed73feddc5 vbox5: react on host size changes immediately
The guest may take some time to adjust nevertheless.

Fixes #3498
2019-11-19 14:23:55 +01:00
Josef Söntgen
c5706e8f4a wifi_drv: enable loading of 5000 series FW
Fixes #3502.
2019-11-19 14:23:55 +01:00
Christian Helmuth
1782c6be79 qt5: rework keyboard handling
Fixes #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth
cccfd0719d qt5: prevent deprecated warnings
Issue #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth
edc9545229 input: move control-modifier handling into clients
Moving the handling into the input-session clients enables more
sophisticated implementations (like Qt5) to apply key-symbol based
handling of those modifiers like correct CTRL-A with QWERTY and AZERTY
layouts and distinction of CTRL-J and Return.

Issue #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth
cc611834c9 input: repeat events require valid codepoints
Issue #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth
bbd27a54d3 input_filter: fix de_de/fr_fr character generators
Issue #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth
5a06751242 Increase input_filter RAM quotas to 1280K
Issue #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth
6df8b44616 platform/x86: support 64-bit base address registers
The API still exports 32-bit address and size values only, which works
as the actual MMIO resources are allocated in platform_drv internally.

Fixes #3494
2019-11-19 14:23:54 +01:00
Christian Helmuth
e0af9c2d8b platform_drv.inc: reduce acpi_drv caps to 350
This value equals the configuration in drivers_managed-pc, i.e., Sculpt.
2019-11-19 14:23:54 +01:00
Christian Helmuth
11a7ac0536 acpi_drv: reduce capability quota requirements
Map ACPI tables entirely as one dataspaces (not page-by-page). Note, the
current approach does only merge overlapping but not consecutive I/O
memory regions, which would reduce the amount of capabilities required
even further.

Fixes #3495
2019-11-19 14:23:54 +01:00
Christian Prochaska
5c25e0bdb0 heap: fix typo in alloc(0) diagnostic message
Fixes #3501
2019-11-19 14:19:34 +01:00
Norman Feske
222f214341 extract.run: suppress rtc warnings 2019-11-19 14:19:34 +01:00
Norman Feske
eefe91ee41 depot_download_manager: no mtime update in extract
With the added modification-time support in the libc, the extract tool
requires a timer session, which is not plausible for the purpose of the
program.

This behavior stems from the fact that the libc implicitly writes the
mtime when closing a written file. For this update, it implicitly calls
'clock_gettime', which in turn initializes the timer subsystem within
the libc (creating a timer session).

For the extract tool, the implicitly updated mtime is useless because
the extract tool overwrites this modification time with the mtime stored
in the archive anyway. However, the dependency from a timer service
remains.

This patch explicitly disables the libc's implicit updating of the
file-modification when closing a written file.

Issue #1784
2019-11-19 14:19:34 +01:00
Norman Feske
979d823d85 libc: make mtime update configurable
By specifying <libc update_mtime="no"...>, the modification-time update
on VFS-sync operations (as issued whenever a written file is closed)
can explicitly be disabled.

Issue #1784
2019-11-19 14:19:34 +01:00
Christian Helmuth
76438a3f85 dde_linux: refactor usb arch-dependent includes
Also added arm_64/arm_v8, which fixes building board-independent usb_hid
etc.
2019-11-19 14:19:34 +01:00
Christian Helmuth
b0271ae5e1 Fix hard-disk image creation in vfs server tests
The hard-disk image must be created before boot-image creation as it is
used as boot module by variants of the test (use_ram_block=true).
2019-11-19 14:17:30 +01:00
Norman Feske
6a063364da fs_rom: adaptation to added file-modification time
Issue #1784
2019-11-19 14:17:30 +01:00
Josef Söntgen
99b632f86c server/vfs: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen
180f9e6384 libc: handle modified files
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen
94b63924ed noux: add time modification
... and set initial time by using RTC session.

Up to now Noux used a monotic clock whose initial start value always
was '0' (which correlates to the start of the UNIX epoch) to provide
a notion of time. In addition it is now possible to use the RTC
session to set the initial value for use cases where having a proper
real-world time matters.

To use the RTC session the 'rtc' attribute of the '<config>' node
must be set to 'yes'. Thereby the session becomes a mandatory
dependency as Noux will not start without it.

Issue #1784
2019-11-19 14:17:30 +01:00
Josef Söntgen
d0bf6d2b52 libc: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen
9a82bbb54d vfs: add modification time member to directory_service
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen
400039e1b6 rump_fs: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen
2e5166efd7 lx_fs: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen
2ec3aaf639 file_system_session: add modification time
* add modification_time member
* add WRITE_TIMESTAMP packet
2019-11-19 14:17:30 +01:00
Norman Feske
ab5187d673 libc: resolve symlinks in execve
This patch complements the commit "libc: execve" with the ability to
execute files stored at arbitrary sub directories of the file system.

Issue #3481
Issue #3500
2019-11-19 14:17:29 +01:00
Norman Feske
697d496093 ldso: don't strip leading path from ROM name
This patch removes ldso's builtin policy of removing any path elements
prepending the ROM module name. Instead, the ROM name is used as is.
This clears the way to access different ROM modules that share the same
name but are stored at different directories behind an fs_rom (e.g.,
/bin/bash vs. /usr/local/bin/bash).

Issue #3500
2019-11-19 14:17:29 +01:00
Norman Feske
a17c5e30b7 mk/gnu_build.mk: avoid absolute lib paths
This patch changes the way how libraries are specified at the linker
command line from /abs/path/to/library.lib.so

Issue #3500
2019-11-19 14:17:29 +01:00
Christian Helmuth
8d6285927b tools.conf: fix check for arm_64
Before arm matched first resulting in the wrong tool-chain binaries
being used.
2019-11-19 14:17:29 +01:00
Norman Feske
90a91f3536 dde_linux: eliminate global ctors in lx_kit
As the lx_kit library is used by the vfs_lxip plugin, it must not
contain any static global constructor.

Related to issue #3487
2019-11-19 14:17:29 +01:00
Norman Feske
c8b7710e5d libc: improve dup/dup2 in vfs_plugin
This patch replaces the naive dup2 implementation (that merely
duplicated the context pointer) by the replication of the original
FD state by re-opening the same file with the same flags and seek
position. This prevents a potential double release of the VFS handle
(the FD context). It also implements 'dup'.

Fixes #3505
Fixes #3477
2019-11-19 14:10:55 +01:00
Norman Feske
59c60b8031 test-libc: test double dup2, dup
Issue #3477
Issue #3505
2019-11-19 14:10:55 +01:00
Norman Feske
9500e8b6e1 lwip: remove use of global constructor
Related to issue #3487
2019-11-19 14:10:55 +01:00
Norman Feske
e0ee56275e vfs_lwip: fix switch fall-through
Pointed out by a compiler warning.
2019-11-19 14:10:55 +01:00
Norman Feske
418ac4c560 libc: remove global watch() function
This patch replaces the function with a 'Watch' interface to be
explicitly passed to the caller (currently only time.cc).

Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske
5f5d709c07 libc: remove global libc_config()
Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske
89a38723bd libc: reimplement passwd handling
- Eliminate call of global libc_config()
- Remove dynamic memory allocation, const cast
- Prepare for moving the state from compilation unit to header
- Fix run/libc_getpwent.run

Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske
648bcd1505 libc: unify use of namespaces
This patch unifies the patterns of using the 'Genode' and 'Libc'
namespaces.

Types defined in the 'internal/' headers reside in the 'Libc'
namespace. The code in the headers does not need to use the
'Libc::' prefix.

Compilation units import the 'Libc' namespace after the definition of
local types. Local types reside in the 'Libc' namespace (and should
eventually move to an 'internal/' header).

Since the 'Libc' namespace imports the 'Genode' namespace, there is
no need to use the 'Genode::' prefix. Consequently, code in the
compilation units rarely need to qualify the 'Genode' or 'Libc'
namespaces.

There are a few cases where the 'Libc', the 'Genode', and the global
(libc) namespaces are ambigious. In these cases, an explicit
clarification is needed:

- 'Genode::Allocator' differs from 'Libc::Allocator'.
- 'Genode::Env' differs from 'Libc::Env'.
- Genode's string functions (strcmp, memcpy, strcpy) conflict
  with the names of the (global) libc functions.
- There exist both 'Genode::uint64_t' and the libc'c 'uint64_t'.

Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske
bf92232698 libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.

The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.

The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.

There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.

Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske
aec1178ab1 libc: simplify initialization sequence
This patch reverts the interim patch "libc: init malloc_heap before
VFS", which is no longer needed with the solved issue #3496 and
issue #3487.
2019-09-20 14:16:07 +02:00
Norman Feske
efe7f5172d ldso: prevent premature execution of ctors
Fixes #3487
2019-09-20 14:16:05 +02:00
Norman Feske
0aedabd245 libc: remove global constructors
- readv_writev: move 'rw_lock' instance into a function scope,
  constructing the instance on the first access.
- select: move 'select_cb_list' instance into function scope.
- thread: move 'key_list_lock' and 'keys' into function scope.
- rwlock, semaphore, socket_fs_plugin, thread, thread_create:
  instantiate 'Libc::Allocator' per use, alleviating the need for a
  global instance.

Issue #3496
2019-09-20 14:16:01 +02:00
Christian Helmuth
4a7b0e99a6 depot: update recipe hashes 2019-09-20 14:14:16 +02:00
Norman Feske
614f7fa56a mesa.run: omit depot content from boot modules 2019-09-17 14:38:07 +02:00
Norman Feske
6d230134cb doc: update challenges 2019-09-13 12:14:19 +02:00
Pirmin Duss
d953030c0e lx_fs: respect writeable session argument
Fixes #3492
2019-09-12 12:28:41 +02:00
Alexander Boettcher
6fe80c3cc7 sculpt: add lock screen/GUI support
Fixes #3491
2019-09-09 15:25:45 +02:00
Christian Prochaska
afa0e26a6a qt5: update virtual keyboard example to Qt 5.13
Fixes #3490
2019-09-09 15:08:13 +02:00
Christian Prochaska
1d3bbde70a qt5: add 'lupdate' and 'lrelease' to host tools
Fixes #1736
2019-09-09 15:05:50 +02:00
Alexander Boettcher
6f0c6501f2 acpica: catch Io_mem exceptions
Issue #2998
2019-09-09 15:04:53 +02:00
Christian Helmuth
e448022f23 Fix hard-disk image creation in libc_fatfs
The hard-disk image must be created before boot-image creation as it is
used as boot module by variants of the test (use_ram_block=true).
2019-09-09 14:58:25 +02:00
Christian Helmuth
664d858e63 Fix sntp_client test for hw/muen 2019-09-09 12:15:07 +02:00
Christian Helmuth
ede009edf9 Fix expected output in USB HID tests
Invalid characters in press events are no longer 0 but 0xfffe since

  a97b8043b5 utf8: non-character U+fffe as invalid codepoint

Issue #3483
2019-09-09 11:35:42 +02:00
Christian Helmuth
08aa7d310a Increase stack size in thread test for arm_v8a
It seems throwing an exception on arm_v8a needs a significant amount of
stack space (> 2048 bytes).
2019-09-03 12:12:46 +02:00
Christian Helmuth
19bf0fdeb8 xkb2ifcfg: detect and log initialization errors 2019-09-03 09:00:31 +02:00
Emery Hemingway
36111a2edf Libc: implement getifaddrs
Implement getifaddrs and freeifaddrs within the libc using socket
control files at the VFS. Add an "address" and "netmask" file to the
lwIP plugin.

Only a single IPv4 address is initially supported, and the broadcast
address returned will never be valid.

Fixes #3439
2019-09-02 16:36:07 +02:00
Christian Prochaska
ab017607a2 tool chain: TLS support
Fixes #3418
2019-09-02 16:29:33 +02:00
9326 changed files with 503124 additions and 369669 deletions

5
.gitignore vendored
View File

@@ -7,5 +7,10 @@
/contrib
/depot
/public
/repos/allwinner
/repos/imx
/repos/riscv
/repos/rpi
/repos/world
/repos/zynq

78
.vscode/c_cpp_properties.json vendored Normal file
View File

@@ -0,0 +1,78 @@
{
"configurations": [
{
"name": "EalánOS",
"includePath": [
"${workspaceFolder}/depot/genodelabs/api/libc/**",
"${workspaceFolder}/depot/genodelabs/api/stdcxx/**",
"${workspaceFolder}/repos/**",
"${workspaceFolder}/repos/mml/**",
"${workspaceFolder}/repos/libports/include/**",
"${workspaceFolder}/contrib/mxtasking-07a3844690ae8eb15832d93e29567a5a8e6e45af/include/**",
"${workspaceFolder}/contrib/libpfm4-b0ec09148c2be9f4a96203a3d2de4ebed6ce2da0/include/**",
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/libc/**",
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/spec/x86_64/libc",
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/libc/sys/**",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/std",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/c_std",
"${workspaceFolder}/repos/libports/include/spec/x86_64/stdcxx",
"${workspaceFolder}/repos/base-nova/src/core/include/**",
"${workspaceFolder}/repos/base-nova/src/include/**",
"${workspaceFolder}/repos/base-nova/include/**",
"${workspaceFolder}/repos/base/src/core/include/**",
"${workspaceFolder}/repos/base/src/include/**",
"${workspaceFolder}/repos/base/include/**",
"/usr/local/genode/tool/21.05/lib/gcc/x86_64-pc-elf/10.3.0/include",
"/home/mml/loopbench/**"
],
"defines": [
"__GENODE__",
"__FreeBSD__=12",
"_GLIBCXX_HAVE_MBSTATE_T",
"_GLIBCXX_ATOMIC_BUILTINS_4",
"_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC"
],
"compilerPath": "/usr/local/genode/tool/21.05/bin/genode-x86-gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64",
"compilerArgs": [
"-nostdinc",
"-m64"
],
"configurationProvider": "ms-vscode.makefile-tools",
"forcedInclude": [
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/libc/stdint.h"
],
"mergeConfigurations": true,
"browse": {
"limitSymbolsToIncludedHeaders": true,
"path": [
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/libc/**",
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/spec/x86_64/libc",
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/libc/sys/**",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/std",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/c_std",
"${workspaceFolder}/repos/libports/include/spec/x86_64/stdcxx"
]
}
},
{
"name": "Genode",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/repos/base/**"
],
"defines": [],
"compilerPath": "/usr/local/genode/tool/21.05/bin/genode-x86-gcc",
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "${default}",
"configurationProvider": "ms-vscode.makefile-tools",
"mergeConfigurations": true
}
],
"version": 4
}

167
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,167 @@
{
"files.associations": {
"*.rasi": "css",
"*.bbmodel": "json",
"*.sublime-snippet": "xml",
"*.hbs": "html",
"*.ejs": "html",
"*.emu": "html",
"lesskey": "lesskey",
"*.Xresources": "xdefaults",
"i3/config": "i3",
"i3/*.conf": "i3",
"polybar/config": "ini",
"polybar/*.conf": "ini",
"*.S": "gas",
"*.html.en": "html",
"*.html.de": "html",
"stop_token": "cpp",
"*.tcc": "cpp",
"initializer_list": "cpp",
"streambuf": "cpp",
"tuple": "cpp",
"memory": "cpp",
"*.def": "cpp",
"array": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"string": "cpp",
"vector": "cpp",
"any": "cpp",
"executor": "cpp",
"internet": "cpp",
"io_context": "cpp",
"memory_resource": "cpp",
"socket": "cpp",
"string_view": "cpp",
"timer": "cpp",
"functional": "cpp",
"rope": "cpp",
"slist": "cpp",
"coroutine": "cpp",
"future": "cpp",
"scoped_allocator": "cpp",
"valarray": "cpp",
"regex": "cpp",
"cstdint": "cpp",
"bitset": "cpp",
"random": "cpp",
"optional": "cpp",
"dynamic_bitset": "cpp",
"mutex": "cpp",
"shared_mutex": "cpp",
"algorithm": "cpp",
"atomic": "cpp",
"bit": "cpp",
"cassert": "cpp",
"cctype": "cpp",
"cerrno": "cpp",
"chrono": "cpp",
"ciso646": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"map": "cpp",
"unordered_map": "cpp",
"exception": "cpp",
"fstream": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"new": "cpp",
"numeric": "cpp",
"ostream": "cpp",
"queue": "cpp",
"ranges": "cpp",
"ratio": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"system_error": "cpp",
"thread": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"utility": "cpp",
"variant": "cpp",
"charconv": "cpp",
"cfenv": "cpp",
"cinttypes": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cuchar": "cpp",
"set": "cpp",
"unordered_set": "cpp",
"codecvt": "cpp",
"condition_variable": "cpp",
"iomanip": "cpp",
"*.run": "xml",
"span": "cpp",
"config.h": "c",
"bench.h": "c",
"hash_map": "cpp",
"hash_set": "cpp",
"strstream": "cpp",
"decimal": "cpp",
"buffer": "cpp",
"netfwd": "cpp",
"propagate_const": "cpp",
"source_location": "cpp",
"complex": "cpp",
"numbers": "cpp",
"typeindex": "cpp",
"bool_set": "cpp"
},
"vscode-as-git-mergetool.settingsAssistantOnStartup": false,
"makefile.makeDirectory": "build/x86_64",
"C_Cpp.errorSquiggles": "enabledIfIncludesResolve",
"C_Cpp.default.cppStandard": "gnu++17",
"C_Cpp.default.cStandard": "gnu17",
"C_Cpp.workspaceSymbols": "Just My Code",
"C_Cpp.inlayHints.parameterNames.enabled": true,
"C_Cpp.inlayHints.autoDeclarationTypes.showOnLeft": true,
"C_Cpp.intelliSenseMemoryLimit": 16384,
"makefile.makefilePath": "",
"makefile.dryrunSwitches": [
"--keep-going",
"--print-directory",
"KERNEL=nova",
"BOARD=pc",
"run/vscode",
"VERBOSE="
],
"C_Cpp.default.intelliSenseMode": "linux-gcc-x64",
"C_Cpp.default.mergeConfigurations": true,
"C_Cpp.autocompleteAddParentheses": true,
"C_Cpp.intelliSenseCacheSize": 20480,
"makefile.buildBeforeLaunch": false,
"makefile.extensionOutputFolder": ".vscode",
"makefile.configurationCachePath": ".vscode/configurationCache.log",
"explorer.excludeGitIgnore": true,
"makefile.buildLog": ".vscode/build.log",
"definition-autocompletion.update_index_on_change": true,
"definition-autocompletion.update_index_interval": 5,
"C_Cpp.intelliSenseEngineFallback": "enabled",
"makefile.extensionLog": ".vscode/extension.log",
"makefile.ignoreDirectoryCommands": false,
"html.format.wrapLineLength": 80,
"editor.wordWrap": "bounded",
"editor.wordWrapColumn": 90,
"editor.fontSize": 13,
"terminal.integrated.shellIntegration.suggestEnabled": true,
"git.mergeEditor": true,
"merge-conflict.autoNavigateNextConflict.enabled": true,
"git.ignoreLimitWarning": true,
"customizeUI.statusBarPosition": "under-panel"
}

View File

@@ -41,7 +41,7 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -683,7 +683,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@@ -698,4 +698,4 @@ specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.

73
README
View File

@@ -4,17 +4,19 @@
=================================
This is the source tree of the reference implementation of the Genode OS
architecture. For a general overview about the architecture, please refer to
the project's official website:
This is the source code of Genode, which is a framework for creating
component-based operating systems. It combines capability-based security,
microkernel technology, sandboxed device drivers, and virtualization with
a novel operating system architecture. For a general overview about the
architecture, please refer to the project's official website:
:Official project website for the Genode OS Framework:
:Website for the Genode OS Framework:
[https://genode.org/documentation/general-overview]
The current implementation can be compiled for 8 different kernels: Linux,
L4ka::Pistachio, L4/Fiasco, OKL4, NOVA, Fiasco.OC, seL4, and a custom
kernel for running Genode directly on ARM-based hardware. Whereas the Linux
Genode-based operating systems can be compiled for a variety of kernels: Linux,
L4ka::Pistachio, L4/Fiasco, OKL4, NOVA, Fiasco.OC, seL4, and a custom "hw"
microkernel for running Genode without a 3rd-party kernel. Whereas the Linux
version serves us as development vehicle and enables us to rapidly develop the
generic parts of the system, the actual target platforms of the framework are
microkernels. There is no "perfect" microkernel - and neither should there be
@@ -22,7 +24,7 @@ one. If a microkernel pretended to be fit for all use cases, it wouldn't be
"micro". Hence, all microkernels differ in terms of their respective features,
complexity, and supported hardware architectures.
Genode allows the use of each of the kernels listed above with a rich set of
Genode allows for the use of each of the supported kernels with a rich set of
device drivers, protocol stacks, libraries, and applications in a uniform way.
For developers, the framework provides an easy way to target multiple different
kernels instead of tying the development to a particular kernel technology. For
@@ -37,7 +39,7 @@ Documentation
#############
The primary documentation is the book "Genode Foundations", which is available
on the front page of Genode website:
on the front page of the Genode website:
:Download the book "Genode Foundations":
@@ -65,34 +67,30 @@ The source tree is composed of the following subdirectories:
:'doc':
This directory contains general documentation. Please consider the following
document for a quick guide to get started with the framework:
! doc/getting_started.txt
If you are curious about the ready-to-use components that come with the
framework, please review the components overview:
! doc/components.txt
This directory contains general documentation along with a comprehensive
collection of release notes.
:'repos':
This directory contains the so-called source-code repositories of Genode.
Please refer to the README file in the 'repos' directory to learn more
about the roles of the individual repositories.
This directory contains the source code, organized in so-called source-code
repositories. Please refer to the README file in the 'repos' directory to
learn more about the roles of the individual repositories.
:'tool':
Source-code management tools and scripts. Please refer to the README file
contained in the directory.
:'depot' and 'public':
Local depot and public archive of Genode packages. Please refer to
Additional hardware support
###########################
! doc/depot.txt
The framework supports a variety of hardware platforms such as different ARM
SoC families via supplemental repositories.
for more details.
:Repositories maintained by Genode Labs:
[https://github.com/orgs/genodelabs/repositories]
Additional community-maintained components
@@ -107,13 +105,32 @@ system scenarios.
[https://github.com/genodelabs/genode-world]
Community blog
##############
Genodians.org presents ideas, announcements, experience stories, and tutorials
around Genode, informally written by Genode users and developers.
:Genodians.org:
[https://genodians.org]
Contact
#######
The best way to get in touch with Genode developers and users is the project's
mailing list. Please feel welcome to join in!
The community forum is organized by Genode users to help newcomers, share ideas
and experiences, and discuss Genode-related projects.
:Genode Mailing Lists:
:Community forum:
[https://genode.discourse.group]
The mailing list is the primary way for reaching out to Genode's core
developers, for receiving announcements, and for the project's annual road-map
discussion.
:Genode Mailing List:
[https://genode.org/community/mailing-lists]

24
README.md Normal file
View File

@@ -0,0 +1,24 @@
# EalánOS — An Operating System for Heterogeneous Many-core Systems
EalánOS is a research operating system, based on the [Genode OS Framework](https://genode.org/), that explores new architectural designs and resource management strategies for many-core systems with heterogeneous computing and memory resources. It is a reference implementation of the [MxKernel](https://mxkernel.org/) architecture.
## MxKernel Architecture
The MxKernel is a new operating system architecture inspired by many-core operating systems, such as [FOS](https://dl.acm.org/doi/abs/10.1145/1531793.1531805) and [Tesselation](https://www.usenix.org/event/hotpar09/tech/full_papers/liu/liu_html/), as well as hypervisors, exokernels and unikernels.
Novel approaches of the MxKernel include the use of tasks, short-lived closed units of work, instead of threads as control-flow abstraction, and the concept of elastic cells as process abstraction. The architecture has first been described in the paper [MxKernel: Rethinking Operating System Architecture for Many-core Hardware](https://ess.cs.uos.de/research/projects/MxKernel/sfma-mxkernel.pdf) presented at the [9th Workshop on Systems for Multi-core and Heterogeneous Architectures](https://sites.google.com/site/sfma2019eurosys/).
## Task-based programming
EalánOS promotes task-parallel programming by including the [MxTasking](https://github.com/jmuehlig/mxtasking.git) task-parallel runtime library. MxTasking improves on the common task-parallel programming paradigm by allowing tasks to be annotated with hints about the tasks behavior, such as memory accesses. These annotations are used by the runtime environment to implement advanced features, like automatic prefetching of data and automatic synchronization of concurrent memory accesses.
## Documentation
Because EalánOS is based on Genode, the primary documentation, for now, can be found in the book [Genode Foundations](https://genode.org/documentation/genode-foundations-22-05.pdf).
## Features added to Genode
EalánOS extends the Genode OS framework by functionality needed and helpful for many-core systems with non-uniform memory access (NUMA), such as
- A topology service that allows to query NUMA information from within a Genode component.
- A port of [MxTasking](https://github.com/jmuehlig/mxtasking.git), a task-based framework designed to aid in developing parallel applications.
- (WiP) A extension of Genode's RAM service that enables applications to allocate memory from a specific NUMA region, similar to libnuma's `numa_alloc_on_node`, and thus improve NUMA-locality of internal data objects.
- (WiP) An interface for using Hardware Performance Monitoring Counters inside Genode components. Currently, performance counters are only implemented for AMD's Zen1 microarchitecture.
### Acknowledgement
The work on EalánOS and the MxKernel architecture is supported by the German Research Foundation (DFG) as part of the priority program 2037 "[Scalable Data Management on Future Hardware](https://dfg-spp2037.de/)" under Grant numbers SP968/9-1 and SP968/9-2.
The MxTasking framework is developed as part of the same DFG project at the [DBIS group at TU Dortmund Universitiy](http://dbis.cs.tu-dortmund.de/cms/de/home/index.html) and funded under Grant numbers TE1117/2-1.

View File

@@ -1 +1 @@
19.08
24.11

View File

@@ -1,52 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFqQDrIBEAC7hA8ceYe/eMqWMUG74miep7D5q2ebbvSBJW69NuhjWefDQiey
sJGIk52ZlHvVsXe/DR1GZ3uWyQVUufWU4hlcphmzzd3RJJ+MF4yhd0YbaefVL7vb
g1soEgBGVsnLBW/sUDEcF1sIe/gh/HcZVWebFr3mCE9AVv/juroDVRL5Eah3YJbV
wOQeMKhYzKUszEuYQGbNw2E7u/M+JUqSfAw49gtlT/HH2jJGF00YJo7SCRRzd6MP
n3e/Fd6nVLcjpDJ+M0pEqqK/Uuiz/2VA6uU+IubqN8JoSWwbxvc09bafet3/CIAH
78M5IrpHsPnH12odI81VRkAT6yjnjC3SjeGjsTeeayKmAt0gn5PAqqpK0Wt9R3GS
xReEYBxqYWoKB1v85eSWlJ0jwjX6LFST5nR/R8ew2k7uLjY9tb0tIGbiG/ECpeHC
kIeO1bXiCtca30rlXaT6U551m2Zhi8mwAGUxiuyLJQ+m0pXe82BB3hSDRUhQJ1Ra
sCaRvwPZdRCDDdhObkgkMlYROVNdC7ju8jZmB4n5O/5N7Ll7/RVhUWD7KeJu1UTM
oNEmhxEMrEcYcHFt8N8YVtJleRMVnsrZBNxOkFnpsPZr02XIQKfYi5tqSaBQZ47h
TTtXP3+FEaU+EoJprWqH55Sh97Fg6vuBJEmcGJeMGudFrypTzwqnM22DHwARAQAB
tCdKb3NlZiBTw7ZudGdlbiA8Y251a2VAZGVwb3QuZ2Vub2RlLm9yZz6JAlQEEwEI
AD4WIQSFq6G0496kOfRE2qnpSz5BlOa1+AUCWpAOsgIbAwUJA8JnAAULCQgHAgYV
CAkKCwIEFgIDAQIeAQIXgAAKCRDpSz5BlOa1+NGTEACg69FezAbc9Rzeb7j66NwW
3x/Zpi/jbmezMEtCZqAOcR8HJ7C0DN8gmCWPPB6oxAEeyL/i2cUb+9F0fTD6N7OL
TSOH75mNlyB9b8D2HdDILnLy4ClEitEOHFLMnlP58PGVtUNgbmsiM6cLLQtlJKvg
1xHlBTG9Ic8qgBcd808lLSC1XWN+nufVYBTE2RHNZqGeIWqPG5z1eW/JJO4M3V3j
MAw1p5Rpf9G6iWNxURutQOl/ii+97IKmHXX7N6ZRzawMGkOCAGNk1xeI71wCrALv
i3m7NmXb6XIJjD88hO5xfjjRO/0Gcw3vdmTXcVNzM1TvWj8ZsU6XjnMvNxa4LHqh
MxWuHlX0cAeCOzo1LJZ54f13hJ3YlTCrv68UIoNGRVi1LEbpE0sU0Ycdbw7ur2Gt
8Brx5WXv3hXTL8s3fmJzYU3/cFDfXjnaRiMWcNYdvckdHy6R7zPTk1NOvmfkolnO
W73ivdbonXpn0YqRGo2L76GdahLaVYn2gEeisqHnyeBCvI2snI+dMlEK0YNFrEkP
wgtWnF131Oorn0HMS6mpjcq4su4s5d84KCMGevFnW69oBRG27Bk/fJQiv2dSqkZg
+3TnyNApg1G7Bp5uD83mOvJWKdTWAntCJSQGbg1dmEsOBG+Bu7EE5LVBoMH3h/LQ
GB7c5NpgNIFQ2DZy2vkOI7kCDQRakA6yARAAws48PKN3BQPEM0M4kTO57/OqwGrA
AMlxnB3n+AP7rtZEC2L548+3pfg7Ub45Oq1X0ySxgPhV15CDUEK69pgs0JhphMbM
DyaUp04DyQWFhdueAqQVFnKvg6nZm/WIJF1VYEc0/q6Ramsdv2cWdxFBkFHYsH3P
G2bXCZZAEO6eJI8cdmBH6+bVptky/AybzBLztp1ruWlj+rm79qULmW7zJfxYwL1U
4MkSN6+nQ2diU2tsOOcENKzuQbB7N1Pdp4VItjIq+65z0U81iPGKMwVjcilx9pVV
C1qf1YvsqsNhWcUCTDiPUrXW65ppq9VcQmHpNKtnrFEpQ3SjjEezWbiEmN5Ua8RJ
NKT6RAy07wO8Fx2kUmnXiHgOu7CYAgXo9jwR/mWdnh3qNAtfvF/BS/EC/F97vWQi
kAVN0Y0H9EGSEoVyKwS1DErzcBgajPKWedKlmjU1uIzupRWn5oqetVbNfZ3Z/EJ/
HdMCX0PN1kxg4WoI9mkP/moly1yopVOTTLJwvC2C85NQUmxyZeb4h9O7toFczBxn
7pV9Eprm/xRcO3ZEEpmdM7gR3+R3PpxkjgPIZAn9il32VYzdT3eQmDZ8sKC0qASG
ik2if34YnAggGmsrVB0nzT9fZR7CQq2IR7eohczLJRl+n7USQMgRweF+sl9PcbDT
aC0b0i+VveSEBOEAEQEAAYkCPAQYAQgAJhYhBIWrobTj3qQ59ETaqelLPkGU5rX4
BQJakA6yAhsMBQkDwmcAAAoJEOlLPkGU5rX4QjEQAIJF78XjvGomhafMsWlcd7fP
/j45B+KIpyruc7wHtLqWibi+YoDuvtG4m1/4Ckcz5qNrV0f5nQojEAeCSCh7Sl+s
yAJ9tmP1XET29DJq1t0iMsu+RDCLhdOfL/Wi/YJARtDloYbDlD8Rc/JnL2aOx2W/
Ybajj2lloxSDxKCnzCh1aZixie1YaQSm8ErshT2k4qTx48D3mRoBLAYyzdEbLkl3
ZBGDQy3Xk/miJ/hsj6L3w3G2YjMywZZZEjgDSUgSJ6MazBTgMmbCy1/0YGh7rNF7
iUoWyDZq4qiDGNAI695I6tas7s4X2dhZn10xgbJoa5Dq2rqQLek+ErEsr3DFYN53
7e9H0vJ9ydXB7piRJ9bxVFBng5CX9677IN5k9T/0lvcZWAFnDcHiMkIjIrTQ1Y04
WkG6DMVvzLD+PKA07cZLf692rsrbfpP4sGj8X6baWh58mGAMMwZ2Dy07grsi73qI
p/H4r4c/xRsH6nTbvb40zLfqcCz1xOTEcDtflYGMoeshu/H2EoruNMFi3c/9WO2G
3zrSOUenWFSiacbsh8HVE9HUFGddBTB3SrLddO5vvvi15OvGI4aWpnkW+9s4107h
jE0d0+c/Xm4AS0T59OGj/cd45k/vRe5vaPhQobZ6hXBzkKWPVt5uH8xbROiGiqdR
jMuaeWIldeJ60aeu39Dh
=JE0L
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -1 +0,0 @@
https://depot.1337.cx

View File

@@ -1,37 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQENBFm3BlYBCADR2ZGIWiYurf/urQ+rAZs3HMobXQ/fckc3FOAdY9qiklrvPr9s
maZZyMF+Wn4J2AmsGctJbBUt3ujcmk09AgZIzrHpVJRagUSz9q+bK7NvAfenDC2q
w4HS5yE9DYxXOjxrcS5a2HhKfE5sZef1zPtFIkEZCJXCvh4IL6maLijOrUZPf9R6
VJ+0itNh0hK9KiYsKA7CwrWuFaw7ZenVkEBV1HGXybFh9aInTTSqopyU6qYLDK1X
U0NG24cjM8TDbMGTaoScpLchcftBGEhjYg7Y2FCu455MDVdrmoOoxDINYgDU1KN6
8GBKKJ+xqG703/o550l+rCMB+TxMN5zKTFhXABEBAAG0IkVtZXJ5IEhlbWluZ3dh
eSA8ZWhtcnlAcG9zdGVvLm5ldD6JAVQEEwEIAD4CGwMFCwkIBwIGFQgJCgsCBBYC
AwECHgECF4AWIQRuEEFO5xYHgfX+6P+xTQQ6JrPSxwUCWgHubgUJAZm9OgAKCRCx
TQQ6JrPSxyJ0B/0eBOIloo3zJwtuQnNXe2ZFAmHFF7MJhrr0IpZ0n5K0OHTFPqXN
VJ+vhTGuI/SlF3a9YEHohIT2KKal1aq+/wVkX6Kdi4G4nGTEXdRsTwlzN/GXHBPF
IW0iUOInJOliKReaamsR/rgXXH5sstq2IU4x+NpHMT/OrkQPNSqVX0RjS9i76Awo
+EqdtW8g3y8qWd8WtTfhbMlQLhuzm99aADbspr4nK9WhZ7UHYLJAz/u7LzZlRiI5
hNa85BCPhNuYz5NTHhn4L9r6PdbKPzUV173XrlAtlteYuGIHk4d/zSAwlgDevChL
0MDRq1vvgfQ2V0SwIqRqIfnO31Ph8uktJ8WRiQEfBBABCAAJBQJaAReyAgcAAAoJ
EIZq4LBroLaERpQH/3Dw0H6N9YF2ATmkse6NNNQjxhKSUoA34UBWj0v4Q1AvXEe6
nHRR0mAa9Gije9ixKUg85VbKM3lUhXCFqW5jzyzpF1rzzTpAHaUTYKb8M2D9iRKo
9ejTK3KrgpstYJ8jthfosxeC+lK24WUXKKWPjgoIhv7Thd31ea/PZdkFVd1MpSwg
5BHRHcogsJI9uou7zWYbap9/k0lxKHJWklLh/oXet+aAoUIL0kTU+nILy3/RZJGW
9WlnZR9g3qSQ8YNpgNSrraEtXpcs6MGsWZSzbzJ1U95NL87NbWEOYgHZA++vhEy5
EXVrd8SuSHbUbqNF36gz1cxmEuKwxAaWZ1/UbGW5AQ0EWbcGVgEIANC9LozG/TXV
4j0TniuLrsq7kkNH+OJQexcD19pBrmEV4eYYD6c8BB9CaBITqvKIqtG0VJrmB5S5
D0oW4mQI+TkcX+Q7y3S7dUkc856d03aUX3vVcNhXEbNgM19qxAGieC8WH2kr4XU1
psu1WvFCXOktrE5c8H0rPCQ1jseB0S67XCA9BLwAqlqu0OuTpbWddjXuE1ahi0ig
Yt5YsHvgCMLup208azQqGCnJ5tFotqzbLg3I6+QzMcLySqsN4BzYmUGbOSSZdUhX
DWxwAK1dB8qa27iwsxCMncdGnqOTkq+mXRmu8ztPTUivyC6YHJ+O5lXvMMADZi4j
8RpQQlh5gFkAEQEAAYkBNgQYAQgAIBYhBG4QQU7nFgeB9f7o/7FNBDoms9LHBQJZ
twZWAhsMAAoJELFNBDoms9LHTmIH/0PuzpA3Ezdrb4xfVwnhUUZGiqfNzULCZipT
qtfym6Ove6To4BbXAihWwnCYs4sgipabW1WaXsDDvU+AmOmz4EPyTna23fUzYRSL
MT/kk77d+BGRGeA8/Gj/BgjPlHlFa7ukbT1DL1lSV0RMQ32tDGnhJ7wMBx4GoYU+
xjlsxrYKKdvZKOQVCCFn4KY/GavqT+8pYYI63stSPGspboQR2iboKqc350MVMvzz
IaDt14YiOYlgV6LoNj2VaPJvFqm9ML+plYl4PPQZTV6KAhFWCDJq2DzEQqwG6RU4
SsneHAqMlG4A5SSMTLEd9F2gZ2sJicybr1WbNLj1KF74ckUhpM4=
=p4q9
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -1,51 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFuhfGYBEADOj0EW/U2O3koeGIuNGDuBDSzkYjncoBrrPN1z69hgK349xiP7
ZwrPBA0kJ3ctLcRQcOEDF5XJzjByuNk3JV6MuKFqwy2i9dDTHkv5pv7Na/R3L2CM
k79weVahjPllt9nnbSMMtYH0eL187EhLW9owd0CY9wDj1lhLISHpyKvb9vwiUAwQ
i+xypGgU+Qvf8BmfTDdjfP0n+Iw31z+R3xiHhWmhrs9gID2XVtGZIy9NQQrijJYS
1Hp8hjgH9Fzmj0GkxUI+2mEqLeEp6wBmmo+7PRzc+iRYJNocyRxDbmdE0eyh3P93
QABzZiWTU+Feq0MYa1FK55uFCFHe6MSFLq33CGYMzQ9oFQHjuEX1KqJT/OoumPgN
iEb8Bt3XmqiI8GejafLKIW8gO8tYLABdrEpFelnyXy12IIOpOwb8GrxFUEu8+bDb
Fc0YkV7cZ4NH2Kq/6/Or30gCA2XUpqhDNSxA6jer35a3ZzvgXvcRkNR/oOt+qt/3
u9ew+e6Xjque0PRWzdavVlKdYWzSV8umVw5DGgQj/rSn+8spog/5w1lElyUa/5Yx
Z+1bvOIyXPg+tTLimWtGRZQorak1sMsLMDqQck9SwOQWpSmVGsJ14uWXSMaZjdj9
4rHSSymYlcQWP8t9lfPf6/ZSH8574PbbJSe71UXcWWznSGprSt2QQAQ7NwARAQAB
tCtNYXJ0aW4gU3RlaW4gPG1hcnRpbi5zdGVpbkBnZW5vZGUtbGFicy5jb20+iQI+
BBMBAgAoBQJboXxmAhsDBQkDwmcABgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAK
CRDJZVRAR8NPkiTSD/9xiUVNgKTkmH9WRdCcaHuyhKoQI6CsWnMOW5OZ+gVXPc9U
LapQ5Wymb+yGE8Uyn4EJnwdEa8TdWztMs3TNtK5vh1Pk1lKmtKcblBiDrUPEURhR
mUBoUkMe2VDXyN27e0lkbxcFJ0HrYnhvb72Yfnw6B3XMa/NIhbOU3ttB/tVR6Kjl
YVDtTokfILQc07Ai+TqkqNARtPGntHAn9qFvPLNKI31c+Xw/QGZbVPNFW1QAYBiO
5dqsSwKaouapHAb0GBmU0fAfJZNcvwt9Ph7WDXU9Ce3LZmIshGW7Gzm7EGdf4VS6
k4OtEWZhZHRnl9/sBJ2UlQU0tFs3ow53aDZQIa4FKd4JKabBeRgDUKCGEyfoNKCq
NKkLZaR/kFA9EqTPZSIXPLYIzIlSFoL3LVDOc5O7hDT9vXaubdZeAfE9VcHDdm3u
usW034F0zbsuu4G83qZ6QhDOp0UhujfSU+BDkH0I+OfFyVkQAmy69J3byi7Iluno
OcZM13rbe30jzyyyWAnjHicAt8tNwCLMmnIRvYT9ELqywID0Zzxkct61eJQ6L6aq
/DnUD9Kq0OwdxC1wMGtimX5eUnN7S7y5+TMRepJnWcTtgrLBVqwRrvSLnsKVd4Gb
Bu3dSs+BxMV1UcyU0KWwDPY2D7k8SGgeH7IEPo/JiGO8RrWYJRac9qel9egMYbkC
DQRboXxmARAAoaRH/xgKvp0QrNFJZBW12SdXT4h1nXglbpZd+bUl738LqM2JSIC5
Qq7t2DUtOiL9UxqvRgAIjkVLR+hHJBZyuPOP5Ebaf3Mr7eAdmCx2TMsHZPKBLnTy
EqeUcnPwThNKcUaGsQYlkxIQAJtPzy3YBuDCYnzzSi6KzP3VC8szHsXcPo2DeKWI
m9BbMMSQkB3m0fz8W3ar/64RDoubRWRJ07b7q4WUb4jPvql+Tz+Gv5x3qm8g6m1j
uD+U5OhGCe3m5/MsI2JYdWXEwif8YD59gylsj3LJIu3i4SkR8aS+x6n3LIvdSCOt
P3To87wfoSqBWWObVe/vOHRXqpzEF6T/ih/rkhUFzrHNMziTPsujBazm82AUZ6xi
2TddbdSAK+ZpSPQjyyRflNyNgv0iu6P3BnBgv0Xcuf2RsDMBDjdvHtX0lXkPMB+r
6jgxl0faV6UktH5R2d4Zt9i0/vWlZZd0MDylPNQDiKs+qSIX3ntfUUaPdEJqYAwM
gloXr3cZtsVh+Yoqt8pa4x0x6kqez+oyBUFf6y1FCKYq2H/QfPRkF/DrfZS+7jXW
iAX8PcrDceCN6Dr10/g5LPWXQOHUWxCu7FEYoYJsVXst4N0FnCOCe/OGYIhMteSV
IJJvNS4qwXZKKZ+cmuT9skEQ6zsLV9+VDYMwVqXB4wTp4EwT2pCp6LEAEQEAAYkC
JQQYAQIADwUCW6F8ZgIbDAUJA8JnAAAKCRDJZVRAR8NPktRiD/9qjH6uuT1y5uNA
4E8u6/vxZGsyBG57dtnQ0KQbcsZSrUxMiDTtMMrklsl2vtut/XDroajm+d2eaQ4K
j0h285VRkT5xJ79JaIQ8oyzRWBtpENy0iLUm7CmqCMuH8VFifZyEBYZgR/K+9ago
WwF3sk0QP0WJTFqIZajKK0Lo5Juk8DCXjvtkvGNytHkZ2vEkiZ9m7Eq0AjQnts5T
PdHkob7Z8fu0KfUMoCUtb+TzNyMYOVGE6uTfo8wKvbhwzUWSymZkrecx73XUUmew
MdZ2WzwGdUMXwcBZ4LvgrZVg+LKxR1lyJ+qbIUpDKXCZGGH2VZVaQspgnx2Yt0EI
Zl2ELMrTq5IcOkxtblEZpQkwaXszqUDNO43ezp/PmbTRWChoM/k3RAbp9rvoYx93
UChyRXpJRaqDxK502k3BSnOfmolpQvxTMKtLZO50URa0F0F4qD2csns4QrqOWsGr
qPqVKcLn8Q/yMW9fm5+xX+ZHICKk64GAB0YyHcw9lOWekLhGzZV1KnD5ID6+5E0B
nsWZB6PDqLM+/ykXh0rcN8DWwZvhimI5/dOEIWIkADKT8WGwh+2JnRyimhxYdaiH
ul1BvZAYqF1FVXAHd0u48MssLywGGbW4fH8D9SM+LFpP4+8oYFLNgH1OreMENuag
i47EaxpnQUgIt8PZ/gL3LeiGs8SNpw==
=flyM
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -1,31 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBFpT5C4BCADHk4DtY2IQI6KlE+2td4wXKw0dILOobGExRffOgdB5d0WWKQgW
gFw+UaywFxgJT0p2b7XoVsXE0bOz4tQRMdMxtYhL0qAhyj9+DsqqCBp0EcBD3XEz
spm0DdNCEVfUbIQUstbSNt1kDGIlqPvZmoRj5YwDECW6ULG8jTWhaAz9SybJCE86
jLPzZHjKtVhCVO1X0ogSxvvYGemUpqVCLfKcIb1TucieKKCrnjiHwp0XZ41DWqSb
kBwWW2YQMEsw8JNGNTfCCUFf6+1l4mMixtv2sEqFiH1wQJ0c4gSa4iSYZ+eNmzJ0
B13K8kONOctSg3NYZz/dC1aUzLOTkgJHqEPHABEBAAG0KVN0ZWZhbiBLYWxrb3dz
a2kgPHNrYWxrQGRlcG90Lmdlbm9kZS5vcmc+iQFUBBMBCAA+FiEEI2X1/oP+p+Ls
2L28qrC4CLnp/P8FAlrQZGACGwMFCQPCZwAFCwkIBwIGFQgJCgsCBBYCAwECHgEC
F4AACgkQqrC4CLnp/P9kKQgAxc11eDhYkMVg9cuipFoqtV5lY9aT2qkocZ28IhbF
LXhy9lcn5FlxZSVdkzJQ5tUf4nSuhhMb6z3r8edaOebcYAyFk0DTymNpcEyT2XHd
lsOcInhfU423m1tCNHdmxtv9HERtj2zS1KNkjWxY6xsqfEw1eDfUvdS3K9KpUqc6
vWZwsPd9EHxW3mzWJS3lrSAnNsCwtdmiqB9045Yss4KednMcN6qxE+uHppQ+25Ib
5ZICpiVqOJ+eQXeY3kRx84lfZJr3uFdn00RSU5fn0uol8ZZYX9tQd9SC1GIlkyYj
HxNLKNVaYzF1nnmR1s7cpY6PUAYbt0im6kd4VJ1wQcWTnrkBDQRaU+QuAQgAuame
2VDCgNmiwu+QmWyNN4jzbE7+VNmDr37HO9lZRIROC4eACPOGfUL03jLGvUn7rrxQ
JK+Pit6gXXCoIWDhCMNRSZKho416KJZWxF2jxKBKGQ7DtWaTR3YOzSf0ka9DZSrp
wG22xS0Uf1U/0ZBIf24LbyUDFLc8zt4eey2D9AHm+9vCf7wnf8TV6SNIXRz3wj7d
VqoZLXRTT7twBSaNahLhNtg7fhS8Nu6/THuwXpNKPAvAsgJRTGk7kmrKj5P7rOZA
rNHC1pvK1EWJJi2onHOmCzBccKRp9SeQlj+ddqG6seZhEnRYG6l7uhkyNZoyvKxO
Fguc5g8Xf37VyuRMfwARAQABiQE8BBgBCAAmFiEEI2X1/oP+p+Ls2L28qrC4CLnp
/P8FAlpT5C4CGwwFCQPCZwAACgkQqrC4CLnp/P/IOAf+LnQVtU7aHh4AZDsi1wXq
KBo5l6r3G8tC/S0HEf8nnWMUio2/mwVrkbuTvBeKrcQ/mXFHHAG8YCAIHPgR7T0y
2L6l2PL4HoXiLD8EwJ0sWZu2waxuxcTX+bb1i3Xm3squnqDtCX3pyoXWx0GVgrz9
7I/zitxeER+35ScaZ+JAAcNW59LpiV1SdIXqbtrw5QBJBuZUp0bvnzCNvdZLhnhb
gWfwPEfcXFt5K87iTmfMFJOJpbUrEz/NWE9gOBCBjqxW0wVb+IWr0oFWvfxjuBq7
IW9DezwkN1wAavP6g7+B4esCD6SRq+3CCzbT1By3X2h3SevU8tHkCSA3cIKgWdyD
2A==
=IsaH
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -1 +0,0 @@
https://s3.eu-central-1.amazonaws.com/dev.depot.gapfruit.com

View File

@@ -1,18 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBFrq0AsBCACyr5B8jH93vUYAspNeiiNd+e71gwA0ftJQJPMp+Fyr+02gI68W
OZmxndHTDIuZkGsgRBkaeeHVbkXi0Br90oZClZKRkhseXgx5gcsvt6FsuakFwf21
MNLYWNiKZhvntdJl7HYTxQ3rx3wMnYOyFhQRORQdSQS3i53CXoT7l+biJGH2ylnu
AfOL5kOP60wrkP+S8tXZRmvXdhHMEy1sqKZoCuo7mEUmZnA4AL/A8n98jDSXw/bP
xAMRSedqN4VAgTRBtgZTCDOU19Q0aRV/eEUsuZTHEU3qhdbHcrmXB2reiRjL+Ol8
EY1Alb+p0c1SM1CmEKpSlpsjDJvzOSgPJuxtABEBAAG0MXRyaW1waW0tZ2l0bGFi
LXN0YWdpbmcgPHBpcm1pbi5kdXNzQGdhcGZydWl0LmNvbT6JAU4EEwEIADgWIQRm
OLnH3fFNXDibg3lDqO6DjZnR1QUCWurQCwIbAwULCQgHAgYVCgkICwIEFgIDAQIe
AQIXgAAKCRBDqO6DjZnR1YNiB/45yYuznT9vi4o/NX1excQKA253CRXhPZii+gCn
FIQk8dAO80fymdH51+h4WR2i1Vwgqrpfoss8dnZ/2BCseOlYbTco0NFISOKcwrTM
ia/R8M4hOk3pAr/+5g5jKijQtYW1P156nJkINsHfxS15lfJwZkiP+FsSz4eV3Qrd
RmBNrlZnUgV87O0my1gDoYwtP95D8qTErB28wQeBXSqoLxu1AJl5KqrFi4nAEgmj
ZYk3abmyYV4KNQGzp3ju0BHdcW8dC/arvAfFJQPc24dH7STHC5ZvF6lQS9gDjDpS
dgtpVymFUkxm9E7z34atXfZgtv3eSy5t8sJv8F0+j+qxiNWd
=Wf/A
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -1,503 +0,0 @@
=======================
The Genode build system
=======================
Norman Feske
Abstract
########
The Genode OS Framework comes with a custom build system that is designed for
the creation of highly modular and portable systems software. Understanding
its basic concepts is pivotal for using the full potential of the framework.
This document introduces those concepts and the best practises of putting them
to good use. Beside building software components from source code, common
and repetitive development tasks are the testing of individual components
and the integration of those components into complex system scenarios. To
streamline such tasks, the build system is accompanied with special tooling
support. This document introduces those tools.
Build directories and repositories
##################################
The build system is supposed to never touch the source tree. The procedure of
building components and integrating them into system scenarios is done at
a distinct build directory. One build directory targets a specific platform,
i.e., a kernel and hardware architecture. Because the source tree is decoupled
from the build directory, one source tree can have many different build
directories associated, each targeted at another platform.
The recommended way for creating a build directory is the use of the
'create_builddir' tool located at '<genode-dir>/tool/'. By starting the tool
without arguments, its usage information will be printed. For creating a new
build directory, one of the listed target platforms must be specified.
Furthermore, the location of the new build directory has to be specified via
the 'BUILD_DIR=' argument. For example:
! cd <genode-dir>
! ./tool/create_builddir linux_x86 BUILD_DIR=/tmp/build.linux_x86
This command will create a new build directory for the Linux/x86 platform
at _/tmp/build.linux_x86/_.
Build-directory configuration via 'build.conf'
==============================================
The fresh build directory will contain a 'Makefile', which is a symlink to
_tool/builddir/build.mk_. This makefile is the front end of the build system
and not supposed to be edited. Beside the makefile, there is a _etc/_
subdirectory that contains the build-directory configuration. For most
platforms, there is only a single _build.conf_ file, which defines the parts of
the Genode source tree incorporated in the build process. Those parts are
called _repositories_.
The repository concept allows for keeping the source code well separated for
different concerns. For example, the platform-specific code for each target
platform is located in a dedicated _base-<platform>_ repository. Also, different
abstraction levels and features of the system are residing in different
repositories. The _etc/build.conf_ file defines the set of repositories to
consider in the build process. At build time, the build system overlays the
directory structures of all repositories specified via the 'REPOSITORIES'
declaration to form a single logical source tree. By changing the list of
'REPOSITORIES', the view of the build system on the source tree can be altered.
The _etc/build.conf_ as found in a fresh created build directory will list the
_base-<platform>_ repository of the platform selected at the 'create_builddir'
command line as well as the 'base', 'os', and 'demo' repositories needed for
compiling Genode's default demonstration scenario. Furthermore, there are a
number of commented-out lines that can be uncommented for enabling additional
repositories.
Note that the order of the repositories listed in the 'REPOSITORIES' declaration
is important. Front-most repositories shadow subsequent repositories. This
makes the repository mechanism a powerful tool for tweaking existing repositories:
By adding a custom repository in front of another one, customized versions of
single files (e.g., header files or target description files) can be supplied to
the build system without changing the original repository.
Building targets
================
To build all targets contained in the list of 'REPOSITORIES' as defined in
_etc/build.conf_, simply issue 'make'. This way, all components that are
compatible with the build directory's base platform will be built. In practice,
however, only some of those components may be of interest. Hence, the build
can be tailored to those components which are of actual interest by specifying
source-code subtrees. For example, using the following command
! make core server/nitpicker
the build system builds all targets found in the 'core' and 'server/nitpicker'
source directories. You may specify any number of subtrees to the build
system. As indicated by the build output, the build system revisits
each library that is used by each target found in the specified subtrees.
This is very handy for developing libraries because instead of re-building
your library and then your library-using program, you just build your program
and that's it. This concept even works recursively, which means that libraries
may depend on other libraries.
In practice, you won't ever need to build the _whole tree_ but only the
targets that you are interested in.
Cleaning the build directory
============================
To remove all but kernel-related generated files, use
! make clean
To remove all generated files, use
! make cleanall
Both 'clean' and 'cleanall' won't remove any files from the _bin/_
subdirectory. This makes the _bin/_ a safe place for files that are
unrelated to the build process, yet required for the integration stage, e.g.,
binary data.
Controlling the verbosity of the build process
==============================================
To understand the inner workings of the build process in more detail, you can
tell the build system to display each directory change by specifying
! make VERBOSE_DIR=
If you are interested in the arguments that are passed to each invocation of
'make', you can make them visible via
! make VERBOSE_MK=
Furthermore, you can observe each single shell-command invocation by specifying
! make VERBOSE=
Of course, you can combine these verboseness toggles for maximizing the noise.
Enabling parallel builds
========================
To utilize multiple CPU cores during the build process, you may invoke 'make'
with the '-j' argument. If manually specifying this argument becomes an
inconvenience, you may add the following line to your _etc/build.conf_ file:
! MAKE += -j<N>
This way, the build system will always use '<N>' CPUs for building.
Caching inter-library dependencies
==================================
The build system allows to repeat the last build without performing any
library-dependency checks by using:
! make again
The use of this feature can significantly improve the work flow during
development because in contrast to source-codes, library dependencies rarely
change. So the time needed for re-creating inter-library dependencies at each
build can be saved.
Repository directory layout
###########################
Each Genode repository has the following layout:
Directory | Description
------------------------------------------------------------
'doc/' | Documentation, specific for the repository
------------------------------------------------------------
'etc/' | Default configuration of the build process
------------------------------------------------------------
'mk/' | The build system
------------------------------------------------------------
'include/' | Globally visible header files
------------------------------------------------------------
'src/' | Source codes and target build descriptions
------------------------------------------------------------
'lib/mk/' | Library build descriptions
Creating targets and libraries
##############################
Target descriptions
===================
A good starting point is to look at the init target. The source code of init is
located at _os/src/init/_. In this directory, you will find a target description
file named _target.mk_. This file contains the building instructions and it is
usually very simple. The build process is controlled by defining the following
variables.
Build variables to be defined by you
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:'TARGET': is the name of the binary to be created. This is the
only *mandatory variable* to be defined in a _target.mk_ file.
:'REQUIRES': expresses the requirements that must be satisfied in order to
build the target. You find more details about the underlying mechanism in
Section [Specializations].
:'LIBS': is the list of libraries that are used by the target.
:'SRC_CC': contains the list of '.cc' source files. The default search location
for source codes is the directory, where the _target.mk_ file resides.
:'SRC_C': contains the list of '.c' source files.
:'SRC_S': contains the list of assembly '.s' source files.
:'SRC_BIN': contains binary data files to be linked to the target.
:'INC_DIR': is the list of include search locations. Directories should
always be appended by using +=. Never use an assignment!
:'EXT_OBJECTS': is a list of Genode-external objects or libraries. This
variable is mostly used for interfacing Genode with legacy software
components.
Rarely used variables
---------------------
:'CC_OPT': contains additional compiler options to be used for '.c' as
well as for '.cc' files.
:'CC_CXX_OPT': contains additional compiler options to be used for the
C++ compiler only.
:'CC_C_OPT': contains additional compiler options to be used for the
C compiler only.
Specifying search locations
~~~~~~~~~~~~~~~~~~~~~~~~~~~
When specifying search locations for header files via the 'INC_DIR' variable or
for source files via 'vpath', relative pathnames are illegal to use. Instead,
you can use the following variables to reference locations within the
source-code repository, where your target lives:
:'REP_DIR': is the base directory of the current source-code repository.
Normally, specifying locations relative to the base of the repository is
never used by _target.mk_ files but needed by library descriptions.
:'PRG_DIR': is the directory, where your _target.mk_ file resides. This
variable is always to be used when specifying a relative path.
Library descriptions
====================
In contrast to target descriptions that are scattered across the whole source
tree, library descriptions are located at the central place _lib/mk_. Each
library corresponds to a _<libname>.mk_ file. The base of the description file
is the name of the library. Therefore, no 'TARGET' variable needs to be set.
The source-code locations are expressed as '$(REP_DIR)'-relative 'vpath'
commands.
Library-description files support the following additional declarations:
:'SHARED_LIB = yes': declares that the library should be built as a shared
object rather than a static library. The resulting object will be called
_<libname>.lib.so_.
Specializations
===============
Building components for different platforms likely implicates portions of code
that are tied to certain aspects of the target platform. For example, a target
platform may be characterized by
* A kernel API such as L4v2, Linux, L4.sec,
* A hardware architecture such as x86, ARM, Coldfire,
* A certain hardware facility such as a custom device, or
* Other properties such as software license requirements.
Each of these attributes express a specialization of the build process. The
build system provides a generic mechanism to handle such specializations.
The _programmer_ of a software component knows the properties on which his
software relies and thus, specifies these requirements in his build description
file.
The _user/customer/builder_ decides to build software for a specific platform
and defines the platform specifics via the 'SPECS' variable per build
directory in _etc/specs.conf_. In addition to an (optional) _etc/specs.conf_
file within the build directory, the build system incorporates the first
_etc/specs.conf_ file found in the repositories as configured for the
build directory. For example, for a 'linux_x86' build directory, the
_base-linux/etc/specs.conf_ file is used by default. The build directory's
'specs.conf' file can still be used to extend the 'SPECS' declarations, for
example to enable special features.
Each '<specname>' in the 'SPECS' variable instructs the build system to
* Include the 'make'-rules of a corresponding _base/mk/spec-<specname>.mk_
file. This enables the customization of the build process for each platform.
* Search for _<libname>.mk_ files in the _lib/mk/<specname>/_ subdirectory.
This way, we can provide alternative implementations of one and the same
library interface for different platforms.
Before a target or library gets built, the build system checks if the 'REQUIRES'
entries of the build description file are satisfied by entries of the 'SPECS'
variable. The compilation is executed only if each entry in the 'REQUIRES'
variable is present in the 'SPECS' variable as supplied by the build directory
configuration.
Building tools to be executed on the host platform
===================================================
Sometimes, software requires custom tools that are used to generate source
code or other ingredients for the build process, for example IDL compilers.
Such tools won't be executed on top of Genode but on the host platform
during the build process. Hence, they must be compiled with the tool chain
installed on the host, not the Genode tool chain.
The Genode build system accommodates the building of such host tools as a side
effect of building a library or a target. Even though it is possible to add
the tool compilation step to a regular build description file, it is
recommended to introduce a dedicated pseudo library for building such tools.
This way, the rules for building host tools are kept separate from rules that
refer to Genode programs. By convention, the pseudo library should be named
_<package>_host_tools_ and the host tools should be built at
_<build-dir>/tool/<package>/_. With _<package>_, we refer to the name of the
software package the tool belongs to, e.g., qt5 or mupdf. To build a tool
named _<tool>_, the pseudo library contains a custom make rule like the
following:
! $(BUILD_BASE_DIR)/tool/<package>/<tool>:
! $(MSG_BUILD)$(notdir $@)
! $(VERBOSE)mkdir -p $(dir $@)
! $(VERBOSE)...build commands...
To let the build system trigger the rule, add the custom target to the
'HOST_TOOLS' variable:
! HOST_TOOLS += $(BUILD_BASE_DIR)/tool/<package>/<tool>
Once the pseudo library for building the host tools is in place, it can be
referenced by each target or library that relies on the respective tools via
the 'LIBS' declaration. The tool can be invoked by referring to
'$(BUILD_BASE_DIR)/tool/<package>/tool'.
For an example of using custom host tools, please refer to the mupdf package
found within the libports repository. During the build of the mupdf library,
two custom tools fontdump and cmapdump are invoked. The tools are built via
the _lib/mk/mupdf_host_tools.mk_ library description file. The actual mupdf
library (_lib/mk/mupdf.mk_) has the pseudo library 'mupdf_host_tools' listed
in its 'LIBS' declaration and refers to the tools relative to
'$(BUILD_BASE_DIR)'.
Automated integration and testing
#################################
Genode's cross-kernel portability is one of the prime features of the
framework. However, each kernel takes a different route when it comes to
configuring, integrating, and booting the system. Hence, for using a particular
kernel, profound knowledge about the boot concept and the kernel-specific tools
is required. To streamline the testing of Genode-based systems across the many
different supported kernels, the framework comes equipped with tools that
relieve you from these peculiarities.
Run scripts
===========
Using so-called run scripts, complete Genode systems can be described in a
concise and kernel-independent way. Once created, a run script can be used
to integrate and test-drive a system scenario directly from the build directory.
The best way to get acquainted with the concept is reviewing the run script
for the 'hello_tutorial' located at _hello_tutorial/run/hello.run_.
Let's revisit each step expressed in the _hello.run_ script:
* Building the components needed for the system using the 'build' command.
This command instructs the build system to compile the targets listed in
the brace block. It has the same effect as manually invoking 'make' with
the specified argument from within the build directory.
* Creating a new boot directory using the 'create_boot_directory' command.
The integration of the scenario is performed in a dedicated directory at
_<build-dir>/var/run/<run-script-name>/_. When the run script is finished,
this directory will contain all components of the final system. In the
following, we will refer to this directory as run directory.
* Installing the Genode 'config' file into the run directory using the
'install_config' command. The argument to this command will be written
to a file called 'config' at the run directory picked up by
Genode's init process.
* Creating a bootable system image using the 'build_boot_image' command.
This command copies the specified list of files from the _<build-dir>/bin/_
directory to the run directory and executes the platform-specific steps
needed to transform the content of the run directory into a bootable
form. This form depends on the actual base platform and may be an ISO
image or a bootable ELF image.
* Executing the system image using the 'run_genode_until' command. Depending
on the base platform, the system image will be executed using an emulator.
For most platforms, Qemu is the tool of choice used by default. On Linux,
the scenario is executed by starting 'core' directly from the run
directory. The 'run_genode_until' command takes a regular expression
as argument. If the log output of the scenario matches the specified
pattern, the 'run_genode_until' command returns. If specifying 'forever'
as argument (as done in 'hello.run'), this command will never return.
If a regular expression is specified, an additional argument determines
a timeout in seconds. If the regular expression does not match until
the timeout is reached, the run script will abort.
Please note that the _hello.run_ script does not contain kernel-specific
information. Therefore it can be executed from the build directory of any base
platform by using:
! make run/hello
When invoking 'make' with an argument of the form 'run/*', the build system
will look in all repositories for a run script with the specified name. The run
script must be located in one of the repositories 'run/' subdirectories and
have the file extension '.run'.
For a more comprehensive run script, _os/run/demo.run_ serves as a good
example. This run script describes Genode's default demo scenario. As seen in
'demo.run', parts of init's configuration can be made dependent on the
platform's properties expressed as spec values. For example, the PCI driver
gets included in init's configuration only on platforms with a PCI bus. For
appending conditional snippets to the _config_ file, there exists the 'append_if'
command, which takes a condition as first and the snippet as second argument.
To test for a SPEC value, the command '[have_spec <spec-value>]' is used as
condition. Analogously to how 'append_if' appends strings, there exists
'lappend_if' to append list items. The latter command is used to conditionally
include binaries to the list of boot modules passed to the 'build_boot_image'
command.
The run mechanism explained
===========================
Under the hood, run scripts are executed by an expect interpreter. When the
user invokes a run script via _make run/<run-script>_, the build system invokes
the run tool at _<genode-dir>/tool/run_ with the run script as argument. The
run tool is an expect script that has no other purpose than defining several
commands used by run scripts, including a platform-specific script snippet
called run environment ('env'), and finally including the actual run script.
Whereas _tool/run_ provides the implementations of generic and largely
platform-independent commands, the _env_ snippet included from the platform's
respective _base-<platform>/run/env_ file contains all platform-specific
commands. For reference, the most simplistic run environment is the one at
_base-linux/run/env_, which implements the 'create_boot_directory',
'install_config', 'build_boot_image', and 'run_genode_until' commands for Linux
as base platform. For the other platforms, the run environments are far more
elaborative and document precisely how the integration and boot concept works
on each platform. Hence, the _base-<platform>/run/env_ files are not only
necessary parts of Genode's tooling support but serve as resource for
peculiarities of using each kernel.
Using run script to implement test cases
========================================
Because run scripts are actually expect scripts, the whole arsenal of
language features of the Tcl scripting language is available to them. This
turns run scripts into powerful tools for the automated execution of test
cases. A good example is the run script at _libports/run/lwip.run_, which tests
the lwIP stack by running a simple Genode-based HTTP server on Qemu. It fetches
and validates a HTML page from this server. The run script makes use of a
regular expression as argument to the 'run_genode_until' command to detect the
state when the web server becomes ready, subsequently executes the 'lynx' shell
command to fetch the web site, and employs Tcl's support for regular
expressions to validate the result. The run script works across base platforms
that use Qemu as execution environment.
To get the most out of the run mechanism, a basic understanding of the Tcl
scripting language is required. Furthermore the functions provided by
_tool/run_ and _base-<platform>/run/env_ should be studied.
Automated testing across base platforms
=======================================
To execute one or multiple test cases on more than one base platform, there
exists a dedicated tool at _tool/autopilot_. Its primary purpose is the
nightly execution of test cases. The tool takes a list of platforms and of
run scripts as arguments and executes each run script on each platform. The
build directory for each platform is created at
_/tmp/autopilot.<username>/<platform>_ and the output of each run script is
written to a file called _<platform>.<run-script>.log_. On stderr, autopilot
prints the statistics about whether or not each run script executed
successfully on each platform. If at least one run script failed, autopilot
returns a non-zero exit code, which makes it straight forward to include
autopilot into an automated build-and-test environment.

View File

@@ -16,28 +16,24 @@ research projects on Genode.
Applications and library infrastructure
#######################################
:GNU Privacy Guard:
:Port of the Ladybird web browser:
The [https://gnupg.org/ - GNU Privacy Guard] (GNUPG) is the most widely
used Free-Software implementation of the OpenGPG standard. It comprises a
rich set of tools for encryption and key management. For many forthcoming
application scenarios of Genode such as package management and email
communication, GNUPG is crucial. Hence, it should be ported to Genode. Such
a port may leverage Genode's fine-grained component architecture to strongly
separate network-exposed functionality, the storage of key material, and the
cryptographic functions.
[https://ladybird.org/ - Ladybird] is a new web browser developed
independently from the large browser-engine vendors. It is designed to
be light-weight and portable. Among the supported platforms is Qt,
which is available for Genode. This makes the porting of Ladybird a
tempting application of the Goa SDK.
:VNC server implementing Genode's framebuffer session interface:
:Goa SDK running on Sculpt OS:
With 'Input' and 'Framebuffer', Genode provides two low-level interfaces
used by interactive applications. For example, the Nitpicker GUI server uses
these interfaces as a client and, in turn, exports multiple virtual
'Framebuffer' and 'Input' interfaces to its clients. This enables a
highly modular use of applications such as the nesting of GUIs. By
implementing the 'Framebuffer' and 'Input' interfaces with a VNC server
implementation, all graphical workloads of Genode would become available over
the network. One immediate application of this implementation is the remote
testing of graphical Genode applications running on a headless server.
Genode's [https://github.com/genodelabs/goa - Goa SDK] is currently used
in Linux-based development environments, facilitating cross-compilation
to Genode. The goal of this project is the ability to use Goa directly on
Sculpt OS without the need for a Linux VM. This entails a number of
challenges, ranging from running the Goa tool itself by porting the expect
interpreter, over running the Genode tool chain, adjusting the
network-facing Goa commands to Genode's environment, to crafting custom
support for executing 'goa run' as a sandboxed Genode subsystem.
:Interfacing with the SAFE network:
@@ -50,43 +46,6 @@ Applications and library infrastructure
integrated in the operating system, i.e., in the form of Genode components
or a set of Genode VFS plugins.
:Tiled window manager:
At Genode Labs, we pursue the goal to shape Genode into an general-purpose
operating system suitable for productive work. The feature set needed to
achieve this goal largely depends on the tools and applications daily used by
the Genode engineers. As one particularly important tool for being highly
productive, we identified a tiled user interface. Currently, all developers
at Genode Labs embrace either the Ion3 window manager or the tiled Terminator
terminal emulator. Hence, we desire to have a similar mode of user
interaction on Genode as well. The goal of this challenge is to identify the
most important usage patters and the implementation of a tiled GUI that
multiplexes the framebuffer into a set of tiled and tabbed virtual
framebuffers.
Related to this work, the low-level 'Framebuffer' and 'Input' interfaces
should be subject to a revision, for example for enabling the flexible change
of framebuffer sizes as needed by a tiled user interface.
:Interactive sound switchbox based on Genode's Audio_out session interface:
Since version 10.05, Genode features a highly flexible configuration concept
that allows the arbitrary routing of session requests throughout the
hierarchic process structure. Even though primarily designed for expressing
mandatory-access control rules, the concept scales far beyond this use case.
For example, it can be used to run an arbitrary number of processes
implementing the same interface and connecting the different interface
implementations. One special case of this scenario is a chain of audio
filters with each using the 'Audio_out' session interface for both roles
client and server. Combined with the Nitpicker GUI server and Genode's
support for real-time priorities, this base techniques enable the creation of
flexible audio mixer / switchboard applications, which require dedicated
frameworks (e.g., Jack audio) on traditional operating systems. The goal of
this project is to create a showcase implementation demonstrating the
feasibility for creating high-quality audio applications on Genode.
Furthermore, we wish for feedback regarding the current design of our bulk
streaming interface when used for low-latency applications.
:Graphical on-target IPC tracing tool using Qt:
Analysing the interaction of components of a multi-server operating system
@@ -116,37 +75,62 @@ Applications and library infrastructure
of communicating threads as captured on the running system. The tool should
work on a selected kernel that provides a facility for tracing IPC messages.
The underlying light-weight tracing infrastructure is
[https://genode.org/documentation/release-notes/19.08#Tracinghttps://genode.org/documentation/release-notes/19.08#Tracing - already in place].
The Qt-based tracing tools would complement this infrastructure with
an interactive front end.
:Ports of popular software:
Genode features a ports mechanism to cleanly integrate 3rd-party software.
The [https://github.com/genodelabs/goa - Goa SDK] streamlines the process
of developing, porting, packaging, and publishing software for Genode,
and Sculpt OS in particular.
Thanks to the C runtime, the flexible per-component VFS, the standard
C++ library, and the Noux runtime (for UNIX software), porting software
to Genode is relatively straight forward. The
[http://genode.org/documentation/developer-resources/porting - porting guide]
explains the typical steps. A wish list of software that we'd like to
have available on Genode is available at
[http://usr.sysret.de/jws/genode/porting_wishlist.html].
C++ library, and a variety of supported 3rd-party libraries, porting
software to Genode is relatively straight forward.
A wish list of software that we'd like to have available on Genode is
available at
[https://usr.sysret.de/jws/genode/porting_wishlist.html].
:Native Open-Street-Maps (OSM) client:
When using Sculpt OS, we regularly need to spawn a fully fledged web browser
for using OSM or Google maps. The goal of this project would be a native
component that makes maps functionality directly available on Genode,
alleviating the urge to reach for a SaaS product. The work would include a
review of existing OSM clients regarding their feature sets and the
feasibility of porting them to Genode. Depending on the outcome of this
review, an existing application could be ported or a new component could be
developed, e.g., leveraging Genode's Qt support.
Application frameworks and runtime environments
###############################################
:GTK:
Genode supports Qt as a native toolkit. But many popular applications
are built upon [https://www.gtk.org/ - GTK]. A port of GTK to Genode would
allow for the use of these applications on Sculpt OS without the need
of a Linux VM. A tangible goal for this line of work could be the port
of [https://mtpaint.sourceforge.net/ - mtPaint] to Sculpt OS.
:OpenJDK:
[http://openjdk.java.net/ - OpenJDK] is the reference implementation of the
[https://openjdk.java.net/ - OpenJDK] is the reference implementation of the
Java programming language and hosts an enormous ecosystem of application
software. The goal of this line of work is the ability to run this
software directly on Genode. The centerpiece of OpenJDK is Hotspot - the
Java virtual machine implementation, which must be ported to Genode.
The initial port should suffice to execute simple example programs that
operate on textual input. Since Genode has the FreeBSD libc readily
available, OpenJDK's existing POSIX backends can be reused. The next step
is the creation of Genode-specific native classes that bridge the gap
between the Java world and Genode, in particular the glue code to
run graphical applications as clients of Genode's GUI server. Since
OpenJDK has been ported to numerous platforms (such as Haiku), there
exists a comforting number of implementations that can be taken as
reference.
software.
Since
[https://genode.org/documentation/release-notes/19.02#Showcase_of_a_Java-based_network_appliance - version 19.02],
Genode features a port of OpenJDK that allows the use of Java for networking
applications.
The next step would be the creation of Genode-specific native classes that
bridge the gap between the Java world and Genode, in particular the glue
code to run graphical applications as clients of Genode's GUI server. Since
OpenJDK has been ported to numerous platforms (such as Haiku), there exists
a comforting number of implementations that can be taken as reference.
:Android's ART VM natively on Genode:
@@ -155,47 +139,6 @@ Application frameworks and runtime environments
removed from the trusted computing base of Android, facilitating the use of
this mobile OS in high-assurance settings.
:Rust bindings for the Genode API:
Rust is a low-level systems programming language that ensures memory
safety without employing a garbage collector. It thereby challenges C++
as the go-to programming language for high-performance and low-level code.
Since
[http://genode.org/documentation/release-notes/16.05#New_support_for_the_Rust_programming_language - version 16.05],
Genode supports the use of the Rust programming language within
components. However, to unleash the potential of this combination,
Genode's API must become available to native Rust code. The intermediate goal
of this project is the implementation of an example server, e.g., a
component that provides a terminal-session interface. Thereby, we
will encounter the problems of bootstrapping and configuration of the
component, the provisioning of signal handlers and session objects, and
memory management.
:Go language runtime:
Go is a popular language in particular for web applications. In the past,
there were numerous attempts to make the Go runtime available on Genode
but so far, none of those undertakings have landed in the official
Genode source tree. To goal of this project is the hosting of
Go-written applications - in particular networking applications - as
Genode components. The topic comprises work on the tool-chain
and build-system integration, the porting the runtime libraries, and
the glue between the Go and Genode environments.
:Combination of CAmkES with Genode:
[https://wiki.sel4.systems/CAmkES - CAmkES] is a component framework for
seL4. In contrast to Genode, which is a dynamic system, CAmkES-based systems
are defined at design time and remain fixed at runtime. Hence, CAmkES and
Genode can be seen as the opposite ends of component-based used-land
architectures. The goal of this project is to build a bridge between
both projects with the potential to cross-pollinate the respective communities.
Among the principal approaches are embedding of a single CAmkES
component as a Genode component (e.g., an individual device driver),
the hosting of a dynamic Genode system as a component within a
CAmkES system, or the hosting of a CAmkES system composition as a Genode
subsystem.
:Runtime for the D programming language:
The D systems programming language was designed to overcome many gripes that
@@ -209,66 +152,64 @@ Application frameworks and runtime environments
programs, and interfacing D programs with other Genode components written in
C++.
:Using Haskell as systems-development language:
:Xlib compatibility:
The goal of this project is the application of functional programming
i.e., Haskell, for the implementation of low-level Genode components.
Implementing critical functionalities in such a high-level language instead
of a classical systems language such as C or C++ would pave the way towards
analyzing such components with formal methods.
Developments like Wayland notwithstanding, most application software on
GNU/Linux systems is built on top of the Xlib programming interface.
However, only a few parts of this wide interface are actually used today.
I.e., modern applications generally deal with pixel buffers instead of
relying on graphical drawing primitives of the X protocol. Hence, it seems
feasible to reimplement the most important parts of the Xlib interface to
target Genode's native GUI interfaces (nitpicker) directly. This would
allow us to port popular application software to Sculpt OS without
changing the application code.
The use of Haskell for systems development was pioneered by the
[http://programatica.cs.pdx.edu/House/ - House Project]. A more recent
development is [http://halvm.org - HalVM] - a light-weight OS runtime for
Xen that is based on Haskell.
:Bump-in-the-wire components for visualizing session interfaces:
Genode's session interfaces bear the potential for monitoring and
visualizing their use by plugging a graphical application
in-between any two components. For example, by intercepting block
requests issued by a block-session client to a block-device driver,
such a bump-in-the-wire component could visualize
the access patterns of a block device. Similar ideas could be pursued for
other session interfaces, like record/play (sound visualization) or NIC
session (live visualization of network communication).
The visualization of system behavior would offer valuable insights,
e.g., new opportunities for optimization. But more importantly, they
would be fun to play with.
Platforms
#########
:Support for additional ARM SoCs:
Genode's ARM support has been focused on NXP's i.MX family, Allwinner A64
(used by the PinePhone), and to a lesser degree the Raspberry Pi. To make
Genode compatible with a larger variety of devices, the support for further
chip families calls for exploration. For example,
[https://en.wikipedia.org/wiki/Rockchip - Rockchip] SoCs are getting
popular in products by open-source hardware vendors such as
[https://pine64.com/ - Pine64] and [https://mntre.com/ - MNT].
The first steps have been [https://github.com/mickenx/genode-rockchip - already taken]
by [https://genodians.org/mickenx/index - Michael Grunditz]!
Another example is the Mediatek SoC family, which is popular in
affordable consumer smartphones.
Another example is the Mediatek SoC family, which is popular in
affordable consumer smartphones.
The process of bringing an OS like Genode to a new SoC is full of technical
challenges and labor-intensive, yet extremely gratifying.
As a guide through this process, the
[https://genode.org/documentation/genode-platforms-23-05.pdf - Genode Platforms]
book breaks the challenge down to a sequence of manageable steps, where
each step can be celebrated as a success.
Virtualization
##############
:VirtualBox on top of KVM on Linux:
Genode's version of VirtualBox replaces the original in-kernel VirtualBox
hypervisor by the virtualization mechanism of the NOVA hypervisor or the
Muen separation kernel. Those mechanisms look very similar the KVM
interface of the Linux kernel. It should in principle be possible to
re-target Genode's version of VirtualBox to KVM. This way, VirtualBox and
Qemu/KVM-based virtual machines could co-exist on the same system, which
is normally not possible. Also, complex Genode scenarios (like Turmvilla)
could be prototyped on GNU/Linux.
:VirtualBox on top of seL4:
The [https://sel4.systems - seL4 microkernel] is a modern microkernel that
undergoes formal verification to prove the absence of bugs. Since version
4.0, the kernel supports virtualization support on x86-based hardware.
Genode has experimental support for seL4 that allows almost all Genode
components to be used on top of this kernel. VirtualBox is an exception
because it closely interacts with the underlying kernel (like NOVA) to
attain good performance. We have shown that VirtualBox can be executed
within a protection domain of the NOVA microhypervisor. The goal of this
project is the application of this approach to the virtualization
interface of seL4. The result will be a VM hosting environment that
ensures the separation of virtual machines via the formally verified
seL4 kernel.
:Xen as kernel for Genode:
Using Xen as kernel for Genode would clear the way to remove the
overly complex Linux OS from the trusted computing base of Xen
guests OSes.
Xen is a hypervisor that can host multiple virtual machines on one physical
machine. For driving physical devices and for virtual-machine management, Xen
relies on a privileged guest OS called Dom0. Currently, Linux is the
predominant choice to be used as Dom0, which implicates a trusted computing
base of millions of lines of code for the other guest OSes.
Even though Xen was designed as hypervisor, a thorough analysis done by Julian
Stecklina concludes that Xen qualifies well as a kernel for Genode. For
example, Julian implemented a version of Genode's IPC framework that utilizes
Xen's communication mechanisms (event channels and shared memory).
:Genode as virtualization layer for Qubes OS:
[https://www.qubes-os.org/ - Qubes OS] is a desktop operating system
@@ -295,128 +236,46 @@ Virtualization
KVM interface based on Genode's VFS plugin concept.
Device drivers
##############
System management and tools
###########################
:Isochronous USB devices:
:Virtual network-boot infrastructure as Sculpt component:
Genode's USB driver supports bulk and interrupt endpoints. Thereby, most
USB devices like USB storage, user input, printers, and networking devices
can be used. However, multi-media devices such as cameras or audio
equipment use isochronous endpoints, which are not supported. The goal
of this line of work is the support of these devices in Genode. The topic
touches the USB driver, the USB session interface, an example implementation
of a USB client driver (using the session interface) for a device of choice,
and - potentially - the enhancement of Genode's USB-pass-through mechanism
for VirtualBox.
Network-based development work flows for PCs require a variety of tools and
network-configuration peculiarities. Think of a development network with a
custom configured DHCP server, a TFTP or HTTP server on the development
machine, the provisioning of a PXE boot loader, tooling for obtaining serial
output over AMT, or tooling for remote power control via AMT.
:Sound on the Raspberry Pi:
The goal of this project would be the hosting of all those functions in a
Sculpt OS component "devnet" that is exclusively in charge of a dedicated
LAN port of the developer's Sculpt machine. By connecting a test machine to
this LAN port, the test machine becomes immediately available as development
target without any manual installation or configuration steps needed. The
devnet component would interface with the rest of the Sculpt system as a
client of a file-system session (containing the boot payloads) and a
terminal session (for the virtual serial connection).
The goal of this project is a component that uses the Raspberry Pi's
PWM device to implement Genode's audio-out-session interface. Since
Genode's version of libSDL already supports this interface as audio
backend, the new driver will make the sound of all SDL-based games
available on the Raspberry Pi.
:Statistical profiler using Sculpt's GDB monitor:
:Framebuffer for UEFI and Coreboot:
Starting with version 24.04, Sculpt OS provides the ability to supervise
selected components
[https://genodians.org/chelmuth/2024-05-17-on-target-debugging - using the GDB protocol].
The underlying mechanism and infrastructure could be leveraged for
implementing a statistical profiler that monitors components live.
Using the on-target information obtained via Sculpt's "download debug info"
option, the tool could display a sorted list of the most executed
functions, facilitating interactive on-target analysis and experimentation.
By moving away from the legacy BIOS boot mechanism, it is time to
reconsider closely related traditional approaches such as the use of
the VESA BIOS extensions for accessing the frame buffer. On UEFI or
Coreboot systems, there exist alternative ways to initialize and
access the framebuffer in a hardware-independent way. On the course of
this project, we will explore the available options and create dedicated
Genode driver components that use the modern mechanisms.
For reference, the current state of Genode's UEFI support is documented
in [https://github.com/genodelabs/genode/issues/2242 - Issue 2242].
:Remote management of Sculpt OS via Puppet:
:Data Plane Development Kit (DPDK):
Genode utilizes the network device drivers of the iPXE project, which
perform reasonably well for everyday use cases but are obviously not
designated for high-performance networking.
The [http://dpdk.org/ - DPDK] is a vendor-supported suite of network device
drivers that is specifically developed for high-performance applications.
It presents an attractive alternative to iPXE-based drivers. This project
has the goal to make DPDK drivers available as a Genode component.
Platforms
#########
:Microkernelizing Linux:
Thanks to Genode's generic interfaces for I/O access as provided by core, all
Genode device drivers including drivers ported from Linux and gPXE can be
executed as user-level components on all supported microkernels. However, so
far, we have not enabled the use of these device drivers on Linux as base
platform. The goal of this project is the systematic replacement of in-kernel
Linux device drivers by Genode processes running in user space, effectively
reducing the Linux kernel to a runtime for Genode's core process. But moving
drivers to Genode processes is just the beginning. By employing further
Genode functionality such as its native GUI, lwIP, and Noux, many protocol
stacks can effectively be removed from the Linux kernel.
The goal of this project is to evaluate how small the Linux kernel can get
when used as a microkernel.
:Support for the HelenOS/SPARTAN kernel:
[http://www.helenos.org - HelenOS] is a microkernel-based multi-server OS
developed at the university of Prague. It is based on the SPARTAN microkernel,
which runs on a wide variety of CPU architectures including Sparc, MIPS, and
PowerPC. This broad platform support makes SPARTAN an interesting kernel to
look at alone. But a further motivation is the fact that SPARTAN does not
follow the classical L4 road, providing a kernel API that comes with an own
terminology and different kernel primitives. This makes the mapping of
SPARTAN's kernel API to Genode a challenging endeavour and would provide us
with feedback regarding the universality of Genode's internal interfaces.
Finally, this project has the potential to ignite a further collaboration
between the HelenOS and Genode communities.
:Support for the XNU kernel (Darwin):
XNU is the kernel used by Darwin and Mac OS X. It is derived from the
MACH microkernel and extended with a UNIX-like syscall API. Because the
kernel is used for Mac OS X, it could represent an industry-strength
base platform for Genode supporting all CPU features as used by Mac OS X.
:Linux process containers for supporting Genode`s resource trading:
Even though the Linux version of Genode is primarily meant as a development
platform, there exist interesting opportunities to explore when combining
Genode with Linux, in particular Linux' process containers.
Linux process containers provide a mechanism to partition physical resources,
foremost CPU time, between Linux processes. This raises the interesting
question of whether this mechanism could be used for a proper implementation
of Genode's resource trading on Linux.
[http://lwn.net/Articles/236038/ - Process containers introduction...]
Optimizations
#############
:Low-latency audio streaming:
Genode comes with an audio streaming interface called 'Audio_out' session.
It is based on a shared-memory packet stream accompanied with asynchronous
data-flow signals. For real-time audio processing involving chains of Genode
components, streams of audio data must be carried at low latency, imposing
constraints to buffer sizes and the modes of operation of the audio mixer and
audio drivers. The goal of this project is to create a holistic design of the
whole chain of audio processing, taking thread-scheduling into account. A
particular challenge is the mixed output of real-time (small buffer, low
latency) and non-real-time (larger buffer to compensate jitter, higher
latency) audio sources.
:De-privileging the VESA graphics driver:
The VESA graphics driver executes the graphics initialization code provided
by the graphics card via an x86 emulator. To initialize a graphics mode, this
code needs to access device hardware. Currently, we permit access to all
device registers requested by the graphics-card's code. These devices include
the system timer, the PCI configuration registers, and the interrupt
controller, which are critical for the proper operating of the kernel. The
goal of this work is to restrict the permissions of the VESA driver to a
minimum by virtualizing all devices but the actual graphics card.
[https://en.wikipedia.org/wiki/Puppet_(company)#Puppet - Puppet] is a
software-configuration management tool for administering a large amount
of machines from one central place. Genode's
[https://genode.org/download/sculpt - Sculpt OS] lends itself to such
an approach of remote configuration management by the means of the
"config" file system (for configuring components and deployments) and
the "report" file system (for obtaining the runtime state of components).
The project would explore the application of the Puppet approach and tools
to Sculpt OS.

View File

@@ -1,281 +0,0 @@
Coding style guidelines for Genode
##################################
Things to avoid
===============
Please avoid using pre-processor macros. C++ provides language
features for almost any case, for which a C programmer uses
macros.
:Defining constants:
Use 'enum' instead of '#define'
! enum { MAX_COLORS = 3 };
! enum {
! COLOR_RED = 1,
! COLOR_BLUE = 2,
! COLOR_GREEN = 3
! };
:Meta programming:
Use templates instead of pre-processor macros. In contrast to macros,
templates are type-safe and fit well with the implementation syntax.
:Conditional-code inclusion:
Please avoid C-hacker style '#ifdef CONFIG_PLATFROM' - '#endif'
constructs. Instead, factor-out the encapsulated code into a
separate file and introduce a proper function interface.
The build process should then be used to select the appropriate
platform-specific files at compile time. Keep platform dependent
code as small as possible. Never pollute existing generic code
with platform-specific code.
Header of each file
===================
! /*
! * \brief Short description of the file
! * \author Original author
! * \date Creation date
! *
! * Some more detailed description. This is optional.
! */
Identifiers
===========
* The first character of class names are uppercase, any other characters are
lowercase.
* Function and variable names are lower case.
* 'Multi_word_identifiers' use underline to separate words.
* 'CONSTANTS' and template arguments are upper case.
* Private and protected members of a class begin with an '_'-character.
* Accessor methods are named after their corresponding attributes:
! /**
! * Request private member variable
! */
! int value() const { return _value; }
!
! /**
! * Set the private member variable
! */
! void value(int value) { _value = value; }
* Accessors that return a boolean value do not carry an 'is_' prefix. E.g.,
a method for requesting the validity of an object should be named
'valid()', not 'is_valid()'.
Indentation
===========
* Use one tab per indentation step. *Do not mix tabs and spaces!*
* Use no tabs except at the beginning of a line.
* Use spaces for the alignment of continuation lines such as function
arguments that span multiple lines. The alignment spaces of such lines
should start after the (tab-indented) indentation level. For example:
! {
! <tab>function_with_many_arguments(arg1,
! <tab><--- spaces for aligment --->arg2,
! ...
! }
* Remove trailing spaces at the end of lines
This way, each developer can set his preferred tab size in his editor
and the source code always looks good.
_Hint:_ In VIM, use the 'set list' and 'set listchars' commands to make tabs
and spaces visible.
Switch statements
~~~~~~~~~~~~~~~~~
Switch-statement blocks should be indented as follows:
! switch (color) {
!
! case BLUE:
! <tab>break;
!
! case GREEN:
! <tab>{
! <tab><tab>int declaration_required;
! <tab><tab>...
! <tab>}
!
! default:
! }
Please note that the case labels have the same indentation
level as the switch statement. This avoids a two-level
indentation-change at the end of the switch block that
would occur otherwise.
Vertical whitespaces
====================
In header files:
* Leave two empty lines between classes.
* Leave one empty line between member functions.
In implementation files:
* Leave two empty lines between functions.
Braces
======
* Braces after class, struct and function names are placed at a new line:
! class Foo
! {
! public:
!
! void method(void)
! {
! ...
! }
! };
except for one-line functions.
* All other occurrences of open braces (for 'if', 'while', 'do', 'for',
'namespace', 'enum' etc.) are at the end of a line:
! if (flag) {
! ..
! } else {
! ..
! }
* One-line functions should be written on a single line as long as the line
length does not exceed approximately 80 characters.
Typically, this applies for accessor functions.
If slightly more space than one line is needed, indent as follows:
! int heavy_computation(int a, int lot, int of, int args) {
! return a + lot + of + args; }
Comments
========
Function/method header
~~~~~~~~~~~~~~~~~~~~~~
Each public or protected (but no private) method in a header-file should be
prepended by a header as follows:
! /**
! * Short description
! *
! * \param a meaning of parameter a
! * \param b meaning of parameter b
! * \param c,d meaning of parameters c and d
! *
! * \throw Exception_type meaning of the exception
! *
! * \return meaning of return value
! *
! * More detailed information about the function. This is optional.
! */
Descriptions of parameters and return values should be lower-case and brief.
More elaborative descriptions can be documented in the text area below.
In implementation files, only local and private functions should feature
function headers.
Single-line comments
~~~~~~~~~~~~~~~~~~~~
! /* use this syntax for single line comments */
A single-line comment should be prepended by an empty line.
Single-line comments should be short - no complete sentences. Use lower-case.
C++-style comments ('//') should only be used for temporarily commenting-out
code. Such commented-out garbage is easy to 'grep' and there are handy
'vim'-macros available for creating and removing such comments.
Variable descriptions
~~~~~~~~~~~~~~~~~~~~~
Use the same syntax as for single-line comments. Insert two or more
spaces before your comment starts.
! int size; /* in kilobytes */
Multi-line comments
~~~~~~~~~~~~~~~~~~~
Multi-line comments are more detailed descriptions in the form of
sentences.
A multi-line comment should be enclosed by empty lines.
! /*
! * This is some tricky
! * algorithm that works
! * as follows:
! * ...
! */
The first and last line of a multi-line comment contain no words.
Source-code blocks
~~~~~~~~~~~~~~~~~~
For structuring your source code, you can entitle the different
parts of a file like this:
! <- two empty lines
!
! /********************
! ** Event handlers **
! ********************/
! <- one empty line
Note the two stars at the left and right. There are two of them to
make the visible width of the border match its height (typically,
characters are ca. twice as high as wide).
A source-code block header represents a headline for the following
code. To couple this headline with the following code closer than
with previous code, leave two empty lines above and one empty line
below the source-code block header.
Order of public, protected, and private blocks
==============================================
For consistency reasons, use the following class layout:
! class Sandstein
! {
! private:
! ...
! protected:
! ...
! public:
! };
Typically, the private section contains member variables that are used
by public accessor functions below. In this common case, we only reference
symbols that are defined above as it is done when programming plain C.
Leave one empty line (or a line that contains only a brace) above and below
a 'private', 'protected', or 'public' label. This also applies when the
label is followed by a source-code block header.

View File

@@ -14,6 +14,11 @@ Genode comes with a growing number of components apparently scattered across
various repositories. This document provides an overview of these components
and outlines the systematics behind them.
The scope of this document is limited to the Genode main repository maintained
by Genode Labs. Many additional components and device drivers can be found in
the community-maintained
[https://github.com/genodelabs/genode-world/ - Genode-World] repository.
Categorization of components
############################
@@ -26,13 +31,14 @@ of them is briefly characterized as follows:
session interfaces. Naturally, a device driver is specific to a
particular hardware platform. The hardware resources are accessed
via core's IO_MEM, IO_PORT, and IRQ services. The functionality of
the driver is made available to other system components by announcing
the driver is made available to other system components via
one of Genode's device-independent session interfaces, which are
'platform_session', 'framebuffer_session', 'input_session', 'block_session',
'audio_out_session', 'log_session', 'nic_session', and 'timer_session'
(see 'os/include/' for the interface definitions). Those interfaces are
uniform across hardware platforms and kernel base platforms. Usually,
each device driver can accommodate only one client at a time.
'platform_session', 'capture_session', 'event_session', 'block_session',
'record_session', 'play_session', 'log_session', 'uplink_session', and
'timer_session' (see _os/include/_ for the interface definitions).
Those interfaces are uniform across hardware platforms and kernel base
platforms. Usually, each device driver accommodates one client at a
time.
:Resource multiplexers: provide mechanisms to multiplex device resources
to multiple clients. A typical resource multiplexer requests one
@@ -59,27 +65,42 @@ of them is briefly characterized as follows:
Device drivers
##############
Device drivers usually reside in the 'src/drivers' subdirectory of source-code
Device drivers usually reside in the _src/driver/_ subdirectory of source-code
repositories. The most predominant repositories hosting device drivers are
'os', 'dde_ipxe', 'dde_linux'.
'os', 'dde_ipxe', 'dde_linux', 'pc'. The main source tree is accompanied
by a variety of optional source-code repositories, each hosting the support of
a different SoC family such as NXP's i.MX, Allwinner, Xilinx Zynq, or RISC-V.
:Repositories maintained by Genode Labs:
[https://github.com/orgs/genodelabs/repositories]
Platform devices
================
:'os/src/drivers/platform/': Platform drivers for various platforms.
:_os/src/driver/platform/_: Platform drivers for various platforms.
On x86, the platform driver uses the PCI controller as found on x86 PC
hardware. A client can probe for a particular device and request information
about physical device resources (using the 'platform_device' interface). I/O
resources for MMIO regions, I/O ports, and interrupts can be requested by the
provided device abstraction.
:'os/src/drivers/acpi':
:_os/src/driver/acpi/_:
On x86 platforms that use the APIC (namely Fiasco.OC, NOVA, and hw_x86_64)
this simple ACPI parser traverses the ACPI tables and reports device-resource
information (e.g., interrupt lines of PCI devices).
:'libports/src/app/acpica':
:_os/src/app/pci_decode/_:
A component that reports the physical information about PCI devices after
parsing and initializing the PCI bus. The reported information is usually
consumed by the platform driver.
:_os/src/app/smbios_decoder/_:
A component that parses SMBIOS information on x86 platforms and makes the
result available as a report.
:_libports/src/app/acpica/_:
In addition to our ACPI base driver, the acpica component uses the
ACPICA library to provide access to dynamic functions like battery
states, events (e.g., notebook lid close and power buttons), as well
@@ -93,91 +114,68 @@ UART devices
The UART device drivers implement the UART-session interface.
:'os/src/drivers/uart/spec/pl011':
:_os/src/driver/uart/spec/pbxa9/_:
Driver for the PL011 UART as found on many ARM-based platforms.
:'os/src/drivers/uart/spec/i8250':
:_os/src/driver/uart/spec/x86/_:
Driver for the i8250 UART as found on PC hardware.
:'os/src/drivers/uart/spec/omap4':
Driver for the UART as found on OMAP4-based hardware.
:'os/src/drivers/uart/spec/exynos5':
Driver for the UART as found on Exynos-5-based hardware.
Framebuffer and input drivers
=============================
Framebuffer and input drivers implement the framebuffer-session interface and
input-session interfaces respectively.
Framebuffer and input drivers are implemented as clients of the
capture-session and event-session interfaces respectively.
:'os/src/drivers/input/dummy':
Pseudo input driver without accessing any hardware. This component is useful
to resolve a dependency from an input session for scenarios where no user
input is required.
:'os/src/drivers/input/spec/ps2/x86':
:_os/src/driver/ps2/x86/_:
Driver for the 'i8042' PS/2 controller as found in x86 PCs. It supports both
mouse (including ImPS/2, ExPS/2) and keyboard.
:'os/src/drivers/input/spec/ps2/pl050':
:_os/src/driver/ps2/pl050/_:
Driver for the PL050 PS/2 controller as found on ARM platforms such as
VersatilePB. The physical base address used by the driver is obtained at
compile time from a header file called 'pl050_defs.h'. The version of the
VersatilePB platform can be found at 'os/include/platform/vpb926/' and
compile time from a header file called _pl050_defs.h_. The version of the
VersatilePB platform can be found at _os/include/platform/vpb926/_ and
is made available to the driver via the SPECS machinery of the Genode build
system.
:'os/src/drivers/input/spec/imx53':
Input driver for Egalaxy touchscreen and Freescale's MPR121
capacitative touch buttons on i.MX53.
:'libports/src/drivers/framebuffer/vesa':
:_libports/src/driver/framebuffer/vesa/_:
Driver using VESA mode setting on x86 PCs. For more information, please refer
to the README file in the driver directory.
:'libports/src/drivers/framebuffer/boot':
:_libports/src/driver/framebuffer/boot/_:
Driver for boot-time initialized framebuffers (e.g., UEFI GOP)
discovered from the 'platform_info' ROM
:'os/src/drivers/framebuffer/spec/pl11x':
:_os/src/driver/framebuffer/pl11x/_:
Driver for the PL110/PL111 LCD display.
:'os/src/drivers/framebuffer/spec/omap4':
Driver for HDMI output on OMAP4 SoCs.
:'os/src/drivers/framebuffer/spec/exynos5':
Driver for HDMI output on Exynos-5 SoCs.
:'os/src/drivers/framebuffer/spec/imx53':
Driver for LCD output on i.MX53 SoCs.
:'os/src/drivers/framebuffer/spec/rpi':
Driver for the HDMI output of the Raspberry Pi.
:'os/src/drivers/framebuffer/spec/sdl':
:_os/src/driver/framebuffer/sdl/_:
Serves as both framebuffer and input driver on Linux using libSDL. This
driver is only usable on the Linux base platform.
:'os/src/drivers/gpu/intel':
Intel Graphics GPU multiplexer for Broadwell and newer.
:_os/src/driver/framebuffer/virtio/_:
Driver for the Virtio virtual graphics device as supported by Qemu.
:'dde_linux/src/drivers/framebuffer/intel':
:_os/src/driver/gpu/intel/_:
An Intel Graphics GPU multiplexer for Broadwell and newer.
:_pc/src/driver/framebuffer/intel/_:
Framebuffer driver for Intel i915 compatible graphic cards based on
the Linux Intel KMS driver.
:'dde_linux/src/drivers/usb':
USB driver that makes USB HID and USB storage devices available as input
sessions and block session respectively. For examples of using this driver,
refer to the run scripts at 'dde_linux/run/usb_hid' and
'dde_linux/run/usb_storage'.
:_pc/src/driver/usb_host/_:
USB host-controller driver that provides an USB session interface to
USB drivers.
:_dde_linux/src/driver/usb_hid/_:
USB Human Interface Device driver using the USB session interface.
Timer drivers
=============
The timer driver located at 'os/src/drivers/timer' implements the timer-session
The timer driver located at _base/src/timer/_ implements the timer-session
interface. Technically, it is both a device driver (accessing a timer
device) and a resource multiplexer (supporting multiple timer-session clients
at the same time). Depending on the base platform, the implementation uses
@@ -197,14 +195,14 @@ provided by the kernel, or a pseudo time source (busy):
Audio drivers
=============
Audio drivers implement the Audio_out session interface defined at
'os/include/audio_out_session/' for playback and optionally the audio_in
interface for recording.
Audio drivers use the audio mixer's record session interface defined at
_os/include/record_session/_ for audio output and optionally the play
session interface _os/include/play_session/_ for audio input.
:'os/src/drivers/audio/spec/linux':
:_os/src/driver/audio/spec/linux/_:
Uses ALSA as back-end on the Linux base platform and supports only playback.
:'dde_bsd/src/drivers/audio':
:_dde_bsd/src/driver/audio/_:
Sound drivers ported from OpenBSD. Currently, the repository
includes support for Intel HD Audio as well as for Ensoniq AudioPCI
(ES1370) compatible sound cards.
@@ -214,121 +212,98 @@ Block drivers
=============
All block drivers implement the block-session interface defined at
'os/include/block_session/'.
_os/include/block_session/_.
:'os/src/drivers/sd_card/spec/pl180':
:_os/src/driver/sd_card/pl180/_:
Driver for SD-cards connected via the PL180 device as found on the PBX-A9
platform.
:'os/src/drivers/sd_card/spec/omap4':
Driver for SD-cards connected to the SD-card controller of the OMAP4 SoC.
:'os/src/drivers/sd_card/spec/exynos5':
Driver for SD-cards and eMMC connected to Exynos-5-based platforms.
:'os/src/drivers/sd_card/spec/imx53':
Driver for SD-cards connected to the Freescale i.MX53 platform like the
Quick Start Board or the USB armory device.
:'os/src/drivers/sd_card/spec/rpi':
Driver for SD-cards connected to the Raspberry Pi.
:'dde_linux/src/drivers/usb':
USB driver that makes USB storage devices available as block sessions.
For an example of using this driver, refer to the run script at
'dde_linux/run/usb_storage'.
:'os/src/drivers/ahci':
:_os/src/driver/ahci/_:
Driver for SATA disks and CD-ROMs on x86 PCs.
:'os/src/drivers/usb_block':
USB Mass Storage Bulk-Only driver using the USB session interface.
:_os/src/driver/nvme/_:
Driver for NVMe block devices on x86 PCs.
:_os/src/driver/usb_block/_:
USB Mass Storage Bulk-Only driver using the USB session interface and provides
a block-session interface.
Network interface drivers
=========================
All network interface drivers implement the NIC session interface
defined at 'os/include/nic_session'.
defined at _os/include/nic_session/_.
:'os/src/drivers/nic/spec/linux':
:_os/src/driver/nic/spec/linux/_:
Driver that uses a Linux tap device as back end. It is only useful on the
Linux base platform.
:'os/src/drivers/nic/spec/lan9118':
:_os/src/driver/nic/lan9118/_:
Native device driver for the LAN9118 network adaptor as featured on the
PBX-A9 platform.
:'os/src/drivers/nic/gem':
Device driver for Cadence EMAC PS network adaptor as featured on the
Xilinx Zynq.
:'dde_ipxe/src/drivers/nic':
:_dde_ipxe/src/driver/nic/_:
Device drivers ported from the iPXE project. Supported devices are Intel
E1000 and pcnet32.
:'dde_linux/src/drivers/wifi':
The wifi_drv component is a port of the Linux mac802.11 stack, including the
:_pc/src/driver/nic/pc/_:
The PC NIC-driver component uses network driver code of the Linux kernel
to drive common network cards as found in commodity PC hardware.
:_pc/src/driver/wifi/_:
The wifi driver component is a port of the Linux mac802.11 stack, including the
iwlwifi driver. It enables the use of Intel Wireless 6xxx and 7xxx cards.
:'dde_linux/src/drivers/usb':
For the OMAP4 platform, the USB driver contains the networking driver.
:'dde_linux/src/drivers/nic/fec':
Driver for ethernet NICs of the i.MX SoC family.
General-purpose I/O drivers
===========================
:'os/src/drivers/gpio/spec/omap4':
Driver for accessing the GPIO pins of OMAP4 platforms.
:'os/src/drivers/gpio/spec/imx53':
Driver for accessing the GPIO pins of i.MX53 platforms.
:'os/src/drivers/gpio/spec/rpi':
Driver for accessing the GPIO pins of Raspberry Pi platforms.
:'os/src/drivers/gpio/spec/exynos5':
Driver for accessing the GPIO pins of Exynos4 platforms, e.g.,
Odroid-X2.
:_dde_linux/src/driver/usb_net/_:
USB network driver using the USB session interface.
Resource multiplexers
#####################
By convention, resource multiplexers are located at the 'src/server'
By convention, resource multiplexers are located at the _src/server/_
subdirectory of a source repository.
:Framebuffer and input: The framebuffer and input session interfaces can be
multiplexed using the Nitpicker GUI server, which allows multiple clients to
create and manage rectangular areas on screen. Nitpicker uses one input
session and one framebuffer session as back end and, in turn, provides
so-called nitpicker sessions to one or multiple clients. Each nitpicker
session contains a virtual framebuffer and a virtual input session. Nitpicker
(including a README file) is located at 'os/src/server/nitpicker'.
:Framebuffer and input: Framebuffer and input devices can be multiplexed using
the Nitpicker GUI server, which allows multiple clients to create and manage
rectangular areas on screen. Nitpicker serves as broker between input
devices, output devices, and graphical applications. It provides an event
service for input drivers, a capture service for output drivers, and a GUI
service for the applications. Each GUI session contains a virtual
framebuffer and a virtual input interface. Nitpicker (including a README
file) is located at _os/src/server/nitpicker/_.
:Audio output: The audio mixer located at 'os/src/server/mixer' enables
multiple clients to use the audio-out interface. The mixing is done by simply
adding and clamping the signals of all present clients.
:Audio output: The audio mixer located at _os/src/server/record_play_mixer/_
allows for the routing and mixing of audio signals from play-session clients
to record-session clients.
:Networking: The NIC bridge located at 'os/src/server/nic_bridge' multiplexes
:Networking: The NIC bridge located at _os/src/server/nic_bridge/_ multiplexes
one NIC session to multiple virtual NIC sessions using a proxy-ARP
implementation. Each client has to obtain a dedicated IP address visible to
the physical network. DHCP requests originating from the virtual NIC sessions
are delegated to the physical network.
:Block: The block-device partition server at 'os/src/server/part_block' reads
The NIC router located at _os/src/server/nic_router/_ multiplexes one NIC
session to multiple virtual NIC sessions by applying network address
translation (NAT).
The NIC-uplink component located at _os/src/server/nic_uplink/_ connects
a NIC client directly to a network driver (as uplink client) without routing.
:Block: The block-device partition server at _os/src/server/part_block/_ reads
the partition table of a block session and exports each partition found as
separate block session. For using this server, please refer to the run
script at 'os/run/part_block'.
script at _os/run/part_block.run_.
:File system: The FAT file-system service allows multiple clients to
concurrently access the same FAT-formatted block device. It is located
at 'libports/src/server/fatfs_fs' and supports FAT, FAT32, and exFAT.
:File system: The VFS file-system server allows multiple clients to
concurrently access the same virtual file system. It is located at
_os/src/server/vfs/_. The VFS can be assembled out of several builtin
file-system types (like a RAM file system, or pseudo file systems for
various Genode session interfaces) as well as external plugins such as rump
(mounting file systems supported by the NetBSD kernel).
:Terminal: The terminal_mux service located at gems/src/server/terminal_mux
:Terminal: The terminal_mux service located at _gems/src/server/terminal_mux/_
is able to provide multiple terminal sessions over one terminal-client
session. The user can switch between the different sessions using a keyboard
shortcut, which brings up an ncurses-based menu.
@@ -340,204 +315,209 @@ Protocol stacks
Protocol stacks come either in the form of separate components that translate
one session interface to another, or in the form of libraries.
Separate components:
Separate components
===================
:'os/src/server/nit_fb':
Translates a nitpicker session to a pair of framebuffer and input sessions.
Each 'nit_fb' instance is visible as a rectangular area on screen presenting
:_os/src/server/gui_fb/_:
Translates a GUI session to a pair of framebuffer and input sessions.
Each 'gui_fb' instance is visible as a rectangular area on screen presenting
a virtual frame buffer. The area is statically positioned. For more
information, please refer to 'os/src/server/nit_fb/README'.
information, please refer to _os/src/server/gui_fb/README_.
:'gems/src/server/wm':
Window manager that implements the nitpicker session interface but manages
:_gems/src/server/wm/_:
Window manager that implements the GUI session interface but manages
each client view as a separate window. The window decorations are provided
by a so-called decorator (e.g., 'gems/src/app/decorator'). The behaviour
by a so-called decorator (e.g., _gems/src/app/decorator/_). The behaviour
is defined by a so-called window layouter such as the floating window
layouter located at 'gems/src/app/floating_window_layouter/'.
layouter located at _gems/src/app/floating_window_layouter/_.
:'demo/src/server/liquid_framebuffer':
Implements the same translation as 'nit_fb' but by presenting an interactive
:_demo/src/server/liquid_framebuffer/_:
Implements the same translation as 'gui_fb' but by presenting an interactive
window rather than a statically positioned screen area.
:'os/src/server/tar_rom':
:_os/src/server/tar_rom/_:
Provides each file contained in a tar file obtained via Genode's ROM session
as separate ROM session.
:'os/src/server/iso9660':
Provides each file of an ISO9660 file system accessed via a block session as
separate ROM session.
:'os/src/server/ram_fs':
A file-system implementation that keeps all data in memory.
:'dde_rump/src/server/rump_fs':
A file-system server that contains various file-systems ported from the
NetBSD kernel.
:'os/src/server/lx_fs':
:_os/src/server/lx_fs/_:
A file system server that makes the file system of a Linux base platform
available to Genode.
:'os/src/server/trace_fs':
A pseudo file system that can be used as a front end to core's TRACE
service.
:_os/src/server/vfs_block/_:
Provides the content of a file obtained from a VFS as a block session,
similar to the loop-mount mechanism on Linux
:'os/src/server/rom_block':
Provides the content of a ROM file as a block session, similar to the
loop-mount mechanism on Linux
:'os/src/server/ram_block':
Provides the content of a RAM dataspace as a block session. In contrast
to 'rom_block', this server provides a writeable block device.
:'os/src/server/terminal_log':
:_os/src/server/terminal_log/_:
Adapter for forwarding LOG messages to a terminal session.
:'os/src/server/log_terminal':
:_os/src/server/log_terminal/_:
Adapter for forwarding terminal output to a LOG session.
:'os/src/server/fs_log':
Adapter that writes LOG messages to files on a file system.
:_demo/src/server/nitlog/_:
Provides a LOG session, printing log output on screen via a GUI session.
:'demo/src/server/nitlog':
Provides a LOG session, printing log output on screen via a nitpicker
session.
:'os/src/app/rom_logger':
:_os/src/app/rom_logger/_:
The rom_logger component requests a ROM session and writes the
content of the ROM dataspace to the LOG.
:'os/src/server/rom_filter':
:_os/src/server/rom_filter/_:
The ROM filter provides a ROM module that depends on the content of
other ROM modules steered by the filter configuration, e.g., dynamic
switching between configuration variants dependent on the state of
the system.
:'os/src/server/vfs':
A file-system server using the VFS library and plugins as backend.
:'os/src/server/log_terminal':
Forwards terminal output to a LOG session.
:'gems/src/server/file_terminal':
:_gems/src/server/file_terminal/_:
Provides terminal sessions that target files on a file system.
:'gems/src/server/terminal':
:_gems/src/server/terminal/_:
Provides a terminal session via a graphical terminal using a framebuffer
session and an input session.
:'gems/src/server/tcp_terminal':
:_gems/src/server/tcp_terminal/_:
Provides one or multiple terminal sessions over TCP connections.
For further information, refer to 'gems/src/server/tcp_terminal/README'.
For further information, refer to _gems/src/server/tcp_terminal/README_.
:'os/src/server/terminal_crosslink':
:_os/src/server/terminal_crosslink/_:
The terminal crosslink service allows to terminal clients to talk to each
other.
:'gems/src/server/http_block':
A block service that fetches a virtual block device over the network from
a HTTP server.
:'os/src/server/fs_rom':
:_os/src/server/fs_rom/_:
A ROM service that translates the 'File_system' session interface to the
'ROM' session' interface. Each request for a ROM file is handled by looking
up an equally named file on the file system.
Please refer to 'os/src/server/fs_rom' for more information.
Please refer to _os/src/server/fs_rom/_ for more information.
:'os/src/server/dynamic_rom':
For use cases where ROMs are known to be static, the
_os/src/server/cached_fs_rom/_ can be considered as a faster alternative to
the regular 'fs_rom' server. Note that 'cached_fs_rom' is not supported
in base-linux though.
:_os/src/server/chroot/_:
An intermediate file-system server that makes a sub directory of a file
system available as the root of a file system handed out to its client.
:_os/src/server/dynamic_rom/_:
A simple ROM service that provides ROM modules that change in time according
to a configured timeline.
:'os/src/server/report_rom':
:_os/src/server/report_rom/_:
A service that implements both the report session interface and the ROM
session interface. It reflects incoming reports as ROM modules.
:'os/src/server/fs_report':
:_os/src/server/fs_report/_:
Report server that writes reports to file-systems
:'os/src/server/clipboard':
:_os/src/server/clipboard/_:
This component is both a report service and a ROM service. The
clients of the report service can issue new clipboard content, which
is then propagated to the clients of the ROM service according to a
configurable information-flow policy.
:'ports/src/app/openvpn':
OpenVPN enables access to remote network resources through a secure tunnel
by providing an encrypted connection to a remote host. It is plugged between
NIC server (such as a network driver) and NIC client.
:_os/src/server/event_filter/_:
A component that transforms and merges input events from multiple sources
into a single event stream.
:'os/src/server/input_merger':
A component that merges input events from multiple sources into a single
stream.
:'libports/src/server/acpi_input':
:_libports/src/app/acpi_event/_:
A component that transforms ACPI events into Genode input events.
:'gems/src/server/nit_fader':
A wrapper for nitpicker's session interface that applies alpha-blending to
the of views a nitpicker client.
:_gems/src/server/gui_fader/_:
A wrapper for nitpicker's GUI session interface that applies alpha-blending
to the of views a GUI client.
Libraries:
:_os/src/server/black_hole/_:
Mockup implementation of Genode session interfaces.
:'libports/lib/mk/libc':
:_dde_linux/src/app/wireguard/_:
Port of the Linux implementation of the WireGuard VPN as Genode component.
VFS plugins
===========
VFS plugins are file-system drivers in the form of shared libraries that
implement the VFS-plugin interface. They can be combined with any application
based on Genode's C runtime, with the VFS server, and with non-POSIX
components that use the Genode's VFS library directly.
:_os/src/lib/vfs/tap/_:
A VFS plugin that allows for packet-level access of a NIC or uplink session.
:_gems/src/lib/vfs/trace/_:
A VFS plugin that makes core's TRACE service accessible as a pseudo
file system.
:_gems/src/lib/vfs/import/_:
A VFS plugin that pre-populates a VFS with initial content.
:_gems/src/lib/vfs/pipe/_:
A VFS plugin that provides bi-directional pipes for exchanging streamed
data between components.
:_gems/src/lib/vfs/ttf/_:
A VFS plugin that makes rendered pixel data of the glyphs of Truetype fonts
available as a pseudo file system.
:_libports/src/lib/vfs/jitterentropy/_:
A VFS plugin that provides random numbers based on the jitter of executing
CPU instructions.
:_libports/src/lib/vfs/lwip/_:
A VFS plugin that uses the light-weight IP (lwIP) stack to provide a
network socket interface as a pseudo file system.
:_dde_linux/src/lib/vfs/lxip/_:
A VFS plugin that uses the TCP/IP stack ported from the Linux kernel to
provide a network socket interface as a pseudo file system.
:_libports/src/lib/vfs/fatfs/_:
A VFS plugin that allows for the mounting of FAT-formatted block devices.
:_os/src/lib/vfs/tap/_:
A VFS plugin for the interaction with raw network packets.
:_dde_rump/src/lib/vfs/rump/_:
A VFS plugin that enables the use of NetBSD's file-system drivers such
as ext2 or msdos.
Libraries
=========
:_libports/lib/mk/libc/_:
C runtime ported from FreeBSD.
:'libports/lib/mk/libc_fatfs':
Accesses files on a block device that contains a FAT32 file system.
:'libports/lib/mk/libc_fuse_exfat':
Accesses files on a block device that contains an exFAT file system.
:'libports/lib/mk/libc_fuse_ext2':
Accesses files on a block device that contains an ext2 file system.
:'libports/lib/mk/stdcxx':
:_libports/lib/mk/stdcxx/_:
Standard C++ library
:'libports/lib/mk/mesa_api':
:_libports/lib/mk/mesa_api/_:
Mesa OpenGL API with backends for software rasterization (egl_swrast)
and Intel Graphics (egl_i965)
:'libports/lib/mk/pthread':
Subset of the POSIX thread and semaphore API.
:'libports/lib/mk/python':
Runtime of the Python scripting language.
:'libports/lib/mk/mupdf':
:_libports/lib/mk/mupdf/_:
PDF rendering engine.
:'libports/lib/mk/sdl':
Translates the libSDL API to framebuffer and input sessions.
:'libports/lib/mk/ncurses':
:_libports/lib/mk/ncurses/_:
Library for implementing pseudo-graphical applications (i.e., VIM) that
run on a text terminal.
:'libports/lib/mk/avcodec':
A library for video decoding, conversion, and streaming.
:_libports/qt6/_:
Qt6 application framework.
:'libports/lib/mk/lua':
Runtime for the Lua scripting language.
:'libports/lib/mk/qt5_*':
Qt5 framework, using nitpicker session and NIC session as back end.
:'libports/lib/mk/vfs_jitterentropy.mk':
:_libports/lib/mk/vfs_jitterentropy.mk_:
A VFS plugin that makes a jitter-based random-number generator available
as a file within the process-local VFS.
:'libports/lib/mk/libarchive.mk':
:_libports/lib/mk/libarchive.mk_:
Library providing a common interface to a variety of archive
formats.
:'libports/lib/mk/lz4.mk':
:_libports/lib/mk/lz4.mk_:
Library for processing LZ4 lossless compression archives.
:'libports/lib/mk/liblzma.mk':
:_libports/lib/mk/liblzma.mk_:
Library for processing LZMA archives.
:'libports/lib/mk/libgcrypt.mk':
:_libports/lib/mk/libgcrypt.mk_:
GnuPG library for OpenPGP processing, e.g., signature verification.
@@ -545,103 +525,95 @@ Applications
############
Applications are Genode components that use other component's services but
usually do not provide services. They are typically located in the 'src/app/'
usually do not provide services. They are typically located in the _src/app/_
subdirectory of a repository. Most applications come with README files
located in their respective directory.
:'gems/src/app/backdrop':
Nitpicker client application that sets a composition of PNG images as
desktop background.
:_gems/src/app/backdrop/_:
GUI client application that sets a composition of PNG images as desktop
background.
:'demo/src/app/launchpad':
:_demo/src/app/launchpad/_:
Graphical application for interactively starting and killing subsystems.
:'gems/app/launcher': Graphical launcher of Genode subsystems.
:'os/app/cli_monitor': Command-line-based launcher of Genode subsystems.
:'demo/src/app/scout':
:_demo/src/app/scout/_:
Graphical hypertext browser used for Genode's default demonstration scenario.
:'libports/src/test/mesa_demo':
Example programs for using the Mesa OpenGL graphics stack.
:_os/src/monitor/_:
Variant of init that allows for the debugging of components via GDB over a
remote connection.
:'ports/src/app/arora':
Arora is a Qt-based web browser using the Webkit engine.
:'ports/src/app/gdb_monitor':
Application that allows the debugging of a process via GDB over a remote
connection.
:'libports/src/app/qt5/qt_launchpad':
:_libports/src/app/qt6/qt_launchpad/_:
Graphical application starter implemented using Qt.
:'libports/src/app/qt5/examples/':
:_libports/src/app/qt6/examples/_:
Several example applications that come with Qt.
:'os/src/app/sequence':
:_os/src/app/sequence/_:
Simple utility to serialize the execution of multiple components
:'ports/src/noux-pkg':
:_ports/src/noux-pkg/_:
Ports of popular commandline-based Unix software such as VIM, bash,
coreutils, binutils, gcc, findutils, and netcat. The programs are supposed
to be executed within the Noux runtime environment.
:'ports/src/app/lighttpd':
:_ports/src/app/lighttpd/_:
Lighttpd is a fast and feature-rich web server. The port of lighttpd uses
a file-system session to access the website content and the web-server
configuration.
:'os/src/app/trace_logger':
:_os/src/app/trace_logger/_:
Convenient, runtime-configurable frontend to the tracing facility.
:'os/src/app/rom_reporter':
:_os/src/app/rom_reporter/_:
The ROM-reporter component requests a ROM session and reports the
content of the ROM dataspace to a report session with the same label
as the ROM session.
:'os/src/app/log_core':
:_os/src/app/log_core/_:
Component transforming core and kernel output to Genode LOG output.
Package-management components
=============================
:'gems/src/app/depot_query':
:_gems/src/app/depot_query/_:
Tool for querying subsystem information from a depot.
:'gems/src/app/depot_download_manager':
:_gems/src/app/depot_download_manager/_:
Tool for managing the download of depot content.
:'gems/src/app/depot_deploy':
:_gems/src/app/depot_deploy/_:
Subsystem init configuration generator based on blueprints.
:'libports/src/app/fetchurl':
:_gems/src/app/depot_remove/_:
Tool for the orderly removal of depot content.
:_libports/src/app/fetchurl/_:
A runtime-configurable frontend to the libcURL library for
downloading content.
:'libports/src/app/extract':
:_libports/src/app/extract/_:
Tool for extracting archives using libarchive.
:'ports/src/app/verify':
:_ports/src/app/verify/_:
This component verifies detached OpenPGP signatures using libgcrypt.
Runtime environments
####################
:'ports/src/noux': Noux is an experimental implementation of a UNIX-like API
that enables the use of unmodified command-line based GNU software. For using
noux, refer to the run script 'ports/run/noux.run'.
:'ports/src/app/seoul': Seoul is a virtual-machine monitor developed for
the use with the NOVA platform. It virtualizes 32bit x86 PC hardware
including various peripherals.
:'os/src/server/loader': A service that allows the creation and destruction
:_os/src/server/loader/_: A service that allows the creation and destruction
of Genode subsystems via a session interface. For further information,
refer to 'os/src/server/loader/README'.
refer to _os/src/server/loader/README_.
:'ports/src/app/dosbox': A port of DosBox for executing DOS software.
:_ports/src/virtualbox6/_: VirtualBox running on top of the NOVA hypervisor.
:'ports/src/virtualbox': VirtualBox running on top of the NOVA hypervisor.
:_os/src/server/vmm/_: A virtual machine monitor that is based on
hardware-assisted virtualization of ARM platforms. It is supported on
the base-hw kernel only.
:_os/src/server/cpu_balancer/_: The CPU balancer intercepts the interaction
of components with core's low-level services to migrate threads dynamically
between CPU cores.

View File

@@ -140,7 +140,7 @@ permission to let Genode Labs redistribute his contributions under non-AGPLv3
licenses. This permission is granted by signing the Genode Contributors
Agreement:
:[http:gca.pdf - Genode Contributor's Agreement]:
:[https://genode.org/community/gca.pdf - Genode Contributor's Agreement]:
Genode Contributor's Agreement (GCA)
By signing the GCA, you don't lose any rights for your contribution. However,

View File

@@ -1,70 +1,333 @@
Conventions for the Genode development
Norman Feske
==================================================
Conventions and coding-style guidelines for Genode
==================================================
Documentation
#############
Documentation and naming of files
#################################
We use the GOSH syntax [https://github.com/nfeske/gosh] for documentation and
README files.
We encourage that each directory contains a file called 'README' that briefly
explains what the directory is about.
README files
############
File names
----------
Each directory should contain a file called 'README' that briefly explains
what the directory is about. In 'doc/Makefile' is a rule for
generating a directory overview from the 'README' files automatically.
You can structure your 'README' file by using the GOSH style for subsections:
! Subsection
! ~~~~~~~~~~
Do not use chapters or sections in your 'README' files.
Filenames
#########
All normal filenames are lowercase. Filenames should be chosen to be
expressive. Someone who explores your files for the first time might not
All normal file names are lowercase. Filenames should be chosen to be
expressive. Someone who explores your files for the first time might not
understand what 'mbi.cc' means but 'multiboot_info.cc' would ring a bell. If a
filename contains multiple words, use the '_' to separate them (instead of
file name contains multiple words, use the '_' to separate them (instead of
'miscmath.h', use 'misc_math.h').
Coding style
############
A common coding style helps a lot to ease collaboration. The official coding
style of the Genode base components is described in 'doc/coding_style.txt'.
If you consider working closely together with the Genode main developers,
your adherence to this style is greatly appreciated.
Things to avoid
===============
Please avoid using pre-processor macros. C++ provides language
features for almost any case, for which a C programmer uses
macros.
:Defining constants:
Use 'enum' instead of '#define'
! enum { MAX_COLORS = 3 };
! enum {
! COLOR_RED = 1,
! COLOR_BLUE = 2,
! COLOR_GREEN = 3
! };
:Meta programming:
Use templates instead of pre-processor macros. In contrast to macros,
templates are type-safe and fit well with the implementation syntax.
:Conditional-code inclusion:
Please avoid C-hacker style '#ifdef CONFIG_PLATFROM' - '#endif'
constructs. Instead, factor-out the encapsulated code into a
separate file and introduce a proper function interface.
The build process should then be used to select the appropriate
platform-specific files at compile time. Keep platform dependent
code as small as possible. Never pollute existing generic code
with platform-specific code.
Include files and RPC interfaces
################################
Header of each file
===================
Never place include files directly into the '<repository>/include/' directory
but use a meaningful subdirectory that corresponds to the component that
provides the interfaces.
Each RPC interface is represented by a separate include subdirectory. For
an example, see 'base/include/ram_session/'. The header file that defines
the RPC function interface has the same base name as the directory. The RPC
stubs are called 'client.h' and 'server.h'. If your interface uses a custom
capability type, it is defined in 'capability.h'. Furthermore, if your
interface is a session interface of a service, it is good practice to
provide a connection class in a 'connection.h' file for managing session-
construction arguments and the creation and destruction of sessions.
Specialization-dependent include directories are placed in 'include/<specname>/'.
! /*
! * \brief Short description of the file
! * \author Original author
! * \date Creation date
! *
! * Some more detailed description. This is optional.
! */
Service Names
#############
Identifiers
===========
* The first character of class names are uppercase, any other characters are
lowercase.
* Function and variable names are lower case.
* 'Multi_word_identifiers' use underline to separate words.
* 'CONSTANTS' and template arguments are upper case.
* Private and protected members of a class begin with an '_'-character.
* Accessor methods are named after their corresponding attributes:
! /**
! * Request private member variable
! */
! int value() const { return _value; }
!
! /**
! * Set the private member variable
! */
! void value(int value) { _value = value; }
* Accessors that return a boolean value do not carry an 'is_' prefix. E.g.,
a method for requesting the validity of an object should be named
'valid()', not 'is_valid()'.
Indentation
===========
* Use one tab per indentation step. *Do not mix tabs and spaces!*
* Use no tabs except at the beginning of a line.
* Use spaces for the alignment of continuation lines such as function
arguments that span multiple lines. The alignment spaces of such lines
should start after the (tab-indented) indentation level. For example:
! {
! <tab>function_with_many_arguments(arg1,
! <tab><--- spaces for aligment --->arg2,
! ...
! }
* Remove trailing spaces at the end of lines
This way, each developer can set his preferred tab size in his editor
and the source code always looks good.
_Hint:_ In VIM, use the 'set list' and 'set listchars' commands to make tabs
and spaces visible.
* If class initializers span multiple lines, put the colon on a separate
line and indent the initializers using one tab. For example:
! Complicated_machinery(Material &material, Deadline deadline)
! :
! <tab>_material(material),
! <tab>_deadline(deadline),
! <tab>...
! {
! ...
! }
* Preferably place statements that alter the control flow - such as
'break', 'continue', or 'return' - at the beginning of a separate line,
followed by vertical space (a blank line or the closing brace of the
surrounding scope).
! if (early_return_possible)
! return;
Switch statements
~~~~~~~~~~~~~~~~~
Switch-statement blocks should be indented as follows:
! switch (color) {
!
! case BLUE:
! <tab>break;
!
! case GREEN:
! <tab>{
! <tab><tab>int declaration_required;
! <tab><tab>...
! <tab>}
!
! default:
! }
Please note that the case labels have the same indentation
level as the switch statement. This avoids a two-level
indentation-change at the end of the switch block that
would occur otherwise.
Vertical whitespaces
====================
In header files:
* Leave two empty lines between classes.
* Leave one empty line between member functions.
In implementation files:
* Leave two empty lines between functions.
Braces
======
* Braces after class, struct and function names are placed at a new line:
! class Foo
! {
! public:
!
! void method(void)
! {
! ...
! }
! };
except for one-line functions.
* All other occurrences of open braces (for 'if', 'while', 'do', 'for',
'namespace', 'enum' etc.) are at the end of a line:
! if (flag) {
! ..
! } else {
! ..
! }
* One-line functions should be written on a single line as long as the line
length does not exceed approximately 80 characters.
Typically, this applies for accessor functions.
If slightly more space than one line is needed, indent as follows:
! int heavy_computation(int a, int lot, int of, int args) {
! return a + lot + of + args; }
Comments
========
Function/method header
~~~~~~~~~~~~~~~~~~~~~~
Each public or protected (but no private) method in a header-file should be
prepended by a header as follows:
! /**
! * Short description
! *
! * \param a meaning of parameter a
! * \param b meaning of parameter b
! * \param c,d meaning of parameters c and d
! *
! * \throw Exception_type meaning of the exception
! *
! * \return meaning of return value
! *
! * More detailed information about the function. This is optional.
! */
Descriptions of parameters and return values should be lower-case and brief.
More elaborative descriptions can be documented in the text area below.
In implementation files, only local and private functions should feature
function headers.
Single-line comments
~~~~~~~~~~~~~~~~~~~~
! /* use this syntax for single line comments */
A single-line comment should be prepended by an empty line.
Single-line comments should be short - no complete sentences. Use lower-case.
C++-style comments ('//') should only be used for temporarily commenting-out
code. Such commented-out garbage is easy to 'grep' and there are handy
'vim'-macros available for creating and removing such comments.
Variable descriptions
~~~~~~~~~~~~~~~~~~~~~
Use the same syntax as for single-line comments. Insert two or more
spaces before your comment starts.
! int size; /* in kilobytes */
Multi-line comments
~~~~~~~~~~~~~~~~~~~
Multi-line comments are more detailed descriptions in the form of
sentences.
A multi-line comment should be enclosed by empty lines.
! /*
! * This is some tricky
! * algorithm that works
! * as follows:
! * ...
! */
The first and last line of a multi-line comment contain no words.
Source-code blocks
~~~~~~~~~~~~~~~~~~
For structuring your source code, you can entitle the different
parts of a file like this:
! <- two empty lines
!
! /********************
! ** Event handlers **
! ********************/
! <- one empty line
Note the two stars at the left and right. There are two of them to
make the visible width of the border match its height (typically,
characters are ca. twice as high as wide).
A source-code block header represents a headline for the following
code. To couple this headline with the following code closer than
with previous code, leave two empty lines above and one empty line
below the source-code block header.
Order of public, protected, and private blocks
==============================================
For consistency reasons, use the following class layout:
! class Sandstein
! {
! private:
! ...
! protected:
! ...
! public:
! };
Typically, the private section contains member variables that are used
by public accessor functions below. In this common case, we only reference
symbols that are defined above as it is done when programming plain C.
Leave one empty line (or a line that contains only a brace) above and below
a 'private', 'protected', or 'public' label. This also applies when the
label is followed by a source-code block header.
Naming of Genode services
=========================
Service names as announced via the 'parent()->announce()' function follow
the following convention:

View File

@@ -1,514 +0,0 @@
============================
Package management on Genode
============================
Norman Feske
Motivation and inspiration
##########################
The established system-integration work flow with Genode is based on
the 'run' tool, which automates the building, configuration, integration,
and testing of Genode-based systems. Whereas the run tool succeeds in
overcoming the challenges that come with Genode's diversity of kernels and
supported hardware platforms, its scalability is somewhat limited to
appliance-like system scenarios: The result of the integration process is
a system image with a certain feature set. Whenever requirements change,
the system image is replaced with a new created image that takes those
requirements into account. In practice, there are two limitations of this
system-integration approach:
First, since the run tool implicitly builds all components required for a
system scenario, the system integrator has to compile all components from
source. E.g., if a system includes a component based on Qt5, one needs to
compile the entire Qt5 application framework, which induces significant
overhead to the actual system-integration tasks of composing and configuring
components.
Second, general-purpose systems tend to become too complex and diverse to be
treated as system images. When looking at commodity OSes, each installation
differs with respect to the installed set of applications, user preferences,
used device drivers and system preferences. A system based on the run tool's
work flow would require the user to customize the run script of the system for
each tweak. To stay up to date, the user would need to re-create the
system image from time to time while manually maintaining any customizations.
In practice, this is a burden, very few end users are willing to endure.
The primary goal of Genode's package management is to overcome these
scalability limitations, in particular:
* Alleviating the need to build everything that goes into system scenarios
from scratch,
* Facilitating modular system compositions while abstracting from technical
details,
* On-target system update and system development,
* Assuring the user that system updates are safe to apply by providing the
ability to easily roll back the system or parts thereof to previous versions,
* Securing the integrity of the deployed software,
* Fostering a federalistic evolution of Genode systems,
* Low friction for existing developers.
The design of Genode's package-management concept is largely influenced by Git
as well as the [https://nixos.org/nix/ - Nix] package manager. In particular
the latter opened our eyes to discover the potential that lies beyond the
package management employed in state-of-the art commodity systems. Even though
we considered adapting Nix for Genode and actually conducted intensive
experiments in this direction (thanks to Emery Hemingway who pushed forward
this line of work), we settled on a custom solution that leverages Genode's
holistic view on all levels of the operating system including the build system
and tooling, source structure, ABI design, framework API, system
configuration, inter-component interaction, and the components itself. Whereby
Nix is designed for being used on top of Linux, Genode's whole-systems view
led us to simplifications that eliminated the needs for Nix' powerful features
like its custom description language.
Nomenclature
############
When speaking about "package management", one has to clarify what a "package"
in the context of an operating system represents. Traditionally, a package
is the unit of delivery of a bunch of "dumb" files, usually wrapped up in
a compressed archive. A package may depend on the presence of other
packages. Thereby, a dependency graph is formed. To express how packages fit
with each other, a package is usually accompanied with meta data
(description). Depending on the package manager, package descriptions follow
certain formalisms (e.g., package-description language) and express
more-or-less complex concepts such as versioning schemes or the distinction
between hard and soft dependencies.
Genode's package management does not follow this notion of a "package".
Instead of subsuming all deliverable content under one term, we distinguish
different kinds of content, each in a tailored and simple form. To avoid the
clash of the notions of the common meaning of a "package", we speak of
"archives" as the basic unit of delivery. The following subsections introduce
the different categories.
Archives are named with their version as suffix, appended via a slash. The
suffix is maintained by the author of the archive. The recommended naming
scheme is the use of the release date as version suffix, e.g.,
'report_rom/2017-05-14'.
Raw-data archives
=================
A raw-data archive contains arbitrary data that is - in contrast to executable
binaries - independent from the processor architecture. Examples are
configuration data, game assets, images, or fonts. The content of raw-data
archives is expected to be consumed by components at runtime. It is not
relevant for the build process for executable binaries. Each raw-data
archive contains merely a collection of data files. There is no meta data.
API archive
===========
An API archive has the structure of a Genode source-code repository. It may
contain all the typical content of such a source-code repository such as header
files (in the _include/_ subdirectory), source codes (in the _src/_
subdirectory), library-description files (in the _lib/mk/_ subdirectory), or
ABI symbols (_lib/symbols/_ subdirectory). At the top level, a LICENSE file is
expected that clarifies the license of the contained source code. There is no
meta data contained in an API archive.
An API archive is meant to provide _ingredients_ for building components. The
canonical example is the public programming interface of a library (header
files) and the library's binary interface in the form of an ABI-symbols file.
One API archive may contain the interfaces of multiple libraries. For example,
the interfaces of libc and libm may be contained in a single "libc" API
archive because they are closely related to each other. Conversely, an API
archive may contain a single header file only. The granularity of those
archives may vary. But they have in common that they are used at build time
only, not at runtime.
Source archive
==============
Like an API archive, a source archive has the structure of a Genode
source-tree repository and is expected to contain all the typical content of
such a source repository along with a LICENSE file. But unlike an API archive,
it contains descriptions of actual build targets in the form of Genode's usual
'target.mk' files.
In addition to the source code, a source archive contains a file
called 'used_apis', which contains a list of API-archive names with each
name on a separate line. For example, the 'used_apis' file of the 'report_rom'
source archive looks as follows:
! base/2017-05-14
! os/2017-05-13
! report_session/2017-05-13
The 'used_apis' file declares the APIs needed to incorporate into the build
process when building the source archive. Hence, they represent _build-time_
_dependencies_ on the specific API versions.
A source archive may be equipped with a top-level file called 'api' containing
the name of exactly one API archive. If present, it declares that the source
archive _implements_ the specified API. For example, the 'libc/2017-05-14'
source archive contains the actual source code of the libc and libm as well as
an 'api' file with the content 'libc/2017-04-13'. The latter refers to the API
implemented by this version of the libc source package (note the differing
versions of the API and source archives)
Binary archive
==============
A binary archive contains the build result of the equally-named source archive
when built for a particular architecture. That is, all files that would appear
at the _<build-dir>/bin/_ subdirectory when building all targets present in
the source archive. There is no meta data present in a binary archive.
A binary archive is created out of the content of its corresponding source
archive and all API archives listed in the source archive's 'used_apis' file.
Note that since a binary archive depends on only one source archive, which
has no further dependencies, all binary archives can be built independently
from each other.
For example, a libc-using application needs the source code of the
application as well as the libc's API archive (the libc's header file and
ABI) but it does not need the actual libc library to be present.
Package archive
===============
A package archive contains an 'archives' file with a list of archive names
that belong together at runtime. Each listed archive appears on a separate line.
For example, the 'archives' file of the package archive for the window
manager 'wm/2018-02-26' looks as follows:
! genodelabs/raw/wm/2018-02-14
! genodelabs/src/wm/2018-02-26
! genodelabs/src/report_rom/2018-02-26
! genodelabs/src/decorator/2018-02-26
! genodelabs/src/floating_window_layouter/2018-02-26
In contrast to the list of 'used_apis' of a source archive, the content of
the 'archives' file denotes the origin of the respective archives
("genodelabs"), the archive type, followed by the versioned name of the
archive.
An 'archives' file may specify raw archives, source archives, or package
archives (as type 'pkg'). It thereby allows the expression of _runtime
dependencies_. If a package archive lists another package archive, it inherits
the content of the listed archive. This way, a new package archive may easily
customize an existing package archive.
A package archive does not specify binary archives directly as they differ
between the architecture and are already referenced by the source archives.
In addition to an 'archives' file, a package archive is expected to contain
a 'README' file explaining the purpose of the collection.
Depot structure
###############
Archives are stored within a directory tree called _depot/_. The depot
is structured as follows:
! <user>/pubkey
! <user>/download
! <user>/src/<name>/<version>/
! <user>/api/<name>/<version>/
! <user>/raw/<name>/<version>/
! <user>/pkg/<name>/<version>/
! <user>/bin/<arch>/<src-name>/<src-version>/
The <user> stands for the origin of the contained archives. For example, the
official archives provided by Genode Labs reside in a _genodelabs/_
subdirectory. Within this directory, there is a 'pubkey' file with the
user's public key that is used to verify the integrity of archives downloaded
from the user. The file 'download' specifies the download location as an URL.
Subsuming archives in a subdirectory that correspond to their the origin
(user) serves two purposes. First, it provides a user-local name space for
versioning archives. E.g., there might be two versions of a
'nitpicker/2017-04-15' source archive, one by "genodelabs" and one by
"nfeske". However, since each version resides under its origin's subdirectory,
version-naming conflicts between different origins cannot happen. Second, by
allowing multiple archive origins in the depot side-by-side, package archives
may incorporate archives of different origins, which fosters the goal of a
federalistic development, where contributions of different origins can be
easily combined.
The actual archives are stored in the subdirectories named after the archive
types ('raw', 'api', 'src', 'bin', 'pkg'). Archives contained in the _bin/_
subdirectories are further subdivided in the various architectures (like
'x86_64', or 'arm_v7').
Depot management
################
The tools for managing the depot content reside under the _tool/depot/_
directory. When invoked without arguments, each tool prints a brief
description of the tool and its arguments.
Unless stated otherwise, the tools are able to consume any number of archives
as arguments. By default, they perform their work sequentially. This can be
changed by the '-j<N>' argument, where <N> denotes the desired level of
parallelization. For example, by specifying '-j4' to the _tool/depot/build_
tool, four concurrent jobs are executed during the creation of binary archives.
Downloading archives
====================
The depot can be populated with archives in two ways, either by creating
the content from locally available source codes as explained by Section
[Automated extraction of archives from the source tree], or by downloading
ready-to-use archives from a web server.
In order to download archives originating from a specific user, the depot's
corresponding user subdirectory must contain two files:
:_pubkey_: contains the public key of the GPG key pair used by the creator
(aka "user") of the to-be-downloaded archives for signing the archives. The
file contains the ASCII-armored version of the public key.
:_download_: contains the base URL of the web server where to fetch archives
from. The web server is expected to mirror the structure of the depot.
That is, the base URL is followed by a sub directory for the user,
which contains the archive-type-specific subdirectories.
If both the public key and the download locations are defined, the download
tool can be used as follows:
! ./tool/depot/download genodelabs/src/zlib/2018-01-10
The tool automatically downloads the specified archives and their
dependencies. For example, as the zlib depends on the libc API, the libc API
archive is downloaded as well. All archive types are accepted as arguments
including binary and package archives. Furthermore, it is possible to download
all binary archives referenced by a package archive. For example, the
following command downloads the window-manager (wm) package archive including
all binary archives for the 32-bit x86 architecture. Downloaded binary
archives are always accompanied with their corresponding source and used API
archives.
! ./tool/depot/download genodelabs/pkg/x86_64/wm/2018-02-26
Archive content is not downloaded directly to the depot. Instead, the
individual archives and signature files are downloaded to a quarantine area in
the form of a _public/_ directory located in the root of Genode's source tree.
As its name suggests, the _public/_ directory contains data that is imported
from or to-be exported to the public. The download tool populates it with the
downloaded archives in their compressed form accompanied with their
signatures.
The compressed archives are not extracted before their signature is checked
against the public key defined at _depot/<user>/pubkey_. If however the
signature is valid, the archive content is imported to the target destination
within the depot. This procedure ensures that depot content - whenever
downloaded - is blessed by a cryptographic signature of its creator.
Building binary archives from source archives
=============================================
With the depot populated with source and API archives, one can use the
_tool/depot/build_ tool to produce binary archives. The arguments have the
form '<user>/bin/<arch>/<src-name>' where '<arch>' stands for the targeted
CPU architecture. For example, the following command builds the 'zlib'
library for the 64-bit x86 architecture. It executes four concurrent jobs
during the build process.
! ./tool/depot/build genodelabs/bin/x86_64/zlib/2018-01-10 -j4
Note that the command expects a specific version of the source archive as
argument. The depot may contain several versions. So the user has to decide,
which one to build.
After the tool is finished, the freshly built binary archive can be found in
the depot within the _genodelabs/bin/<arch>/<src>/<version>/_ subdirectory.
Only the final result of the built process is preserved. In the example above,
that would be the _zlib.lib.so_ library.
For debugging purposes, it might be interesting to inspect the intermediate
state of the build. This is possible by adding 'KEEP_BUILD_DIR=1' as argument
to the build command. The binary's intermediate build directory can be
found besides the binary archive's location named with a '.build' suffix.
By default, the build tool won't attempt to rebuild a binary archive that is
already present in the depot. However, it is possible to force a rebuild via
the 'REBUILD=1' argument.
Publishing archives
===================
Archives located in the depot can be conveniently made available to the public
using the _tool/depot/publish_ tool. Given an archive path, the tool takes
care of determining all archives that are implicitly needed by the specified
one, wrapping the archive's content into compressed tar archives, and signing
those.
As a precondition, the tool requires you to possess the private key that
matches the _depot/<you>/pubkey_ file within your depot. The key pair should
be present in the key ring of your GNU privacy guard.
To publish archives, one needs to specify the specific version to publish.
For example:
! ./tool/depot/publish <you>/pkg/x86_64/wm/2018-02-26
The command checks that the specified archive and all dependencies are present
in the depot. It then proceeds with the archiving and signing operations. For
the latter, the pass phrase for your private key will be requested. The
publish tool prints the information about the processed archives, e.g.:
! publish /.../public/<you>/api/base/2018-02-26.tar.xz
! publish /.../public/<you>/api/framebuffer_session/2017-05-31.tar.xz
! publish /.../public/<you>/api/gems/2018-01-28.tar.xz
! publish /.../public/<you>/api/input_session/2018-01-05.tar.xz
! publish /.../public/<you>/api/nitpicker_gfx/2018-01-05.tar.xz
! publish /.../public/<you>/api/nitpicker_session/2018-01-05.tar.xz
! publish /.../public/<you>/api/os/2018-02-13.tar.xz
! publish /.../public/<you>/api/report_session/2018-01-05.tar.xz
! publish /.../public/<you>/api/scout_gfx/2018-01-05.tar.xz
! publish /.../public/<you>/bin/x86_64/decorator/2018-02-26.tar.xz
! publish /.../public/<you>/bin/x86_64/floating_window_layouter/2018-02-26.tar.xz
! publish /.../public/<you>/bin/x86_64/report_rom/2018-02-26.tar.xz
! publish /.../public/<you>/bin/x86_64/wm/2018-02-26.tar.xz
! publish /.../public/<you>/pkg/wm/2018-02-26.tar.xz
! publish /.../public/<you>/raw/wm/2018-02-14.tar.xz
! publish /.../public/<you>/src/decorator/2018-02-26.tar.xz
! publish /.../public/<you>/src/floating_window_layouter/2018-02-26.tar.xz
! publish /.../public/<you>/src/report_rom/2018-02-26.tar.xz
! publish /.../public/<you>/src/wm/2018-02-26.tar.xz
According to the output, the tool populates a directory called _public/_
at the root of the Genode source tree with the to-be-published archives.
The content of the _public/_ directory is now ready to be copied to a
web server, e.g., by using rsync.
Automated extraction of archives from the source tree
#####################################################
Genode users are expected to populate their local depot with content obtained
via the _tool/depot/download_ tool. However, Genode developers need a way to
create depot archives locally in order to make them available to users. Thanks
to the _tool/depot/extract_ tool, the assembly of archives does not need to be
a manual process. Instead, archives can be conveniently generated out of the
source codes present in the Genode source tree and the _contrib/_ directory.
However, the granularity of splitting source code into archives, the
definition of what a particular API entails, and the relationship between
archives must be augmented by the archive creator as this kind of information
is not present in the source tree as is. This is where so-called "archive
recipes" enter the picture. An archive recipe defines the content of an
archive. Such recipes can be located at an _recipes/_ subdirectory of any
source-code repository, similar to how port descriptions and run scripts
are organized. Each _recipe/_ directory contains subdirectories for the
archive types, which, in turn, contain a directory for each archive. The
latter is called a _recipe directory_.
Recipe directory
----------------
The recipe directory is named after the archive _omitting the archive version_
and contains at least one file named _hash_. This file defines the version
of the archive along with a hash value of the archive's content
separated by a space character. By tying the version name to a particular hash
value, the _extract_ tool is able to detect the appropriate points in time
whenever the version should be increased due to a change of the archive's
content.
API, source, and raw-data archive recipes
-----------------------------------------
Recipe directories for API, source, or raw-data archives contain a
_content.mk_ file that defines the archive content in the form of make
rules. The content.mk file is executed from the archive's location within
the depot. Hence, the contained rules can refer to archive-relative files as targets.
The first (default) rule of the content.mk file is executed with a customized
make environment:
:GENODE_DIR: A variable that holds the path to root of the Genode source tree,
:REP_DIR: A variable with the path to source code repository where the recipe
is located
:port_dir: A make function that returns the directory of a port within the
_contrib/_ directory. The function expects the location of the
corresponding port file as argument, for example, the 'zlib' recipe
residing in the _libports/_ repository may specify '$(REP_DIR)/ports/zlib'
to access the 3rd-party zlib source code.
Source archive recipes contain simplified versions of the 'used_apis' and
(for libraries) 'api' files as found in the archives. In contrast to the
depot's counterparts of these files, which contain version-suffixed names,
the files contained in recipe directories omit the version suffix. This
is possible because the extract tool always extracts the _current_ version
of a given archive from the source tree. This current version is already
defined in the corresponding recipe directory.
Package-archive recipes
-----------------------
The recipe directory for a package archive contains the verbatim content of
the to-be-created package archive except for the _archives_ file. All other
files are copied verbatim to the archive. The content of the recipe's
_archives_ file may omit the version information from the listed ingredients.
Furthermore, the user part of each entry can be left blank by using '_' as a
wildcard. When generating the package archive from the recipe, the extract
tool will replace this wildcard with the user that creates the archive.
Convenience front-end to the extract, build tools
#################################################
For developers, the work flow of interacting with the depot is most often the
combination of the _extract_ and _build_ tools whereas the latter expects
concrete version names as arguments. The _create_ tool accelerates this common
usage pattern by allowing the user to omit the version names. Operations
implicitly refer to the _current_ version of the archives as defined in
the recipes.
Furthermore, the _create_ tool is able to manage version updates for the
developer. If invoked with the argument 'UPDATE_VERSIONS=1', it automatically
updates hash files of the involved recipes by taking the current date as
version name. This is a valuable assistance in situations where a commonly
used API changes. In this case, the versions of the API and all dependent
archives must be increased, which would be a labour-intensive task otherwise.
If the depot already contains an archive of the current version, the create
tools won't re-create the depot archive by default. Local modifications of
the source code in the repository do not automatically result in a new archive.
To ensure that the depot archive is current, one can specify 'FORCE=1' to
the create tool. With this argument, existing depot archives are replaced by
freshly extracted ones and version updates are detected. When specified for
creating binary archives, 'FORCE=1' normally implies 'REBUILD=1'. To prevent
the superfluous rebuild of binary archives whose source versions remain
unchanged, 'FORCE=1' can be combined with the argument 'REBUILD='.
Accessing depot content from run scripts
########################################
The depot tools are not meant to replace the run tool but rather to complement
it. When both tools are combined, the run tool implicitly refers to "current"
archive versions as defined for the archive's corresponding recipes. This way,
the regular run-tool work flow can be maintained while attaining a
productivity boost by fetching content from the depot instead of building it.
Run scripts can use the '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. Each 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 corresponding binary archive into the scenario. The binary archives
are selected according the spec values as defined for the build directory.

View File

@@ -1,145 +0,0 @@
=============================
How to start exploring Genode
=============================
Norman Feske
Abstract
########
This guide is meant to provide you a painless start with using the Genode OS
Framework. It explains the steps needed to get a simple demo system running
on Linux first, followed by the instructions on how to run the same scenario
on a microkernel.
Quick start to build Genode for Linux
#####################################
The best starting point for exploring Genode is to run it on Linux. Make sure
that your system satisfies the following requirements:
* GNU Make version 3.81 or newer
* 'libSDL-dev'
* 'tclsh' and 'expect'
* 'byacc' (only needed for the L4/Fiasco kernel)
* 'qemu' and 'xorriso' (for testing non-Linux platforms via Qemu)
For using the entire collection of ported 3rd-party software, the following
packages should be installed additionally: 'autoconf2.64', 'autogen', 'bison',
'flex', 'g++', 'git', 'gperf', 'libxml2-utils', 'subversion', and 'xsltproc'.
Your exploration of Genode starts with obtaining the source code of the
[https://sourceforge.net/projects/genode/files/latest/download - latest version]
of the framework. For detailed instructions and alternatives to the
download from Sourceforge please refer to [https://genode.org/download].
Furthermore, you will need to install the official Genode tool chain, which
you can download at [https://genode.org/download/tool-chain].
The Genode build system never touches the source tree but generates object
files, libraries, and programs in a dedicated build directory. We do not have a
build directory yet. For a quick start, let us create one for the Linux base
platform:
! cd <genode-dir>
! ./tool/create_builddir x86_64
This creates a new build directory for building x86_64 binaries in './build'.
The build system creates unified binaries that work on the given
architecture independent from the underlying base platform, in this case Linux.
To give Genode a try, build and execute a simple demo scenario via:
! cd build/x86_64
! make KERNEL=linux BOARD=linux run/demo
By invoking 'make' with the 'run/demo' argument, all components needed by the
demo scenario are built and the demo is executed. This includes all components
which are implicitly needed by the base platform. The base platform that the
components will be executed upon on is selected via the 'KERNEL' and 'BOARD'
variables. If you are interested in looking behind the scenes of the demo
scenario, please refer to 'doc/build_system.txt' and the run script at
'os/run/demo.run'.
Using platforms other than Linux
================================
Running Genode on Linux is the most convenient way to get acquainted with the
framework. However, the point where Genode starts to shine is when used as the
user land executed on a microkernel. The framework supports a variety of
different kernels such as L4/Fiasco, L4ka::Pistachio, OKL4, and NOVA. Those
kernels largely differ in terms of feature sets, build systems, tools, and boot
concepts. To relieve you from dealing with those peculiarities, Genode provides
you with an unified way of using them. For each kernel platform, there exists
a dedicated description file that enables the 'prepare_port' tool to fetch and
prepare the designated 3rd-party sources. Just issue the following command
within the toplevel directory of the Genode source tree:
! ./tool/ports/prepare_port <platform>
Note that each 'base-<platform>' directory comes with a 'README' file, which
you should revisit first when exploring the base platform. Additionally, most
'base-<platform>' directories provide more in-depth information within their
respective 'doc/' subdirectories.
For the VESA driver on x86, the x86emu library is required and can be
downloaded and prepared by again invoking the 3rd-party sources preparation
tool:
! ./tool/ports/prepare_port x86emu
On x86 base platforms the GRUB2 boot loader is required and can be
downloaded and prepared by invoking:
! ./tool/ports/prepare_port grub2
Now that the base platform is prepared, the 'create_builddir' tool can be used
to create a build directory for your architecture of choice by giving the
architecture as argument. To see the list of available architecture, execute
'create_builddir' with no arguments. Note, that not all kernels support all
architectures.
For example, to give the demo scenario a spin on the OKL4 kernel, the following
steps are required:
# Download the kernel:
! cd <genode-dir>
! ./tool/ports/prepare_port okl4
# Create a build directory
! ./tool/create_builddir x86_32
# Uncomment the following line in 'x86_32/etc/build.conf'
! REPOSITORIES += $(GENODE_DIR)/repos/libports
# Build and execute the demo using Qemu
! make -C build/x86_32 KERNEL=okl4 BOARD=pc run/demo
The procedure works analogously for the other base platforms. You can, however,
reuse the already created build directory and skip its creation step if the
architecture matches.
How to proceed with exploring Genode
####################################
Now that you have taken the first steps into using Genode, you may seek to
get more in-depth knowledge and practical experience. The foundation for doing
so is a basic understanding of the build system. The documentation at
'build_system.txt' provides you with the information about the layout of the
source tree, how new components are integrated, and how complete system
scenarios can be expressed. Equipped with this knowledge, it is time to get
hands-on experience with creating custom Genode components. A good start is the
'hello_tutorial', which shows you how to implement a simple client-server
scenario. To compose complex scenarios out of many small components, the
documentation of the Genode's configuration concept at 'os/doc/init.txt' is an
essential reference.
Certainly, you will have further questions on your way with exploring Genode.
The best place to get these questions answered is the Genode mailing list.
Please feel welcome to ask your questions and to join the discussions:
:Genode Mailing Lists:
[https://genode.org/community/mailing-lists]

View File

@@ -1,236 +0,0 @@
==========================
Google Summer of Code 2012
==========================
Genode Labs has applied as mentoring organization for the Google Summer of Code
program in 2012. This document summarizes all information important to Genode's
participation in the program.
:[http://www.google-melange.com/gsoc/homepage/google/gsoc2012]:
Visit the official homepage of the Google Summer of Code program.
*Update* Genode Labs was not accepted as mentoring organization for GSoC 2012.
Application of Genode Labs as mentoring organization
####################################################
:Organization ID: genodelabs
:Organization name: Genode Labs
:Organization description:
Genode Labs is a self-funded company founded by the original creators of the
Genode OS project. Its primary mission is to bring the Genode operating-system
technology, which started off as an academic research project, to the real
world. At present, Genode Labs is the driving force behind the Genode OS
project.
:Organization home page url:
http://www.genode-labs.com
:Main organization license:
GNU General Public License version 2
:Admins:
nfeske, chelmuth
:What is the URL for your Ideas page?:
[http://genode.org/community/gsoc_2012]
:What is the main IRC channel for your organization?:
#genode
:What is the main development mailing list for your organization?:
genode-main@lists.sourceforge.net
:Why is your organization applying to participate? What do you hope to gain?:
During the past three months, our project underwent the transition from a
formerly company-internal development to a completely open and transparent
endeavour. By inviting a broad community for participation in shaping the
project, we hope to advance Genode to become a broadly used and recognised
technology. GSoC would help us to build our community.
The project has its roots at the University of Technology Dresden where the
Genode founders were former members of the academic research staff. We have
a long and successful track record with regard to supervising students. GSoC
would provide us with the opportunity to establish and cultivate
relationships to new students and to spawn excitement about Genode OS
technology.
:Does your organization have an application templateo?:
GSoC student projects follow the same procedure as regular community
contributions, in particular the student is expected to sign the Genode
Contributor's Agreement. (see [http://genode.org/community/contributions])
:What criteria did you use to select your mentors?:
We selected the mentors on the basis of their long-time involvement with the
project and their time-tested communication skills. For each proposed working
topic, there is least one stakeholder with profound technical background within
Genode Labs. This person will be the primary contact person for the student
working on the topic. However, we will encourgage the student to make his/her
development transparant to all community members (i.e., via GitHub). So
So any community member interested in the topic is able to bring in his/her
ideas at any stage of development. Consequently, in practive, there will be
multiple persons mentoring each students.
:What is your plan for dealing with disappearing students?:
Actively contact them using all channels of communication available to us,
find out the reason for disappearance, trying to resolve the problems. (if
they are related to GSoC or our project for that matter).
:What is your plan for dealing with disappearing mentors?:
All designated mentors are local to Genode Labs. So the chance for them to
disappear to very low. However, if a mentor disappears for any serious reason
(i.e., serious illness), our organization will provide a back-up mentor.
:What steps will you take to encourage students to interact with your community?:
First, we discussed GSoC on our mailing list where we received an overly
positive response. We checked back with other Open-Source projects related to
our topics, exchanged ideas, and tried to find synergies between our
respective projects. For most project ideas, we have created issues in our
issue tracker to collect technical information and discuss the topic.
For several topics, we already observed interests of students to participate.
During the work on the topics, the mentors will try to encourage the
students to play an active role in discussions on our mailing list, also on
topics that are not strictly related to the student project. We regard an
active participation as key to to enable new community members to develop a
holistic view onto our project and gather a profound understanding of our
methodologies.
Student projects will be carried out in a transparent fashion at GitHub.
This makes it easy for each community member to get involved, discuss
the rationale behind design decisions, and audit solutions.
Topics
######
While discussing GSoC participation on our mailing list, we identified the
following topics as being well suited for GSoC projects. However, if none of
those topics receives resonance from students, there is more comprehensive list
of topics available at our road map and our collection of future challenges:
:[http://genode.org/about/road-map]: Road-map
:[http://genode.org/about/challenges]: Challenges
Combining Genode with the HelenOS/SPARTAN kernel
================================================
[http://www.helenos.org - HelenOS] is a microkernel-based multi-server OS
developed at the university of Prague. It is based on the SPARTAN microkernel,
which runs on a wide variety of CPU architectures including Sparc, MIPS, and
PowerPC. This broad platform support makes SPARTAN an interesting kernel to
look at alone. But a further motivation is the fact that SPARTAN does not
follow the classical L4 road, providing a kernel API that comes with an own
terminology and different kernel primitives. This makes the mapping of
SPARTAN's kernel API to Genode a challenging endeavour and would provide us
with feedback regarding the universality of Genode's internal interfaces.
Finally, this project has the potential to ignite a further collaboration
between the HelenOS and Genode communities.
Block-level encryption
======================
Protecting privacy is one of the strongest motivational factors for developing
Genode. One pivotal element with that respect is the persistence of information
via block-level encryption. For example, to use Genode every day at Genode
Labs, it's crucial to protect the confidentiality of some information that's
not part of the Genode code base, e.g., emails and reports. There are several
expansion stages imaginable to reach the goal and the basic building blocks
(block-device interface, ATA/SATA driver for Qemu) are already in place.
:[https://github.com/genodelabs/genode/issues/55 - Discuss the issue...]:
Virtual NAT
===========
For sharing one physical network interface among multiple applications, Genode
comes with a component called nic_bridge, which implements proxy ARP. Through
this component, each application receives a distinct (virtual) network
interface that is visible to the real network. I.e., each application requests
an IP address via a DHCP request at the local network. An alternative approach
would be a component that implements NAT on Genode's NIC session interface.
This way, the whole Genode system would use only one IP address visible to the
local network. (by stacking multiple nat and nic_bridge components together, we
could even form complex virtual networks inside a single Genode system)
The implementation of the virtual NAT could follow the lines of the existing
nic_bridge component. For parsing network packets, there are already some handy
utilities available (at os/include/net/).
:[https://github.com/genodelabs/genode/issues/114 - Discuss the issue...]:
Runtime for the Go or D programming language
============================================
Genode is implemented in C++. However, we are repeatedly receiving requests
for offering more safe alternatives for implementing OS-level functionality
such as device drivers, file systems, and other protocol stacks. The goals
for this project are to investigate the Go and D programming languages with
respect to their use within Genode, port the runtime of of those languages
to Genode, and provide a useful level of integration with Genode.
Block cache
===========
Currently, there exists only the iso9660 server that is able to cache block
accesses. A generic solution for caching block-device accesses would be nice.
One suggestion is a component that requests a block session (routed to a block
device driver) as back end and also announces a block service (front end)
itself. Such a block-cache server waits for requests at the front end and
forwards them to the back end. But it uses its own memory to cache blocks.
The first version could support only read-only block devices (such as CDROM) by
caching the results of read accesses. In this version, we already need an
eviction strategy that kicks in once the block cache gets saturated. For a
start this could be FIFO or LRU (least recently used).
A more sophisticated version would support write accesses, too. Here we need a
way to sync blocks to the back end at regular intervals in order to guarantee
that all block-write accesses are becoming persistent after a certain time. We
would also need a way to explicitly flush the block cache (i.e., when the
front-end block session gets closed).
:[https://github.com/genodelabs/genode/issues/113 - Discuss the issue...]:
; _Since Genode Labs was not accepted as GSoC mentoring organization, the_
; _following section has become irrelevant. Hence, it is commented-out_
;
; Student applications
; ####################
;
; The formal steps for applying to the GSoC program will be posted once Genode
; Labs is accepted as mentoring organization. If you are a student interested
; in working on a Genode-related GSoC project, now is a good time to get
; involved with the Genode community. The best way is joining the discussions
; at our mailing list and the issue tracker. This way, you will learn about
; the currently relevant topics, our discussion culture, and the people behind
; the project.
;
; :[http://genode.org/community/mailing-lists]: Join our mailing list
; :[https://github.com/genodelabs/genode/issues]: Discuss issues around Genode

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,830 +0,0 @@
==============================================
Release notes for the Genode OS Framework 8.11
==============================================
Genode Labs
Summary
#######
This document presents the new features and major changes introduced
in version 8.11 of the Genode OS Framework. It is geared towards
people interested in closely following the progress of the Genode
project and to developers who want to adopt their software to our
mainline development. The document aggregates important fragments
of the updated documentation such that you won't need to scan existing
documents for the new bits. Furthermore, it attempts to provide our
rationale behind the taken design decisions.
The general theme for the release 8.11 is enabling the use of the
Genode OS framework for real-world applications. Because we regard
the presence of device drivers and a way to reuse existing library
code as fundamental prerequisites for achieving this goal, the major
new additions are an API for device drivers written in C, an API for
handling asynchronous notifications, and a C runtime. Other noteworthy
improvements are the typification of capabilities at the C++-language
level, a way for receiving and handling application faults, the
introduction of managed dataspaces, and a new API for scheduling
timed events.
Base framework
##############
This section documents the new features and changes affecting the
'base' repository, in particular the base API.
New features
============
Connection handling
~~~~~~~~~~~~~~~~~~~
The interaction of a client with a server involves the definition of
session-construction arguments, the request of the session creation via
its parent, the initialization of the matching RPC-client stub code
with the received session capability, the actual use of the session
interface, and the closure of the session. A typical procedure of
using a service looks like this:
!#include <rom_session/client.h>
!...
!
!/* construct session-argument string and create session */
!char *args = "filename=config, ram_quota=4K");
!Capability session_cap = env()->parent()->session("ROM", args);
!
!/* initialize RPC stub code */
!Rom_session_client rsc(session_cap);
!
!/* invoke remote procedures, 'dataspace' is a RPC function */
!Capability ds_csp = rsc.dataspace();
!...
!
!/* call parent to close the session */
!env()->parent()->close(session_cap);
Even though this procedure does not seem to be overly complicated,
is has raised the following questions and criticism:
* The quota-donation argument is specific for each server. Most services
use client-donated RAM quota only for holding little meta data and,
thus, are happy with a donation of 4KB. Other services maintain larger
client-specific state and require higher RAM-quota donations. The
developer of a client has to be aware about the quota requirements for
each service used by his application.
* There exists no formalism for documenting session arguments.
* Because session arguments are passed to the 'session'-call as a plain
string, there are no syntax checks for the assembled string performed
at compile time. For example, a missing comma would go undetected until
a runtime test is performed.
* There are multiple lines of client code needed to open a session to
a service and the session capability must be maintained manually for
closing the session later on.
The new 'Connection' template provides a way to greatly simplify the
handling of session arguments, session creation, and destruction on the
client side. By implementing a service-specific connection class
inherited from 'Connection', session arguments become plain constructor
arguments, session functions can be called directly on the 'Connection'
object, and the session gets properly closed when destructing the
'Connection'. By convention, the 'Connection' class corresponding to a
service resides in a file called 'connection.h' in the directory of the
service's RPC interface. For each service, a corresponding 'Connection'
class becomes the natural place where session arguments and quota
donations are documented. With this new mechanism in place, the example
above becomes as simple as:
!#include <rom_session/connection.h>
!...
!
!/* create connection to the ROM service */
!Rom_connection rom("config");
!
!/* invoke remote procedure */
!Capability ds_csp = rom.dataspace();
[http://genode.org/documentation/api/base_index#Connecting_to_services - See the API documentation for the connection template...]
Typed capabilities
~~~~~~~~~~~~~~~~~~
A plain 'Capability' is an untyped reference to a remote object of any
type. For example, a capability can reference a thread object or a
session to a service. It is loosely similar to a C void pointer, for which
the programmer maintains the knowledge about which data type is actually
referenced. To facilitate the type-safe use of RPC interfaces at the C++
language level, we introduced a template for creating specialized
capability types ('Typed_capability' in 'base/typed_capability.h') and
the convention that each RPC interface declares a dedicated capability
type. Note that type-safety is not maintained across RPC interfaces. As
illustrated in Figure [layered_ipc], typification is done at the
object-framework level on the server side and via in the 'Connection'
classes at the client side.
[image layered_ipc]
From the application-developer's perspective, working with capabilities
has now become type-safe, making the produced code more readable and robust.
[http://genode.org/documentation/api/base_index#Capability_representation - See the updated API documentation for the capability representation...]
Fifo data structure
~~~~~~~~~~~~~~~~~~~
Because the 'List' data type inserts new list elements at the list head,
it cannot be used for implementing wait queues requiring first-in
first-out semantics. For such use cases, we introduced a dedicated
'Fifo' template. The main motivation for introducing 'Fifo' into the
base API is the new semaphore described below.
[http://genode.org/documentation/api/base_index#Structured_data_types - See the new API documentation for the fifo template...]
Semaphore
~~~~~~~~~
Alongside lock-based mutual exclusion of entering critical sections,
organizing threads in a producer-consumer relationship via a semaphore
is a common design pattern for thread synchronization. Prior versions
of Genode provided a preliminary semaphore implementation as part of
the 'os' repository. This implementation, however, supported only one
consumer thread (caller of the semaphore's 'down' function). We have
now enhanced our implementation to support multiple consumer threads
and added the semaphore to Genode's official base API. We have made
the wake-up policy in the presence of multiple consumers configurable
via a template argument. The default policy is first-in-first-out.
[http://genode.org/documentation/api/base_index#Synchronization - See the new API documentation for the semaphore...]
Thanks to Christian Prochaska for his valuable contributions to the new
semaphore design.
Asynchronous notifications
~~~~~~~~~~~~~~~~~~~~~~~~~~
Inter-process communication via remote procedure calls requires both
communication partners to operate in a synchronous fashion. The caller
of an RPC blocks as long as the RPC is not answered by the called
server. In order to receive the call, the server has to explicitly
wait for incoming messages. There are a number of situations where
synchronous communication is not suited.
For example, a GUI server wants to deliver a notification to one of its
clients about new input events being available. It does not want to
block on a RPC to one specific client because it has work to do for
other clients. Instead, the GUI server wants to deliver this
_notification_ with _fire-and-forget_ semantics and continue with
its operation immediately, regardless of whether the client received
the notification or not. The client, in turn, does not want to poll
for new input events at the GUI server but it wants to be _waken_up_
when something interesting happens. Another example is a block-device
driver that accepts many requests for read/write operations at once.
The operations may be processed out of order and may take a long time.
When having only synchronous communication available, the client and
the block device driver would have to employ one distinct thread for
each request, which is complicated and a waste of resources. Instead,
the block device driver just wants to acknowledge the completeness of
an operation _asynchronously_.
Because there are many more use cases for asynchronous inter-process
communication, we introduced a new signalling framework that complements
the existing synchronous RPC mode of communication with an interface for
issuing and receiving asynchronous notifications. It defines interfaces
for signal transmitters and signal receivers. A signal receiver can
receive signals from multiple sources, whereas the sources of incoming
signals are clearly distinguishable. One or multiple threads can either
poll or block for incoming signals. Each signal receiver is addressable
via a capability. The signal transmitter provides fire-and-forget
semantics for submitting signals to exactly one signal receiver. Signals
are communicated in a reliable fashion, which means that the exact number
of signals submitted to a signal transmitter is communicated to the
corresponding signal receiver. If notifications are generated at a higher
rate than as they can be processed at the receiver, the transmitter
counts the notifications and delivers the total amount with the next
signal transmission. This way, the total number of notifications gets
properly communicated to the receiver even if the receiver is not highly
responsive. Notifications do not carry any payload because this payload
would have to be queued at the transmitter.
[image signals]
Image [signals] illustrates the roles of signaller thread,
transmitter, receiver, and signal-handler thread.
[http://genode.org/documentation/api/base_index#Asynchronous_notifications - See the new API documentation for asynchronous notifications...]
The current generic implementation of the signalling API employs one
thread at each transmitter and one thread at each receiver. Because
the used threads are pretty heavy weight with regard to resource usage,
ports of Genode should replace this implementation with platform-
specific variants, for example by using inter-process semaphores or
native kernel support for signals.
Region-manager faults
~~~~~~~~~~~~~~~~~~~~~
In Genode, region-manager (RM) sessions are used to manage the
address-space layout for processes. A RM session is an address-space
layout that can be populated by attaching (portions of) dataspaces to
(regions of) the RM session. Normally, the RM session of a process is
first configured by the parent when decoding the process' ELF binary.
During the lifetime of the process, the process itself may attach
further dataspaces to its RM session to access the dataspace's content.
Core as the provider of the RM service uses this information for
resolving page faults raised by the process. In prior versions of
Genode, core ignored unresolvable page faults, printed a debug message
and halted the page-faulted thread. However, this condition may be of
interest, in particular to the process' parent for reacting on the
condition of a crashed child process. Therefore, we enhanced the RM
interface by a fault-handling mechanism. For each RM session, a fault
handler can be installed by registering a signal receiver capability.
If an unresolvable page fault occurs, core delivers a signal to the
registered fault handler. The fault handler, in turn, can request the
actual state of the RM session (page-fault address) and react upon
the fault. One possible reaction is attaching a new dataspace at the
fault address and thereby implicitly resolving the fault. If core
detects that a fault is resolved this way, it resumes the operation
of the faulted thread.
This mechanism works analogously to how page faults are handled by
CPUs, but on a more abstract level. A (n-level) page table corresponds
to a RM session, a page-table entry corresponds to a dataspace-
attachment, the RM-fault handler corresponds to a page-fault
exception handler, and the resolution of page-faults (RM fault)
follows the same basic scheme:
# Application accesses memory address with no valid page-table-entry
(RM fault)
# CPU generates page-fault exception (core delivers signal to fault
handler)
# Kernel reads exception-stack frame or special register to determine
fault address (RM-fault handler reads RM state)
# Kernel adds a valid page-table entry and returns from exception
(RM-fault handler attaches dataspace to RM session, core resumes
faulted thread)
The RM-fault mechanism is not only useful for detecting crashing child
processes but it enables a straight-forward implementation of growing
stacks and heap transparently for a child process. An example for
using RM-faults is provided at 'base/src/test/rm_fault'.
Note that this mechanism is only available on platforms on which core
resolves page faults. This is the case for kernels of the L4 family.
On Linux however, the Linux kernel resolves page faults and suspends
processes performing unresolvable memory accesses (segmentation fault).
Managed dataspaces (experimental)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The RM-fault mechanism clears the way for an exciting new feature
of Genode 8.11 called managed dataspaces. In prior versions of Genode,
each dataspace referred to a contiguous area of physical memory (or
memory-mapped I/O) obtained by one of core's RAM, ROM, or IO_MEM
services, hence we call them physical dataspaces. We have now added
a second type of dataspaces called managed dataspaces. In contrast
to a physical dataspace, a managed dataspace is backed by the content
described by an RM session. In fact, each RM session can be used as
dataspace and can thereby be attached to other RM sessions.
Combined with the RM fault mechanism described above, managed
dataspaces enable a new realm of applications such as dataspaces
entirely managed by user-level services, copy-on-write dataspaces,
non-contiguous large memory dataspaces that are immune to physical
memory fragmentation, process-local RM fault handlers (e.g., managing
the own thread-stack area as a sub-RM-session), and sparsely populated
dataspaces.
Current limitations
-------------------
Currently, managed dataspaces still have two major limitations. First,
this mechanism allows for creating cycles of RM sessions. Core must
detect such cycles during page-fault resolution. Although, a design for
an appropriate algorithm exists, cycle-detection is not yet implemented.
The missing cycle detection would enable a malicious process to force
core into an infinite loop. Second, RM faults are implemented using the
new signalling framework. With the current generic implementation, RM
sessions are far more resource-demanding than they should be. Once the
signalling framework is optimized for L4, RM sessions and thereby
managed dataspaces will become cheap. Until then, we do not recommend
to put this mechanism to heavy use.
Because of these current limitations, managed dataspaces are marked as
an experimental feature. When building Genode, experimental features are
disabled by default. To enable them, add a file called 'specs.conf'
with the following content to the 'etc/' subdirectory of your build
directory:
! SPECS += experimental
For an example of how to use the new mechanism to manage a part of a
process' own address space by itself, you may take a look at
'base/src/test/rm_nested'.
Changes
=======
Besides the addition of the new features described above, the following
parts of the base framework underwent changes worth describing.
Consistent use of typed capabilities and connection classes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We applied capability typification to all interfaces of Genode including
the base API and the interfaces defined in the 'os' repository. Figure
[base_cap_types] provides an overview about the capability types
provided by the base API.
[image base_cap_types]
Overview about the capability types provided by the base API
Furthermore, we have complemented all session interfaces with
appropriate 'Connection' classes taking service-specific session
arguments into account.
For session-interface classes, we introduced the convention to declare
the service name as part of the session-interface via a static member
function:
! static const char *service_name();
Allocator refinements
~~~~~~~~~~~~~~~~~~~~~
Throughout Genode, allocators are not only used for allocating memory
but also for managing address-space layouts and ranges of physical
resources such as I/O-port ranges or IRQ ranges. In these cases, the
address '0' may be a valid value. Consequently, this value cannot be
used to signal allocation errors as done in prior versions of Genode.
Furthermore, because managed dataspaces use the RM session interface to
define the dataspace layout, the address-'0' problem applies here as
well. We have now refined our allocator interfaces and the RM-session
interface to make them fit better for problems other than managing
virtual memory.
Misc changes
~~~~~~~~~~~~
We revised all interfaces to consistently use _exceptions_ to signal
error conditions rather than delivering error codes as return values.
This way, error codes become exception types that have a meaningful
name and, in contrast to global 'errno' definitions, an error exception
type can be defined local to the interface it applies to. Furthermore,
the use of exceptions allows for creating much cleaner looking interfaces.
Traditionally, we have provided our custom _printf_ implementation as C
symbol to make this function available from both C and C++ code. However,
we observed that we never called this function from C code and that the
'printf' symbol conflicts with the libc. Hence, we turned 'printf'
into a C++ symbol residing in the 'Genode' namespace.
Operating-system services and libraries
#######################################
This section documents the new features and changes affecting
the 'os' repository.
New Features
============
Device-driver framework for C device drivers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Genode's base API features everything needed to create user-level device
drivers. For example, the 'os' repository's PS/2 input driver and the
PCI bus driver are using Genode's C++ base API directly. However, most of
today's device drivers are written in C. To ease the reuse of existing
drivers on Genode, we have introduced a C API for device drivers into
Genode's 'os' repository. The API is called DDE kit (DDE is an acronym
for device-driver environment) and it is located at 'os/include/dde_kit'.
The DDE kit API is the result of long-year experiences with porting device
drivers from Linux and FreeBSD to custom OS environments. The following
references are the most significant contributions to the development of
the API.
;
Christian Helmuth created the initial version of the Linux device-driver
environment for L4. He describes his effort of reusing unmodified sound
drivers on the L4 platform in his thesis
[http://os.inf.tu-dresden.de/papers_ps/helmuth-diplom.pdf - Generische Portierung von Linux-Gerätetreibern auf die DROPS-Architektur].
;
Gerd Griessbach approached the problem of re-using Linux USB drivers
by following the DDE approach in his diploma thesis
[http://os.inf.tu-dresden.de/papers_ps/griessbach-diplom.pdf - USB for DROPS].
;
Marek Menzer adapted Linux DDE to Linux 2.6 and explored the DDE
approach for block-device drivers in his student research project
[http://os.inf.tu-dresden.de/papers_ps/menzer-beleg.pdf - Portierung des DROPS Device Driver Environment (DDE) für Linux 2.6 am Beispiel des IDE-Treibers ]
and his diploma thesis
[http://os.inf.tu-dresden.de/papers_ps/menzer-diplom.pdf - Entwicklung eines Blockgeräte-Frameworks für DROPS].
;
Thomas Friebel generalized the DDE approach and introduced the DDE kit
API to enable the re-use of device driver from other platforms than
Linux. In particular, he experimented with the block-device drivers of
FreeBSD in his diploma thesis
[http://os.inf.tu-dresden.de/papers_ps/friebel-diplom.pdf - Übertragung des Device-Driver-Environment-Ansatzes auf Subsysteme des BSD-Betriebssystemkerns].
;
Dirk Vogt successfully re-approached the port of USB device drivers
from the Linux kernel to L4 in his student research project
[http://os.inf.tu-dresden.de/papers_ps/beleg-vogt.pdf - USB for the L4 Environment].
The current incarnation of the DDE kit API provides the following
features:
* General infrastructure such as init calls, assertions, debug output
* Interrupt handling (attach, detach, disable, enable)
* Locks, semaphores
* Memory management (slabs, malloc)
* PCI access (find device, access device config space)
* Virtual page tables (translation between physical and virtual
addresses)
* Memory-mapped I/O, port I/O
* Multi-threading (create, exit, thread-local storage, sleep)
* Timers, jiffies
For Genode, we have created a complete reimplementation of the DDE kit
API from scratch by fully utilizing the existing Genode infrastructure
such as the available structured data types, core's I/O services,
the synchronization primitives, and the thread API.
[image dde_kit]
Figure [dde_kit] illustrates the role of DDE kit when re-using an
unmodified device driver taken from the Linux kernel. DDE kit translates
Genode's C++ base API to the DDE kit C API. The DDE kit API, in turn, is
used as back end by the Linux driver environment, which translates Linux
kernel interfaces to calls into DDE kit. With this translation in place,
an unmodified Linux device driver can be embedded into the Linux driver
environment. The device API is specific for a class of devices such as
NICs, block devices, or input devices. It can either be used directly as
a function interface by an application that is using the device driver
as a library, or it can be made accessible to external processes via an
RPC interface.
Limitations
-----------
The PCI sub system is not completely implemented, yet.
Alarm API providing a timed event scheduler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The scheduling of timed events is a recurring pattern found in device
drivers, application frameworks such as Qt4 ('qeventdispatcher'), and
applications. Therefore, we have added a timed event scheduler to the
'os' repository. The new alarm API ('os/include/os/alarm.h') allows
for the scheduling of both one-shot alarms and periodic alarms.
Changes
=======
PS/2 input driver
~~~~~~~~~~~~~~~~~
The original PS/2 driver tried to switch the PS/2 keyboard to
scan-code set 2 and assumed that all modern keyboards support this
mode of operation. However, this assumption was wrong. We observed
that the legacy PS/2 support of some USB keyboards covers only the
emulated (xlate) scan-code set 1 mode. This is also case for the PS/2
emulation in VirtualBox. Therefore, we changed our PS/2 driver to
never touch the keyboard mode but to only detect the current mode
of operation. The driver has now to support both, scan-code set 1 and
scan-code set 2. This change comes along with a slightly more complex
state machine in the driver. Hence, we moved the state machine from
the IRQ handler to a distinct class and changed the control flow of
the driver to fetch only one value from the i8042 PS/2 controller
per received interrupt.
PCI bus driver
~~~~~~~~~~~~~~
Until now, Genode's PCI bus driver was only used for experimentation
purposes. With the forthcoming driver framework however, the PCI bus
driver will play a central role in the system. Therefore, we adapted
the interface of the PCI driver to these requirements. Specifically,
the scanning of the PCI bus can now be performed without constraining
the results by a specific vendor ID.
Nitpicker GUI server
~~~~~~~~~~~~~~~~~~~~
We improved the _output_latency_ of the Nitpicker GUI server by flushing
pixels eagerly and deferring the next periodically scheduled flush.
This change has a positive effect on the responsiveness of the GUI to
user input.
Misc changes
~~~~~~~~~~~~
Prior versions of the 'os' repository came with a custom 'os/include/base'
directory with interfaces extending the base API. To avoid confusion
between the 'base' repository and the 'os' repository, 'os'-local API
extensions are now located at 'os/include/os'. This way, the folder
prefix of include statements indicates well from which repository the
included header files comes from.
C runtime
#########
Most of existing libraries rely on the presence of a C library. For
making the reuse of this software on Genode possible, we have now
made a complete C library available for Genode. It comes as a separate
source-code repository called 'libc' and is based on the code of FreeBSD.
The original code is available at the official FreeBSD website.
:FreeBSD website:
[http://www.freebsd.org/developers/cvs.html]
Our libc port comprises the libraries 'gdtoa', 'gen', 'locale', 'stdio',
'stdlib', 'stdtime', 'string', and 'msun'. Currently, it supports the
x86 architecture. Support for other architectures is planned as future
addition. At the current stage, our back end is very basic and most of
its functions are dummy stubs. We used Christian Prochaska's forthcoming
Genode port of Qt4 as test case and successfully used the new libc as
foundation for building graphical Qt4 applications. We will further
extend the back end in correspondence to the growing feature set of the
Genode OS framework.
:Usage:
To use the libc in your application, just add 'libc' to the 'LIBS'
declaration in your build-description file. This declaration will make
the libc headers available for the include path of your target and link
the C library. When building, make sure that the 'libc' repository is
included in your build configuration ('etc/build.conf').
:Limitations:
The current version of the C library is not thread-safe. For most
string and math functions, this is not a problem (as these functions
do not modify global state) but be careful with using more complex
functions such as 'malloc' from multiple threads. Also, 'errno' may
become meaningless when calling libc functions from multiple threads.
We have left out the following files from the Genode port of the
FreeBSD libc: gdtoa 'strtodnrp.c' (gdtoa), 'getosreldate.c' (gen),
'strcoll.c', 'strxfrm.c', 'wcscoll.c', 'wcsxfrm.c' (string),
's_exp2l.c' ('msun').
The current back end is quite simplistic and it may help you to revisit
the current state of the implementation in the 'libc/src/lib/libc'
directory. If one of the functions in 'dummies.c' is called, you will
see the debug message:
! "<function-name> called, not yet implemented!"
However, some of the back-end function implemented in the other files
have dummy semantics but have to remain quiet because they are called
from low-level libc code.
Build infrastructure
####################
Build-directory creation tool
=============================
Because we think that each Genode developer benefits from knowing the
basics about the functioning of the build system, the manual creation of
build directories is described in Genode's getting-started document.
However, for regular developers, creating build directories becomes a
repetitive task. Hence, it should be automated. We have now added a
simple build-directory creation tool that creates pre-configured build
directories for some supported platforms. The tool is located at
'tool/builddir/create_builddir'. To print its usage information, just
execute the tool without arguments.
Improved linking of binary files
================================
For linking binary data, binary file have to be converted to object
files. Over the time, we have used different mechanisms for this
purpose. Originally, we used 'ld -r -b binary'. Unfortunately, these
linker options are not portable. Therefore, the mechanism was changed
to a 'hexdump' and 'sed' magic that generated a C array from binary data.
This solution however, is complicated and slow. Now, we have adopted
an idea of Ludwig Hähne to use the 'incbin' directive of the GNU
assembler, which is a very clean, flexible, and fast solution.
Lib-import mechanism
====================
Libraries often require specific include files to be available at the
default include search location. For example, users of a C library
expect 'stdio.h' to be available at the root of the include search
location. Placing the library's include files in the root of the
default search location would pollute the include name space for
all applications, regardless if they use the library or not. To
keep library-include files well separated from each other, we have
enhanced our build system by a new mechanism called lib-import.
For each library specified in the 'LIBS' declaration of a build
description file, the build system incorporates a corresponding
'import-<libname>.mk' file into the build process. Such as file
defines library-specific compiler options, in particular additional
include-search locations. The build system searches for lib-import
files in the 'lib/import/' subdirectories of all used repositories.
Using 'ar' for creating libraries
=================================
The previous versions of Genode relied on incremental linking ('ld -r')
for building libraries. This approach is convenient because the linker
resolves all cross-dependencies between libraries regardless of the
order of how libraries are specified at the linker's command line.
However, incremental linking prevents the linker from effectively
detecting dead code. In contrast, when linking '.a' files, the linker
detects unneeded object files. Traditionally, we have only linked our
own framework containing no dead code. This changed with the new 'libc'
support. When linking the 'libc', the presence of dead code becomes
the normal case rather than the exception. Consequently, our old
incremental-linking approach produced exceedingly large binaries
including all functions that come with the 'libc'. We have now adopted
the classic 'ar' mechanism for assembling libraries and use the linker's
'start-group' 'end-group' feature to resolve inter-library-dependencies.
This way, dead code gets eliminated at the granularity of object files.
In the future, we will possible look into the '-ffunction-sections' and
'-gc-sections' features of the GNU tool chain to further improve the
granularity to function level.
If your build-description files rely on custom rules referring to
'lib.o' files, these rules must be adapted to refer to 'lib.a' files
instead.
Misc changes
============
* Added sanity check for build-description files overriding 'INC_DIR'
instead of extending it.
* Restrict inclusion of dependency files to those that actually matter
when building libraries within 'var/libcache'. This change significantly
speeds up the build process in the presence of large libraries such as
Qt4 and libc.
* Added rule for building 'cpp' files analogously to the 'cc' rule.
Within Genode, we name all C++ implementation files with the 'cc'
suffix. However, Qt4 uses 'cpp' as file extension so we have to
support both.
* Build-description files do no longer need the declaration
'REQUIRES = genode'. Genode's include search locations are now
incorporated into the build process by default.
Applications
############
This section refers to the example applications contained in Genode's
'demo' repository.
We have enhanced the _Scout_widgets_ as used by the launchpad and the
Scout tutorial browser to perform all graphical output double-buffered,
which effectively eliminates drawing artifacts that could occur when
exposing intermediate drawing states via direct (unbuffered) output.
Furthermore, we have added a way to constrain the maximum size of
windows to perform pixel-buffer allocations on realistic window sizes.
Both launchpad and Scout can now start child applications. In Scout
this functionality is realized by special "execute" links. We have
generalized the underlying application logic for creating and
maintaining child processes between both applications and placed
the unification into a separate 'launchpad' library.
We have replaced the default document presented in Scout with an
_interactive_walk-through_guide_ explaining the basic features of Genode.
The document uses the new "execute" link facility to let the user start
a launchpad instance by clicking on a link.
Platform-specific changes
#########################
Genode used to define _fixed-width_integer_types_ in a file 'stdint.h'
placed in a directory corresponding to bit-width of the platform, for
example 'include/32bit/stdint.h'. When building for a 32bit platform,
the build system included the appropriate directory into the
include-search path and thereby made 'stdint.h' available at the root
of the include location. Unfortunately, this clashes with the 'stdint.h'
file that comes with the C library. To avoid conflict with libc header
files, we moved the definition of fixed-width integer types to
'32bit/base/fixed_stdint.h'.
For the L4/Fiasco version of Genode, there existed some x86-specific
header files that did not specifically depend on L4/Fiasco, for example
atomic operations. Because these files are not L4/Fiasco-specific and
may become handy for other platforms as well, we moved them to the
generic 'base' repository.
Linux 32bit
===========
:Dissolving Genode's dependency from the glibc:
The port of the C runtime to Genode posed an interesting challenge to
the Linux version of Genode. This version used to rely on certain
functions provided by the underlying glibc:
* For creating and destroying threads, we used to rely on POSIX threads
as provided by the 'pthread' library
* The lock implementation was based on the POSIX semaphore functions
'sem_init', 'sem_wait', and 'sem_post'
* Shared memory was realized by using files ('open', 'close',
'ftruncate') and the 'mmap' interface
* Starting and killing processes was implemented using 'fork' and 'kill'
* Inter-process communication used the glibc's socket functions
For our custom C runtime, we want to override the glibc functionality
with our own implementation. For example, we want to provide the 'mmap'
interface to a Genode application by implementing 'mmap' with
functions of our base API. On Linux, however, this base API, in turn,
used to rely on 'mmap'. This is just an example. The problem applies
also for the other categories mentioned above. We realized that we cannot
rely on the glibc on one hand but at the same time replace it by a custom
C runtime (in fact, we believe that such a thing is possible by using
awkward linker magic but we desire a clean solution). Consequently, we
have to remove the dependency of Genode from the glibc on Linux. Step
by step, we replaced the used glibc functions by custom Linux system-call
bindings. Each binding function has a prefix 'lx_' such that the symbol
won't collide with 'libc' symbols. The new bindings are located at the file
'base-linux/src/platform/linux_syscalls.h'. It consist of 20 functions,
most of them resembling the original interface ('socket', 'connect',
'bind', 'getsockname', 'recvfrom', 'write', 'close', 'open', 'fork',
'execve', 'mmap', 'ftruncate', 'unlink', 'tkill', 'nanosleep').
For other functions, we simplified the semantics for our use case
('sigaction', 'sigpending', 'sigsetmask', 'create_thread'). The most
noteworthy changes are the creation and destruction of threads by
directly using the 'clone' and 'tkill' system calls, and the lock
implementation. Because we cannot anymore rely on the convenience of
using futexes indirectly through the POSIX semaphore interface, we
have adopted the simple locking approach that we already use for the
L4/Fiasco version. This lock implementation is a simple sleeping
spinlock.
:Compromises:
The introduction of custom Linux system-call bindings for Genode has
several pros and cons. With this change, The Linux version of Genode is
not anymore easy to port to other POSIX platforms such as the Darwin
kernel. For each POSIX kernel used as Genode platform, a custom
implementation of our system-call bindings must be created. The
original POSIX variant could still be reanimated, but this version
would inherently lack support for Genode's C runtime, and thus would
have limited value. A positive side effect of this solution, however,
is that 'linux_syscalls.h' documents well the subset of the Linux'
kernel interface that we are actually using.
The replacement of POSIX semaphores with sleeping spinlocks decreases
locking performance quite significantly. In the contention case, the
wakeup from sleeping introduces a high latency of up to one millisecond.
Furthermore, fairness is not guaranteed and the spinning produces a bit
of system load. If this approach turns out to become a serious performance
bottleneck, we will consider creating custom bindings for Linux' futexes.
L4/Fiasco
=========
The concepts of _RM_faults_ and _managed_dataspaces_ as described in
Section [Base framework], had been implemented into the L4/Fiasco
version of core. Although the introduction of these concepts involved
only minimal changes at the API level, the required core-internal
changes had been quite invasive, affecting major parts of the pager
and RM-session implementations.
Prior versions of the L4/Fiasco version of core did not implement
the _cancel-blocking_mechanism_ as specified by the CPU-session API.
The missing implementation resulted in lock-ups when destructing a
thread that blocks for lock. With the new implementation based on
L4/Fiasco's inter-task ex-regs system call, such threads can now
be gracefully destructed.

View File

@@ -1,460 +0,0 @@
==============================================
Release notes for the Genode OS Framework 9.02
==============================================
Genode Labs
Summary
#######
Whereas the focus of the previous release 8.11 was the refinement of
Genode's base API and the creation of the infrastructure needed to build
real-world applications, the release 9.02 is focused on functional
enhancements in two directions. The first direction is broadening the
number of possible base platforms for the framework. At present, most
microkernels bring along a custom user land, which is closely tied to the
particular kernel. Our vision is to establish Genode as a common ground for
developing applications, protocol stacks, and device drivers in such a way
that the software becomes easily portable among different kernels. This
release makes Genode available on the L4ka::Pistachio kernel. Hence,
software developed with the Genode API can now run unmodified on
Linux/x86, L4/Fiasco, and L4ka::Pistachio. In the second direction, we
are steadily advancing the functionality available on top of Genode. With
this release, we introduce a basic networking facility and support for
native Qt4 applications as major new features. Thanks to Genode's
portability, these features become automatically available on all
supported base platforms.
Our original plan for the release 9.02 also comprised the support of a
Linux-on-Genode (para-)virtualization solution. Initially, we intended to
make [http://os.inf.tu-dresden.de/L4/LinuxOnL4/ - L4Linux] available on
the L4/Fiasco version of Genode. However, we identified several downsides
with this approach. Apparently, the development of the officially available
version of L4/Fiasco has become slow and long-known issues remain unfixed.
L4Linux, however, is closely tied to L4/Fiasco and the L4 environment. For
us at Genode Labs, maintaining both a custom port of L4Linux for Genode
and L4/Fiasco by ourself in addition to developing Genode is unfeasible.
In contrast, the Pistachio kernel features more advanced options for
virtualization ([http://l4ka.org/projects/virtualization/afterburn/ - Afterburner]
and VT support) that we want to explore. Furthermore, there exists another
version of L4Linux called OKLinux for the OKL4 kernel developed at
[http://ok-labs.com - OK-Labs], which is very interesting as well.
Therefore, we decided against an ad-hoc solution and deferred this feature
to the next release. [http:/about/road-map - See our updated road map...]
Major new Features
##################
Genode on L4ka::Pistachio
=========================
From the very beginning, the base API of the Genode OS Framework was
designed for portability. We put a lot of effort into finding API
abstractions that are both implementable on a wide range of kernels and as
close to the hardware as possible to keep the abstraction overhead low. For
this reason, we developed the framework in parallel for the Linux kernel and
the L4/Fiasco kernel. To validate our claim that Genode is highly portable,
Julian Stecklina ported the framework to another member of the L4 family,
namely the [http://l4ka.org/projects/pistachio/ - L4ka::Pistachio kernel].
This high-performance kernel implements the latest official L4 API called
L4.x2 and has a number of advanced features such as multi-processor support
and virtualization support.
After Julian successfully created the first Pistachio version of Genode,
we successively refined his work and conducted further unifications among
the platform-dependent code for the different kernels. The result of this
effort is included in this release and comes in the form of the
'base-pistachio' source-code repository.
;Interesting technical notes:
* The IRQ handling on Pistachio is slightly different from L4/Fiasco.
On L4/Fiasco, an IRQ becomes unmasked only when the user-level IRQ
handler thread blocks for an IRQ by issuing an IPC call to the
kernel's corresponding IRQ thread. In contrast, Pistachio unmasks an
IRQ as soon as the user-level IRQ handler associates itself with an
IRQ. Thus, an IRQ message may occur not only when the user-level IRQ
handler blocks for any IRQ but anytime. In particular, IRQ messages
may interfere with the IRQ handler's IPC communication with other
threads. To ensure that IRQ messages do only occur when expecting
them, we lazily associate the IRQ handler thread to the IRQ the
first time we wait for an IRQ and issue an unmasking IPC call
subsequent times.
* Genode provides a mechanism for gracefully destructing threads that
are in a blocking state, for example waiting for an IPC message.
Such a thread may hold locks or other resources that would not
get properly freed when just killing the thread by force. Therefore,
Genode provides a way to issue the cancellation of a blocking
operation by another thread (e.g., the thread calling the destructor).
Once, a blocking operation got canceled, a C++ exception
('Blocking_canceled') is raised such the thread can fall back into
a defined state and then be destructed. On L4ka::Pistachio, we use
Pistachio's pager-exchange-registers feature in combination with
the user-defined UTCB handle for cancelling blocking operations and
detecting cancellations. The interesting code bits can be found in
'src/base/ipc/ipc.cc', 'src/base/lock/lock.cc',
'src/core/platform_thread.cc', and in the Pistachio-specific
timer-service implementation.
* During the refinement of the Pistachio version, we were able to further
generalize code that was previously specific for L4/Fiasco and
L4ka::Pistachio respectively. Now, the platform-specific code comprises
less than 3,000 lines of code (LOC) for L4/Pistachio, circa 2,000 LOC
for L4/Fiasco, and circa 1,000 LOC for Linux. Hence, we expect that
porting the framework to further kernels is possible at reasonable
engineering costs.
:Current limitations:
* The current version does not use superpages (4M mappings) because we
experienced problems with mapping 4K pages out of 4M pages. This is an
issue that we like to investigate further because using 4M mappings
would improve the boot time and reduce the kernel-memory usage.
* Currently, we use a simple sleeping spinlock for synchronization, which
is not optimal for several reasons. There are no fairness guarantees,
the spinning consumes CPU time, and threads that got blocked in the
contention case are woken up at the coarse granularity of the kernel's
timer tick, which is typically one millisecond.
* Nested RM sessions as introduced as an experimental feature in the
Genode release 8.11 are not yet supported.
:Further details:
You can find further technical details and usage instructions at this
dedicated [http://genode.org/documentation/platforms/pistachio - page].
Qt4 on Genode
=============
The minimalism of the Genode OS Framework with regard to its code
complexity raised the question of whether this framework is feasible
for hosting real-world applications and widely used runtime environments.
Christian Prochaska took the challenge to port Trolltech's Qt4 application
framework, which serves as the basis for the popular KDE desktop, to Genode.
Because Christian started his work more than a year ago at a time when no
C library was available on Genode, several intermediate steps were needed.
The first step was the integration of the Qt4 tools such as the meta-object
compiler (moc) and resource compiler properly into the our build systion.
With the tools in place, the Linux version of Genode came to an advantage.
In this environment, a Genode application is able to use glibc functionality.
So the problem of a missing C library could be deferred and Christian was
able to focus on interfacing Qt with the existing Genode services such as
the Nitpicker GUI sever. Next, the glibc dependencies were successively
replaced by custom implementations or simple dummy stubs. Thereby, all
needed functionalities such as timed semaphores and thread-local storage
had to be mapped to existing Genode API calls. Once, all glibc dependencies
had been dissolved, Qt could be compiled for the L4/Fiasco version.
Since a C library has become available in Genode 8.11, we were able to
replace Christian's intermediate stub codes with a real C library. We also
utilize recently added features of Genode such as its alarm framework to
simplify the Qt4 port. Furthermore, we were able to remove all
platform-specific bits such that the Qt4 port has now become completely
generic with regard to the underlying kernel. Qt4 can be executed on Linux,
L4/Fiasco, and L4ka::Pistachio without any changes. Figure [qt4_screenshot]
shows a screenshot of Qt's Tetrix example running side-by-side with native
Genode applications.
[image qt4_screenshot]
:Current state:
* The Qt4 port comes in the form of a source-code repository, which contains
all Qt source codes, and some example programs such as Tetrix. You can
download the Qt4 repository as a separate archive at the download page of
the Genode release 9.2. For the next release, we plan to separate the
Genode-specific parts from Qt original code and make the Genode-specific
parts a regular component of the Genode main line.
* The Qt4 port consists of Qt's Core library, GUI library, Script library,
XML library, and the UI tools library. Other libraries such as Webkit
are not ported yet.
* This first version of Qt4 on Genode is not to be considered as stable.
There are several known issues yet to be addressed. In particular,
the 'QEventDispatcher' is still work in progress and not fully stabilized.
* Because, we use to statically link programs, the binaries of Qt
applications are exceedingly large. For example the Tetrix binary is
100MB including debug information and 11MB in the stripped form. For
employing Qt on Genode at a larger scale, Genode should be enhanced with
shared-library support.
Networking
==========
With Genode 8.11, we introduced the Device-Driver-Environment Kit (DDE Kit)
API, which is a C API specifically designed for implementing and porting
device drivers written in plain C. We have now complemented DDE Kit with an
environment for executing Linux device drivers natively on Genode. This
library is called 'dde_linux26' and contained in our new 'linux_drivers'
source-code repository. The environment consists of several parts, which
correspond to the different sub systems of the Linux kernel 2.6, such as
'arch', 'drivers', 'kernel'.
The first class of device-drivers supported by DDE Linux 2.6 is networking.
At the current stage, the DDE Linux network library comprises general
network-device infrastructure as well as an exemplary driver for the PCnet32
network device.
Based on this library, we have created a basic TCP/IP test utilizing the
uIP stack, which uses the DDE Linux network library as back end. The test
program implements a basic web server displaying uIP packet statistics.
When executed on Qemu, you can use your host's web browser to connect to
the web server running on Genode:
For booting Genode on L4/Fiasco with the web-server demo, use a GRUB
entry in your 'menu.lst' file as follows.
! title Genode: DDE Linux 2.6 NET on L4/Fiasco
! kernel /fiasco/bootstrap -maxmem=64 -modaddr=0x02000000
! module /fiasco/fiasco -nokd -serial -serial_esc
! module /fiasco/sigma0
! module /genode/core
! module /genode/init
! module /config
! module /genode/timer
! module /genode/pci_drv
! module /genode/test-dde_linux26_net
The first four lines are L4/Fiasco specific. When using L4ka::Pistachio,
the 'menu.lst' entry looks like this:
! title Genode: DDE Linux 2.6 NET on L4/Pistachio
! kernel /pistachio/kickstart
! module /pistachio/x86-kernel
! module /pistachio/sigma0
! module /genode/core
! module /genode/init
! module /config
! module /genode/timer
! module /genode/pci_drv
! module /genode/test-dde_linux26_net
The web-server test requires the PCI bus driver and the timer service.
Therefore, the 'config' file for Genode's init should have following
content:
! <config>
! <start>
! <filename>timer</filename>
! <ram_quota>512K</ram_quota>
! </start>
! <start>
! <filename>pci_drv</filename>
! <ram_quota>512K</ram_quota>
! </start>
! <start>
! <filename>test-dde_linux26_net</filename>
! <ram_quota>16M</ram_quota>
! </start>
! </config>
Now, its time to create an ISO image from all files specified in
the GRUB configuration. For this, the new utility 'tool/create_iso'
becomes handy. The ISO image can then be booted on Qemu using the
following arguments:
! qemu -m 64 -serial stdio -no-kqemu -cdrom <iso-image> \
! -net nic,model=pcnet -net user -redir tcp:5555::80
The '-redir' argument tells qemu to redirect TCP connections with
localhost:5555 to the guest OS at port 80. After having booted
up Genode on Qemu, you can use your host's web browser to access
the web server:
! firefox http://localhost:5555
:Notes about using the TAP version:
* Preparations
* You must be permitted to sudo and have installed the tunctl
utility. Under Debian/Ubuntu execute
! sudo apt-get install uml-utilities
* Create TAP device
! TAPDEV=$(sudo tunctl -b -u $USER)
! sudo /sbin/ifconfig $TAPDEV 10.0.0.1
* setup DHCP server on $TAPDEV and 10.0.0.0/8
* Run qemu
! qemu -m 64 -serial stdio -no-kqemu -cdrom dde.iso \
! -net nic,model=pcnet \
! -net tap,ifname=$TAPDEV,script=no,downscript=no
* Ping
* Cleanup
* Stop DHCP server
* Remove TAP device
! sudo tunctl -d $TAPDEV
Operating-system services and libraries
#######################################
C Runtime
=========
We have replaced the 'malloc' implementation of the original FreeBSD C
library with a custom implementation, which relies on Genode's 'Heap' as
allocator. The FreeBSD libc reserves a default memory pool of 1MB, which
is no problem on FreeBSD because virtual memory is backed lazily with
physical pages on demand. On Genode however, we immediately account the
allocated memory, which implicates high quota requirements even for
applications that use little memory. In contrast, Genode's heap allocates
and accounts its backing store in relatively small chunks of a few KB.
Therefore, the quota accounting for applications is much more in line with
the actual memory usage. Furthermore, our custom 'malloc' implementation
has the additional benefit of being thread safe.
* Added i386-specific parts of gen lib, in particular longjmp, setjmp.
Device-Driver-Environment Kit
=============================
* The DDE Kit uses our alarm framework (located in the 'os' repository) now
rather than its own event-scheduler implementation formerly called 'Tick'.
* We refined the DDE Kit API and reduced the number of custom types. For
example, we removed the custom 'dde_kit_lock_t' and using
'struct dde_kit_lock' instead, and replaced 'dde_kit_thread_t' with
'struct dde_kit_thread'.
Because of the apparent stabilization of the DDE Kit API, we have now added
this API to Genode's official API reference.
[http://genode.org/documentation/api/dde_kit_index - See the documentation of the DDE Kit API...]
PS/2 input driver
=================
We improved the PS/2 keyboard driver by adding missing scan-code translations
for the scan code set 1, in particular the cursor keys.
Applications
############
Launchpad configuration
=======================
Launchpad is a graphical application for interactively starting and killing
programs. It is used for the default demonstration of Genode. By default,
launchpad displays a preconfigured list of programs and their respective
default memory quotas. The user can tweak the memory quota for each entry
with mouse and then start a program by clicking on its name. As an
alternative to using the default list, you can now define the list manually
by supplying a configuration to Launchpad. The following example tells
launchpad to display a list of two launcher entries:
!<config>
! <launcher>
! <filename>sdl_pathfind</filename>
! <ram_quota>10M</ram_quota>
! </launcher>
! <launcher>
! <filename>liquid_fb</filename>
! <ram_quota>10M</ram_quota>
! </launcher>
!</config>
To use this configuration for a Launchpad started via init, you can simply
insert the launchpad configuration into the '<start>' node of the launchpad
entry in init's 'config' file.
Platform-specific changes
#########################
L4/Fiasco
=========
* Raise 'Blocking_canceled' exceptions on canceled IPC calls
32-bit Linux
============
* We continued dissolving the dependency of Genode from the glibc by using
a custom 'getenv' implementation used during process creation.
* By default, we compile now with '-nostdinc' and explicitly specify
'/usr/include' as include search directory only when needed. Previously,
a Genode application, which included a host include file by mistake, has
not raised any compilation error when compiled for the Linux version of
Genode. Now, all Genode platforms behave equally with regard to include
search directories.
* We enforce using the actual compiler's C++ support libraries rather than
the default libraries installed on the host.
Tools and build infrastructure
##############################
Official tool chain
===================
At the download section of our website, we used to provide a crosstool-based
tool chain as pre-compiled binaries. Since we got several requests about
how to build such a tool chain from scratch, we created custom utility for
downloading, building, and installing the official Genode tool chain. You
can find the utility at 'tool/tool_chain'. For usage instructions, just
start 'tool_chain' without arguments. Because this utility is a plain script,
you can follow and verify each step that we use for creating the Genode tool
chain. Currently, this official tool chain is based on binutils 2.18 and
gcc 4.2.4.
As an alternative to installing the tool chain from source, we also
provide pre-compiled binaries at the download section of our website.
[http://genode.org/download/tool-chain - Visit our tool-chain download website...]
For the Linux version of Genode, we still use the host's default gcc
as tool chain. This way, we spare the hassle of downloading and installing
a custom tool chain for somebody who wants to give Genode a quick try.
With this is mind, we have fixes several small issues with gcc 4.3.2:
* Fixed dependency generation for gcc-4.3.2. Older version of gcc used to
append a '.o' dependency at the target of '.d'-files. However, gcc-4.3.2
seems to handle the option '-MT' differently, resulting in a rule that
contains only the '.d' as target. Now, we explicitly specify both the
'.o' file and the '.d' file as target. Consequently, on older gcc
versions, the '.o' file appears twice but that is no problem.
* Fixed assembler issue with the 'fnstsw' instruction in the C library.
This instruction does not accept eax but only ax as argument.
Build-directory creation tool
=============================
We added a rule for creating a pre-configured build directory for the
Pistachio version to our build-directory creation tool
('tool/builddir/create_builddir'). Furthermore, we changed the default
build configuration such that the official Genode tool chain is used for
L4/Fiasco and L4ka::Pistachio.
Build system
============
* Improved clean rule - visit each target directory only once
* Stop the build process on the first error by default, for continuing
the build process depite of an error, you can use the '-i' argument
of make.
* Compiler flags can now be set specific for compiling C and C++ sources.
This is needed because both variants allow different sets of warning
options. The new variables are called 'CC_CXX_OPT' and 'CC_C_OPT'.
ISO image creation tool
=======================
We have created a convenient front end for 'genisoimage', which we
use for testing Genode on Qemu. You can find this ISO-image-creation
tool at 'tool/create_iso'. For usage instructions, simply start the
tool without arguments.

View File

@@ -1,585 +0,0 @@
==============================================
Release notes for the Genode OS Framework 9.05
==============================================
Genode Labs
Shortly after including support for the L4ka::Pistachio kernel in the
previous release, the Genode version 9.05 gives a further evidence of
Genode's high portability by making the framework available on top of
the OKL4 kernel. This kernel is a commercial-grade microkernel
developed by [http://ok-labs.com - Open Kernel Labs]. In Section
[Supporting the OKL4 kernel as new base platform], we elaborate on the
new base platform and summarize the experiences made during our porting
work.
The previous Genode release was accompanied by a source-code archive containing
the initial version of Qt4 for Genode. Our approach is to make the Qt4
framework available for building Genode applications running natively on the
microkernel rather than within a virtualization environment. As advertised in
our [http://genode.org/about/road-map - road map], we have now seamlessly
integrated the Qt4 framework into our mainline source tree. Furthermore, we
have adapted our port to the Qt4 version 4.5.1. Section [Integration of Qt4
into the mainline repository] gives a rough overview of the changes and an
introduction on how to use the Qt4 framework with Genode.
The third major feature of the release is the addition of preliminary USB
support. We have been able to port major parts of Linux' USB infrastructure
to Genode using the DDE Kit introduced in autumn 2008. Section [USB support]
presents an overview about the pursued design and the current state of
implementation.
Section [OKLinux on Genode] outlines our ongoing efforts of running Linux
as a node in Genode's process tree.
Supporting the OKL4 kernel as new base platform
###############################################
The OKL4 kernel developed by Open Kernel Labs started as a fork of the
L4ka::Pistachio kernel. Whereas L4ka::Pistachio remained true to the L4
x.2 specification, OKL4 was subject of major API changes geared towards high
performance on the ARM architecture. OKL4 earned much fame for executing a
user-level variant of Linux (OKLinux) on top the microkernel, which turned out
to be faster than executing Linux natively on the ARM9 architecture. Even
though OKL4 is primary targeted at the ARM architecture, we wanted to go for
the x86 variant because of two reasons. First, there exists the just mentioned
user-level port of Linux for OKL4, which looks like an attractive way to execute
Linux on Genode once Genode runs on OKL4. Second, we think that distributing
Genode in the form of ISO images bootable on plain PC hardware is the best
way to reach the OS community. Therefore, we decided to use OKL4 version 2.1 as
the base for our work. In contrast to later releases, this version supports
both x86 and ARM. The following section reviews the unique features of the
OKL4 kernel from our perspective.
OKL4 viewed from the angle of a Genode developer
================================================
On the kernel-API level, OKL4 has several interesting properties that had been
both welcome and challenging. We want to highlight the following points:
In contrast to prior L4 kernels, OKL4 has *removed wall-clock timeouts* from
the kernel interface. On L4, timeouts were used as arguments for for blocking
IPC operations serving two purposes. First, specifying IPC timeouts allowed the
IPC caller for regaining control over the blocking thread after the specified
time elapsed. This is considered as important in the case that the called
thread misbehaves and never answers the call. However, the problem of choosing
an appropriate timeout was never properly resolved. When dimensioning the
timeout too small, the called thread may miss the timeout just because it had
no chance to be selected by the scheduler in time. Such timeouts rely on the
presumption that there is low load on the system. On the other hand, when
dimensioning the timeout too high, the system will become sluggish when the
called thread misbehaves. For example, a simple GUI server may want to send
input events to its clients with a timeout to be robust against misbehaving
clients that never wait for events. When choosing a timeout too small, chances
are high that an event will occur at a time when the receiver is handling a
previous event. The timeout would trigger and the event would get lost. When
choosing the timeout too large, say 1 second, any misbehaving client could make
the GUI server freeze for 1 second. Therefore, timeouts for regaining control
over a blocked thread seem to be a bad idea. So we welcome their absence in
OKL4. The second use of timeouts is their use as user-level time source. On L4,
sleep is typically implemented as a blocking IPC with a timeout set to the
sleep value. For this purpose, a system built on top of OKL4 has to employ a
user level device driver accessing a timer device. In Genode, we already have a
timer service for this purpose. So we won't miss timeouts at all.
Classical L4 kernels provide two variants of *synchronous IPC*. So called long
IPC could copy any amount of memory from the sending to the receiving address
space. This is complicated operation because either communication partner may
specify communication buffers that contain unmapped pages. Hence, page faults
may occur during long-IPC operations. On L4, page faults, in turn, are handled
by the user land. Not until a user-level pager thread resolves the page fault
by establishing a mapping at the faulting address, the kernel can proceed the
IPC operation. This sounds pretty complicated, and it is. The second IPC
variant is called short IPC. It constrains the transferable payload to CPU
registers. Hence, these IPC operations should only be used for messages with a
payload of a maximum of 2 machine words. Because short IPCs are never touching
user-level memory pages, no page faults can occur.
On OKL4, there is only one IPC operation, which copies payload from the
sender's user-level thread-control block (UTCB) to the receiver's UTCB. An
UTCB is an always-mapped memory region. Hence no page faults can occur during
IPC operations. On Genode, the UTCB size of 256 bytes may become a limitation
when RPC messages get large. For example, session requests may include large
session-argument strings specifying session-constructor arguments. Current
services rely only on a few arguments so the size limitation is not an
apparent problem. But that may change for future services. Furthermore, in
contrast to L4 x.2, OKL4 does not allow for transferring payload other than
plain data. In particular, OKL4 does not support the transfer of memory
mappings via IPC. Removing memory mappings from the IPC operation is a very
good idea. On Genode, only roottask (core) establishes mappings and shared
memory is implemented as a user-level protocol (data spaces). There is no need
to allow arbitrary processes to establish memory mapping via IPC.
The *boot procedure* of OKL4 largely differs from other L4 kernels. This is
attributed to Open Kernel Labs' focus on embedded systems, which mostly rely on
single-image boot loading. OKL4 employs a tool (elfweaver) for creating a
bootable image from a bunch of files and an XML configuration file. Among the
declarations about which processes to be loaded and which policies to enforce,
the configuration file contains platform parameters such as the amount of
physical memory of the machine. This static approach to configure a system is
certainly useful for embedded systems but PC hardware uses to vary a lot. In
this case, evaluating boot-time memory descriptors would be the preferred
solution.
OKL4 introduces kernel support for *user-level synchronization*. Prior L4
kernels facilitated user-level synchronization through a combination of
synchronous IPC operations with either priorities or delayed preemption.
OKL4's mutexes can make the life in the user land much easier. However, we have
not looked into OKL4 mutexes yet.
There does not exist a recursive *map operation* as the source operand of the
map operation is a physical memory descriptor rather than a virtual address in
the mapper's address space. Consequently, this design eliminates the need for
having a recursive unmap operation and thereby, the need to maintain a mapping
data base in the kernel. This is cool because Genode keeps track of the
mappings at the user level anyway (within core). From our perspective, there is
no need to maintain mapping relationships in the kernel. Removing the mapping
database effectively discards a lot of much-discussed problems about how to
manage the mapping database in a clever way.
There exists *no root memory manager* (sigma0). Because the map operation
takes a physical memory descriptor as argument instead of a virtual address
in the mapper's address space. The mapper does not need to have the mapped
page locally mapped within its own address space. In fact, core (as the only
mapper in a Genode system) does only have very little memory mapped locally.
This design accelerates the boot time because there is no need to map each
physical page in core at startup as performed when running core on the other
L4 kernels.
These differences of OKL4 compared with the microkernels already supported
by Genode posed a number of interesting challenges and opportunities. We have
thoroughly documented the process in
[http://genode.org/documentation/articles/genode-on-okl4 - Bringing Genode to OKL4].
Usage
=====
For using Genode with OKL4, please refer to the following dedicated page:
:[http://genode.org/documentation/platforms/okl4 - Genode on the OKL4 microkernel]:
Site about building and using Genode with the OKL4 kernel.
Limitations of the current implementation
=========================================
The current implementation is able to execute the complete Genode demonstration
scenario on OKL4. This means, we can build and destroy arbitrary trees of
processes, have all the needed infrastructure in place to execute user-level
device drivers such as VESA and PS/2, perform inter-process communication
via RPC and shared memory, and have all basic framework API functions available.
We regard the current state as the first functional version. However, there are
the following points that need improvement and are subject to our future work.
:Incomplete timer driver:
On x86, the timer driver should program the PIT to dispatch sleep requests.
However, the I/O ports of the PIT can only by made available to one party in
the system (which naturally would be the timer driver). Unfortunately, there
are some VESA BIOSes around, which try using the PIT directly. The current
version of our VESA driver does not virtualize these accesses. It rather
tries to gain direct access to the I/O ports from core. This would not work
if the timer already uses this device resource. Our plan is to supplement
our VESA driver with a virtual PIT that uses the timer service as back end.
Then we can safely use the PIT by the timer driver.
:Signalling framework not yet implemented:
We have not yet implemented Genode's API for asynchronous notifications
in the OKL4 version. In fact, the goal of the initial version of the
OKL4 support was running the default demonstration scenario, which does
not rely on signals. The second and more technical reason is that we
consider exploiting OKL4's event mechanism for implementing the signalling
API but have not finalized the design. The generic implementation as used
on the other platforms cannot be used on OKL4 because this implementation
utilizes one helper thread per signal transmitter. Within core, each RM
session is a potential signal transmitter, which means that we need to
create a helper thread per process. Unfortunately, by default, OKL4
limits the number of threads within roottask (core) to only 8 threads,
which would impose a severe limit on the number of processes we could
run on OKL4.
:OKL4's kernel mutexes yet to be used:
We have not yet explored the use of mutexes provided by the OKL4 kernel
for implementing Genode synchronization APIs but we rather rely on a
yielding spin lock for now. This has a number of drawbacks such as high
wake-up latencies in the contention case (depending on the scheduling
time slice), no support for priorities, and no fairness. Although it
is a simple and robust solution to start with, we plan to facilitate
the OKL4 kernel feature with our upcoming work.
:Overly simplistic UTCB allocation:
Right now, we allocate a fixed amount of 32 UTCBs per address space and
thereby limit the maximum number of threads per process. In the future,
this limit should be made configurable.
:Managed dataspaces not yet supported:
The support of managed dataspaces relies on the signal API, which is
not yet available for OKL4.
:Message buffers are limited to 256 bytes:
Because OKL4 performs message-based inter-process communication by
copying data between the UTCBs of the communicating threads, the
UTCB size constaints the maximum message size. Therefore, message
must not exceed 256 bytes. This is not a huge problem for the currently
available Genode programs but we can imagine session argument-lists
to become larger in the future.
:Advanced thread functions are incomplete:
Thread functions such as querying registers of remote threads are not yet
implemented.
Integration of Qt4 into the mainline repository
###############################################
Qt4 is a tool kit for developing platform-independent applications. It
comprises a complete platform-abstraction layer and a rich GUI tool kit
widely used for commercial and open-source applications. It is particularly
known as the technical foundation of the KDE project. The previous Genode
release was accompanied by a snapshot of our initial port of Qt4 to Genode. For
the current release, we have turned this proof-of-concept implementation into a
properly integrated part of the Genode mainline development. This enables Qt4
applications to be executed natively on the full range of kernels supported by
Genode.
Usage
=====
We complemented Genode's source tree with the new 'qt4' source-code repository,
which contains the Genode-specific parts of the Qt4 framework. The most
portions for the Qt4 framework are used unmodified and thereby have not been
made part of the Genode source tree. Instead, we fetch the original Qt4 source
code from Trolltech's FTP server. This way, our source tree remains tidy and
neat.
For using Qt4 for your Genode applications, you first need to download and
prepare the original Qt4 source codes and build a few Qt4 tools such as the
meta-object compiler and the resource compiler. The makefile found in the
top-level directory of the 'qt4' repository automates this task:
! make prepare
To include the 'qt4' repository into the Genode build process, just add the
'qt4' directory to the 'REPOSITORIES' declaration of the 'etc/build.conf' file
within your build directory. Make sure that the repositories 'demo' and 'libc'
are included as well. The 'qt4' repository comes with a couple of demo applications.
The 'qt_launchpad' is especially interesting because it makes use of both the
Qt4 framework and the Genode framework in one application.
Features and limitations
========================
The Qt4 port comprises Qt's Core library, GUI library, Script library, XML
library, and the UI tools library.
For using Qt4 on the Linux version of Genode, we recommend using the Genode
tool chain rather than your host's tool chain. Qt4 makes use of a lot of libc
functionality, supplied by Genode's 'libc' repository. However, on Linux we
still link against your host's libc. This becomes a problem if your host
compiler's C++ support code references libc functionality that is not part of
Genode's libc. Thereby the linker will silently create references to glibc
symbols, making both libraries collide. So if using Qt4, we recommend using the
Genode tool chain:
:[http://genode.org/download/tool-chain]:
Information about downloading and using the Genode tool chain
USB support
###########
This release introduces the first fragments of USB support to Genode, taking
the USB human-interface device (HID) class as starting point. With this work,
we follow our approach of reusing unmodified Linux device drivers executed
within a device-driver environment called DDE Linux. In the previous release,
we already utilized this approach for realizing basic networking on Genode.
With this release, we complement DDE Linux with support required by USB
drivers. We are grateful for being able to base our implementation on the
excellent foundation laid by Dirk Vogt. He described his work in
[http://os.inf.tu-dresden.de/papers_ps/beleg-vogt.pdf - USB for the L4 environment].
For USB HID support, we added the Linux USB and input subsystems to the DDE
Linux 2.6 framework. Besides the 'dde_linux26/net.h' API for network drivers
added in Genode 9.02, the current version also includes APIs for input
('dde_linux26/input.h') and USB ('dde_linux26/usb.h'). We intend these
interfaces to mature towards generic driver-library APIs in the future. For
example, BSD-based drivers shall transparently provide the same functionality
as the current Linux drivers, which permits the simple reuse of driver server
implementations.
[image usb_current]
Image [usb_current] illustrates the current implementation of the USB-based
human-interface device (HID) driver. In this monolithic setup, all parts of the
USB stack and the device API are executed within one address space. These parts
are
* Input server glue code
* HID driver and input subsystem
* Core functions for management of USB request buffers (URBs),
attached devices, and registered drivers
* Host controller drivers for UHCI, OHCI, and EHCI
[image usb_aspired]
We regard this as an intermediate step towards our goal to decompose the USB
stack. Image [usb_aspired] shows our aspired design. In this design, the
USB server and one or more USB gadget drivers run in dedicated address spaces.
The USB server provides two interfaces called USB session interface and USB
device interface. A USB session interface corresponds to a virtual root hub,
from which USB devices can be queried. The client of the USB session interface
is usually an USB gadget driver that uses the USB device interface. Because
this interface is used for transferring the actual payload at a potentially
high bandwidth, it is based on shared memory and signals. The USB server
consists of the following components:
* USB server glue code
* Virtual USB device driver managing all attached devices
* Core functions including hardware hub management
* Host controller drivers
The USB server presents a virtual USB hub to each USB gadget driver. Such
a driver consists of:
* Device interface, e.g., input server glue code
* Gadget driver, e.g., HID driver and input subsystem
* Core functions
* Virtual host controller
* USB client glue code
The HID driver uses the USB session API to monitor ports of its virtual root
hub and submit URBs to attached devices. The session interface facilitates the
signalling framework for event notification and a shared-memory dataspace for
URB transmission.
The 'os' repository already contains the USB session and USB device interfaces.
However, the decomposition is not yet in a functional state.
:Current limitations:
The current monolithic implementation of the USB HID service can already be
used as a replacement of the PS/2 driver. However, both drivers cannot be used
at the same time, yet. To enable the use of both USB HID and PS/2, we plan to
create a further component that merges multiple streams of input events and
passes the result to the GUI server.
OKLinux on Genode
#################
According to our road map, we pursued the goal to run Linux as a node in
Genode's process tree. We explored two approaches:
:Reanimating the Afterburner project conducted by the [http://l4ka.org - L4Ka group]:
This approach is the result of the L4Ka groups's long-year experience with
manually supporting L4Linux on top of the L4ka::Pistachio kernel. Because of
the high costs of maintaining the paravirtualized Linux kernel, a
semiautomatic paravirtualization technique was created. According to the
impressive results presented in
[http://www.l4ka.org/l4ka/publ_2006_levasseur-ua_soft-layering.pdf - Pre-Virtualization: Soft Layering for Virtual Machines],
this approach is able to drastically reduce maintenance costs while retaining
good performance. Furthermore, the approach was applied not only to Linux
running on the L4 kernel but also for using Xen or Linux as underlying
host operating systems.
:Porting the OKL4-specific version of L4Linux to Genode:
Open Kernel Labs maintain a custom version of L4Linux that runs on OKL4. This
version is mostly referred to as OKLinux aka Wombat. Since Genode can now use OKL4
as base platform, the reuse of OKLinux in combination with Genode has become
a feasible option.
Both approaches have pros and cons. Whereas Afterburner is a intriguing
approach, this project seems to be stalled. It relies on a rather old tool
chain, and recent Linux features such as thread-local storage support are not
considered, yet. To pick up this solution for Genode will require us to fully
understand the mechanisms and the code. So we consider this as a mid-term
solution. In short term, running OKLinux on Genode is more feasible. We were
already able to create a prototype version of OKLinux running on Genode. This
version starts up the kernel including all Linux kernel threads, mounts the
boot partition supplied as memory image, and starts the init process. The
engineering costs had been rather low. We replaced the Iguana user land
libraries as originally used by Wombat by a Genode-specific reimplementation to
keep our manual adaptions of the Linux kernel code as small as possible.
Our custom reimplementation of the needed Iguana APIs consists of less than
1,000 lines of code (SLOC). The diff for our changes to the OKLinux kernel code
comprises less than 1,000 lines. We plan to make a snapshot of this prototype
publicly available soon.
Operating-system services and libraries
#######################################
Nitpicker GUI server
====================
We optimized the performance of the 'refresh' call, which updates all views of
a session, which display a given buffer portion. The new implementation restricts
the redraw operations to the fragment of each view that displays the specified
buffer portion. The performance improvement becomes most visible when updating
only small parts of a buffer.
USB session interface
=====================
Genode's emerging USB support introduces two new interfaces to the 'os' repository,
which are called USB session and USB device.
An _USB_session_ is a virtual USB bus with just one root hub with 'MAX_PORTS'
downstream ports. The client of such as session submits USB request blocks
(URBs) and is, in turn, informed about port changes on the root hub as well as
request completion. Connected USB devices can be referenced by USB device
capabilities and are associated with one port at the virtual root hub on
server side.
An _USB_device_ references a hardware device connected to a virtual USB bus's
root hub. The device capability enables the client to send USB request
blocks to the hardware device.
Input interface
===============
We updated the key codes of the input interface in response to recent changes
of Linux' 'dev/event' definitions.
VESA driver
===========
Until now, there existed different processes that tried to access the PCI bus
via I/O ports, in particular the VESA framebuffer driver and the PCI bus
driver.
Since core enforces that each I/O port can only be assigned exclusively to one
component in the system, multiple processes that need access to the same I/O
ports cannot run at the same time. For our default demonstration scenario, we
had been able to allow the VESA driver to use the PCI I/O ports because nobody
else needed them. However, our growing base of device drivers relies on the
PCI bus driver. To be able to use the VESA driver together with other drivers,
we virtualized the access to the PCI bus from within the VESA driver.
Our current PCI virtualization code is pretty limited. The VESA driver sees a
virtual PCI bus with only the VGA card attached. For now, we only allow reading
the PCI configuration space of this device, but not writing to it. Apparently,
this simple approach is sufficient to run the VESA BIOS of Qemu. However, other
VESA BIOS implementations may need further access to the PCI device's
configuration space. For example, for querying the size of a PCI resource,
write access to base address registers is required. In such an event, the VESA
driver will print a message about the missing virtualization feature:
! writing data register not supported
If you see such a message, we are very interested to see your log output such
that we can enhance our PCI virtualization code as needed. Please contact us!
Base framework
##############
In the process of bringing Genode to the OKL4 kernel, we have generalized much
of former platform-specific code:
* The initialization of C++ exception handling has now become part of the
generic 'cxx' library in the 'base' repository. All platforms except
Linux are using this generic library now.
* The 'server' library used to contain a platform-specific part that
implemented the 'manage' function of a 'Server_entrypoint'. The
generalized version of this library is now being used on all platforms
other than Linux.
* We unified core-internal interfaces and their implementations such as
'Dataspace_component', 'Cap_session_component', 'Rm_session_component',
and 'Irq_session_component'. The result has become part of the 'base'
repository.
* On OKL4, threads need to execute small startup code for querying their
own thread IDs. Therefore, we have extended the 'Thread_base' interface
with a platform-specific hook function called '_thread_bootstrap'.
* The types defined in 'base/native_types.h' had been complemented by a
new 'Native_thread_id' type. This type is exclusively used by core and the
framework libraries. For using the Genode API, this type is meaningless.
* For the 64bit support, we slightly refined the interfaces of some utility
template functions in 'util/misc_math.h'. Furthermore, parts of the generic
marshalling code of the IPC framework needed refinement, but no API changes
were needed.
Linux-specific changes
######################
Adaptation to 64 bit
====================
Because most Genode developers tend to work with the Linux version of Genode,
supporting 64-bit Linux becomes increasingly important. With the current release,
we start to officially support 64-bit Linux as base platform. This comes
along with the following changes:
* We replaced the 'spec-x86.mk' file with new 'spec-x86_32.mk' and 'spec-x86_64.mk'
files. The default version of 'base-linux/etc/specs.conf' automatically
chooses the right spec file according to the output of 'uname -m'. Therefore,
output of the build processes matches your host architecture. This behaviour
can be changed by placing a customized 'spec.conf' file in your build directory's
'etc/' subdirectory.
* We added type definitions for 64-bit-specific fixed-size integers in the form
of a 64-bit-specific 'fixed_stdint.h' file.
* Because using 64 bit instead of 32 bit changes the payload size of RPC
messages, we had to adjust several message buffers such as 'Ram_session_client'
and 'Input::Session_client', and adapted the used stack sizes.
* Towards the goal of completely dissolving Genode's dependency on the Linux' glibc,
we implemented custom system-call bindings. Apparently, Linux' syscall interface
differs between 32 bit and 64 bit. For example, the 32-bit version handles
all socket-related calls via a compound 'socketcall' whereas the 64-bit
version uses distinct syscalls. Another difference is the handling of the
'mmap' syscall and different behaviour of 'tkill'. The latter problem was
resolved by replacing 'tkill' with 'tgkill' and setting the thread-group
argument of the corresponding PID. Therefore, a 'Native_thread_id' on Linux
now comprises both the TID and the PID.
* The 'Platform_env' on Linux contains a local implementation of the 'Rm_session'
interface, which uses 'mmap' to attach dataspaces to the process' address
space and maintains the region list in the form of a static array. This array
was dimensioned to 256 entries, which constrained the maximum amount of
usable memory when allocating a lot of small blocks via Genode's heap. Since
the heap allocates backing store at the granularity of only 16KB, the worst
case for reaching this limit was about 4MB. This was OK for our simple test
applications. But for using Qt4, in particular on 64 bit, this has become a
serious limitation. For now, we increased the region limit to 4096 and plan
to replace the static array with a dynamically growing data structure.
Furthermore, we made the heap granularity depend on the actual machine-word
size. Therefore, the heap allocates its backing store in 32KB blocks when
running on 64 bit.
Debugging hooks
===============
On Linux, we use gdb for debugging Genode. This is feasible as long as the
targeted process is running. However, during low-level debugging, we had the
recurring problem of a thread dying shortly after starting up. So we added a hook
for halting a thread at the startup in order to be able to attach gdb to the
thread before it dies. This simple hook lets the thread wait for a key press by
directly calling the 'read' syscall. We also added a simple debug facility for
printing debug messages bypassing Genode's LOG service by calling the 'write'
syscall directly. Both hooks are now part of the Linux version of the 'env'
library (see 'base-linux/src/base/env/debug.cc'). Note that these hooks are not
part of the Genode API. There exists no header file.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,871 +0,0 @@
===============================================
Release notes for the Genode OS Framework 10.11
===============================================
Genode Labs
During the past three months, the Genode project was primarily driven by our
desire to create a bigger picture out of the rich set of components that we
introduced over time, in particular over the last year. Looking back at the
progress made since mid 2009, there were many functional additions to the
framework, waiting to get combined. To name a few, we added support for
networking, audio output, real-time priorities, mandatory access control,
USB, ATAPI block devices, Python, hardware-accelerated 3D graphics, Qt4,
the WebKit-based Arora browser, and the paravirtualized OKLinux kernel.
So many wonderful toys waiting to get played with. This is how the idea of
creating [http://genode.org/download/live-cds - the new Genode Live CD] was
born. In the past, Genode was mostly used in settings with a relatively static
configuration consisting of several components orchestrated to fulfill
a few special-purpose functions. Now, the time has come for the next step,
creating one dynamic setup that allows for the selection of different subsystems
at runtime rather than at boot time.
This step is challenging in several ways. First, the processes that form
the base system have to run during the entire time of all demo setups. If
any of those processes contained stability problems or leaked memory, it would
subvert the complete system. Second, the components of all subsystems combined
are far too complex to be loaded into memory at boot time. This would not
only take too long but would consume a lot of RAM. Instead, those components
and their data had to be fetched from disk (CDROM) on demand. Third, because
multiple demo subsystems can be active at a time, low-level resources such as
networking and audio output must be multiplexed to prevent different
subsystems from interfering with each other. Finally, we had to create a
single boot and configuration concept that is able to align the needs of all
demos, yet staying manageable.
Alongside these challenges, we came up with a lot of ideas about how Genode's
components could be composed in new creative ways. Some of these ideas such
as the browser-plugin concept and the http-based block server made it onto
the Live CD. So for producing the Live CD, we not only faced the said
technical challenges but also invested substantial development effort in new
components, which contributed to our overall goal. Two weeks ago, we released
the Live CD. This release-notes document is the story about how we got there.
To keep ourself focused on the mission described above, we deferred the
original roadmap goal for this release, which was the creation of a Unix-like
runtime environment to enable compiling Genode on Genode. This will be the
primary goal for the next release.
Execution environment for gPXE drivers
######################################
Up to now, DDE Linux provided Genode with drivers for hardware devices
ranging from USB HID to WLAN. In preparation of the live CD, we
noticed the demand for support of a broader selection of ethernet
devices. Intel's e1000 PCI and PCIe cards seemed to mark the bottom
line of what we had to support. The major advantage of NIC drivers
from Linux is their optimization for maximum performance. This emerges
a major downside if DDE Linux comes into play: We have to provide all
the nifty interfaces used by the driver in our emulation framework. To
achieve our short-term goal of a great live CD experience, we had to
walk a different path.
[http://gpxe.org/ - gPXE] is a lovely network boot loader / open-source
PXE ROM project and the successor of the famous Etherboot
implementation. Besides support for DNS, HTTP, iSCSI and AoE, gPXE
includes dozens of NIC drivers and applies a plain driver framework.
As we were also itching to evaluate DDE kit and the DDE approach at
large with this special _donator OS_, we went for implementing the
device-driver environment for gPXE (DDE gPXE).
The current version provides drivers for e1000, e1000e, and pcnet
devices. The emulation framework comprises just about 600 lines of
code compared to more than 22,000 LOC reused unmodified from gPXE.
Benchmarks with the PCNet32 driver showed that DDE gPXE's performance
is comparable to DDE Linux.
The gPXE driver environment comes in the form of the new 'dde_gpxe'
repository. For building DDE gPXE, you first need to download and patch
the original sources. The top-level makefile of this repository automates
this task. Just issue:
! make prepare
Now, you need to include the DDE gPXE repository into your Genode
build process. Just add the path to this directory to the
'REPOSITORIES' declaration of the 'etc/build.conf' file within your
build directory, for example
! REPOSITORIES += $(GENODE_DIR)/dde_gpxe
After successful build the DDE gPXE based ethernet driver is located
at 'bin/gpxe_nic_drv'.
On-demand paging
################
In the [http://genode.org/documentation/release-notes/8.11#section-8 - release 8.11],
we laid the foundation for implementing user-level dataspace managers.
But so far, the facility remained largely unused except for managing thread
contexts. This changed with this release.
So what is a user-level dataspace manager and who needs it? In short,
Genode's memory management is based on dataspaces. A dataspace is a
container for memory. Normally, it is created via core's RAM or ROM
services. The RAM service hands out dataspaces containing contiguous
physical memory. After allocating such a RAM dataspace, the creator can
attach the dataspace to its own address space to access the dataspace
content. In addition, it can pass a dataspace reference (called dataspace
capability) to other processes, which, in turn, can than attach the same
dataspace to their local address space, thereby establishing shared memory.
Similarly, core's ROM service hands out boot-time binary data as dataspaces.
For the most use cases of Genode so far, these two core services were the
only dataspace providers needed. However, there are use cases that require
more sophisticated memory management. For example, to implement swapping,
the content of a dataspace must be transferred to disk in a way that
is transparent to the users of the dataspace. In monolithic kernels, such
functionality is implemented in the kernel. But on a multi-server OS
such as Genode, this is no option. Implementing such a feature into
core would increase the trusted computing base of all applications
including those who do not need swapping. Core would need a hard-disk
driver, effectively subverting the Genode concept. Other examples for
advanced memory-management facilities are copy-on-write memory and
non-contiguous memory - complexity we wish to avoid at the root of the
process tree. Instead of implementing such memory management facilities
by itself, core provides a mechanism to let any process manage dataspaces.
This technique is also called user-level page-fault handling.
For the Live CD, we decided to give Genode's user-level page-fault handling
facility a go. The incentive was accessing files stored on CDROM in an
elegant way. We wanted to make the CDROM access completely transparent to
the applications. An application should be able to use a ROM session as
if the file was stored at core's ROM service. But instead of being
provided by core, the session request would be delegated to an
alternative ROM service implementation that reads the data from disk
as needed. Some of the files stored in the CDROM are large. For example,
the disk image that we use for the Linux demo is 160MB. So reading
this file at once and keeping it in memory is not an option. Instead, only
those parts of the file should be read from disk, which are actually
needed. To uphold the illusion of dealing with plain ROM files for
the client, we need to employ on-demand-paging in the CDROM server.
Here is how it works.
# The dataspace manager creates an empty managed dataspace. Core
already provides a tool for managing address spaces called
region manager (RM service). A RM session is an address space,
to which dataspaces can be attached. This is exactly what is
needed for a managed dataspace. So a dataspace manager uses the
same core service to define the layout of a managed dataspace
as is used to manage the address space of a process. In fact,
any RM session can be converted into a managed dataspace.
! enum { MANAGED_DS_SIZE = 64*1024*1024 };
! Rm_connection rm(0, MANAGED_DS_SIZE);
This code creates a RM session with the size of 64MB. This is an empty
address space. A dataspace capability that corresponds to this address
space can then be requested via
! Dataspace_capability ds = rm.dataspace();
# The dataspace capability can be passed to a client, which may
attach the dataspace to its local address space. Because the
managed dataspace is not populated by any backing store, however,
an access would trigger a page fault, halting the execution of
the client. Here, the page-fault protocol comes into play.
# The dataspace manager registers itself for receiving a signal each time
a fault occurs:
! Signal_receiver rec;
! Signal_context client;
! Signal_context_capability sig_cap = rec.manage(client);
! rm.fault_handler(sig_cap);
When an empty part of the managed dataspace is accessed by any
process, a signal is delivered. The dataspace manager can then
retrieve the fault information (access type, fault address) and
dispatch the page fault by attaching a real dataspace at the
fault address of the managed dataspace. In a simple case, the code
looks as follows:
! while (true) {
! Signal signal = rec.wait_for_signal();
! for (int i = 0; i < signal.num(); i++) {
! Rm_session::State state = rm.state();
! ds = alloc_backing_store_dataspace(PAGE_SIZE);
! rm.attach_at(ds, state.addr & PAGE_MASK);
! }
! }
This simple page-fault handler would lazily allocate a page of
backing store memory each time a fault occurs. When the backing
store is attached to the managed dataspace, core will automatically
wake up the faulted client.
# The example above has the problem that the dataspace manager has
to pay for the backing store that is indirectly used by the client.
To prevent the client from exhausting the dataspace manager's memory,
the dataspace manager may choose to use a limited pool of backing
store only. If this pool is exceeded, the dataspace manager can reuse
an already used backing-store block by first revoking it from its
current managed dataspace:
! rm.detach(addr);
This will flush all mappings referring to the specified address
from all users of the managed dataspace. The next time, this
address region is accessed, a new signal will be delivered.
This page-fault protocol has the following unique properties. First,
because core is used as a broker between client and dataspace manager, the
dataspace manager remains completely unaware of the identity of its client.
It does not even need to possess the communication right to the client. In
contrast, all other user-level page-fault protocols that we are aware of
require direct communication between client and dataspace manager. Second,
because dataspaces are used as first-level objects to resolve page faults,
page faults can be handed at an arbitrary granularity (of course, a multiple
of the physical page size). For example, a dataspace manager may decide to
attach backing-store dataspaces of 64K to the managed dataspace. So the
overhead produced by user-level page-fault handler can be traded for the
page-fault granularity. But most importantly, the API is the same across
all kernels that support user-level page fault handling. Thus the low-level
page-fault handling code becomes inherently portable.
Having said that, we have completed the implementation of the described
core mechanisms, in particular the 'detach' facility, for OKL4. The ISO9660
driver as featured on the Live CD implements the 'ROM' interface and
reads the contents of those files from CDROM on demand. It uses a
fixed pool of backing store, operates at a page-fault granularity of
64KB, and implements a simple fifo replacement strategy.
Base framework
##############
There had been only a few changes to the base framework described as
follows.
We unified the core-specific console implementation among all
base platforms and added synchronization of 'vprintf' calls.
The kernel-specific code resides now in the respective
'base-<platform>/src/base/console/core_console.h' files.
We removed the argument-less constructor from 'Allocator_avl_tpl'.
This constructor created an allocator that uses itself for
meta-data allocation, which is the usual case when creating
local memory allocators. However, on Genode, this code is typically
used to build non-memory allocators such as address-space regions.
For these use cases, the default policy is dangerous. Hence, we
decided to remove the default policy.
The 'printf' helper macros have been unified and simplified. The
available macros are 'PINF' for status information, 'PWRN' for warnings,
'PLOG' for log messages, and 'PERR' for errors. By default, the message
types are colored differently to make them easily distinguishable.
In addition to normal messages, there is the 'PDBG' for debugging
purposes. It remains to be the only macro that prints the function name
as message prefix and is meant for temporary messages, to be removed
before finalizing the code.
Genode's on-demand-paging mechanism relies on the signalling framework.
Each managed dataspace is assigned to a distinct signal context.
Hence, signal contexts need to be created and disposed alongside
with managed dataspaces. We complemented the signalling framework
with a 'dissolve' function to enable the destruction of signal
contexts.
Operating-system services and libraries
#######################################
Finished transition to new init concept
=======================================
With the release 10.05, we introduced the
[http://genode.org/documentation/release-notes/10.05#section-0 - current configuration concept of init].
This concept supports mandatory access control and provides flexible
ways for defining client-server relationships. Until now, we maintained
the old init concept. With the current release, the transition to the
new concept is finished and we removed the traditional init.
We retained the support for loading configurations for individual subsystems
from different files but adopted the syntax to the use of attributes.
Instead of
! <configfile>subsystem.config</configfile>
the new syntax is
! <configfile name="subsystem.config"/>
Virtual network bridge (Proxy ARP)
==================================
Since we originally added networking support to Genode, only one program could
use the networking facilities at a time. In the simplest form, such a program
included the network driver, protocol stack, and the actual application. For
example, the uIP stack featured with release 9.02 followed this approach.
In release 9.11 we added the 'Nic_session' interface to decouple the network
driver from the TCP/IP protocol stack. But the 1-to-1 relation between
application and network interface remained. With the current release, we
introduce the 'nic_bridge' server, which is able to multiplex the 'Nic_session'
interface.
The implementation is roughly based on the proxy ARP RFC 1027. At startup, the
'nic_bridge' creates a 'Nic_session' to the real network driver and, in turn,
announces a 'Nic' service at its parent. But in contrast to a network driver
implementing this interface, 'nic_bridge' supports an arbitrary number of
'Nic_sessions' to be opened. From the client's perspective, such a session
looks like a real network adaptor.
This way, it has become possible to run multiple TCP/IP stacks in
parallel, each obtaining a distinct IP address via DHCP. For example,
is has become possible to run multiple paravirtualized Linux kernels
alongside an lwIP-based web browser, each accessing the network via a
distinct IP address.
As a side effect for developing the 'nic_bridge', we created a set
of utilities for implementing network protocols. The utilities are
located at 'os/include/net' and comprise protocol definitions for
ethernet, IPv4, UDP, ARP, and DHCP.
Nitpicker GUI server
====================
Our work on the Live CD motivated several improvements of the Nitpicker
GUI server.
Alpha blending
~~~~~~~~~~~~~~
In addition to nitpicker's plain pixel buffer interface that is compatible
with a normal framebuffer session, each nitpicker session can now have
an optional alpha channel as well as an corresponding input-mask channel
associated. Both the alpha channel and the input mask are contained in the
same dataspace as the pixel buffer. The pixel buffer is followed by
the 8-bit alpha values, which are then followed by the input-mask values.
This way, the presence of an alpha channel does not interfere with the
actual pixel format. Each 8-bit input mask value specifies the user-input
policy for the respective pixel. If the value is zero, user input
referring to the pixel is not handled by the client but "falls through"
the view that is visible in the background of the pixel. This is typically
the case for drop shadows. If the input-mask value is '1', the input
is handled by the client.
With the input-mask mechanism in place, we no longer have a definitive
assignment of each pixel to a single client anymore. In principle, an
invisible client is able to track mouse movements by creating a full-screen
view with all alpha values set to '0' and all input-mask values set to '1'.
Once, the user clicks on this invisible view, the user input gets routed
to the invisible client instead of the actually visible view. This
security risk can be addressed at two levels:
* In X-Ray mode, nitpicker completely disables alpha blending
and the input-mask mechanism such that the user can identify the
client that is responsible for each pixel on screen.
* The use of the alpha channel is a session argument, which is specified
by nitpicker clients at session-creation time. Consequently, this
session argument is subjected to the policy of all processes involved
with routing the session request to nitpicker. Such a policy may permit
the use of an alpha channel only for trusted applications.
_Caution:_ The use of alpha channels implies read operations from
the frame buffer. On typical PC graphics hardware, such operations are
extremely slow. For this reason, the VESA driver should operate in
buffered mode when using alpha blending in Nitpicker.
Tinted views in X-Ray mode
~~~~~~~~~~~~~~~~~~~~~~~~~~
We added support for tinting individual clients or groups of clients
with different colors based on their label as reported at session-creation
time. By using session colors, nitpicker assists the user to tell apart
different security domains without reading textual information. In
addition to the tinting effect, the title bar presents the session
color of the currently focused session.
The following nitpicker configuration tints all views of the launchpad
subsystem in blue except for those views that belong to the testnit
child of launchpad. Those are tinted red.
! <config>
! <policy label="launchpad" color="#0000ff"/>
! <policy label="launchpad -> testnit" color="#ff0000"/>
! </config>
Misc Nitpicker changes
~~~~~~~~~~~~~~~~~~~~~~
We introduced a so-called 'stay-top' session argument, which declares
that views created via this session should stay on top of other views.
This function is useful for menus that should always remain accessible
or banner images as used for Live CD.
Nitpicker's reserved region at the top of the screen used to cover up
the screen area as seen by the clients. We have now excluded this area
from the coordinate system of the clients.
We implemented the 'kill' mode that can be activated by the 'kill' key.
(typically this is the 'Print Screen' key) This feature allows the user
to select a client to be removed from the GUI. The client is not
actually killed but only locked out. The 'kill' mode is meant as an
emergency brake if an application behaves in ways not wanted by the
user.
ISO9660 server
==============
As outlined in Section [On-demand paging], we revisited the ISO9660 server
to implement on-demand-paged dataspaces. It is the first real-world
use case for Genode's user-level page-fault protocol. The memory pool
to be used as backing store for managed dataspaces is dimensioned according
to the RAM assigned to the iso9660 server. The server divides this backing
store into blocks of 64KB and assigns those blocks to the managed dataspaces
in a fifo fashion. We found that using a granularity of 64KB improved the
performance over smaller block sizes because this way, we profit from reading
data ahead for each block request. This is particularly beneficial for
CDROM drives because of their extremely long seek times.
Audio mixer
===========
We added a new *channel synchronization* facility to the 'Audio_out_session'
interface. An 'Audio_out_session' refers to a single channel. For stereo
playback, two sessions must be created. At session-creation time, the
client can provide a hint about the channel type such as "front-left" as
session-construction argument. This design principally allows for supporting
setups with an arbitrary amount of channels. However, those channels must
be synchronized. For this reason, we introduced the 'sync_session' function
to the 'Audio_out_session' interface. It takes the session capability of
another 'Audio_out_session' as argument. The specified session is then
used as synchronization reference.
To reduce the latency when stopping audio replay, we introduced a new *flush*
function to the 'Audio_out_session' interface. By calling this function,
a client can express that it is willing to discard all audio data already
submitted to the mixer.
Furthermore, we improved the audio mixer to support both long-running
streams of audio and sporadic sounds. For the latter use case, low latency
is particularly critical. In this regard, the current implementation is a
vast improvement over the initial version. However, orchestrating the
mixer with audio drivers as well as with different clients (in particular
ALSA programs running on a paravirtualized Linux) is not trivial. In the
process, we learned a lot, which will eventually prompt us to further
optimize the current solution.
Nitpicker-based virtual Framebuffer
===================================
To support the browser-plugin demo, we introduced 'nit_fb', which is a
framebuffer service that uses the nitpicker GUI server as back end. It
is similar to the liquid framebuffer as featured in the 'demo' repository
but in contrast to liquid framebuffer, 'nit_fb' is non-interactive.
It has a fixed screen position and size. Furthermore, it does not
virtualize the framebuffer but passes through the framebuffer portion of
the nitpicker session, yielding better performance and lower latency.
If instantiated multiple times, 'nit_fb' can be used to statically arrange
multiple virtual frame buffers on one physical screen. The size and screen
position of each 'nit_fb' instance can be defined via Genode's configuration
mechanism using the following attributes of the 'nit_fb' config node:
! <config xpos="100" ypos="150"
! width="300" height="200"
! refresh_rate="25"/>
If 'refresh_rate' isn't set, the server will not trigger any refresh
operations by itself.
On the Live CD, each browser plugin instantiates a separate instance of
'nit_fb' to present the plugin's content on screen. In this case, the
view position is not fixed because the view is further virtualized by the
loader, which imposes its policy onto 'nit_fb' - Genode's nested
policies at work!
TAR ROM service
===============
For large setups, listing individual files as boot modules in single-image
creation tools (e.g., elfweaver) or multiboot boot loaders can be
cumbersome, especially when many data files or shared libraries are
involved. To facilitate the grouping of files, 'tar_rom' is an
implementation of the 'ROM' interface that operates on a 'tar' file.
The name of the TAR archive must be specified via the 'name' attribute of
an 'archive' tag, for example:
! <config>
! <archive name="archive.tar"/>
! </config>
The backing store for the dataspaces exported via ROM sessions is accounted
on the 'rom_tar' service (not on its clients) to make the use of 'rom_tar'
transparent to the regular users of core's ROM service. Hence, this service
must not be used by multiple clients that do not trust each other.
Typically, 'tar_rom' is instantiated per client.
The Live CD uses the 'tar_rom' service for the browser demo. Each plugin
is fetched from the web as a tar file containing the config file of the
plugin subsystem as well as supplemental binary files that are provided
to the plugin subsystem as ROM files. This way, a plugin can carry along
multiple components and data that form a complete Genode subsystem.
DDE Kit
=======
The DDE kit underwent slight modifications since the previous release.
It now provides 64-bit integer types and a revised virtual PCI bus
implementation.
Device drivers
##############
PCI bus
=======
Genode was tested on several hardware platforms in preparation of the
current release. This revealed some deficiencies with the PCI bus
driver implementation. The revised driver now efficiently supports
platforms with many PCI busses (as PCIe demands) and correctly handles
multi-function devices.
VESA framebuffer
================
We updated the configuration syntax of the VESA driver to better match
the style of new init syntax, preferring the use of attributes rather than
XML sub nodes. Please refer to the updated documentation at
'os/src/drivers/framebuffer/vesa/README'.
:Buffered output:
To accommodate framebuffer clients that need to read from the frame buffer,
in particular the nitpicker GUI server operating with alpha channels, we
introduced a buffered mode to the VESA driver. If enabled, the VESA driver
will hand out a plain memory dataspace to the client rather than the
physical framebuffer. Each time, the client issues as 'refresh' operation
on the framebuffer-session interface, the VESA driver copies the corresponding
screen region from the client-side virtual framebuffer to the physical
framebuffer. Note that the VESA driver will require additional RAM quota
to allocate the client buffer. If the quota is insufficient, the driver will
fall back to non-buffered output.
:Preinitialized video modes:
As an alternative to letting the VESA driver set up a screen mode, the
driver has become able to reuse an already initialized mode, which is useful
if the VESA mode is already initialized by the boot loader. If the screen
is initialized that way, the 'preinit' attribute of the 'config' node can
be set to '"yes"' to prevent the driver from changing the mode. This way,
the driver will just query the current mode and make the already
initialized framebuffer available to its client.
Audio
=====
We observed certain hardware platforms (in particular VirtualBox) to
behave strangely after ALSA buffer-underrun conditions. It seems that the
VirtualBox audio driver plays actually more frames than requested by
ALSA's 'writei' function, resulting in recurring replay of data that
was in the buffer at underrun time. As a work-around for this problem,
we zero-out the sound-hardware buffer in the condition of an ALSA buffer
underrun. This way, the recurring replay is still there, but it is
replaying silence.
To improve the support for sporadic audio output, we added a check for the PCM
state for buffer underruns prior issuing the actual playback. In the event of
an underrun, we re-prepare the sound card before starting the playback.
Furthermore, we implemented the new flush and channel-synchronization
abilities of the 'Audio_out_session' interface for the DDE Linux driver.
Paravirtualized Linux
#####################
To support the demo scenarios that showcase the paravirtualized Linux kernel,
we enhanced our custom stub drivers of the OKLinux kernel. Thereby, we have
reached a high level of integration of OKLinux with native Genode services,
including audio output, block devices, framebuffer output, seamless integration
with the Nitpicker GUI, and networking. All stub drivers are compiled in by
default and are ready to use by specifying a device configuration in the config
node for the Linux kernel. This way, one Linux kernel image can be easily used
in different scenarios.
:Integration with the Nitpicker GUI:
We enhanced our fbdev stub driver with a mechanism to merge view reposition
events. If a X11 window is moved, a lot of subsequent events of this type are
generated. Using the new optimization, only the most recent state gets
reported to Nitpicker, making the X11 GUI more responsive.
:UnionFS:
As we noticed that unionfs is required by all our Linux scenarios, we decided
to include and enable the patch by default.
:Network support:
With the introduction of the 'nic_bridge', multiple networking stacks can run
on Genode at the same time, which paves the way for new use cases. We have now
added a stub driver using Genode's 'Nic_session' interface to make the new
facility available to Linux.
:Audio output:
We adapted the ALSA stub driver to the changes of the 'Audio_out_session'
interface, using the new channel synchronization and flush functions.
Thereby, we optimized the stub driver to keep latency and seek times of
Linux userland applications reasonably low.
:Removed ROM file driver:
With the addition of the 'Block_session' stub driver, the original ROM file
driver is no longer required. So we removed the stub. For using ROM files as
disk images for Linux, there is the 'rom_loopdev' server, which provides a
block session that operates on a ROM file.
:Asynchronous block interface:
To improve performance, we changed the block stub driver to facilitate the
asynchronous mode of operation as provided by the 'Block_session' interface.
This way, multiple block requests can be issued at once, thereby shadowing
the round trip times for individual requests.
Protocol stacks and libraries
#############################
Gallium3D / Intel GEM
=====================
We improved the cache handling of our DRM emulation code (implementing
'drm_clflush_pages') and our EGL driver, thereby fixing caching
artifacts on i945 GPUs. Furthermore, we added a temporary work-around
for the currently dysfunctional sequence-number tracking with i945 GPUs.
On this chipset, issuing the 'MI_STORE_DWORD_INDEX' GPU command used
for tracking sequence numbers apparently halts the processing the command
stream. This condition is normally handled by an interrupt. However,
we have not enabled interrupts yet.
To prepare the future support for more Gallium drivers than i915, we
implemented a driver-selection facility in the EGL driver. The code
scans the PCI bus for a supported GPU and returns the name of the
corresponding driver library. If no driver library could be found,
the EGL driver falls back to softpipe rendering.
lwIP
====
We revised our port of the lwIP TCP/IP stack, and thereby improved its
stability and performance.
* The lwIP library is now built as shared object, following the convention
for libraries contained in the 'libports' repository.
* By default (when using the 'libc_lwip_nic_dhcp' library), lwIP will
issue a DHCP request at startup. If this request times out, the loopback
device is set as default.
* If there is no 'Nic' service available, the lwIP stack will fall back to
the loopback device.
* We increased the default number of PCBs in lwIP to 64.
* We removed a corner case of the timed semaphore that could occur
when a timeout was triggered at the same time ,'up' was called.
In this case, the semaphore was unblocked but the timeout condition
was not reflected at the caller of 'down'. However, the lwIP code
relies on detecting those timeouts.
Qt4
====
We implemented a custom *nitpicker plugin widget*, which allows for the
seamless integration of arbitrary nitpicker clients into a Qt4 application.
The primary use case is the browser plugin mechanism presented at
the Live CD. In principle, the 'QNitpickerViewWidget' allows for creating
mash-up allocations consisting of multiple native Genode programs. As shown
by the browser plugin demo, a Qt4 application can even integrate other
programs that run isolated from the Qt4 application, and thereby depend on
on a significantly less complex trusted computing base than the Qt4
application itself.
[image nitpicker_plugin]
The image above illustrates the use of the 'QNitpickerViewWidget' in the
scenario presented on the Live CD. The browser obtains the Nitpicker view to be
embedded into the website from the loader service, which virtualizes the
Nitpicker session interface for the loaded plugin subsystem. The browser then
tells the loader about where to present the plugin view on screen. But it has
neither control over the plugin's execution nor can it observe any user
interaction with the plugin.
New Gems repository with HTTP-based block server
################################################
To give the web-browser demo of our Live CD a special twist, and to show off
the possibilities of a real multi-server OS, we decided to implement the
somewhat crazy idea of letting a Linux OS run on a disk image fetched at
runtime from a web server. This way, the Linux OS would start right away and
disk blocks would be streamed over the network as needed. Implementing this
idea was especially attractive because such a feature would be extremely hard
to implement on a classical OS but is a breeze to realize on Genode where all
device drivers and protocol stacks are running as distinct user-level
components. The following figure illustrates the idea:
[image http_block]
The block stub driver of the Linux kernel gets connected to a special block
driver called 'http_block', which does not access a real block device but
rather uses TCP/IP and HTTP to fetch disk blocks from a web server.
Because the 'http_block' server is both user of high-level functionality (the
lwIP stack) and provider of a low-level interface ('Block_session'), the
program does not fit well into one of the existing source-code repositories.
The 'os' repository, which is normally hosting servers for low-level interfaces
is the wrong place for 'http_block' because this program would make the 'os'
repository depend on the higher-level 'libports' repository where the 'lwip'
stack is located. On the other hand, placing 'http_block' into the 'libports'
repository is also wrong because the program is not a ported library. It merely
uses libraries provided by 'libports'. In the future, we expect that native
Genode components that use both low-level and high-level repositories will
become rather the norm than an exception. Therefore, we introduced a new
repository called 'gems' for hosting such programs.
Tools
#####
Automated coding-style checker
==============================
As Genode's code base grows and new developers start to get involved,
we noticed recurring questions regarding coding style. There is a
[http://genode.org/documentation/developer-resources/coding_style - document]
describing our coding style but for people just starting to get involved,
adhering all the rules can become tedious. However, we stress the importance
of a consistent coding style for the project. Not only does a consistent style
make the framework more approachable for users, but it also eases the work
of all regular developers, who can feel right at home at any part of
the code.
To avoid wasting precious developer time with coding-style fixes, we
have created a tool for the automated checking and (if possible) fixing
the adherence of source code to Genode's coding style. The tool is
located at 'tool/beautify'. It takes a source file as argument and
reports coding-style violations. The checks are fairly elaborative:
* Placement of braces and parenthesis
* Indentation and alignment, trailing spaces
* Vertical spacing (e.g., between member functions, above comments)
* Naming of member variables and functions (e.g., private members start with '_')
* Use of upper and lower case
* Presence of a file header with the mandatory fields
* Policy for function-header comments (comment at declaration, not
at implementation)
* Style of single-line comments, function-header comments, multi-line comments
The user of 'beautify' may opt to let the tool fix most of the violations
automatically by specifying the command line arguments '-fix' and '-write'.
With only the '-fix' argument, the tool will output the fixed version of
the code via stdout. By specifying the '-write' argument, the changes will
be written back to the original file. In any case, we strongly recommend
to manually inspect all changes made by the tool.
Under the hood, the tool consists of two parts. A custom C++ parser called
'parse_cxx' reads the source code and converts it to a syntax tree. In the
syntax tree, all formating information such as whitespaces are preserved.
The C++ parser is a separate command-line tool, which we also use for
other purposes (e.g., generating the API documentation at the website).
The actual 'beautify' tool calls 'parse_cxx', and applies its checks and
fixes to the output of 'parse_cxx'. For this reason, both tools have to
reside in the same directory.
Platform-specific changes
#########################
OKL4
====
:Added support for shared interrupts:
The Genode Live CD operates on a large number of devices that trigger
interrupts (USB, keyboard, mouse, ATAPI, timer, network). On most
platforms, the chances are extremely high that some of them use
the same IRQ line. Therefore, we enhanced core's IRQ service to
allow multiple clients to request the same IRQ. If the interrupt occurs,
all clients referring to this interrupt are notified. The interrupt
gets cleared after all of those clients responded. Even though, we regard
PIC interrupts as a legacy, the support of shared interrupts enables
us to use OKL4 with such complex usage scenarios.
:Revised page-fault handling:
If a page fault occurs, the OKL4 kernel delivers a message to the page-fault
handler. The message contains the page-fault address and type as well as the
space ID where the fault happened. However, the identity of the faulting
thread is not delivered. Instead, the sender ID of the page fault message
contains the KTCB index of the faulting thread, which is only meaningful
within the kernel. This KTCB index is used as a reply token for answering the
page fault message. We wondered about why OKL4 choose to deliver the KTCB
index rather then the global thread ID as done for plain IPC messages. The
only reasonable answer is that by using the KTCB index directly in OKL4's
page-fault protocol, one lookup from the userland-defined thread ID to the
KTCB index can be avoided. However, this comes at the cost of losing the
identity of the faulting thread. We used to take the space ID as a key for
the fault context within core. However, with Genode's user-level page-fault
mechanism, this simplification does not suffice anymore. We have to know the
faulting thread as a page fault may not be answered immediately but at a
later time. During that time, the page-fault state has to be stored at core's
representation of the faulting thread. Our solution is reverting OKL4's
page-fault protocol to operate with global thread IDs only and to never make
kernel-internal KTCB indices visible at the user land. You can find the patch
for the OKL4 kernel at 'base-okl4/patches/reply_tid.patch'.
:Reboot via kernel debugger:
We fixed the reboot code of OKL4's kernel debugger to improve our work
flow. The patch can be found at 'base-okl4/patches/kdb_reboot.patch'.
:Relieved conflict with libc 'limits.h':
For some reason, the OKL4 kernel bindings provide definitions
normally found in libc headers. This circumstance ultimately leads
to trouble when combining OKL4 with a real C runtime. We have
relieved the problem with the patch 'base-okl4/patches/char_bit.patch'.
:Exception handling:
We added a diagnostic message to core that reports about exceptions
such as division by zero.
Pistachio
=========
Our revised syscall bindings for supporting position-independent code
on L4ka::Pistachio have been integrated into the mainline development
of the kernel. Therefore, the patch is not needed anymore when using
a kernel revision newer than 'r791:0d25c1f65a3a'.
Linux
=====
On Linux, we let the kernel manage all virtual address spaces for us,
except for the thread-context area. Because the kernel does not know
about the special meaning of the thread-context area, it may choose to
use this part of the virtual address space as target for 'mmap'. This
may lead to memory corruption. Fortunately, there is a way to tell the
kernel about virtual address regions that should be reserved. The
trick is to pre-populate the said region with anonymous memory using
the 'mmap' arguments 'MAP_PRIVATE', 'MAP_FIXED', 'MAP_ANONYMOUS', and
'PROT_NONE'. The kernel will still accept a fixed-address mapping
within such a reserved region (overmap) but won't consider using the
region by itself. The reservation must be done at the startup of each
process and each time when detaching a dataspace from the thread
context area. For the process startup, we use the hook function
'main_thread_bootstrap' in 'src/platform/_main_helper.h'. For reverting
detached dataspaces to a reserved region within the context area, we
added as special case to 'src/base/env/rm_session_mmap.cc'.
For hybrid programs (Genode processes that link against native
shared libraries of the Linux system), which are loaded by the dynamic
linker of Linux, we must further prevent the dynamic linker from
populating the thread-context area. This is achieved by adding a
special program segment at the linking stage of all elf binaries.

View File

@@ -1,876 +0,0 @@
===============================================
Release notes for the Genode OS Framework 11.02
===============================================
Genode Labs
One year ago, the release 10.02 was our break-through with regard to the support
of multiple kernels as base platform for Genode. With the added support for
the NOVA hypervisor and the Codezero kernel, Genode applications could be executed
on 6 different kernels. With the current release, we take our commitment to
kernel platform support even further. With the added support for the Fiasco.OC
kernel, we make Genode available on one of the most feature-rich modern microkernels.
Additionally, we entered the realms of kernel design with our new platform support
for the Xilinx MicroBlaze architecture. This platform support comes in the shape
of a custom kernel specifically targeted to the MicroBlaze CPU architecture.
Furthermore, we updated our support for the NOVA Hypervisor to the bleeding-edge
version 0.3, which has been released earlier this month.
With the current support for 8 different kernel platforms (L4/Fiasco, Linux,
L4ka::Pistachio, OKL4, NOVA, Codezero, Fiasco.OC, and native MicroBlaze), testing
and integrating application scenarios across all platforms becomes increasingly
challenging. Therefore, we introduce a new framework for automating such tasks.
Thanks to the tight integration of the automation tool with Genode's build system,
going back and forth between different kernels becomes an almost seamless
experience.
Functionality-wise, the release carries on our vision to create a highly secure
yet easy to use general-purpose operating system. Because the Genode framework
is developed on Linux using the wonderful GNU tools, we consider the
availability of the GNU user land on Genode as crucial for using the system by
ourself. This motivation drives the creation of a custom execution environment
for GNU software on top of Genode. With the current release, we are proud to
present the first pieces of this execution environment. Even though not fully
functional yet, it clearly shows the direction of where we are heading.
Support for Fiasco.OC
#####################
The OC in the name of the Fiasco.OC kernel stands for "object capability", hinting
at the most significant feature that sets current-generation microkernels such as
NOVA, seL4, and Fiasco.OC apart from their predecessors. Whereas previous L4 kernels
succeeded in protecting subsystems from each other, the new generation of kernels
is geared towards strict security policies. Traditionally, two protection domains
were able to communicate with each other if they both agreed. Communication partners
were typically globally known via their respective thread/task IDs. Obviously, this
policy is not able to guarantee the separation of subsystems. If two subsystems
conspire, they could always share information. Object-capability-based kernels
are taking the separation much further by prohibiting any communication between
protection domains by default. Two protection domains can communicate only if
a common acquaintance of both agrees. This default-deny policy facilitates the
creation of least-privilege security policies. From the ground up, Genode has
been designed as a capability-based system which is naturally capable of leveraging
kernel-based object-capability support if present. After NOVA, Fiasc.OC is the
second of Genode's base platforms that provides this feature.
Apart from being a capability-based kernel, Fiasco.OC has a number of compelling
features such as thorough support for ARM platforms and the x86 32/64 bit
architectures. It supports SMP, hardware virtualization, and provides special
optimizations for running paravirtualized operating systems.
Technically, Fiasco.OC is the successor of the L4/Fiasco kernel developed by
the OS group of the TU-Dresden. However, the kernel interface of Fiasco.OC has
not much in common with L4/Fiasco. Some heritages are still there (e.g., IPC
timeouts) but the kernel API has evolved to a fully object-oriented model.
:Thanks:
We are indebted to the main developer of Fiasco.OC Alexander Warg for being
very reponsive to our inquiries while doing the porting work. Thanks to his
support, the adaptation of Genode to this kernel has been an almost smooth
ride.
Prerequisites
=============
You need GNU C & C++ Compilers, GNU Binutils, GNU Make, and Perl to use the
Fiasco.OC build system. On Debian/Ubuntu systems, you have to install the
following packages:
! apt-get install make gawk g++ binutils pkg-config subversion
Moreover, you need to download and install the tool-chain used by Genode. Have
a look at this page:
:[http://genode.org/download/tool-chain]:
Genode tool-chain
Downloading and building Fiasco.OC
==================================
Checkout the Fiasco.OC sources and tool-chain to an appropriated directory:
! export REPOMGR_SVN_REV=27
! svn cat http://svn.tudos.org/repos/oc/tudos/trunk/repomgr |\
! perl - init http://svn.tudos.org/repos/oc/tudos fiasco l4re
Building the kernel
~~~~~~~~~~~~~~~~~~~
Create the build directory for the kernel:
! cd <path_to_fiasco_src_dir>/src/kernel/fiasco
! make BUILDDIR=<path_to_kernel_build_dir>
Go to the build directory, configure the kernel:
! cd mybuild
! make config
This will launch the configuration menu. Here you can configure your kernel.
The default config is just fine to test the Genode port. It will build a
uniprocessor IA32 kernel with debugging features enabled. You can exit the menu and
save the configuration by simply typing 'x'.
Now, build Fiasco.OC by invoking:
! make
Building necessary tools
~~~~~~~~~~~~~~~~~~~~~~~~
To practically use Fiasco.OC, you need in addition to the kernel a tool to
bootstrap it, and the initial pager of the system, namely 'sigma0'. Both tools
can be found in the L4 runtime environment's base directory. Outgoing from
the directory where you checked out the sources, you have to change to the
following directory:
! cd <path_to_fiasco_src_dir>/src/l4
Create another build directory:
! make B=<path_to_l4re_build_dir>
Again, you might want to tweak the configuration:
! make O=<path_to_l4re_build_dir> config
Finally, build the tools:
! make O=<path_to_l4re_build_dir>
Building the Fiasco.OC version of Genode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Fiasco.OC version of Genode is available at the Genode public subversion repository:
:http://genode.org/download/subversion-repository:
Information about accessing the Genode public subversion repository
Go to a directory where you want the Genode/Fiasco.OC build directory to remain. Use
the helper script in the 'tool/builddir' directory of the Genode source tree to
create the initial build environment. You need to state the absolute path to the
build directory of the L4 runtime environment as 'L4_DIR', as it contains the kernel
bindings needed by the Genode port.
! <path_to_genode_src_dir>/tool/builddir/create_builddir foc_x86_32 \
! L4_DIR=<path_to_l4re_build_dir> \
! GENODE_DIR=<path_to_genode_src_dir> \
! BUILD_DIR=<path_to_genode_build_dir>
Now, go to the newly created build directory and type make.
! cd <path_to_genode_build_dir>
! make
Booting Genode on top of Fiasco.OC
==================================
Example GRUB configuration entry:
! timeout 0
! default 0
!
! title Genode on Fiasco.OC
! kernel /bootstrap -modaddr=0x01100000
! module /fiasco -serial_esc
! module /sigma0
! module /core
! module /init
! module /config
! module /pci_drv
! module /vesa_drv
! module /ps2_drv
! module /timer
! module /nitpicker
! module /launchpad
! module /liquid_fb
! module /scout
! module /testnit
! module /nitlog
For an example of a matching Genode 'config' file, please take a look
at 'os/config/demo'.
The Genode binaries are located in '<path_to_genode_build_dir>/bin',
the 'fiasco' kernel in '<path_to_kernel_build_dir>'. Assuming you compiled
for x86/586 (the default), you can find the 'bootstrap' binary in
'bin/x86_586' and 'sigma0' in 'bin/x86_586/l4f' within the
'<path_to_l4re_build_dir>' directory.
Current state
=============
The adaptation of Genode to Fiasco.OC covers most parts of the Genode API
including advanced semantics such as cancelable locks and support for
real-time priorities. So far, it has been tested on the x86 architecture.
Because 'base-foc' does not contain x86-specific code, we expect no major
roadblocks for running Genode on Fiasco.OC on ARM. However, we have not
exercised tests in this regard.
As of today, there exist the following limitations of the Fiasco.OC support:
* The dynamic linker is not yet adapted to Fiasco.OC. Special care must
be taken for handling the parent capability for dynamically loaded
programs. We have already covered this issue for the NOVA version but
the adaptation to Fiasco.OC remains yet to be done.
* The destruction of sub systems is not yet fully stable. Because Genode
forms a more dynamic workload than the original userland accompanied with
the kernel, the usage pattern of the kernel API triggers different
effects. We are working with the Fiasco.OC developers to remedy this
issue.
* The signalling framework is not yet supported. A design exist but it is
not implemented yet.
We believe however that none of these limitations are a significant hurdle for
starting to use Genode with this kernel. Please expect this issues to be
resolved with the upcoming Genode release.
Technical details about 'base-foc'
==================================
The following technical bits are worth noting when exploring the use of
Genode with the 'base-foc' platform.
* The timer implementation uses a one thread-per-client mode of operation.
We use IPC timeouts as time source. Hence, the timer driver is hardware
independent and should work out of the box on all hardware platforms
supported by Fiasco.OC.
* Each 'Server_object' of Genode corresponds to a so-called IPC gate,
which is the Fiasco.OC kernel object used for capability invocation.
Therefore, protection and object integrity is provided at the fine
granularity of single 'Server_objects'. This is in line with our
support for NOVA's implementation of capability-based security.
* In contrast to the lock implementation that we used with the original
L4/Fiasco kernel, the 'base-foc' lock is a fully-featured Genode lock
with support for lock cancellation and blocking. For blocking and
waking up lock applicants, we use Fiasco.OC's IRQ objects.
* The allocator used for managing process-local capability selectors
does not yet support the reuse of capability selectors.
Further Information
===================
:genode/tool/builddir/README:
Reference manual for the 'create_builddir' script
:[http://os.inf.tu-dresden.de/fiasco]:
Official website for the Fiasco.OC microkernel.
Noux - an execution environment for the GNU userland
####################################################
Even though Genode is currently mainly geared to the classical special-purpose
application domains for microkernel-based systems, the main property that sets
Genode apart from traditional systems is the thorough support for dynamic
workloads and the powerful mechanisms for handling hardware resources and
security policies in highly dynamic setting. We are convinced that Genode's
architecture scales far beyond static special-purpose domains and believe in
the feasibility of Genode as a solid foundation for a fully-fledged general
purpose operating system. Internally at Genode Labs, we set up the ultimate
goal to switch from Linux to Genode for our day-to-day work. We identified
several functionalities that we could not live without and systematically try
to bring those features to Genode. Of course, the most fundamental programs
are the tools needed to develop and build Genode. Currently we are developing
on Linux and enjoy using the GNU userland.
Consequently, we require a solution for using this rich tool set on Genode.
The straight-forward way for making these tools available on Genode would be
running them within a virtualized Linux instance (e.g., using OKLinux on OKL4).
However, this approach would defeat our actual goal to create a highly secure
yet easy to use working environment because adding Linux to the picture would
involve administering the virtualized Linux system. We would prefer a native
solution that makes the overall system less, not more, complicated. This way
the idea for a native execution environment for the GNU userland on Genode
was born. The implementation is called Noux and the first bits of code are
featured in the 'ports' repository. Noux consists of two parts, a build
environment for compiling GNU programs such that they can be run as Genode
processes and an execution environment that provides the classical UNIX
functionality to these programs.
Noux build environment
======================
From our experience, porting existing UNIX applications to a non-UNIX system
tends to be a task of manual and time-consuming labour. One has to loosely
understand the build system and the relationship of the involved source codes,
implement dummy functions for unresolved references, and develop custom glue
code that interfaces the ported application to the actual system. Taking the
shortcut of changing the original code has to be avoided at any cost because
this produces recurring costs in the future when updating the application. In
short, this long-winding process does not scale. For porting a tool set such as
the GNU userland consisting of far more than a three-digit number of individual
programs, this manual approach becomes unfeasible. Therefore, we have created
a build environment that facilitates the use of the original procedure of
invoking './configure && make'. The challenge is to supply configure with
the right arguments and environment variables ('CFLAGS' and the like) such that
the package is configured against the Genode environment. The following
considerations must be taken:
* Configure must not detect any global headers (e.g., '/usr/include/')
or libraries (e.g., '/usr/lib/'). This can be achieved by the '-nostdinc' and
'-nostdlib' options
* Configure has to use the same include-search paths as used for compiling
normal libc-using Genode programs
* Configure must use the Genode tool chain
* The final linking stage must use the Genode linker script, the Genode
base libraries, and other Genode-specific linker arguments.
Thanks to the power of the GNU build system, all this can be achieved by
supplying arguments to './configure' and indirectly to the 'make' process via
environment variables. The new Noux build environment takes care of these
precautions. It comes in the form of the 'ports/mk/noux.mk' file which enables
the seamless integration of GNU packages with the Genode build system. To
compile a GNU package, the manual steps needed are reduced to the creation of a
'target.mk' file representing the package. This 'target.mk' defines the name
of the package (by default, the basename of the 'target.mk' enclosing directory
is assumed) and the location of the source package. With this approach, we
managed to build 'coreutils' (over 100 small UNIX utilities such as 'ls', 'cp',
'sort'), 'binutils' (GNU linker, assembler, object-file tools), 'findutils'
('find', 'xargs'), 'bash', 'dash', GNU make, and finally the GNU compiler
collection including 'g++'. The resulting binaries are ready to be executed as
native Genode processes. However, without the right environment that presents
the program the needed UNIX functionality, those programs won't do much.
This leads us to the Noux execution environment.
Noux execution environment
==========================
The Noux execution environment plays the role of a UNIX kernel for programs
built via the Noux build environment. In contrast to a real kernel, the Noux
environment is a plain Genode user-level process that plays the role of being
the parent of one or multiple Noux processes. In addition of providing the
'Genode::Parent' interface, Noux also provides a locally implemented service called
'Noux::Session' that offers UNIX-like system-calls via an RPC interface. Each
hosted program is linked against a special Noux libc plugin that catches all
libc calls that would normally result in a system call. It then transparently
forwards this function call to the 'Noux::Session' interface.
Currently the Noux execution environment implements the following
system calls: 'getcwd', 'write', 'stat', 'fstat', 'fcntl', 'open',
'close', 'dirent', 'fchdir', 'read', and 'execve'.
The execution environment submits arguments (argc, argv, environment) to the
hosted program, manages its current working directory and receives its exit
code. File operations are targeted to a custom VFS infrastructure, which
principally allows a flexible configuration of the virtual file system visible
to the hosted programs. At the current stage, Noux supports mounting plain tar
archives obtained from core's ROM service as read-only file system. On startup,
the Noux environment starts one process (the init process) and connects the
file descriptor 1 (stdout) to Genode's LOG service.
State of the implementation
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The infrastructure implemented so far already allows the execution of many simple
UNIX tools such as 'ls -lRa', 'echo', 'seq', 'find'. The 'execve' system call
is implemented such that a new process is started that inherits the file
descriptors and the PID of the calling process. This allows using the exec
functionality of the 'bash' shell. However, because 'fork' is not implemented
yet, there is currently no way to start multiple programs hosted in a single
Noux execution environment.
As of today, the Noux environment is not considered to be usable for practical
purposes. However, it clearly shows the feasibility of the path we are walking.
With the foundation laid, we are looking forward to expanding Noux to a capable
solution for running our beloved GNU userland tools on Genode.
Vision
~~~~~~
The most significant intermediate result of pursuing the development of Noux is
the realization that such an environment is not exceedingly complex. Because of
the combination with Genode, we only need to provide a comfortable runtime as
expected by user processes but we can leave much of intricate parts of UNIX out
of the picture. For example, because we handle device drivers on Genode, we do
not need to consider device-user interaction in Noux. As another example,
because the problem of bootstrapping the OS is already solved by Genode, there
is no need to run an 'init' process within Noux. Our vision foresees that Noux
runtimes are to be created on demand for individual tasks such as editing a
file (starting a custom Noux instance containing only the file to edit and the
text editor), compiling source code (starting a custom Noux instance with only
the source code and the build tools). Because Noux is so simple, we expect the
runtime overhead of starting a Noux instance to be not more than the time
needed to spawn a shell in a normal UNIX-like system.
Test drive
~~~~~~~~~~
To give Noux a spin, we recommend using Linux as base platform as this is
the platform we use for developing it. First, you will need to download the
source code of the GNU packages. From within the 'ports' repository,
use the following command:
! make prepare PKG=coreutils
This command will download the source code of the GNU coreutils. You may
also like to give the other packages a try. To see what is available,
just call 'make' without any argument.
Create a build directory (e.g., using tool/builddir/create_builddir).
Change to the build directory and issue the command
! make run/noux
This command will execute the run script provided at 'ports/run/noux.run'.
First it builds core, init, and coreutils. Then it creates a tar archive
containing the installed coreutils. Finally, it starts the Noux environment on
Genode. Noux then mounts the TAR archive as file system and executes 'ls -laR',
showing the directory tree.
Approaching platform support for Xilinx MicroBlaze
##################################################
With the release 11.02, we are excited to include the first version of our
custom platform support for the Xilinx MicroBlaze CPU architecture. MicroBlaze
is a so-called softcore CPU, which is commonly used as part of FPGA-based
System-on-Chip designs. At Genode Labs, we are regularly using this IP core,
in particular for our Genode FPGA Graphics Project, which is a GUI software stack
and a set of IP cores for implementing fully-fledged windowed GUIs on FPGAs:
:Website of the Genode FPGA Graphics Project:
[http://genode-labs.com/products/fpga-graphics]
Ever since we first released the Genode FPGA project, we envisioned to combine
it with the Genode OS Framework. In Spring 2010, Martin Stein joined our team
at Genode Labs and accepted the challenge to bring the Genode OS Framework to
the realms of FPGA-based SoCs. Technically, this implies porting the framework
to the MicroBlaze CPU architecture. In contrast to most softcore CPUs such as
the popular Lattice Mico32, the MicroBlaze features a MMU, which is a fundamental
requirement for implementing a microkernel-based system. Architecturally-wise
MicroBlaze is a RISC CPU similar to MIPS. Many system parameters of the CPU
(caches, certain arithmetic and shift instructions) can be parametrized at
synthesizing time of the SoC. We found that the relatively simple architecture
of this CPU provides a perfect playground for pursuing some of our ideas about
kernel design that go beyond the scope of current microkernels. So instead of
adding MicroBlaze support into one of the existing microkernels already
supported by Genode, we went for a new kernel design. Deviating from the typical
microkernel, which is a self-sufficient program running in kernel mode that
executes user-level processes on top, our design regards the kernel as a part of
Genode's core. It is not a separate program but a library that implements the
glue between user-level core and the raw CPU. Specifically, it provides the
entrypoint for hardware exceptions, a thread scheduler, an IPC mechanism, and
functions to manipulate virtual address spaces (loading and flushing entries
from the CPU's software-loaded TLB). It does not manage any physical memory
resources or the relationship between processes. This is the job of core.
From the kernel-developer's point of view, the kernel part can be summarized as
follows:
* The kernel provides user-level threads that are scheduled in a round-robin
fashion.
* Threads can communicate via synchronous IPC.
* There is a mechanism for blocking and waking up threads. This mechanism
can be used by Genode to implement locking as well as asynchronous
inter-process communication.
* There is a single kernel thread, which never blocks in the kernel code paths.
So the kernel acts as a state machine. Naturally, there is no concurrency in the
execution paths traversed in kernel mode, vastly simplifying these code parts.
However, all code paths are extremely short and bounded with regard to
execution time. Hence, we expect the interference with interrupt latencies
to be low.
* The IPC operation transfers payload between UTCBs only. Each thread has a
so-called user-level thread control block which is mapped transparently by
the kernel. Because of this mapping, user-level page faults cannot occur
during IPC transfers.
* There is no mapping database. Virtual address spaces are manipulated by
loading and flushing physical TLB entries. There is no caching of mappings
done in the kernel. All higher-level information about the interrelationship
of memory and processes is managed by the user-level core.
* Core runs in user mode, mapped 1-to-1 from the physical address space
except for its virtual thread-context area.
* The kernel paths are executed in physical address space (MicroBlaze).
Because both kernel code and user-level core code are observing the same
address-space layout, both worlds appear to run within a single address
space.
* User processes can use the entire virtual address space (4G) except for a
helper page for invoking syscalls and a page containing atomic operations.
There is no reservation used for the kernel.
* The MicroBlaze architecture lacks an atomic compare-and-swap instruction. On
user-level, this functionality is emulated via delayed preemption. A kernel-
provided page holds the sequence of operations to be executed atomically and
prevents (actually delays) the preemption of a thread that is currently
executing instructions at that page.
* The MicroBlaze MMU supports several different page sizes (1K up to 16MB).
Genode fully supports this feature for page sizes >= 4K. This way, the TLB
footprint can be minimized by choosing sensible alignments of memory
objects.
Current state
=============
The MicroBlaze platform support resides in the 'base-mb' repository. At the
current stage, core is able to successfully start multiple nested instances of
the init process. Most of the critical kernel functionality is working. This
includes inter-process communication, address-space creation, multi-threading,
thread synchronization, page-fault handling, and TLB eviction.
This simple scenario already illustrates the vast advantage of
using different page sizes supported by the MicroBlaze CPU. If using
4KB pages only, a scenario with three nested init processes produces more than
300.000 page faults. There is an extremely high pressure on the TLB, which
only contains 64 entries. Those entries are constantly evicted so that
threshing effects are likely to occur. By making use of flexible page
sizes (4K, 16K, 64K, 256K, 1M, 4M, 16M), the number of page faults gets
slashed to only 1.800, speeding up the boot time by factor 10.
Currently, there is no restriction of IPC communication rights. Threads are
addressed using their global thread IDs (in fact, using their respective
indices in the KTCB array). For the future, we are planning to add
capabilty-based delegation of communication rights.
Building and using Genode on MicroBlaze
=======================================
For building Genode for the MicroBlaze platform, you need the MicroBlaze
tool chain as it comes with the Xilinx EDK. The tool chain is typically
prefixed with 'mb-'. Please make sure that the tool chain's 'bin/' directory
is included in your 'PATH' environment variable.
For building and starting Genode on MicroBlaze, you first need to create
a build directory using the build-directory creation tool:
! tool/builddir/create_builddir microblaze \
! BUILD_DIR=</path/to/build/dir> \
! GENODE_DIR=</path/to/genode/dir>
The 'base-mb' repository comes with support for Genode's run tool. In order to
use it, you will first need to declare the location of your qemu binary using
the 'QEMU=/path/to/qemu' variable in the '<build-dir>/etc/microblaze.conf'
file. Then you will be able to start an example scenario by issuing the
following command from within your build directory:
! make run/nested_init
Thereby, the 'run' tool will attempt to start core using the microblaze version
of qemu.
You can also find a simple hello-world example at 'base-mb/src/test/hello'.
The corresponding run script is located at 'base-mb/run/hello.run'. You can
execute it via 'make run/hello' from the build directory.
Note that currently, all boot modules are linked against the core binary.
To change the boot modules, the file 'base-mb/src/core/boot_modules.s' must
be modified.
For reference, we are using the following tools:
* mb-g++ (GCC) 4.1.1 20060524 (Xilinx 11.2 Build EDK_LS2.2
20 Apr 2009 Xilinx 11.2 Build EDK_LS2.2 23 Apr 2009)
* GNU ld version 2.16 Xilinx 11.2 Build EDK_LS2.2 23 Apr 2009
* GNU assembler 2.16 Xilinx 11.2 Build EDK_LS2.2 23 Apr 2009
* QEMU emulator version 0.14.50, Copyright (c) 2003-2008 Fabrice Bellard
Petalogix linux reference design targeting Xilinx Spartan 3ADSP-1800 boards.
Supporting the NOVA hypervisor version 0.3
##########################################
NOVA is a so called microhypervisor - a modern capability-based microkernel
with special support for hardware-based virtualization and IOMMUs. Since we
incorporated the initial support for the NOVA hypervisor in Genode one year
ago, this kernel underwent multiple revisions. The latest version was released
earlier this month. To our delight, much of the features that we missed from
the initial release had been implemented during the course of the last year. We
are especially happy about the fully functional 'revoke' system call and the
support for remote kernel-object creation.
With the Genode release 11.02, we officially support the latest NOVA version.
The update of Genode to the new version required two steps. First, because many
details of the kernel interface were changed between version 0.1 and version
0.3, we had to revisit our syscall bindings and adapting our code to changed
kernel semantics. Second, we filled our 'base-nova' code related to object
destruction and unmapping with life to benefit from NOVA's 'revoke' system
call. Consequently, we are now able to run the complete Genode software stack
including the dynamic linker on NOVA.
Note that for using Genode on NOVA, you will need to apply a small patch to the
NOVA source code. This patch enables the re-use of user-level thread control
blocks in the kernel. The patch can be found at 'base-nova/patches/utcb.patch'.
When executing NOVA on qemu, please specify the '-cpu coreduo' argument to the
qemu command line. When using Genode 'run' tool, you may assign this argument
to the 'QEMU_OPT' variable in '<build-dir>/etc/build.conf'.
:Thanks:
We are grateful for the ongoing very pleasant collaboration with Udo Steinberg
who is the driving force behind NOVA. Thanks for the ultra-fast responses to our
questions and for considering our suggestions regarding the feature set of
NOVA's kernel interface!
Base framework
##############
Upgrading existing sessions
===========================
Genode enables a client of a service to lend parts of its own resources to
the service when opening a session. This way, servers do not need to allocate
own resources on behalf of their clients and become inherently robust against
resource-exhaustion-based denial-of-service attacks.
However, there are cases when the client can not decide about the amount of
resources to lend at session-creation time. In such cases, we used to devise an
overly generous client policy. Now, we have added a new 'upgrade' function to
the 'Parent' and 'Root' interfaces that enables a client to upgrade the
resources of an existing session.
For the 'env()->rm_session()' and 'env()->ram_session()' of processes using
the Genode 'env' library, we implemented a transparent quota upgrade that kicks in
in the event of an exceeded metadata backing store.
Comprehensive accounting of core resources
==========================================
We changed all services of core to limit their respective resource usage
specifically for each individual session. For example, the number of dataspaces
that can be handled by a particular region-manager (RM) session depends on the
resource donation attached to the session. To implement this accounting scheme
throughout core, we added a generic 'Allocator_guard' utility to
'base/include/'. We recommend using this utility when implementing resource
multiplexers, in particular multi-level services. Thanks to this change in
core, the need for a slack memory reservation in core has vanished.
Various changes
===============
The remaining parts of the base API underwent no fundamental revision. The
changes are summarized as follows.
:C++ Support:
We removed 'libgcc' from our C++ support library ('cxx') and link
it to each individual final target and shared library instead. This change alleviates
the need to abuse the 'KEEP_SYMBOLS' mechanism that we used in 'cxx' to
keep libc-dependencies of GCC's support libraries local to the 'cxx'
library. Besides the benefit of reducing heuristics, this change improves
the compatibility with recent cross-compiling tool chains.
Furthermore, we added 'realloc' to the local libc support of the 'cxx'
library because recent ARM tool chains tend to use this function.
:Argument handling for 'main()':
We added a hook to the startup code to enable the implementation of
custom facilities for passing arguments to the main function. The
hook uses the global variables 'genode_argc' and 'genode_argv'.
:Child-exit policy hook:
We enhanced the 'Child_policy' with a new policy interface that allows
a simplified implementation of policies related to program termination.
:Changed API of 'Range_allocator':
We changed the return value of 'alloc_addr' to distinguish different error
conditions. Note that the boolean meaning of the return value is inverted.
Please check your uses of 'alloc_addr'!
Operating-system services and libraries
#######################################
C Runtime
=========
In conjunction with our work on Noux, we improved Genode's C runtime at many
places. First, we added libstdtime and some previously missing bits of libgdtoa
to the libc. These additions largely alleviate the need for dummy stubs, in
particular time-related functions. Second, we added the following functions to
our libc plugin interface: 'dup2', 'fchdir', 'fcntl', 'fstat', 'stat', and
'write'. This enables the creation of advanced libc plugins simulating a whole
file system as done with Noux. Still, there are a number of dummy stubs found
at 'libc/src/lib/libc/dummy.cc'. However, those stubs are now all defined as
weak symbols such that they can be overridden by libc plugins. Finally, we have
replaced the original 'exit' implementation that comes with the libc with a
Genode-specific version. The new version reports the exit code of the
application to the parent process via an 'Parent::exit()' RPC call.
Until now, Genode's libc magically handled output to stdout and stderr by
printing messages via Genode's LOG interface. We have now replaced this
hard-wired interface by an optional libc plugin called 'libc_log'. If present, write
operations to stdout are caught at the libc plugin interface and delegated to
the plugin, which implements the output to the LOG interface. If you have an
application using Genode's libc, you might consider adding the 'libc_log'
library to your 'target.mk' file.
Support for big numbers by the means of libgmp and libmpfr
==========================================================
We have now include both the GNU Multiple Precision Arithmetic Library and
(GMP) and MPFR to the 'ports' repository. This work was specifically motivated
by our port of GCC to Genode as GCC version 4.4.5 requires both libraries.
Because we intend to use those libraries primarily on x86_32, the current port
covers only this architecture. However, expanding the port to
further CPU architectures should be straight-forward if needed.
Furthermore, you can now also find GCC's 'longlong.h' header at
'libports/include/gcc'.
Qt4 updated to version 4.7.1
############################
The current release bumps the supported Qt4 version from 4.6.2 to 4.7.1 and the
Arora web browser (located at the ports repository) from version 0.10.2 to
version 0.11. Of course, we updated our custom additions such as our custom
Nitpicker plugin widget that enables the seamless integration of native
Nitpicker GUI clients into Qt4 applications to work with the new Qt4 version.
Tools
#####
Tool chain update to GCC 4.4.5 and Binutils 2.21
================================================
We upgraded the official Genode tool chain from gcc 4.2.4 to gcc 4.4.5. Please
update your tool chain by downloading the new binary archive (available for x86_32)
or building the tool chain from source using our 'tool/tool_chain' utility.
New support for automated integration and testing
=================================================
With the growing number of supported base platforms, the integration and testing
of Genode application scenarios across all kernels becomes
increasingly challenging. Each kernel has a different boot mechanism and
specific requirements such as the module order of multiboot modules (Fiasco's
bootstrap, Pistachio's sigma0 and kickstart), kernel parameters, or the
invocation of a single-image creation tool (OKL4's elfweaver). To make our
life supporting all those platforms easier, we have created a tool called
'run', which is tightly integrated within Genode's build system. In short 'run'
gathers the intrinsics in the form of a 'run/env' file specific for the
platform used by the current build directory from the respective
'base-<platform>' repository. It then executes a so-called run script, which
contains all steps needed to configure, build, and integrate an application
scenario. For example, a typical run script for building and running a test
case resides in a file called '<any-repository>/run/<run-script-name>.run' and
looks as follows:
! build "core init test/exception"
! create_boot_directory
! install_config {
! <config>
! <parent-provides>
! <!--<service name="ROM"/>-->
! <service name="LOG"/>
! </parent-provides>
! <default-route>
! <any-service> <parent/> </any-service>
! </default-route>
! <start name="test-exception">
! <resource name="RAM" quantum="1M"/>
! </start>
! </config>
! }
! build_boot_image "core init test-exception"
! append qemu_args "-nographic -m 64"
! run_genode_until {.*Exception \(label 0xffb0\) occured.*} 10
First, the build system is instructed to create the targets specified as argument
for the 'build' function. Next, for the integration part, a new boot directory is
created. On most kernel platform, the respective location of the boot directory
is '<build-dir>/var/run/<run-script-name>'. Initially, this directory is empty.
It gets populated with a 'config' file specified as argument of the 'install_config'
command, and by the boot modules specified at the 'build_boot_image' command.
Now that the integration is complete, the scenario is executed via the
'run_genode_until' command. This command takes a regular expression as
argument, which determines the successful termination of the test case. The
second argument is a timeout (is seconds). In the example, the test case will
fail if its output does not match the regular expression within the execution
time of 10 seconds.
The command 'append qemu_args' specifies run-script-specific qemu arguments in
the case that qemu is used to execute the scenario. This is the case for most
kernel platforms (except for Linux where core gets executed directly on the host).
Additional build-directory-specific qemu arguments can be specified in the
'etc/build.conf' file by defining the 'QEMU_OPT' variable. For example, to
prevent KVM being used on Ubuntu Linux, specify:
! QEMU_OPT = -no-kvm
To execute the run script from with build directory, you need to have Expect
installed. Typically, the Linux package is called 'expect'. Simply issue
the following command from within your build directory:
! make run/<run-script>
Note that you will need to have a GRUB 'stage2_eltorito' binary available
at '<genode-dir>/tool/grub' on base platforms that use an ISO image as boot
stategy.
Because the whole chain of actions, building, integrating, executing, and
validating an application scenario is now at the fingertips of issuing a
single command with no kernel-specific considerations needed, it has never
been easier to run the same scenario on a wide range of different kernels.
Please find further instructive examples at 'os/run/'. The 'ldso' run
script executes the test of the dynamic linker. It is completely generic.
The 'demo' run script starts Genode's default demo scenario and shows how
platform-specific considerations (e.g., which device drivers to use) can be
taken into account.
We found that the 'run' tool significantly boosted our productivity not
only for testing purposes but also for accelerating the development-test
cycle during our day-to-day work.
:Technical notes:
The 'run' tool uses Expect as automation tool. Expect is a Tcl interpreter,
which is accompanied by special functionality for automating interactive
command-line applications. Technically, a run script is an Expect script
which gets included by the 'tool/run' script. For the reference of
run-specific functions, please revise the documentation in the 'tool/run'
script. Because each run script is actual Expect source code, it is possible
to use all Tcl and Expect scripting features in a run script.
In particular, a run script may issue shell commands using Tcl's 'exec'
function. This way, even complex integration tasks can be accomplished.
For example, the integration of the Genode Live CD was done via a single
run script.
Build system
============
To facilitate the integration of 3rd-party build systems into the Genode build
process, we added support for pseudo targets that do not require any 'SRC'
declaration. Such 'target.mk' may contain custom rules that will be executed
when the target is revisited by the build system. The bindings are as follows:
! build_3rd_party:
! ...custom commands...
!
! $(TARGET): build_3rd_party
!
! clean_3rd_party:
! ...custom commands...
!
! clean_prg_objects: clean_3rd_party:

File diff suppressed because it is too large Load Diff

View File

@@ -1,703 +0,0 @@
===============================================
Release notes for the Genode OS Framework 11.08
===============================================
Genode Labs
One of Genode's most distinctive properties is its support for various
different kernels as base platforms. Each of the 8 currently supported kernels
differs with regard to features, security, hardware support, complexity, and
resource management. Even though different applications call for different
kernel properties, through Genode, those properties can be leveraged using a
unified API. The growing number of supported base platforms, however, poses two
challenges, which are the comprehension of the large diversity of tools and
boot concepts, and capturing of the semantic differences of all the kernels.
With the version 11.08, the framework mitigates the former challenge by
introducing a unified way to download, build, and use each of the
kernels with Genode's user-level infrastructure. The new tools empower users of
the framework to instantly change the underlying kernel without the need to know
the peculiarities of the respective kernels. Using microkernels has never been
easier.
The second challenge of translating each kernel's specific behaviour to the
framework's unified API longs for an automated testing infrastructure that
systematically exercises all the various facets of the API on all base
platforms. The new version introduces the tooling support especially designed
for conducting such quality-assurance measures. These tools largely remove the
burden of manual testing while helping us to uphold the stability and quality
of the framework as it grows in terms of functional complexity and number of
base platforms.
Speaking of functional enhancements, the work on version 11.08 was focused
on our block-device infrastructure and ARM support. The block-device-related
work is primarily motivated by our fundamental goal to scale Genode to a
general-purpose computing platform. The additions comprise new drivers for
SD-cards, IDE, SATA, USB storage as well as a new partition server. All those
components provide Genode's generic block interface, which is meant to be used
as back end for file systems. On file-system level, a new libc plugin utilizes
libffat to enable the straight-forward use of VFAT partitions by libc-using
programs.
The current release comes with far-reaching improvements with respect to
ARM-based platforms. The paravirtualized L4Linux kernel has been updated to
Linux version 2.6.39 running on both x86_32 and ARM. Also, Qt4 including Webkit
has become functional on ARMv6-based platforms.
Among the further improvements are many new examples in the form of
ready-to-use run scripts as well as a comprehensive documentation update.
Originally, we had planned to complement the Noux runtime environment to
support interactive command-line applications by the time of the current
release. However, we realized that the current users of the framework would
value the new streamlined tooling support, the enhanced documentation, and the
new quality-assurance infrastructure over such a functional addition. Hence, we
prioritized the topics accordingly. Even though you will find the first bits of
interactive GNU application support in this release, we deferred working on
this topic in full steam to the upcoming version 11.11.
Blurring the boundaries between different kernels
#################################################
Before the Genode project was born, each microkernel carried along its own
userland. For example, the L4/Fiasco kernel came with the L4 environment, the
OKL4 kernel came with Iguana, or the L4ka::Pistachio kernel came with a small
set of example components. Those user-level counterparts of the kernel
complemented their respective kernels with a runtime for user-level
applications and components while exposing significant parts of the kernel
interface at API level. Consequently, most if not all applications developed
against these APIs were tied to a particular kernel. On the one hand, this
approach enabled developers to fine-tune their programs using kernel-specific
features. On the other hand, much effort was wasted by duplicating other
people's work. Eventually, all of the mentioned userlands stayed limited to
special purposes - for the most part the purposes of operating-systems
researchers. Consequently, none of the microkernels gained much attention in
general-purpose computing. Another consequence of the highly fragmented
microkernel community was the lack of a common ground to compare different
kernels in an unbiased way because each userland provided a different set of
components and libraries.
Different application areas call for different kernel features such as
security mechanisms, scheduling, resource management, and hardware support.
Naturally, each kernel exhibits a specific profile of these parameters
depending on its primary purpose. If one microkernel attempted to accommodate
too many features, it would certainly sacrifice the fundamental idea of being
minimally complex. Consequently, kernels happen to be vastly different. During
the past three years, however, Genode has demonstrated that one carefully
crafted API can target highly diverse kernels, and thereby enables users of
the framework to select the kernel that fits best with the requirements
dictated by each application scenario individually. For us Genode developers,
it was extremely gratifying to see that kernels as different as Linux and NOVA
can be reconciled at the programming-interface level. Still, each kernel comes
with different tools, configuration mechanisms, and boot concepts. Even though
Genode programs can be developed in a kernel-independent way, the deployment of
such programs still required profound insights into the peculiarities of the
respective kernel.
With the current release, we introduce a fundamentally new way of using
different microkernels by unifying the procedures of downloading and building
kernels as well as integrating and running Genode programs with each of them.
Existing Genode application scenarios can be ported between kernels in an
instant without the need for deep insights into the kernel's technicalities. As
a teaser, consider the following commands for building and running Genode's
graphical demo scenario on the OKL4 microkernel:
! # check out Genode
! svn co https://genode.svn.sourceforge.net/svnroot/genode/trunk genode
!
! # download the kernel, e.g., OKL4
! make -C genode/base-okl4 prepare
!
! # create Genode build directory
! genode/tool/create_builddir \
! okl4_x86 BUILD_DIR=build
!
! # build everything and execute the interactive demo
! make -C build run/demo
The same principle steps can be used for any of the OKL4, NOVA,
L4/Fiasco, Fiasco.OC, L4ka::Pistachio, or Codezero kernels. You should
nevertheless consult the documentation at 'base-<platform>/doc/' before
starting to use a specific kernel because some base platforms require
the installation of additional tools.
Under the hood, this seamless way of dealing with different kernels is made
possible by the following considerations:
:Repository preparation:
Each kernel comes from a different source such as a Git/SVN/Mercurial
repository or a packaged archive. Some kernels require additional patches. For
example, OKL4 needs to be patched to overcome problems with modern tool chains.
Now, each 'base-<platform>' repository hosts a 'Makefile' that automates the
download and patch procedure. To download the source code of a kernel,
issue 'make prepare' from within the kernel's 'base-<platform>' directory. The
3rd-party source code will be located at 'base-<platform>/contrib/'.
:Building the kernel:
Each kernel has a different approach when it comes to configuration and
compilation. For example, NOVA comes with a simple 'Makefile', OKL4 relies on a
complex SCons-based build system, L4ka::Pistachio uses CML2 and autoconf (for
the userland tools). Furthermore, some kernels require the setting of specific
configuration values. We have streamlined all these procedures into the Genode
build process by the means of a 'kernel' pseudo target and a 'platform' pseudo
library. The kernel can be compiled directly from the Genode build directory by
issuing 'make kernel'. The 'platform' pseudo library takes care of making the
kernel headers available to Genode. For some kernels such as OKL4 and NOVA, we
replaced the original build mechanism with a Genode target. For other kernels
such as L4ka::Pistachio or Fiasco.OC, we invoke the kernel's build system.
:Genode build directory:
Genode build directories are created via the 'tool/create_builddir' tool.
This tool used to require certain kernel-specific arguments such as the
location of the kernel source tree. Thanks to the unified way of preparing
kernels, the need for such arguments has vanished. Now, the only remaining
arguments to 'create_builddir' are the actual platform and the location
of the build directory to create.
:System integration and booting:
As diverse the build systems of the kernels are, so are the boot concepts. Some
kernels rely on a multiboot-compliant boot loader whereas others have special
tools for creating boot images. Thankfully, Genode's run concept allows us to
hide the peculiarities of booting behind a neat and easy-to-use facade. For
each platform we have crafted a dedicated run environment located at
'base-<platform>/run/env', which contains the rules for system integration and
booting. Therefore, one and the same run script can be used to build and
execute one application scenario across various different kernels. For an
illustrative example, the 'os/src/run/demo.run' script can be executed on all
base platforms (except for base-mb) by issuing 'make run/demo' from within the
build directory.
Emerging block-device infrastructure
####################################
Since version 10.08, Genode is equipped with a block-session interface. Its
primary use cases so far were the supply of the paravirtualized OKLinux kernel
with backing store, and the access of the content of a bootable Live CD.
However, for our mission to use Genode as general-purpose computing platform,
disk device access is crucial. Therefore, we dedicated our attention to
various aspects of Genode's block-device infrastructure, reaching from
programming APIs for block drivers, over partition handling, to file-system
access.
:Block session interface:
The glue that holds all block-device-related components together is the generic
block interface 'os/include/block_session'. It is based on the framework's
packet-stream facility, which allows the communication of bulk data via shared
memory and a data-flow protocol using asynchronous notifications. The interface
supports arbitrary allocation schemes and the use of multiple outstanding
requests. Hence, it is generally suited for scatter-gather DMA and the use of
command queuing as offered by the firmware of modern block-device controllers.
(albeit the current drivers do not exploit this potential yet)
:Block component framework:
Our observation that components implementing the block session interface share
similar code patterns prompted us to design a framework API for implementing
this family of components. The set of classes located at 'os/include/block'
facilitate the separation of device-specific code from application logic.
Whereas 'component.h' provides the application logic needed to implement the
block service, the 'driver.h' is an abstract interface to be implemented by the
actual device driver. This new infrastructure significantly reduces code
duplication among new block-device drivers.
:Device-driver implementations:
The new block-device drivers introduced with the current release address
common types of block devices:
* By adding ATA read/write support to the ATAPI driver ('os/src/drivers/atapi'),
this driver can be used to access IDE disks now.
* The new fully-functional SD-card driver ('os/src/drivers/sdcard') enables the
use of SD-cards connected via the PL180 controller.
* The USB storage driver ('linux_drivers/src/drivers/usb') has been adapted
to the block-session interface and can be used on PC hardware.
* The new AHCI driver ('os/src/drivers/ahci') enables the access of disks
connected via SATA on PC hardware.
Because all drivers are providing the generic block-session interfaces, they
can be arbitrarily combined with components that use this interface as back
end, for example, the partition server and file systems.
:Partition manager as resource multiplexer:
The new partition manager ('os/src/server/part_blk') multiplexes one back-end
block session to multiple block sessions, each accessing a different partition.
Its natural role is being "plugged" between a block-device driver and a file
system.
:File-system access:
Even though a session interface for file systems does not exist yet, we
enabled the use of VFAT partitions through a libc plugin. This libc plugin uses
the ffat library to access files stored on a block device. An
application using this plugin can be directly connected to a block session.
New documentation
#################
The new way of dealing with different kernels motivated us to revisit and
complement our exiting documentation. The following documents are new or
have received considerable attention:
:[http://genode.org/documentation/developer-resources/getting_started - Getting started]:
The revised guide of how to explore Genode provides a quick way to
test drive Genode's graphical demo scenario with a kernel of your
choice and gives pointers to documents needed to proceed your
exploration.
:[http://genode.org/documentation/developer-resources/build_system - Build system manual]:
The new build-system manual explains the concepts behind Genode's
build system, provides guidance with creating custom programs and
libraries, and covers the tool support for the automated integration
and testing of application scenarios.
:[http://genode.org/documentation/components - Components overview]:
The new components-overview document explains the categorization of
Genode's components and lists all components that come with the framework.
:[http://genode.org/documentation/developer-resources/init - Configuration of the init process]:
The document describes Genode's configuration concept, the routing of
service requests, and the expression of mandatory access-control policies.
:[http://genode.org/community/wiki - Wiki]:
The platform-specific Wiki pages for L4/Fiasco, L4ka::Pistachio, NOVA,
Codezero, Fiasco.OC, and OKL4 have been updated to reflect the new flows of
working with the respective base platforms.
Base framework
##############
The RPC API for performing procedure calls across process boundaries
introduced with the version 11.05 was the most significant API change
in Genode's history. To make the transition from the old client-server
API to the new RPC API as smooth as possible, we temporarily upheld
compatibility to the old API. Now, the time has come to put the old
API at rest. The changes that are visible at API level are as follows:
* The old client-server API in the form of 'base/server.h' is no more.
The functionality of the original classes 'Server_entrypoint' and
'Server_activation' is contained in the 'Rpc_entrypoint' class provided
via 'base/rpc_server.h'.
* When introducing the RPC API, we intentionally left the actual session
interfaces as unmodified as possible to proof the versatility of the new
facility. However, it became apparent that some of the original interfaces
could profit from using a less C-ish style. For example, some interfaces used
to pass null-terminated strings as 'char const *' rather than via a dedicated
type. The methodology of using the new RPC API while leaving the original
interfaces intact was to implement such old-style functions as wrappers
around new-style RPC functions. These wrappers were contained in
'rpc_object.h' files, e.g. for 'linux_dataspace', 'parent', 'root',
'signal_session', 'cpu_session'. Now, we have taken the chance to modernise
the API by disposing said wrappers. Thereby, the need for 'rpc_object.h'
files has (almost) vanished.
* The remaining users of the old client-server API have been adapted to the
new RPC API, most prominently, the packet-stream-related interfaces such as
'block_session', 'nic_session', and 'audio_session'.
* We removed 'Typed_capability' and the second argument of the 'Capability'
template. The latter was an artifact that was only used to support the
transition from the old to the new API.
* The 'ipc_client' has no longer an 'operator int'. The result of an IPC can
be requested via the 'result' function.
* We refined the accessors of 'Rpc_in_buffer' in 'base/rpc_args.h'. The
'addr()' has been renamed to 'base()', 'is_valid_string()' considers the
buffer's capacity, and the new 'string()' function is guaranteed to return a
null-terminated string.
* We introduced a new 'Rm_session::Local_addr' class, which serves two
purposes. It allows the transfer of the bit representation of pointers across
RPC calls and effectively removes the need for casting the return type of
'Rm_session::attach' to the type needed at the caller side.
* The 'Connection' class template has been simplified, taking the session
interface as template argument (rather than the capability type). This change
simplified the 'Connection' classes of most session interfaces.
* The never-used return value of 'Parent::announce' has been removed. From the
child's perspective, an announcement always succeeds. The way of how the
announcement is treated is entirely up to the parent. The client should never
act differently depending on the parent's policy anyway.
* The new 'Thread_base::cap()' accessor function allows obtaining the thread's
capability as used for the argument to CPU-session operations.
Operating-system services and libraries
#######################################
Dynamic linker
==============
As a follow-up to the major revision of the dynamic linker that was featured
with the previous release, we addressed several corner cases related to
exception handling and improved the handling of global symbols.
The dynamic linker used to resolve requests for global symbols by handing out
its own symbols if present. However, in some cases, this behaviour is
undesired. For example, the dynamic linker contains a small set of libc
emulation functions specifically for the ported linker code. In the presence of
the real libc, however, these symbols should never be considered at all. To
avoid such ambiguities during symbol resolution, the set of symbols to be
exported is now explicitly declared by the white-list contained in the
'os/src/lib/ldso/symbol.map' file.
We changed the linkage of the C++ support library ('cxx') against dynamic
binaries to be consistent with the other base libraries. Originally, the 'cxx'
library was linked to both the dynamic linker and the dynamic binary, which
resulted in subtle problems caused by the duplication of cxx-internal data
structures. By linking 'cxx' only to the dynamic linker and exporting the
'__cxa' ABI as global symbols, these issues have been resolved. As a positive
side effect, this change reduces the size of dynamic binaries.
C++ exception handling in the presence of shared libraries turned out to be
more challenging than we originally anticipated. For example, the
'_Unwind_Resume' symbol is exported by the compiler's 'libsupc++' as a hidden
global symbol, which can only be resolved when linking this library to the
binary but is not seen by the dynamic linker. This was the actual reason of why
we used to link 'cxx' against both dynamic binaries and shared libraries
causing the problem mentioned in the previous paragraph. Normally, this problem
is addressed by a shared library called 'libgcc_s.so' that comes with the
compiler. However, this library depends on glibc, which prevents us from using
it on Genode. Our solution is renaming the hidden global symbol using a
'_cxx__' prefix and introducing a non-hidden global wrapper function
('__cxx__Unwind_Resume' in 'unwind.cc'), which is resolved at runtime by the
dynamic linker.
Another corner case we identified is throwing exceptions from within the
dynamic linker. In contrast to the original FreeBSD version of the dynamic
linker, which is a plain C program that can never throw a C++ exception,
Genode's version relies on C++ code that makes use of exceptions. To support
C++ exceptions from within the dynamic linker, we have to relocate the
linkers's global symbols again after having loaded the dynamic binary. This
way, type information that is also present within the dynamic binary becomes
relocated to the correct positions.
Block partition server
======================
The new block-partition server uses Genode's block-session interfaces as both
front and back end, leading to the most common use case where this server will
reside between a block driver and a higher level component like a file-system
server.
At startup, the partition server will try to parse the master boot record (MBR)
of its back-end block session. If no partition table is found, the whole block
device is exported as partition '0'. In the other case, the MBR and possible
extended boot records (EBRs) are parsed and offered as separate block sessions
to the front-end clients. The four primary partitions will receive partition
numbers '1' to '4' whereas the first logical partition will be assigned to '5'.
The policy of which partition is exposed to which client can be expressed
in the config supplied to the 'part_blk' server. Please refer to the
documentation at 'os/src/server/part_blk/README' for further details. As an
illustration of the practical use of the 'part_blk' server, you can find a run
script at 'os/run/part_blk.run'.
Skeleton of text terminal
=========================
As part of the ongoing work towards using interactive text-based GNU software
on Genode, we created the first bits of the infrastructure required for
pursuing this quest:
The new terminal-session interface at 'os/include/terminal_session/' is the
designated interface to be implemented by terminal programs.
After investigating the pros and cons of various terminal protocols and
terminal emulators, we settled for implementing a custom terminal emulator
implementing the Linux termcap. This termcap offers a reasonable small set of
commands while providing all essential features such as function-key support
and mouse support. Thanks to Peter Persson for pointing us to the right
direction! The preliminary code for parsing the escape sequences for the Linux
termcap is located at 'gems/include/terminal/'.
We have created a simplistic terminal service that implements the
terminal-session interface using a built-in font. Please note that the
implementation at 'gems/src/server/terminal/' is at an early stage. It is
accompanied by a simple echo program located at 'gems/src/test/terminal_echo'.
Device drivers
##############
USB HID and USB storage
=======================
We replaced the former DDE-Linux-based USB-related driver libraries (at the
'linux_drivers/' repository) by a single USB driver server that offers the
'Input' and 'Block' services. This enables us to use both USB HID and USB
storage at the same time. The new USB driver is located at
'linux_drivers/src/drivers/usb/'.
For using the USB driver as input service (supporting USB HID), add the
'<hid/>' tag to the 'usb_drv' configuration. Analogously, for using the driver
as block service, add the '<storage/>' tag. Both tags can be combined.
For testing the USB stack, the 'linux_drivers' repository comes with the run
scripts 'usb_hid.run' and 'usb_storage.run'.
ATA read/write support
======================
The ATAPI driver has been extended to support IDE block devices for both
read and write transactions. To use the new facility, supply 'ata="yes"'
as XML attribute to the config node of 'atapi_drv'. Please note that this
driver was primarily tested on Qemu. Use it with caution.
SATA driver
===========
The new SATA driver at 'os/src/drivers/ahci/' implements the block-driver
API ('os/include/block'), thus exposing the block-session interface as
front-end. AHCI depends on Genode's PCI driver as well as the timer server. For
a usage example see: 'os/run/ahci.run'.
Limitations and known issues
----------------------------
Currently, the server scans the PCI bus at startup and retrieves the first available
AHCI controller, scans the controller ports and uses the first non-ATAPI port
where a device is present.
On real hardware and on kernels taking advantage of I/O APICs (namely NOVA and
Fiasco.OC) we still lack support for ACPI parsing and thus for interrupts,
leading to a non-working driver.
SD-card driver
==============
The first fragments of our SD-card driver that we introduced with the previous
release have been complemented. The new SD-card driver located at
'os/src/drivers/sd_card/' implements the block-session interface by using
MMC/SD-cards and the PL180 controller as back end. Currently the driver
supports single-capacity SD cards. Therefore, the block file for Qemu should
not exceed 512 MB. Because the driver provides the generic block-session
interface, it can be combined with the new 'libc_ffat' plugin in a
straight-forward way. To give the driver a quick spin, you may give the
'libports/run/libc_ffat.run' script on the 'foc_pbxa9' platform a try.
ARM Realview PL011 UART driver
==============================
The new PL011 UART driver at 'os/src/drivers/uart/' implements the LOG session
interface using the PL011 device. Up to 4 UARTs are supported. The assignment
of UARTs to clients can be defined via a policy supplied to the driver's config
node. For further information, please refer to the README file within the
'uart' directory.
Libraries and applications
##########################
Hello tutorial
==============
The 'hello_tutorial/' repository contains a step-by-step guide for building
a simple client-server scenario. The tutorial has been rewritten for the new
RPC API and is now complemented by a run script for testing the final scenario
on various base platforms.
C and C++ runtimes
==================
:Support for standard C++ headers:
Triggered by public demand for using standard C++ headers for Genode applications,
we introduced a generally usable solution in the form of the 'stdcxx' library
to the 'libc' repository. The new 'stdcxx' library is not a real library. (you
will find the corresponding 'lib/mk/stdcxx.mk' file empty) However, it comes
with a 'lib/import/import-stdcxx.mk' file that adds the compiler's C++ includes
to the default include-search path for any target that has 'stdcxx' listed in
its 'LIBS' declaration.
:Libc back end for accessing VFAT partitions:
The new 'libc_ffat' libc plugin uses a block session via the ffat library. It
can be used by a Genode application to access a VFAT file system via the libc
file API. The file-system access is performed via the 'ffat' library. To
download this library and integrate it with Genode, change to the 'libports'
repository and issue the following command:
! make prepare PKG=ffat
For an example of how to use the libc-ffat plugin, please refer to the run
script 'libports/run/libc_ffat.run'. The source code of the test program can be
found at 'libports/src/test/libc_ffat/'.
Qt4
===
Qt4 version 4.7.1 has been enabled on ARMv6-based platforms, i.e., PBX-A9 on
Fiasco.OC. The support comprises the entire Qt4 framework including qt_webcore
(Webkit).
L4Linux
=======
L4Linux enables the use of one or multiple instances of Linux-based operating
systems as subsystems running on the Fiasco.OC kernel. The Genode version of
L4Linux has seen the following improvements:
:Kernel version: has been updated to Linux 2.6.39.
:ARM support: The L4Linux kernel can be used on ARM-based platforms now.
The PBX-A9 platform is supported via the 'l4linux.run' script as found
at 'ports-foc/run/'. Please find more information at 'ports-foc/README'.
:Genode-specific stub drivers outside the kernel tree:
The stub drivers that enable the use of Genode's services as virtual
devices for L4Linux have been moved outside the kernel patch, which
makes them much easier to maintain. These stub drivers are located
under 'ports-foc/src/drivers/'.
Platform support
################
All base platforms are now handled in a unified fashion. Downloading 3rd-party
source code is performed using the 'prepare' rule of the 'Makefile' provided by
the respective kernel's 'base-<platform>' repository. Once, the platform's base
repository is prepared, the kernel can be built directly from the Genode
build directory using 'make kernel'. All base platforms are now supported by
Genode's run mechanism that automates the tasks of system integration and
testing. For more details about each specific kernel, please revisit the
updated documentation within the respective 'base-<platform>/doc/' directory.
:L4/Fiasco:
The kernel has been updated to revision 472, enabling the use of recent
GNU tool chains.
:Fiasco.OC:
The kernel as been updated to revision 36, which remedies stability problems
related to interaction of the IPC path with thread destruction. The new version
improves the stability of highly dynamic workloads that involve the frequent
creation and destruction of subsystems. However, we experienced the new kernel
version to behave instable on the x86_64 architecture. If you depend on x86_64,
we recommend to temporarily stick with Genode 11.05 and Fiasco.OC revision 31.
:L4ka::Pistachio:
The kernel has been updated to revision 803, enabling the use of recent
versions of binutils.
:OKL4:
OKL4v2 is showing its age. Apparently, the use of the original distribution
requires tools (i.e., python 2.4) that do not ship with current Linux
distributions anymore. This makes it increasingly difficult to use this kernel.
Still, we find ourselves frequently using it for our day-to-day development. To
streamline the use of OKL4v2, we have now incorporated the kernel compilation
into the Genode build system and thereby weakened the kernel's dependency on
ancient tools. However, we decided to drop support for OKL4/ARM for now. We
figured that the supported GTA01 platform is hardly used anymore and hard to
test because it is unsupported by Qemu. Newer ARM platforms are supported by
other kernels anyway.
:Codezero:
Even though B-Labs apparently abandoned the idea of developing the Codezero
kernel in the open, we adapted Genode to the kernel's most recent Open-Source
version that is still available at the official Git repository. Furthermore,
the kernel is now fully supported by Genode's new 'make prepare' procedure and
run environment. Therefore, run scripts such as 'run/demo' can now easily be
executed on Codezero without the need to manually configure the kernel.
Note that, for now, we have disabled Codezero's capabilities because they do
not allow the assignment of device resources. Consequently, 'sys_map' fails for
MMIO regions when performing the capability check (calling 'cap_map_check').
Furthermore, the current version of the kernel requires a workaround for a
current limitation regarding the definition of a thread's pager. At some point,
Codezero abandoned the facility to define the pager for a given thread via the
exregs system call. Instead, the kernel hard-wires the creator of the thread as
the thread's pager. This is conflicting with Genode's way of creating and
paging threads. In the current version of Genode for this kernel, all threads
are paged by one thread (thread 3 happens to be the global pager) within core.
As a workaround to Codezero's current limitation, we define thread 3 to be the
pager of all threads. The patch of the upstream code is automatically being
applied by the 'make prepare' mechanism.
Build system and tools
######################
In addition to the major change with respect to the integration of the various
base platforms, Genode's tool support received the following incremental
improvements:
Build system
============
:Simplification of 'create_builddir' tool:
The 'create_builddir' tool has been relocated from
'tool/builddir/create_builddir' to 'tool/create_builddir' to make it more
readily accessible. Furthermore, we simplified the usage of the tool by
removing the mandatory 'GENODE_DIR' argument. If not explicitly specified, the
tool deduces 'GENODE_DIR' from the its known location within the Genode source
tree.
:Booting from USB sticks:
For most x86-based base platforms, their respective run environments execute
Genode from an ISO image via Qemu. Naturally, such an ISO image can be burned
onto a CD-ROM to be used to boot a real machine. However, booting from CD-ROM
is slow and optical drives are becoming scarce. Therefore we changed the
procedure of creating ISO images to support writing the resulting images to a
USB stick. Under the hood, the boot mechanism chain-loads GRUB via ISOLinux.
The files to implement the boot concept are located at 'tool/boot/'.
:Support for source files in target sub directories:
Until now, the 'SRC_*' declarations in target description files contained
a list of plain file names. The location of the files within the directory
tree had to be defined via 'vpath'. This led to inconveniences when building
3rd-party code that contains files with the same name at different subdirectories.
To resolve such an ambiguity, the target had to be decomposed into multiple
libraries each building a different set of subdirectories. To make the
build system more convenient to use, we have now added support for specifying
source codes with a relative pathname. For example, instead of using
! SRC_CC = main.cc addon.cc
! vpath addon.cc $(PRG_DIR)/contrib
we can now use
! SRC_CC = main.cc contrib/addon.cc
Automated testing across multiple kernels
=========================================
To execute one or multiple test cases on more than one base platform, we
introduced a dedicated tool located at 'tool/autopilot'. Its primary purpose is
the nightly execution of test cases. The tool takes a list of platforms and a
list of run scripts as arguments and executes each run script on each platform.
The build directory for each platform is created at
'/tmp/autopilot.<username>/<platform>' and the output of each run script is
written to a file called '<platform>.<run-script>.log'. On stderr, autopilot
prints the statistics about whether or not each run script executed
successfully on each platform. If at least one run script failed, autopilot
returns a non-zero exit code, which makes it straight forward to include
autopilot into an automated build-and-test environment.

File diff suppressed because it is too large Load Diff

View File

@@ -1,862 +0,0 @@
===============================================
Release notes for the Genode OS Framework 12.02
===============================================
Genode Labs
The release of Genode 12.02 marks an exciting point in the history of the
project as it is the first version developed in the open rather than within the
chambers of Genode Labs. Thereby, we have embraced GitHub as central facility
for discussion and source-code management. This change has benefits for users
and developers of the framework alike. For users, it has become possible to get
hold of the latest developments using the official 'genodelabs/master' branch and
get involved with discussing the current activities. For regular Genode
developers, the public Git repository replaces a former mix of public
Subversion and company-internal Mercurial repositories, making life much
easier. In Section [Liberation of the development process], we outline the
motivation behind this change and give pointers to the new resources.
The major new additions to the base system are a new framework API for accessing
memory-mapped I/O resources, special support for using Genode as user-level
component framework on Linux, and API support for the reuse of existing
components in the form of sandboxed libraries. These changes are accompanied
with new device-driver infrastructure such as the first version of a device
driver manager and a new ACPI parser.
Feature-wise, the current release takes the first steps towards the goal of the
[http://genode.org/about/road-map - Roadmap for 2012], turning Genode into a
general-purpose OS ready for everyday use by its developers. According to the
roadmap, we enhanced the Noux runtime with fork semantics so that we can run
command-line based GNU programs such as the bash shell and coreutils unmodified
and natively on various microkernels. Furthermore, the library infrastructure
has been enhanced by porting and updating libraries such as Qt 4.7.4 and the
MuPDF PDF rendering engine.
Liberation of the development process
#####################################
In summer 2011, we started a discussion within Genode Labs about changing the
mode of how Genode is developed. Until then, most design discussions and the
actual development work took place locally at the company. At quarterly
intervals, we used to publish our work in the form of official Genode
releases. This way of development seemed to work quite well for us, we were
satisfied about the pace of development, and with each release, our project got
more recognition.
However, the excellent book [http://producingoss.com/ - Producing Open Source Software]
made us realize that even though we released our work under an Open-Source
license, our development process was actually far from being open and may have
discouraged participation of people outside the inner circle of developers.
Because we believe that the framework has reached a state where it becomes
interesting for a wider audience of users and developers, the idea was born
to liberate the project from its closed fashion of development.
In the beginning of December, the vague idea has become a plan. So we finally
brought the topic to our mailing list
([http://genode.org/news/steps-towards-an-open-development-process - Steps towards an open development process]).
We decided to take the release cycle for Genode 12.02 as the opportunity to put
our plan to practice. The central element of this endeavour was moving the
project over to GitHub and adapt our workflows and tooling support accordingly.
First, we started to embrace GitHub's issue tracker for the management of
working topics:
:[http://github.com/genodelabs/genode/issues]: Issue Tracker
The most significant step was leaving our Genode-Labs-internal code
repositories behind and starting a completely public Git repository instead:
:[https://github.com/genodelabs]: Genode Labs at GitHub
With the code repository going public, the way was cleared to opening up design
discussions as well. Instead of having such discussions internally at Genode
Labs, we try to increasingly take them to our mailing list and issue tracker.
With this new way of development, we hope to make the project much more
approachable for people who want to get involved and let Genode reach far out
beyond the reach of our little company.
The changes mentioned above are actually just the tip of the iceberg. For
example, the transition phase required us to rethink the way the project
website is maintained. From now on, almost all of the content of genode.org
comes directly from the project's Git repository. So maintaining website
content is done in the same coherent and transparent way as working on Genode's
code base. So we could finally put the old Wiki to rest. In the process, we
largely revisited the existing content. For example, we rewrote the
[http://genode.org/community/contributions - contributions] document in a
tutorial-like style and incorporated several practical hints, in particular
related to the recommended use of Git.
Although it is probably too early to judge the outcome of our transition, we
are excited how smooth this massive change went. We attribute this pleasant
experience mostly to the excellent GitHub hosting platform, which instantly
ignited a spirit of open collaboration among us. We are excited to see new
people approaching us and showing their interest for teaming up, and we are
curious about where this new model of development will take Genode in the
future.
Base framework, low-level OS infrastructure
###########################################
RPC framework refinements
=========================
Until now, the RPC framework did not support const RPC functions. Rather than
being a limitation inherent to the concept, const RPC functions plainly did not
exist. So supporting them was not deemed too important. However, there are uses
of RPC interfaces that would benefit from a way to declare an RPC function as
const. Candidates are functions like 'Framebuffer::Session::mode()' and
'Input::Session::is_pending()'.
With the current version, we clear the way towards declaring such functions as
const. Even though the change is pretty straight-forward, the thorough support
for const-qualified RPC functions would double the number of overloads for the
'call_member' function template (in 'base/include/util/meta.h'). For this
reason, as of now, the support of const functions is limited to typical getter
functions with no arguments. This appears to be the most common use of such
functions.
API support for enslaving services
==================================
While evolving and using the framework, we always keep an eye on recurring
patterns of how its API is used. Once such a pattern becomes obvious, we try
to take a step back, generalize the observed pattern, and come up with a new
building block that unifies the former repetitive code fragments.
One of those patterns that was far from obvious when we designed Genode years
ago is the use of a service running as child of its own client. At the first
glance, this idea seems counter-intuitive because normally, services are
understood as components that operate independently and protected from their
(untrusted) clients. But there is a class of problems where this approach
becomes extremely useful: The reuse of protocol implementations as a
library-like building block. Most services are actually protocol stacks that
translate a low-level protocol to a more abstract API. For example, a block
device driver translates a specific device API to the generic 'Block_session'
interface. Or the 'iso9660' service translates the 'Block_session' interface to
the 'Rom_session' interface by parsing the ISO9660 file system. Or similarly,
the 'tar_rom' service parses the tar file format to make its content available
via the 'Rom_session' interface.
If a particular functionality is needed by multiple programs, it is common
practice to move this functionality into a dedicated library to avoid the
duplication of the same code at many places. For example, if a program would
need to parse a tar archive, it might be tempting to move the tar-parsing code
from the 'tar_rom' service into a dedicated library, which can then be used by
both the 'tar_rom' service and the new program. An alternative approach is to
just re-use the 'tar_rom' service as a black box and treat it like it was a
library. That is, start the 'tar_rom' service as a child process, supply the
resources the component needs to operate and, in turn, use its API (now in the
form of an RPC interface) to get work done. Because the service is started as a
mere tool at the discretion of its client, we call it *slave*. It turns out
that this idea works exceedingly well in many cases. In a way, it resembles the
Unix philosophy to solve complex problems by combining many small tools each
with a specific purpose. In contrast to the use of libraries, the reuse of
entire components has benefits with regard to fault isolation. Because the
reused functionality is sandboxed within a distinct process, the environment
exposed to this code can be tailored to a rigid subset of the host program's
environment. In the event of a fault within the reused component, the reach of
problem is therefore limited.
On the other hand, we observed that even though this idea works as intended,
implementing the idea for a particular use case involved a good deal of
boiler-plate code where most of this code is needed to define the slave's
environment and resources. Hence, we reviewed the existing occurrences of the
slave pattern and condensed their common concerns into the 'Slave_policy' and
'Slave' classes residing in 'os/include/os/slave.h'. The 'Slave' class is meant
to be used as is. It is merely a convenience wrapper for a child process and
its basic resources. The 'Slave_policy' is meant as a hook for service-specific
customizations. The best showcase is the new 'd3m' component located at
'gems/src/server/d3m'. D3m extensively uses the slave pattern by instantiating
and destroying drivers and file-system instances on-the-fly. A further instance
of this pattern can be found in the new ACPI driver introduced with the current
release.
Support for resizable framebuffers
==================================
The framebuffer-session interface has remained largely untouched since the
original release of Genode in 2008. Back then, we were used to rely on C-style
out parameters in RPC functions. The current RPC framework, however, promotes
the use of a more object-oriented style. So the time has come to revisit the
framebuffer session interface. Instead of using C-style out parameters, the new
'mode()' RPC call returns the mode information as an object of type 'Mode'.
Consequently, mode-specific functions such as 'bytes_per_pixel()' have been
moved to the new 'Framebuffer::Mode' class. The former 'info()' function is
gone.
In addition to the overhaul of the RPC interface, we introduced basic support
for resizable framebuffers. The new 'mode_sigh()' function enables a client to
register a signal handler at the framebuffer session. This signal handler gets
notified in the event of server-side mode changes. Via the new 'release()'
function, the client is able to acknowledge a mode change. By calling it, the
client tells the framebuffer service that it no longer uses the original
framebuffer dataspace. So the server can replace it by a new one. After having
called 'release()', the client can obtain the dataspace for the new mode by
calling 'dataspace()' again.
MMIO access framework
=====================
As the arsenal of native device drivers for Genode grows, we are observing
an increased demand to formalize the style of how drivers are written to
foster code consistency. One particular cause of inconsistency used to be
the way of how memory-mapped I/O registers are accessed. C++ has poor support
for defining bit-accurate register layouts in memory. Therefore, driver code
usually carries along a custom set of convenience functions for reading and
writing registers of different widths as well as a list of bit definitions in
the form of enum values or '#define' statements. To access parts of a register,
the usual pattern is similar to the following example (taken from the pl011
UART driver:
! enum {
! UARTCR = 0x030, /* control register */
! UARTCR_UARTEN = 0x0001, /* enable bit in control register */
! ...
! }
! ...
!
! /* enable UART */
! _write_reg(UARTCR, _read_reg(UARTCR) | UARTCR_UARTEN);
This example showcases two inconveniences: The way the register layout is
expressed and the manual labour needed to access parts of registers. In the
general case, a driver needs to also consider 'MASK' and 'SHIFT' values to
implement access to partial registers properly. This is not just inconvenient
but also error prone. For lazy programmers as ourselves, it's just too easy to
overwrite "undefined" bits in a register instead of explicitly masking the
access to the actually targeted bits. Consequently, the driver may work fine
with the current generation of devices but break with the next generation.
So the idea was born to introduce an easy-to-use formalism for this problem. We
had two goals: First, we wanted to cleanly separate the declaration of register
layouts from the program logic of the driver. The actual driver program should
be free from any intrinsics in the form of bit-masking operations. Second, we
wanted to promote uncluttered driver code that uses names (i.e., in the form of
type names) rather than values to express its operations. The latter goal is
actually achieved by the example above by the use of enum values, but this is
only achieved through discipline. We would prefer to have an API that
facilitates the use of proper names as the most convenient way to express an
operation.
The resulting MMIO API comes in the form of two new header files located at
'base/include/util/register.h' and 'base/include/util/mmio.h'.
Register declarations
~~~~~~~~~~~~~~~~~~~~~
The class templates found in 'util/register.h' provide a means to express
register layouts using C++ types. In a way, these templates make up for
C++'s missing facility to define accurate bitfields. Let's take a look at
a simple example of the 'Register' class template that can be used to define
a register as well as a bitfield within this register:
! struct Vaporizer : Register<16>
! {
! struct Enable : Bitfield<2,1> { };
! struct State : Bitfield<3,3> {
! enum{ SOLID = 1, LIQUID = 2, GASSY = 3 };
! };
!
! static void write (access_t value);
! static access_t read ();
! };
In the example, 'Vaporizer' is a 16-bit register, which is expressed via the
'Register' template argument. The 'Register' class template allows for
accessing register content at a finer granularity than the whole register
width. To give a specific part of the register a name, the 'Register::Bitfield'
class template is used. It describes a bit region within the range of the
compound register. The bit 2 corresponds to true if the device is enabled and
bits 3 to 5 encode the 'State'. To access the actual register, the methods
'read()' and 'write()' must be provided as backend, which performs the access
of the whole register. Once defined, the 'Vaporizer' offers a handy way to
access the individual parts of the register, for example:
! /* read the whole register content */
! Vaporizer::access_t r = Vaporizer::read();
!
! /* clear a bit field */
! Vaporizer::Enable::clear(r);
!
! /* read a bit field value */
! unsigned old_state = Vaporizer::State::get(r);
!
! /* assign new bit field value */
! Vaporizer::State::set(r, Vaporizer::State::LIQUID);
!
! /* write whole register */
! Vaporizer::write(r);
Memory-mapped I/O
~~~~~~~~~~~~~~~~~
The utilities provided by 'util/mmio.h' use the 'Register' template class as
a building block to provide easy-to-use access to memory-mapped I/O registers.
The 'Mmio' class represents a memory-mapped I/O region taking its local base
address as constructor argument. Let's take a simple example to see how it is
supposed to be used:
! class Timer : Mmio
! {
! struct Value : Register<0x0, 32> { };
! struct Control : Register<0x4, 8> {
! struct Enable : Bitfield<0,1> { };
! struct Irq : Bitfield<3,1> { };
! struct Method : Bitfield<1,2>
! {
! enum { ONCE = 1, RELOAD = 2, CYCLE = 3 };
! };
! };
!
! public:
!
! Timer(addr_t base) : Mmio(base) { }
!
! void enable();
! void set_timeout(Value::access_t duration);
! bool irq_raised();
! };
The memory-mapped timer device consists of two registers: The 32-bit 'Value'
register and the 8-bit 'Control' register. They are located at the MMIO offsets
0x0 and 0x4, respectively. Some parts of the 'Control' register have specific
meanings as expressed by the 'Bitfield' definitions within the 'Control'
struct.
Using these declarations, accessing the individual bits becomes almost a
verbatim description of how the device is used. For example:
! void enable()
! {
! /* access an individual bitfield */
! write<Control::Enable>(true);
! }
!
! void set_timeout(Value::access_t duration)
! {
! /* write complete content of a register */
! write<Value>(duration);
!
! /* write all bitfields as one transaction */
! write<Control>(Control::Enable::bits(1) |
! Control::Method::bits(Control::Method::ONCE) |
! Control::Irq::bits(0));
! }
!
! bool irq_raised()
! {
! return read<Control::Irq>();
! }
In addition to those basic facilities, further noteworthy features of the new
API are the support for register arrays and the graceful overflow handling
with respect to register and bitfield boundaries.
C Runtime
=========
We extended our FreeBSD-based C runtime to accommodate the needs of the Noux
runtime environment and our port of the MuPDF application.
* The dummy implementation of '_ioctl()' has been removed. This function is
called internally within the libc, i.e., by 'tcgetattr()'. For running
libreadline in Noux, we need to hook into those ioctl operations via the
libc plugin interface.
* The 'libc/regex' and 'libc/compat' modules have been added to the libc.
These libraries are needed by the forthcoming port of Slashem to Noux.
* We added a default implementation of 'chdir()'. It relies on the sequence of
'open()', 'fchdir()', 'close()'.
* The new libc plugin 'libc_rom' enables the use of libc file I/O functions
to access ROM files as provided by Genode ROM session.
* We changed the libc dummy implementations to always return ENOSYS. Prior
this change, 'errno' used to remain untouched by those functions causing
indeterministic behaviour of code that calls those functions, observes the
error return value (as returned by most dummies), and evaluates the error
condition reported by errno.
* If using the libc for Noux programs, the default implementations of
time-related functions such as 'gettimeofday()' cannot be used because they
rely on a dedicated timeout-scheduler thread. Noux programs, however, are
expected to contain only the main thread. By turning the functions into weak
symbols, we enabled the noux libc-plugin to provide custom implementations.
DDE Kit
=======
Linux DDE used to implement Linux spin locks based on 'dde_kit_lock'. This
works fine if a spin lock is initialized only once and used from then on. But
if spin locks are initialized on-the-fly at a high rate, each initialization
causes the allocation of a new 'dde_kit_lock'. Because in contrast to normal
locks, spinlocks cannot be explicitly destroyed, the spin-lock emulating locks
are never freed. To solve the leakage of locks, we complemented DDE Kit with
the new 'os/include/dde_kit/spin_lock.h' API providing the semantics as
expected by Linux drivers.
Libraries and applications
##########################
New and updated libraries
=========================
:Qt4 updated to version 4.7.4:
We updated Qt4 from version 4.7.1 to version 4.7.4. For the most part, the
update contains bug fixes as detailed in the release notes for the versions
[http://qt.nokia.com/products/changes/changes-4.7.2 - 4.7.2],
[http://qt.nokia.com/products/changes/changes-4.7.3 - 4.7.3], and
[http://labs.qt.nokia.com/2011/09/01/qt-4-7-4-released - 4.7.4].
:Update of zlib to version 1.2.6:
Because zlib 1.2.5 is no more available at zlib.net, we bumped the zlib
version to 1.2.6.
:New ports of openjpeg, jbig2dec, and mupdf:
MuPDF is a fast and versatile PDF rendering library with only a few
dependencies. It depends on openjpeg (JPEG2000 codec) and jbig2dec (b/w image
compression library). With the current version, we integrated those libraries
alongside the MuPDF library to the 'libports' repository.
GDB monitor refinements and automated test
==========================================
We improved the support for GDB-based user-level debugging as introduced with
the previous release.
For the x86 architecture, we fixed a corner-case problem with using the
two-byte 'INT 0' instruction for breakpoints. The fix changes the breakpoint
instruction to the single-byte 'HLT'. 'HLT' is a privileged instruction and
triggers an exception when executed in user mode.
The new 'gdb_monitor_interactive.run' script extends the original
'gdb_monitor.run' script with a startup sequence that automates the
initial break-in at the 'main()' function of a dynamically linked binary.
The revised 'gdb_monitor.run' script has been improved to become a full
automated test case for GDB functionalities. It exercises the following
features (currently on Fiasco.OC only):
* Breakpoint in 'main()'
* Breakpoint in a shared-library function
* Stack trace when not in a syscall
* Thread info
* Single stepping
* Handling of segmentation-fault exception
* Stack trace when in a syscall
PDF viewer
==========
According to our road map for 2012, we pursued the port of an existing PDF
viewer as native application to Genode.
We first looked at the [http://poppler.freedesktop.org - libpoppler],
which seems to be the most popular PDF rendering engine in the world of
freedesktop.org. To get a grasp on what the porting effort of this engine may
be, we looked at projects using this library as well as the library source
code. By examining applications such as the light-weight epdfview
application, we observed that libpoppler's primary design goal is to integrate
well with existing freedesktop.org infrastructure rather than to reimplement
functionality that is provided by another library. For example, fontconfig is
used to obtain font information and Cairo is used as rendering backend. In the
context of freedesktop.org, this makes perfect sense. But in our context,
porting libpoppler would require us to port all this infrastructure to Genode
as well. To illustrate the order of magnitude of the effort needed, epdfview
depends on 65 shared libraries. Of course, at some point in the future, we will
be faced to carry out this porting work. But for the immediate goal to have a
PDF rendering engine available on Genode, it seems overly involved. Another
criterion to evaluate the feasibility of integrating libpoppler with Genode is
its API. By glancing at the API, it seems to be extremely feature rich and
complex - certainly not a thing to conquer in one evening with a glass of wine.
The Qt4 backend of the library comprises circa 8000 lines of code. This value
can be taken as a vague hint at the amount of work needed to create a custom
backend, i.e., for Genode's framebuffer-session interface.
Fortunately for us, there exists an alternative PDF rendering engine named
MuPDF. The concept of MuPDF is quite the opposite of that of libpoppler.
MuPDF tries to be as self-sufficient as possible in order to be suitable
for embedded systems without comprehensive OS infrastructure. It comes with a
custom vector-graphics library (instead of using an existing library such as
Cairo) and it even has statically linked-in all font information needed to
display PDF files that come with no embedded fonts. That said, it does not
try to reinvent the wheel in every regard. For example, it relies on
common libraries such as zlib, libpng, jpeg, freetype, and openjpeg. Most
of them are already available on Genode. And the remaining libraries are rather
free-standing and easy to port. To illustrate the low degree of dependencies,
the MuPDF application on GNU/Linux depends on only 15 shared libraries. The
best thing about MuPDF from our perspective however, is its lean and clean API,
and the wonderfully simple example application. Thanks to this example, it was
a breeze to integrate the MuPDF engine with Genode's native framebuffer-session
and input-session interfaces. The effort needed for this integration work lies
in the order of less than 300 lines of code.
At the current stage, the MuPDF rendering engine successfully runs on Genode
in the form of a simple interactive test program, which can be started
via the 'libports/run/mupdf' run script. The program supports the basic key
handling required to browse through a multi-page PDF document
(page-up or enter -> next page, page-down or backspace -> previous page).
Improved terminal performance
=============================
The terminal component used to make all intermediate states visible to the
framebuffer in a fully synchronous fashion. This is an unfortunate behaviour
when scrolling through large text outputs. By decoupling the conversion of the
terminal state to pixels from the 'Terminal::write()' RPC function,
intermediate terminal states produced by sub sequential write operations do not
end up on screen one by one but only the final state becomes visible. This
improvement drastically improves the speed in situations with a lot of
intermediate states.
Noux support for fork semantics
===============================
Genode proclaims to be a framework out of which operating systems can be built.
There is no better way of putting this claim to the test than to use the
framework for building a Unix-like OS. This is the role of the Noux runtime
environment.
During the past releases, Noux evolved into a runtime environment that is able
to execute complex command-line-based GNU software such as VIM with no
modification. However, we cannot talk of Unix without talking about its
fundamental concept embodied in the form of the 'fork()' system call. We did
not entirely dismiss the idea of implementing 'fork()' into Noux but up to now,
it was something that we willingly overlooked. However, the primary goal of
Noux is to run the GNU userland natively on Genode. This includes a good deal
of programs that rely on fork semantics. We could either try to change all the
programs to use a Genode-specific way of starting programs or bite in the
bullet and implement fork. With the current release, we did the latter.
The biggest challenge of implementing fork was to find a solution that is not
tied to one kernel but one that works across all the different base platforms.
The principle problem of starting a new process in a platform-independent
manner is already solved by Genode in the form of the 'Process' API. But this
startup procedure is entirely different from the semantics of fork. The key to
the solution was Genode's natural ability to virtualize the access to low-level
platform resources. To implement fork semantics, all Noux has to do is to
provide local implementations of core's RAM, RM, and CPU session interfaces.
The custom implementation of the CPU session interface is used to tweak the
startup procedure as performed by the 'Process' class. Normally, processes
start execution immediately at creation time at the ELF entry point. For
implementing fork semantics, however, this default behavior does not work.
Instead, we need to defer the start of the main thread until we have finished
copying the address space of the forking process. Furthermore, we need to start
the main thread at a custom trampoline function rather than at the ELF entry
point. Those customizations are possible by wrapping core's CPU service.
The custom implementation of the RAM session interface provides a pool of RAM
shared by Noux and all Noux processes. The use of a shared pool alleviates the
need to assign RAM quota to individual Noux processes. Furthermore, the custom
implementation is needed to get hold of the RAM dataspaces allocated by each
Noux process. When forking a process, the acquired information is used to
create a shadow copy of the forking address space.
Finally, a custom RM service implementation is used for recording all RM
regions attached to the region-manager session of a Noux process. Using the
recorded information, the address-space layout can then be replayed onto a new
process created via fork.
With the virtualized platform resources in place, the only puzzle piece that
is missing is the bootstrapping of the new process. When its main thread is
started, it has an identical address-space content as the forking process but
it has to talk to a different parent entrypoint and a different Noux session.
The procedure of re-establishing the relationship of the new process to its
parent is achieved via a small trampoline function that re-initializes the
process environment and then branches to the original forking point via
setjmp/longjmp. This mechanism is implemented in the libc_noux plugin.
As the immediate result of this work, a simple fork test can be executed across
all base platforms except for Linux (Linux is not supported yet). The test
program is located at 'ports/src/test/noux_fork' and can be started with the
'ports/run/noux_fork.run' script.
Furthermore, as a slightly more exciting example, there is a run script for
running a bash shell on a tar file system that contains coreutils. By starting
the 'ports/run/noux_bash.run' script, you get presented an interactive bash
shell. The shell is displayed via the terminal service and accepts user input.
It allows you to start one of the coreutils programs such as ls or cat. Please
note that the current state is still largely untested, incomplete, and flaky.
But considering that Noux is comprised of less than 2500 lines of code, we are
quite surprised of how far one can get with such little effort.
Device drivers
##############
Driver improvements to accommodate dynamic (re-)loading
=======================================================
To support the dynamic probing of devices as performed by the new d3m
component, the ATAPI and USB device drivers have been enhanced to support the
subsequent closing and re-opening of sessions.
First bits of the d3m device-driver manager
===========================================
The abbreviation d3m stands for demo device-driver manager. It is our current
solution for the automated loading of suitable drivers as needed for running
Genode from a Live CD or USB stick. Because of the current narrow focus of d3m,
it is not a generic driver-management solution but a first step in this
direction. We hope that in the long run, d3m will evolve to become a generic
driver-management facility so that we can remove one of the "D"s from its name.
In the current form d3m solves the problems of merging input-event streams,
selecting the boot device, and dealing with failing network drivers.
When using the live CD, we expect user input to come from USB HID devices or
from a PS/2 mouse and keyboard. The live system should be operational if at
least one of those sources of input is available. In the presence of multiple
sources, we want to accumulate the events of all of them.
The live CD should come in the form of a single ISO image that can be burned onto a CDROM or
alternatively copied to an USB stick. The live system should boot fine in both
cases. The first boot stage is accommodated by syslinux and the GRUB boot
loader using BIOS functions. But once Genode takes over control, it needs to
figure out on its own from where to fetch data. A priori, there is no way to
guess whether the ATAPI driver or the USB storage driver should be used.
[image d3m_what_next]
Therefore, d3m implements a probing mechanism that starts each of the drivers,
probes for the presence of a particular file on an iso9660 file system.
[image d3m_probing]
Once d3m observes a drivers that is able to successfully access the magic file,
it keeps the driver and announces the driver's service to its own parent. For
the system outside of d3m, the probing procedure is completely transparent. D3m
appears to be just a service that always provides the valid block session for
the boot medium.
[image d3m_ready]
The network device drivers that we ported from the iPXE project cover the
range of most common wired network adaptors, in particular the E1000 family.
But we cannot presume that a computer running the live system comes equipped
with one of the supported devices. If no supported network card could be
detected the driver would simply fail. Applications requesting a NIC session
would block until a NIC service becomes available, which won't happen. To
prevent this situation, d3m wraps the NIC driver and provides a dummy NIC
service in the event the drivers fails. This way, the client application won't
block infinitely but receive an error on the first attempt to use the NIC.
ACPI support
============
To accommodate kernels like Fiasco.OC or NOVA that take advantage of x86's
APIC, we have introduced a simple ACPI parser located at 'os/src/drivers/acpi'.
The server traverses the ACPI tables and sets the interrupt line of devices
within the PCI config space to the GSIs found in the ACPI tables. Internally it
uses Genode's existing PCI driver as a child process for performing PCI access
and, in turn, announces a PCI service itself.
For obtaining the IRQ routing information from the ACPI tables without
employing a full-blown ACPI interpreter, the ACPI driver uses an ingenious
technique invented by Bernhard Kauer, which is described in the following
paper:
:[http://os.inf.tu-dresden.de/papers_ps/tr-atare-2009.pdf - ATARE - ACPI Tables and Regular Expressions]:
_TU Dresden technical report TUD-FI09-09, Dresden, Germany, August 2009_
:Usage:
Start the 'acpi_drv' in your Genode environment. Do not start the 'pci_drv'
since this will be used as a slave of the 'acpi_drv'. You still must load the
'pci_drv' in your boot loader. To integrate the ACPI driver into your boot
configuration, you may take the following snippet as reference:
!<start name="acpi">
! <resource name="RAM" quantum="2M"/>
! <binary name="acpi_drv"/>
! <provides><service name="PCI"/></provides>
! <route>
! <service name="ROM"> <parent/> </service>
! <any-service> <any-child/> <parent/> </any-service>
! </route>
!</start>
:Limitations and known issues:
Currently there is no interface to set the interrupt mode for core's IRQ
sessions (e.g., level or edge triggered). This is required by Fiasco.OCs kernel
interface. We regard this as future work.
Platform support
################
Fiasco.OC microkernel
=====================
The support for the Fiasco.OC base platform is still lacking proper handling
for releasing resources such as kernel capabilities. Although this is a known
issue, we underestimated the reach of the problem when Genode's signal API is
used. Each emitted signal happens to consume one kernel capability within core,
ultimately leading to a resource outage when executing signal-intensive code
such as the packet-stream interface. The current release comes with an interim
solution. To remedy the acute problem, we extended the 'Capability_allocator'
class with the ability to register the global ID of a Genode capability so
that the ID gets associated with a process-local kernel capability. Whenever
a Genode capability gets unmarshalled from an IPC message, the
capability-allocator is asked, with the global ID as key, whether the
kernel-cap already exists. This significantly reduces the waste of
kernel-capability slots.
To circumvent problems of having one and the same ID for different kernel
objects, the following problems had to be solved:
* Replace pseudo IDs with unique ones from core's badge allocator
* When freeing a session object, free the global ID _after_ unmapping
the kernel object, otherwise the global ID might get re-used in some
process and the registry will find a valid but wrong capability
for the ID
Because core aggregates all capabilities of all different processes, its
capability registry needs much more memory compared to a regular process.
By parametrizing capability allocators differently for core and non-core
processes, the global memory overhead for capability registries is kept
at a reasonable level.
Please note that this solution is meant as an interim fix until we have
resolved the root of the problem, which is the proper tracking and releasing
of capability selectors.
Linux
=====
Linux is one of the two original base platforms of Genode. The original
intension behind supporting Linux besides a microkernel was to facilitate
portability of the API design and to have a convenient testing environment for
platform-independent code. Running Genode in the form of a bunch of plain Linux
processes has become an invaluable feature for our fast-paced development.
To our delight, we lately discovered that the use of running Genode on Linux
can actually go far beyond this original incentive. Apparently, on Linux, the
framework represents an equally powerful component framework as on the other
platforms. Hence, Genode has the potential to become an attractive option for
creating complex component-based user-level software on Linux.
For this intended use, however, the framework has to fulfill the following
additional requirements:
* Developers on Linux expect that their components integrate seamlessly with
their existing library infrastructure including all shared libraries
installed on Linux.
* The use of a custom tool chain is hard to justify to developers who regard
Genode merely as an application framework. Hence, a way to use the normal
tool chain as installed on the Linux host system is desired.
* Application developers are accustomed with using GDB for debugging and expect
that GDB can be attached to an arbitrary Genode program in an intuitive way.
Genode's original support for Linux as base platform did not meet those
expectations. Because Genode's libc would ultimately collide with the Linux
glibc, Genode is built with no glibc dependency at all. It talks to the kernel
directly using custom kernel bindings. In particular, Genode threads are created
directly via the 'clone()' system call and thread-local storage (TLS) is managed
in the same way as for the other base platforms. This has two implications.
First, because Genode's TLS mechanism is different than the Linux TLS
mechanism, Genode cannot be built with the normal host tool chain. This
compiler would generate code that would simply break on the first attempt to
use TLS. We solved this problem with our custom tool chain, which is configured
for Genode's needs. The second implication is that GDB is not able to handle
threads created differently than those created via the pthread library. Even
though GDB can be attached to each thread individually, the debugger would not
correctly handle a multi-threaded Genode process as a multi-threaded Linux
program. With regard to the use of Linux shared libraries, Genode used to
support a few special programs that used both the Genode API and Linux
libraries. Those programs (called hybrid Linux/Genode programs) were typically
pseudo device drivers that translate a Linux API to a Genode service. For
example, there exists a framebuffer service that uses libSDL as back end.
Because those programs were a rarity, the support by the build system for such
hybrid targets was rather poor.
Fortunately, all the problems outlined above could be remedied pretty easily.
It turns out that our custom libc is simply not relevant when Genode is
used as plain application framework on Linux. For this intended use, we always
want to use the host's normal libc. This way, the sole reason for using plain
system calls instead of the pthread library vanishes, which, in turn,
alleviates the need for a custom tool chain. Genode threads are then simply
pthreads compatible with the TLS code as emitted by the host compiler and
perfectly recognised by GDB. With the surprisingly little effort of creating a
new implementation of Genode's thread API to target pthreads instead of using
syscalls, we managed to provide a decent level of support for using Genode as
user-level component framework on Linux.
These technical changes alone, however, are not sufficient to make Genode
practical for real-world use. As stated above, the few hybrid Linux/Genode
programs used to be regarded as some leprous artifacts. When using Genode as
Linux application framework, however, this kind of programs are becoming the
norm rather than an exception. For this reason, we introduced new support for
such hybrid programs into the build system. By listing the 'lx_hybrid'
library in the 'LIBS' declaration of a target, this target magically becomes a
hybrid Linux/Genode program. It gets linked to the glibc and uses pthreads
instead of direct syscalls. Furthermore, host libraries can be linked to the
program by stating their respective names in the 'LX_LIBS' variable. For an
example, please refer to the libSDL-based framebuffer at
'os/src/drivers/framebuffer/sdl/target.mk'.
To enforce the build of all targets as hybrid Linux/Genode programs, the build
system features the 'alyways_hybrid' 'SPEC' value. To make it easy to create a
build directory with all targets forced to be hybrid, we have added the new
'lx_hybrid_x86' platform to the 'create_builddir' tool.
OKL4
====
:Sending an invalid-opcode exception IPC on OKL4:
When an invalid opcode gets executed, OKL4 switches to the kernel debugger
console instead of sending an exception IPC to the userland. We fixed this
problem by removing the code that invokes the debugger console from the kernel.
:Hard-wire OKL4 elfweaver to Python 2:
Recent Linux distributions use Python version 3 by default. But OKL4's
elfweaver is not compatible with this version of Python. For this reason, we
introduced a patch for pinning the Python version used by elfweaver to
version 2.
Both patches get automatically applied when preparing the 'base-okl4'
repository via 'make prepare'.
Build system and tools
######################
:Facility for explicitly building all libraries:
During its normal operation, the build system creates libraries as mere side
effects of building targets. There is no way to explicitly trigger the build of
libraries only. However, in some circumstances (for example for testing the
thorough build of all libraries), a mechanism for explicitly building libraries
would be convenient. Hence we introduced this feature in the form of the pseudo
target located at 'base/src/lib/target.mk'. By issuing 'make lib' in a build
directory, this target triggers the build of all libraries available for the
given platform.

File diff suppressed because it is too large Load Diff

View File

@@ -1,665 +0,0 @@
===============================================
Release notes for the Genode OS Framework 12.08
===============================================
Genode Labs
With Genode 12.08, the project focused on platform support. It enters the world
of OMAP4-based ARM platforms, revived and vastly enhanced the support for the
NOVA hypervisor, and becomes able to run directly on ARM platforms without the
need for an underlying kernel.
The new 'base-hw' platform is a deviation from Genode's traditional approach to
complement existing kernels with user-land infrastructure. It completely leaves
the separate kernel out of the picture and thereby dwarfs the base line of the
trusted computing base of Genode-based systems to approximately the half. The
new base platform is described in Section [Genode on naked ARM hardware].
Speaking of base platforms, we are happy to have promoted the NOVA hypervisor
to a first-class citizen among the base platforms. During the last months, this
kernel underwent fundamental changes regarding its mode of development and its
feature set. This prompted us to vastly improve Genode's support for this
platform and leverage its unique features. If considering the use of Genode on
x86-based hardware, NOVA has become a very attractive foundation. Section
[Embracing the NOVA Hypervisor] describes the NOVA-specific changes.
The improvement of platform support with the current release does not entail
the base platforms only but extends to profound additions of device drivers, in
particular for the ARM-based OMAP4 SoC as used on the popular Pandaboard. We
are proud to announce the availability of device drivers for HDMI output,
SD-card, USB HID, and networking for this platform.
Beyond the low-level platform improvements, the new version comes with several
new services, optimizations of existing components, and new ported libraries.
In particular, the Noux runtime has reached a point where we can principally
execute serious networking applications such as the Lynx web browser natively
on Genode. Another example is the new FFAT-based file-system service, which
makes persistent storage available via Genode's file-system interface. By
combining this new service with existing components such as the partition
service, Noux, or the file-system plugin of the libc, a lot of new application
scenarios become available. Thanks to these new components, the framework has
become able to perform on-target debugging via GDB running in Noux, or host
the genode.org website via the lighttpd web server,
:What about the road map?:
Those of you who track the milestones laid out in our [http:/about/road-map - road map]
may wonder how Genode 12.08 relates to the stated goals. In fact, several
points of the road map haven't received the attention as originally planned.
As an explanation, let us quote the paragraph right atop of the road-map page:
"The road map is not fixed. If there is commercial interest of pushing the
Genode technology to a certain direction, we are willing to revisit our plans."
Well, this is what happened. So we traded the work on the tiled window manager,
the Intel wireless driver, and SMP support for the work on the platform topics
outlined above. Nevertheless, we stick to our overall plan to turn Genode into
a general-purpose OS that is fit for use by its developers by the end of the
year. If looking closely at the additions that come with the current release,
it will become apparent how well they fit into the big picture.
Genode on naked ARM hardware
############################
One of Genode's most distinguishing properties is the ability to use the framework
on top of a range of different kernels. This way, users of the framework
benefit from the wide variety of features provided by those kernels while
only dealing with a single API and configuration concept. For example, we
frequently find ourselves using the Linux kernel as base platform while
developing services, interfaces, and protocol stacks. By being able to start
Genode as a regular program, we effectively eliminate the reboot-time for each
test run and enjoy using commodity debugging and profiling tools. On the other
hand, if high security is a concern, NOVA and Fiasco.OC provide
capability-based security at kernel-level. So the use of one of those kernels
is desirable. Genode allows for switching between those vastly different
kernels almost seamlessly.
In general, a Genode system consists of a kernel, Genode's core, and the
largely generic components on top of core. Core abstracts away the
peculiarities of the respective kernel and provides a unified API to the
components on top. From the application's point of view both kernel and core
are always at the root of the process tree and thereby are a inherent part of
the application's trusted computing base (TCB). The distinction of both
programs is almost superficial.
Since both the kernel and core must be ultimately trusted, the complexity of
both programs is critical for each Genode-based system. On our quest for
minimizing the TCB complexity so far, however, we did not question the role of
the kernel as an inherent part of the TCB and focused our attention to the
software stack on top. However, with more and more kernels entering the
picture, we identified that there is typically a considerable overlap in
functionality between kernel and core. For example, both need to know about
address spaces and their relationship to physical memory objects. Most kernels
keep track of memory mappings in an in-kernel database. Core also needs to keep
track of this information. Consequently, we found several information
replicated without a clear benefit. With this comes a seemingly significant
redundancy of code for data structures, allocators, and utility functions.
Furthermore, there exists a class of problems that must be solved by the kernel
and core alike. In particular the resource management of dynamically allocated
in-kernel objects respectively in-core objects. Whereas core uses Genode's
resource-trading concept to solve this problem, most kernels lack a good
solution for the management of in-kernel resources and are consequently prone
to resource exhaustion problems.
Out of these observations, the idea was born to explore the opportunities of
merging both programs into one and thereby eliminating the redundancies. Our
first attempt to go into this direction was the 'base-mb' platform, which
enabled us to run Genode on the Xilinx MicroBlaze softcore CPU. With this
experiment, we gained confidence that the approach is generally feasible. So we
took on the challenge to implement the idea of a hybrid kernel/core on a more
complex architecture namely ARM Cortex-A9.
The 'base-hw' platform introduced with the current release is the intermediate
result of our experiment. With this base platform, core plays the role of core
and the kernel within one program. A few code paths that require execution in
privileged mode are executed in kernel mode whereas most code paths are
executed in user mode. Both user mode code and kernel mode code run in the same
address space. The kernel portion merely provides a few basic mechanisms
without performing complex operations such as dynamic memory allocations. For
example, if core is requested to create a new thread via core's CPU session
interface, the user-level code within core allocates a KTCB (kernel thread
control block) and UTCB (user-level thread-control block) from the physical
memory allocator and passes both physical addresses to the kernel function that
spawns the actual thread. This way, we can employ Genode's resource-trading
concept for managing typical kernel resources.
The experiment turned out to be a great success. Traditionally, we would account
at least 10,000 lines of code (LOC) for the kernel. Most kernels are actually
much larger than that. Core comes at a complexity of another 10,000 LOC. So
both kernel and core make up a base line of TCB complexity of more than 20,000
LOC. By co-locating core with the kernel, we end up with a program of just
about 13,000 LOC. The vast reduction of TCB complexity compared to having
kernel and core as separate programs strikes us.
The 'base-hw' version of core supports the complete Genode API covering support
for user-level device drivers, synchronous RPCs, asynchronous notifications,
shared memory, and managed dataspaces. It is thereby able to execute the
sophisticated Genode scenarios on top including the GUI, the dynamic linker,
and user-level device drivers. That said, we regard the current version still
as work in progress. We successfully use it as an experimentation platform for
ongoing research activities (i.e., for exploring ARM TrustZone) but some
important features such as capability-based security are not yet implemented.
:Using the base-hw platform:
The new base platform is fully integrated with Genode's build system.
When listing the supported base platforms via the 'tool/create_builddir' tool,
you will see the new 'hw_panda_a2', 'hw_vea9x4', 'hw_pbxa9' choices of
build-directory templates. The latter platform enables you to run a
'base-hw' Genode system on Qemu.
[http://genode.org/documentation/platforms/hw - Learn more about using the new base-hw platform...]
For running Genode directly on the Pandaboard, please refer to the
[http://genode.org/documentation/platforms/hw_panda_a2 - Pandaboard-specific documentation...]
Embracing the NOVA Hypervisor
#############################
NOVA is a so-called microhypervisor for the x86 architecture. It combines the
principles of microkernels with capability-based security and hardware-assisted
virtualization. Among the various base platforms supported by Genode, NOVA's
kernel interface stands out for being extremely minimalistic and orthogonal,
even by microkernel standards.
Genode has supported NOVA as base platform since 2010. But because we used NOVA
solely for sporadic research activities and NOVA's lack of a regular release
schedule, the framework's platform support received only little attention. This
has changed now. NOVA's main developer Udo Steinberg moved from TU Dresden to
Intel Labs where he leads the development of NOVA as a true Open-Source
project. In fact, the code is now being hosted at GitHub:
:[https://github.com/IntelLabs/NOVA]:
NOVA hypervisor at GitHub
Since its move to GitHub, the hypervisor has already seen significant
improvements. The repository is continuously updated, which enables us to stay
in a close feedback loop with the NOVA developers. This change of how NOVA's
development is conducted ignited our renewed interest in promoting this
platform to a first-level citizen of our framework. The first noteworthy
improvement is the recently added 64-bit support of NOVA. We enabled Genode to
work with both variants of the kernel - 32 bit and 64 bit.
But this was just the first step. The second major change addresses the
allocation of kernel resources. Early versions of the hypervisor allowed each
process to create kernel objects and thereby indirectly consume the limited
memory resources of the kernel. This is perfectly fine for a research project
but it becomes a potential denial-of-service problem in real-world use cases.
For this reason, newer versions introduced the ability to retain the allocation
of kernel objects within a trusted component only. In the Genode world, this
component is naturally core. Even though NOVA still lacks a flexible concept for
kernel-resource management as of now, Genode has become able to use NOVA
without suffering the inherent resource management limitation. This is achieved
because core is able to arbitrate the allocation of kernel resources.
The third fundamental change is the abolishment of the last traces of global
names in a NOVA-based Genode system. There are no thread IDs, object IDs, or
any other kind of globally meaningful names. Each process has a local view on
(a small part of) the system only. If a process interacts with another process,
the kernel translates the references to remote objects from one namespace to
the other. The security implications are eminent. First, a process can only
interact with or refer to objects for which it has a name, which vastly reduces
problems of ambient authority. Second, because the kernel translates names, it
becomes impossible to forge object identities. If a process tried to pass a
forged object reference to another process, the translation would simply fail,
rendering the attack ineffective.
The described changes do not come without issues, though. To make the NOVA
kernel fit with Genode's requirements, minor patches of the hypervisor are
needed. The patches are located at 'base-nova/patches/'. However, those patches
are meant as interim solutions until we find mechanisms that fit well with the
design of the hypervisor and also fulfil our requirements.
So far, we greatly enjoyed the revived collaboration with the NOVA developers
and congratulate Udo Steinberg for the new mode of development of the
hypervisor.
Base framework
##############
In the following, we describe changes of the base API that may affect users of
the framework.
:Allocation of DMA buffers:
We extended the RAM session interface with the ability to allocate DMA buffers.
The client specifies the type of RAM dataspace to allocate via the new 'cached'
argument of the 'Ram_session::alloc()' function. By default, 'cached' is true,
which corresponds to the common case and the original behavior. When setting
'cached' to 'false', core takes the precautions needed to register the memory
as uncached in the page table of each process that has the dataspace attached.
Currently, the support for allocating DMA buffers is implemented for Fiasco.OC
only. On x86 platforms, it is generally not needed. But on platforms with more
relaxed cache coherence (such as ARM), user-level device drivers should always
use uncacheable memory for DMA transactions.
:MMIO framework improvements:
As we find ourselves increasingly using the 'Register' and 'Mmio' templates
provided by 'util/register.h' and 'util/mmio.h' for dealing with memory-mapped
devices, we extended the utilities with support for 64-bit registers and a new
interface for polling bit states. The latter functionality is provided by the
new 'wait_for' function template. To decouple the MMIO-related utility code
from an actual timer facility, the function takes a so-called 'delayer' functor
as argument. This way the user of the MMIO framework is able to pick a timer
facility that fits best with the device.
:New 'memcpy' implementation:
The memory-copy functions provided by 'util/string.h' are extremely simple
and arguably slow, particularly on platforms where byte-wise copy operations
are not supported by the CPU (i.e., ARM). Hence, we have added a CPU-specific
memcpy function ('memcpy_cpu') to 'cpu/string.h', which enables us to
provide optimized implementations. So far, we did so for the ARM architecture.
Low-level OS infrastructure
###########################
FFat-based file-system service
==============================
With the previous release, we introduced Genode's file-system interface
accompanied with a simple in-memory file-system service. With the addition of
'ffat_fs', the current release adds the first persistent file system to the
framework. The service is located at 'libports/src/server/ffat_fs'. It uses
Genode's 'Block::Session' interface as back end. Therefore, it can be combined
with any of Genode's block-device drivers and the partition service called
'part_blk'. To see the new 'ffat_fs' service in action, please refer to the new
'libports/run/libc_ffat_fs.run' script.
On the course of our work on the 'ffat_fs' service, we enabled support for long
file names in libffat and added 'lseek' support to the 'libc_ffat' plugin.
TAR-based file-system service
=============================
The new 'tar_fs' service located at 'os/src/server/tar_fs' provides a read-only
file-system session interface by reading data from a TAR archive, which, in
turn, is fetched from a ROM service. By combining 'tar_fs' with the 'libc_fs'
plugin, it becomes easy to provide customized pseudo file systems to individual
Genode programs. For example, one instance of 'tar_fs' containing a static
website and a web-server configuration can be provided as file system to a web
server. The configuration is similar to the patterns known from the 'tar_rom'
and 'ram_fs' servers:
! <config>
! <archive name="tar_archive.tar" />
! <policy label="label_of_client" root="/rootdir/for/client" />
! </config>
The policy node allows for assigning different parts of one TAR archive to
different clients. For a practical usage example of 'tar_fs', please refer to
the 'libports/run/libc_fs_tar_fs.run' script.
Terminal improvements
=====================
Our work on running a growing number of command-line-based Unix programs via
Noux prompted us to improve our terminal implementation as needed. To ease
debugging for terminal colors, we changed the previous default color scheme to
fully saturated combinations of red, green, and blue. Albeit this looks quite
painful on the eyes, it is easier to spot wrong colors when using a program
that uses ncurses, for example Lynx. Furthermore, we added the handling of
sgr0 and sgr escape sequences and thereby enabled Lynx to become almost
usable when running within Noux.
Terminal cross-link service
===========================
The 'Terminal::Session' interface gets increasingly popular within Genode.
It is used by the UART drivers, the graphical terminal, GDB monitor, the TCP
terminal, and Noux. For most of these programs, their respective client or
server role is quite clear but we find ourselves tempted to combine components
in unusual ways. For example, to let Noux run an instance of GDB, which operates
on a terminal via a virtual character device. For remote debugging, GDB plays
the role of a terminal client and the UART driver plays the role of the server.
But when running GDB monitor on the same machine, GDB monitor will also
expect to play the role of the client. In order to connect GDB monitor
to a local instance of GDB, both of them being terminal clients, we need an
adapter component. This is where the new terminal cross-link service enters
the picture. It plays the role of a terminal server between exactly two
clients. The output of one client ends up as input to the other and vice
versa. Data sent to the server gets stored in a buffer of 4096 bytes (one
buffer per client). As long as the data to be written fits into the buffer, the
'write()' call returns immediately. If no more data fits into the buffer, the
'write()' call blocks until the other client has consumed some of the data from
the buffer via the 'read()' call. The 'read()' call never blocks. A signal
receiver can be used to block until new data is ready for reading.
The new terminal crosslink can be tested via the 'os/run/terminal_crosslink.run'
script. It is also used for the just mentioned on-target debugging scenario
demonstrated by the 'ports/run/noux_gdb.run' script.
DMA-aware and optimized packet streams
======================================
Motivated by our work on OMAP4 platform support, we introduced API extensions
for handling of DMA buffers to the following interfaces:
:'Attached_ram_dataspace':
The convenience utility for allocating and locally mapping a RAM dataspace
has been enhanced with the 'cached' constructor argument, which is true
by default. When using 'Attached_ram_dataspace' for allocating DMA buffers,
this argument should be set to false.
:Block and network packet stream:
The 'Block::Session' and 'Nic::Session' interfaces use Genode's packet stream
facility for transferring bulk payload between processes. A packet stream
combines shared memory with asynchronous notifications and thereby facilitates
the use of batched packet processing. To principally enable zero-copy semantics
for device drivers, the packet-stream buffer is now explicitly allocated as DMA
buffer. This clears the way to let the SD-card driver direct DMA transactions
right into the packet stream buffer. Consequently, when attaching the SD-card
driver directly to a file system, there is no copy of payload needed.
The 'Nic::Session' interface has further been improved by using a fast
bitmap allocator for allocations within the packet-stream buffer. This is
possible because networking packets have the MTU size as an upper limit.
In contrast to the 'Block::Session' interface where requests are relatively
large, 'Nic::Session' packets are tiny, and thus, greatly benefit from the
optimized allocator.
Libraries and applications
##########################
C runtime
=========
:File I/O:
We complemented our C runtime with support for the 'pread', 'pwrite', 'readv',
and 'writev' functions. The 'pread' and 'pwrite' functions are shortcuts for
randomly accessing different parts of a file. Under the hood, the functions are
implemented via 'lseek' and 'read/write'. To provide the atomicity of the
functions, a lock guard prevents the parallel execution of either or both
functions if called concurrently by multiple threads. The 'readv' and 'writev'
functions principally enable the chaining of multiple I/O requests.
Furthermore, we added 'ftruncate', 'poll', and basic support for (read-only)
mmapped files to the C runtime.
:Libc RPC framework headers:
Certain RPC headers of the libc are needed for compiling 'getaddrinfo.c'.
Unfortunately that means we have to generate a few header files, which we do
when we prepare the libc.
New and updated 3rd-party libraries
===================================
:Expat:
[http://expat.sourceforge.net - Expat] is an XML parsing library. The port of
this library was motivated by our goal to use the GNU debugger for on-target
debugging. GDB depends on this library.
:MPC and GMP:
We complemented our existing port of the
[http://gmplib.org - GNU multiple precision arithmetic library (libgmp)] with
support for the x86_64 and ARM architectures. This change combined with the
port of the [http://www.multiprecision.org/index.php?prog=mpc - MPC library]
enables us to build the Genode tool chain for these architectures.
:OpenSSL:
Our port of OpenSSL has been updated to version 1.0.1c. Because libcrypto
provides certain optimized assembler functions, which unfortunately are not
expressed with position-independent code, we removed this assembler code and
build libcrypto with '-DOPENSSL_NO_ASM'. Because the assembler code is not
needed anymore, its generation is also removed from 'openssl.mk'.
:Light-weight IP stack (lwIP):
We enabled the lwIP TCP/IP stack for 64-bit machines and updated the library to
version 1.4.1-rc1. With the new version, the call of 'lwip_loopback_init' is
not needed anymore because lwIP always creates a loopback device. Hence, we
will be able to remove the 'libc_lwip_loopback' in the future. For now, we keep
it around so we currently do not need to update the other targets that depend
on it.
:PCRE:
[http://www.pcre.org/ - PCRE] is a library for parsing regular rexpressions. We
require this library for our ongoing work on porting the lighttpd webserver.
Lighttpd web server
===================
The [http://www.lighttpd.net/ - Lighttpd] web server has been added to the
'ports' repository. The port runs as a native Genode application and ultimately
clears the way to hosting the genode.org website on Genode. To test drive this
scenario, please give the 'ports/run/genode_org.run' script a try.
At the current stage, the port is still quite limited. For example, it does not
make use of non-blocking sockets yet. But the 'genode_org.run' run script
already showcases very well how simple a Genode-based web-server appliance can
look like.
Device drivers
##############
OMAP4 platform drivers
======================
:HDMI output:
The new HDMI driver at 'os/src/drivers/framebuffer/omap4' implements Genode's
'Framebuffer::Session' interface by using the HDMI output of OMAP4. The current
version sets up a fixed XGA screen mode of 1024x768 with the RGB565 pixel
format.
:SD-card:
The new SD card driver at 'os/src/drivers/sd_card/omap4' allows the use of a
HDSD card with the Pandaboard as block service. The driver can be tested using
the 'os/run/sd_card.run' script. Because it implements the generic
'Block::Session' interface, it can be combined with a variety of other
components such as 'part_blk' (for accessing individual partitions) or
'ffat_fs' for accessing a VFAT file system on the SD card.
The driver uses the master DMA facility of the OMAP4 SD-card controller, which
yields to good performance at low CPU utilization. The throughput matches (and
in some cases outperforms) the Linux kernel driver. In the current version,
both modes of operation PIO and DMA are functional. However, PIO mode is
retained for benchmarking purposes only and will possibly be removed to further
simplify the driver.
:USB HID:
The OMAP4-based Pandaboard relies on USB for attaching input devices.
Therefore, we need a complete USB stack to enable the interactive use of the
board. Instead of implementing a USB driver from scratch, we built upon the USB
driver introduced with the Genode release 12.05. This driver was ported from the
Linux kernel.
:Networking:
The Pandaboard realizes network connectivity via the SMSC95xx chip attached to
the USB controller. Therefore, we enhanced our USB driver with support for USB
net and the smsc95xx driver. In addition to enabling the actual device-driver
functionality, the USB stack has received much attention concerning performance
optimizations. To speed up the allocation of SKBs, we replaced the former
AVL-tree based allocator with a fast bitmap allocator. For anonymous
allocations, we introduced a slab-based allocator. Furthermore, we introduced
the distinction between memory objects that are subjected to DMA operations
from non-DMA memory objects. The most profound conceptual optimization is the
use of transmit bursts by the driver. The Linux kernel, which our driver
originates from, does not provide an API for transmitting multiple packets as a
burst. For our driver, however, this optimization opportunity opened up thanks
to Genode's packet stream interface, which naturally facilitates the batching
of networking packets. So the driver has all the information needed to create
burst transactions.
USB driver
==========
By testing our new USB driver on a variety of real PC hardware, we discovered
several shortcomings, which we resolved. In particular, we added support for
more than one UHCI controller, make sure that the 'PIRQ' bit in the legacy
support register (PCI config space) of the UHCI controller is enabled and that
the 'Trap on IRQ' bit is disabled.
With those modifications in place, the USB driver works reliably on the tested
platforms.
Runtime environments
####################
Noux
====
Noux enables the easy reuse of unmodified GNU software on Genode by providing
a Unix-like kernel interface as user-level service. Because Noux is pivotal for
our plan to use Genode for productive work, we significantly enhanced and
complemented its feature set.
:Noux on ARM and x86_64:
For keeping the scope of the development manageable, the initial version of
Noux was tied to the x86_32 platform. This was not a principal limitation of
the approach but rather an artificial restriction to keep us focused on
functionality first. Now that Noux reaches a usable state, we desire to use it
on platforms other than x86_32. The current release enables Noux for the 64-bit
x86 and ARM architectures.
The level of support is pretty far-reaching and even includes the building and
execution of the Genode tool chain on those platforms. In the process of
enabling these platforms, we updated the Noux package for GCC to version 4.6.1,
which matches the version of the current Genode tool chain.
:Terminal file system:
Noux supports the concept of stacked file systems. The virtual file system
is defined at the start of a Noux instance driven by the static Noux
configuration. This way, arbitrary directory structures can be composed out
of file-system sessions and TAR archives. The VFS concept allows for the
easy addition of new file system types. To allow programs running in a Noux
instance to communicate over a dedicated terminal session, we added a new
file-system type that corresponds to a virtual character device node attached
to a terminal session.
:GDB running in the Noux environment:
With the terminal file system in place, we are ready to execute GDB within
Noux and let it talk to a GDB monitor instance over the terminal session
interface. From GDB's point of view, the setup looks like a remote debugging
session. But in reality both the debugging target and GDB reside in different
subtrees of the same Genode system.
:Executing shell scripts:
By inspecting the program specified to the execve system call, Noux has become
able to spawn scripts that use the '#!' syntax. If such a file is detected, it
executes the specified interpreter instead and passes the arguments specified
after the '#!' marker, followed by command-line arguments.
:Networking support:
Our work on porting various networking tools to Noux triggers us to steadily
improve the networking support introduced with Genode 12.05. In particular, we
added proper support for DNS resolving, which enables us to execute the
command-line based Lynx web browser within Noux.
:User information:
Because there are certain programs, which need the information that is stored
in 'struct passwd', we introduced configurable user information support to
Noux. One can set the user information via the '<user>' node in the Noux
config:
! <config>
! <user name="baron" uid="1" gid="1">
! <shell name="/bin/bash" />
! <home name="/home" />
! </user>
! ...
! </config>
When '<user>' is not specified, default values are used. Currently these
are 'root', 0, 0, '/bin/bash', '/'. Note that this is just a single user
implementation because each Noux instance has only one user or rather one
identity and there will be no complete multi-user support in Noux. If you need
different users, just start new Noux instances for each of them.
:New '/dev/null' and '/dev/zero' pseudo devices:
These device are mandatory for most programs (well, at least null is required
to be present for a POSIX compliant OS, which Noux is actually not). But for
proper shell-script support we will need them anyway. Under the hood, both
pseudo devices are implemented as individual file-systems and facilitate Noux's
support for stacked file systems. The following example configuration snippet
creates the pseudo devices under the '/dev' directory.
! <config>
! <fstab>
! <dir name="dev" >
! <null /> <zero />
! </dir>
! ...
! <fstab>
! ...
! </config>
Vancouver
=========
The comprehensive rework of the NOVA base platform affected the Genode version
of the Vancouver virtual machine monitor as this program used to speak directly
to the NOVA kernel. Since no kernel objects can be created outside of core
anymore, the Vancouver port had to be adjusted to solely use Genode interfaces.
L4Linux
=======
To improve the stability and performance of L4Linux on OMAP4 platforms, we
reworked parts of the Genode-specific stub drivers, in particular the
networking code. Among the improvements are the use of a high-performance
allocator for networking packets, improved IRQ safety of IPC calls (to
the Genode world), and tweaks of the TCP rmem and wmem buffer sizes to
achieve good TCP performance when running Linux with little memory.
Furthermore, we added two ready-to-use run scripts residing within
'ports-foc/run' as examples for executing L4Linux on the OMAP4-based
Pandaboard. The 'linux_panda.run' script is meant as a blue print for
experimentation. It integrates one instance of L4Linux with the native SD-card
driver, the HDMI driver, and the USB HID input driver. The
'two_linux_panda.run' script is a more elaborative example that executes two
instances of L4Linux, a block-device test, and a simple web server. Each of
the L4Linux instances accesses a different SD-card partition whereas the
block-device test operates on a third partition.

View File

@@ -1,735 +0,0 @@
===============================================
Release notes for the Genode OS Framework 12.11
===============================================
Genode Labs
The central theme of version 12.11 of the Genode OS Framework is
self-hosting Genode on Genode. With self-hosting, we understand the execution of the
entire Genode build system within the Genode environment. There are two motivations
for pursing this line of work. First, it is a fundamental prerequisite for the
Genode developers to move towards using Genode as a day-to-day OS. Of course,
this prerequisite could be realized using one of the available virtualization
solutions. For example, we could run L4Linux on top of Genode on the Fiasco.OC
kernel and use the Genode build system from within an L4Linux instance.
However, this defeats the primary incentive behind Genode to reduce system
complexity. By having both Genode and L4Linux in the picture, we would indeed
increase the overall complexity in configuring, maintaining, and using the
system. Therefore, we would largely prefer to remove the complex Linux user
land from the picture. The second motivation is to prove that the framework and
underlying base platforms are suited and stable enough for real-world use.
If the system is not able to handle a workload like the build system,
there is little point in arguing about the added value of having a
microkernel-based system over current commodity OSes such as GNU/Linux.
We are happy to have reached the state where we can execute the unmodified
Genode build system directly on Genode running on a microkernel. As the
build system is based on GNU utilities and the GNU compiler collection,
significant effort went into the glue between those tools and the Genode API.
Section [Building Genode on Genode] provides insights into the way we achieved
the goal and the current state of affairs.
Along with the work on bringing the build system to Genode came numerous
stability improvements and optimizations all over the place, reaching from the
respective kernels, over the C runtime, the file-system implementations, memory
allocators, up to the actual programs the tool chain is composed of. Speaking
of the tool chain, the official Genode tool chain has been updated from GCC
version 4.6.1 to version 4.7.2. Thereby, all 3rd-party code packages were
subjected to testing and fixing activities.
For running the build system, the project currently focuses on NOVA and
Fiasco.OC as base platforms. However, our custom kernel platform for the ARM
architecture has also received significant improvements. With added support for
Freescale i.MX and Texas Instruments OMAP4, this platform proved to be very
well adaptable to new SoCs whereas new cache handling brings welcome
performance improvements. Furthermore, we have added experimental support for
ARM TrustZone technology, which principally enables the execution of Genode in
the so-called secure world of TrustZone while executing Linux in the so-called
normal world.
As we discovered the increasing interest in using Genode as a middleware
solution on Linux, we largely revisited the support for this kernel platform
and discovered amazing new ways to align the concept of Genode with the
mechanisms provided by the Linux kernel. Section [Linux] provides a summary
of the new approaches taken for supporting this platform.
Functionality-wise, the new version introduces support for audio drivers of
the Open Sound System, a new OMAP4 GPIO driver, improvements of the graphical
terminal, and the initial port of an SSH client.
Building Genode on Genode
#########################
On the Genode developer's way towards using Genode as a day-to-day OS, the
ability to execute the Genode build system within the Genode environment is a
pivotal step - a step that is highly challenging because the build system is
based on the tight interplay of many GNU programs. Among those
programs are GNU make, coreutils, findutils, binutils, gcc, and bash. Even
though there is a large track record of individual programs and libraries ported
to the environment, those programs used to be self-sustaining applications that
require only little interaction with other programs. In contrast, the build
system relies on many utilities working together using mechanisms such as
files, pipes, output redirection, and execve. The Genode base system does not
come with any of those mechanisms let alone the subtle semantics of the POSIX
interface as expected by those utilities. Being true to microkernel principles,
Genode's API has a far lower abstraction level and is much more rigid in scope.
To fill the gap between the requirements of the build system and the bare
Genode mechanisms, the Noux runtime environment was created. Noux is a Genode
process that acts like a Unix kernel. When started, it creates a child process,
which plays a similar role as the init process of Unix. This process communicates
via RPC messages to Noux. Using those messages, the process can perform all the
operations normally provided by a classical Unix kernel. When executed under
Noux, a process can even invoke functionalities such as fork and execve, which
would normally contradict with Genode's principles of resource management.
Over the course of the past year, more and more programs have been ported to
the Noux environment. Thereby, the semantics provided by Noux have been
successively refined so that those program behave as expected. This was an
iterative process. For example, at the beginning, Noux did not consider the
differences between 'lstat' and 'stat' as they did not matter for the first
batch of GNU programs ported to Noux. As soon as the programs got more
sophisticated, such shortcuts had to be replaced by the correct semantics. The
Genode build system is by far the most complex scenario exposed to Noux so far.
It revealed many shortcomings by both functionality implemented in Noux or the
C runtime as well as the underlying base platforms. So it proved to be a great
testing ground for analysing and improving those platform details. Therefore,
the secondary effects of self-hosting Genode on Genode in terms of stability
turned out to be extremely valuable.
The release comes with two ready-to-use run scripts for building bootable
system images that are able to execute the Genode tool chain, one for targeting
NOVA and one for targeting Fiasco.OC. Those run scripts are located at
'ports/run/' and called 'noux_tool_chain_nova.run' and 'noux_tool_chain_foc.run'
respectively. Each of those run scripts can be executed on either of those base
platforms. For example, by executing 'noux_tool_chain_nova' on Fiasco.OC, the
image will run Genode on Fiasco.OC and the tool chain will build binaries for
NOVA. When started, a build directory will be created at '/home/build'.
The Genode source code is located at '/genode'. In the '/bin' directory,
there are all the GNU programs needed to execute the tool chain. For
taking a look into the source code, 'vim' is available. To build core,
change to the build directory '/home/build' and issue 'make core'.
On Fiasco.OC, the complete Genode demo scenario can be compiled. On NOVA, the
incomplete life-time management of kernel objects will still result in an
out-of-memory error of the kernel. This kernel issue is currently being worked
on. Executing the tool chain on either of those platforms is still relatively
slow as extensive trace output is being generated and no actions have been taken to
optimize the performance so far. There are many opportunities for such
optimizations, which will be taken on as the next step.
Base framework
##############
Genode's base framework has received new support for extending session
interfaces and gained improvements with regard to interrupt handling on the x86
platform. At the API level, there are minor changes related to the CPU session
and 'Range_allocator' interfaces.
Support for specializing session interfaces
===========================================
With increasingly sophisticated application scenarios comes the desire to
extend Genode's existing session interface with new functionality. For example,
the 'Terminal::Session' interface covers plain read and write operations. It is
implemented by services such as a graphical terminal, the telnet-like TCP
terminal, or UART drivers. However, for the latter category, the breadth of the
interface is severely limited as UART drivers tend to supplement the read / write
interface with additional control functions, e.g., for setting the baud rate.
One way to go would be to extend the existing 'Terminal::Session' interface
with those control functions. However, these functions would be meaningless for
most implementations. Some of those other implementations may even desire their
own share of additions. In the longer term, this approach might successively
broaden the interface and each implementation will cover a subset only.
Because Genode aspires to keep interfaces as low-complex as possible while, at
the same time, it wants to accommodate the growing sophistication of usage
scenarios, we need a solution that scales. The solution turns out to be
strikingly simple. The RPC framework already supports the inheritance of RPC
interfaces. So it is possible to model the problem such that a new
'Uart::Session' interface derived from the existing 'Terminal::Session' will
be the host of UART-specific functionality. The only piece missing is the
propagation of both 'Uart' and 'Terminal' through the parent interface while
announcing the service. To spare the work of manually announcing the chain of
inherited interfaces from the implementor, the 'Parent::announce()' function has
been enhanced to automatically announce all service types implemented by the
announced interface. This way, a UART driver will always announce a "Uart"
and a "Terminal" service.
Improved interrupt handling
===========================
To accommodate modern x86 platforms, the session arguments of core's IRQ
service have been supplemented with the IRQ mode. There are two degrees of
freedom, namely the trigger (level / edge) and polarity (high / low). Thanks to
this addition, device drivers have become able to supply their knowledge of
devices to core.
In system scenarios with many peripherals, in particular when using the USB
driver, IRQ lines are shared between devices. Until now, Genode supported
shared interrupts for the OKL4 base platform only. To also cover the other
x86 kernels, we have generalized the interrupt sharing code and enabled this
feature on Fiasco.OC and NOVA.
Revised CPU session interface
=============================
We revisited the CPU session interface, removed no-longer used functions and
added support for assigning threads to CPUs.
The original CPU session interface contained functions for iterating through
the threads of a session. This interface was originally motivated by an
experimental statistical profiling tool that was developed at an early stage of
Genode. In the meanwhile, we discovered that the virtualization of the CPU
session interface is much more elegant to cover this use case than the
thread-iterator interface. Because the iteration has no transactional
semantics, it was unsafe to use it anyway.
To enable the use of multiple CPUs on multi-processor systems, the CPU
session interface has been enhanced with two functions, namely 'affinity'
and 'num_cpus'. The interface extension principally allows the assignment of
individual threads to CPUs. It is currently implemented on Fiasco.OC only.
On all other base platforms, 'num_cpus' returns one CPU. Note that on
the Linux platform, multiple CPUs will be used transparently.
The 'Cpu_session::state' function has been split into two functions, one
for retrieving information and one for propagating state information. The
prior interface was less explicit about the semantics of the 'state' function
as it took a non-const pointer to a 'Thread_state' object as argument.
Platform-tailored protection domains
====================================
Genode tries to provide a uniform API across all the different base platforms.
Yet, it also strives to make genuine platform features available to the
users of the framework. Examples for such features are the virtualization
support of the NOVA hypervisor or the special support for paravirtualizing
Linux on Fiasco.OC. Another example is the security model as found on the Linux
platform. Even though the security mechanisms of plain Linux are not as strong
as Genode's capability concept on a conceptual level, we still want to leverage
the available facilities such as user IDs and chroot as far as possible.
Consequently, we need a way to assign platform-specific properties to PD
sessions. With the new 'Native_pd_args' type introduced into
'base/native_types.h', there is now a way to express those platform-specific
concerns. This type is now used at all the places that deal with the creation
of protection domains such as 'Process', 'Child', and the loader.
Revised 'Range_allocator' interface
===================================
The handling of allocation errors has been refined in order to distinguish
different error conditions, in particular out-of-metadata and out-of-memory
conditions. The user of the allocator might want to handle both cases
differently. Hence we return an 'Alloc_return' value as result. In prior
versions, this type was just an enum value. With the new version, the type has
been changed to a class. This makes the differentiation of error conditions at
the caller side more robust because, in contrast to enum values, typed objects
don't get implicitly converted to bool values.
Low-level OS infrastructure
###########################
New UART session interface
==========================
To accommodate UART specific extensions of the 'Terminal::Session' interface,
in particular setting the baud rate, we introduced the new 'Uart::Session'
interface and changed the existing UART drivers to implement this
interface instead of the 'Terminal::Session' interface. Because 'Uart::Session'
inherits the 'Terminal::Session' interface, 'Uart' services announce both
"Uart" and "Terminal" at their parent.
New GPIO session interface
==========================
Embedded SoCs such as OMAP4 provide many general-purpose I/O pins, which can be
used for different purposes depending on the board where they are soldered on.
For example, the Pandaboard uses such GPIO pins to detect the presence of a
HDMI plug or control the power supply for the USB. If only one driver deals
with GPIO pins, the GPIO programming can reside in the driver. However, if
multiple drivers are used, the GPIO device resources cannot be handed out to
more than one driver. This scenario calls for the creation of a GPIO driver as
a separate component, which intermediates (and potentially multiplexes) the
access to the physical GPIO pins. The new 'Gpio::Session' interface allows one
or multiple clients to configure I/O pins, request states, as well as to
register for events happening on the pins.
Terminal
========
The graphical terminal has been enhanced with support for different built-in
font sizes and background-color handling.
In addition to those functional changes, the implementation has been decomposed
into several parts that thereby became reusable. Those parts comprise the
handling of key mappings, decoding the VT character stream, and the handling of
the character array. These functionalities are now available at
'gems/include/terminal'.
Libraries and applications
##########################
C runtime
=========
:Allocator optimized for small-object allocations:
To optimize the performance of workloads that depend on a large number of small
dynamic memory allocations, in particular the lwIP TCP/IP stack, we replaced
the memory allocator of the libc with a more sophisticated strategy. Until now,
the libc used 'Genode::Heap' as allocator. This implementation is an
AVL-tree-based best-fit allocator that is optimized for low code complexity
rather than performance for small allocations. The observation of the allocator
usage pattern of lwIP prompted us to replace the original libc malloc/free with
a version that uses slab allocators for small objects and relies on the
'Genode::Heap' for large objects only.
:Symbolic links:
Because part of our ongoing refinements of the Noux runtime is the provision of
symbolic links, support for symbolic links was added in the libc, libc plugins,
and file system servers.
lwIP
====
We updated the light-weight IP stack to version STABLE-1.4.1. Additionally,
the following optimizations were conducted to improve its performance and
robustness.
We reduced the maximum segment lifetime from one minute to one second to avoid
queuing up PCBs in TIME-WAIT state. This is the state, PCBs end up after
closing a TCP connection socket at the server side. The number of PCBs in this
state is apparently not limited by the value of 'MEMP_NUM_TCP_PCB'. One
allocation costs around 160 bytes. If clients connect to the server at a high
rate, those allocations accumulate quickly and thereby may exhaust the memory
of the server. By reducing the segment lifetime, PCBs in TIME-WAIT state are
cleaned up from the 'tcp_tw_pcbs' queue in a more timely fashion (by
'tcp_slowtmr()').
To prevent the TCP/IP stack from artificially throttling TCP throughput,
we adjusted lwIP's TCP_SND_BUF size.
From our work on optimizing the NIC stub-code performance of L4Linux as
described [http://genode.org/documentation/articles/pandaboard - here],
we learned that the use of a NIC-specific packet allocator for the
packet-stream interface is beneficial. At the lwIP back end, we still relied on
the original general-purpose allocator. Hence, we improved the lwIP back-end
code by using the bitmap-based 'Nic::Packet_allocator' allocator instead.
Standard C++ library
====================
Genode used to rely on the standard C++ library that comes with the tool chain.
However, this mechanism was prone to inconsistencies of the types defined in
the header files used at compile time of the tool chain and the types provided
by our libc. By building the C++ standard library as part of the Genode build
process, such inconsistencies cannot happen anymore. The current version of the
C++ standard library corresponds to GCC 4.7.2.
Note that the patch changes the meaning of the 'stdcxx' library for users that
happened to rely on 'stdcxx' for hybrid Linux/Genode applications. For such
uses, the original mechanism is still available, in the renamed form of
'toolchain_stdcxx'.
Device drivers
##############
Open Sound System
=================
Genode tries to re-use existing device drivers as much as possible using an
approach called device-driver environment (DDE). A DDE is a library that
emulates the environment of the original driver by translating device accesses
to the Genode API. There are many success stories of drivers successfully ported
to the framework this way. For example, using DDE-Linux, we are able to use the
Linux USB stack. Using DDE-ipxe, we are able to use iPXE networking drivers.
With Genode 12.11 we extend our arsenal of DDEs with DDE-OSS, which is a
device-driver environment for the audio drivers of the Open Sound System (OSS).
:Website of the Open Sound System:
[http://http://www.4front-tech.com]
The new 'dde_oss' contains all the pieces needed to use Intel HDA, AC97, and
ES1370 audio cards on Genode. On first use, the 3rd-party code can be
downloaded by issuing 'make prepare' from within the 'dde_oss' source-code
repository. Also, you need to make sure to add the 'dde_oss' repository to your
'REPOSITORIES' variable in 'etc/build.conf'.
An OSS demo configuration can be found under 'run/oss.run' and can be started
via 'make run/oss' from a Genode build directory. Be sure to adjust the
'filename' tag of the 'audio0' program. The file has to reside under
'<build-dir>/bin/'. The file format is header-less two-channel float-32 at
44100 Hz. You may use the 'sox' utility to create these audio files:
! sox -c 2 -r 44100 foo.mp3 foo.f32
OMAP4 GPIO driver
=================
The new OMAP4 GPIO driver is the first implementation of the just introduced
'Gpio::Session' interface. The driver supports two ways of interacting
with GPIO pins, by providing a static configuration, or by interacting with a
session interface at runtime. An example for a static configuration looks as
follows:
! <config>
! <gpio num="121" mode="I"/>
! <gpio num="7" mode="O" value="0"/>
! <gpio num="8" mode="O" value="0"/>
! </config>
The driver is located at 'os/src/drivers/gpio/omap4'. As reference for using
the driver, please refer to the 'os/run/gpio_drv.run' script.
Thanks to Ivan Loskutov of Ksys-Labs for contributing the session interface
and the driver!
iPXE networking drivers
=======================
We updated our device-driver environment for iPXE networking drivers to a
recent git revision and enabled support for the x86_64 architecture.
Currently, the driver covers Intel gigabit ethernet (e1000, e1000e, igb),
Intel eepro100, and Realtek 8139/8169.
Runtime environments
####################
Noux
====
The Noux runtime environment has received plenty of love thanks to the
aspiration to execute the Genode build system.
:Time:
The build system uses GNU make, which depends on time stamps of files. We do
not necessarily need a real clock. A monotonic increasing virtual time is
enough. To provide such a virtual time, the libc was enhanced with basic
support for functions like 'gettimeofday', 'clock_gettime', and 'utimes'. As
there is currently no interface to obtain the real-world time in Genode, Noux
simulates a pseudo real-time clock using a jiffies-counting thread. This
limited degree of support for time is apparently sufficient to trick tools like
ping, find, and make into working as desired.
:Improved networking support:
The Noux/net version of Noux extends the Noux runtime with the BSD-socket
interface by using the lwIP stack. This version of Noux multiplexes the
BSD-socket interface of lwIP to multiple Noux programs, each having a different
socket-descriptor name space and the principal ability to use blocking calls
such as 'select'. The code for multiplexing the lwIP stack among multiple Noux
processes has been improved to cover corner cases exposed by sophisticated
network clients, i.e., openssh.
:Directory cache for the TAR file system:
The original version of the TAR file system required a search in all TAR
records for each file lookup. This takes a long time when composing a large
directory tree out of multiple TAR archives stacked together. This is the case
for the Genode build-system scenario where we have all the files of the GNU
tools as well as the Genode source tree. Searching through thousands of records
for each call of 'stat' quickly becomes a scalability issue. Therefore, we
introduced a TAR indexing mechanism that scans each TAR file only once at the
startup of Noux and generates a tree structure representing the directory
layout. Looking up files using this index is quick.
:New packages:
With Genode-12.11, new 3rd-party packages have become available, namely
OpenSSH, the 'which' command, and all tool-chain components in their current
version. OpenSSH is still at an experimental stage. The run script at
'ports/run/noux_net_openssh_interactive.run' demonstrates how SSH can be used
to login into a remote machine.
:New pseudo file systems:
The new 'stdio' and 'random' file systems are intended to represent the pseudo
devices '/dev/random' and '/dev/tty' on Noux. Both are needed to run OpenSSH.
Note that the 'Arc4random' class, on which the random file system is based on,
currently _does not collect enough_ random bytes! It should not be used for
security-critical applications.
L4Linux
=======
The paravirtualized L4Linux kernel for the Fiasco.OC platform was updated to
SVN revision 25, which matches the Fiasco.OC SVN revision 40. We further
improved the integration of L4Linux with Genode by optimizing the stub drivers
for block devices and networking, and added principal support for running
L4Linux on SMP platforms.
Platforms
#########
NOVA
====
Genode follows the steady development of the NOVA microhypervisor very closely.
The kernel used by the framework corresponds to the current state of the master
branch of IntelLabs/NOVA.
:Improvements towards GDB support:
The NOVA-specific implementation of the CPU session interface has been improved
to accommodate the requirements posed by GDB. In particular, the 'pause',
'resume', 'state', and 'single_step' functions have been implemented. Those
functions can be used to manipulate the execution and register state of
threads. Under the hood, NOVA's 'recall' feature is used to implement these
mechanisms. By issuing a 'recall' for a given thread, the targeted thread is
forced into an exception. In the exception, the current state of the thread can
be obtained and its execution can be halted/paused.
:Maximizing contiguous virtual space:
To enable the Vancouver virtual machine monitor to hand out large amounts of
guest memory, we optimized core's virtual address space to retain large and
naturally aligned contiguous memory regions. For non-core processes, the
thread-context area that contains the stacks of Genode threads has been moved
to the end of the available virtual address space.
:Life-time management of kernel resources:
We improved the life-time management of kernel resources, in particular
capabilities, within Genode. Still the management of such kernel resources
is not on par with the Fiasco.OC version, partially because of missing
kernel functionality. This is an ongoing topic that is being worked on.
:Using the BIOS data area (BDA) to get serial I/O ports on x86:
If the I/O ports for the comport are non default (default is 0x3f8), we had to
specify manually the correct I/O ports in the source code. To avoid the need
for source-code modifications when changing test machines, we changed the core
console to read the BDA and use the first serial interface that is available.
If no serial interface is available, no device configuration will be
undertaken. The BDA can be populated via a multi-boot chain loader. Bender is
such a chain loader that can detect serial ports accessible via PCI and writes
the I/O ports to the Bios Data area (BDA). These values get then picked up by
core.
Fiasco.OC
=========
The Fiasco.OC kernel has been updated to the SVN revision 40. The update improves
SMP support and comes with various bug fixes. There is no noteworthy change
with regard to the kernel interface. We extended the number of supported
Fiasco.OC-based platforms for Genode by including the Freescale i.MX53.
To enable the use of multiple CPUs by Genode processes, the CPU session
interface has been enhanced to support configuring the affinity of threads with
CPUs. We changed the default kernel configuration for x86 and ARM to
enable SMP support and adapted L4Linux to use the new interface.
Execution on bare hardware (base-hw)
====================================
The development of our custom platform for executing Genode directly on bare
hardware with no kernel underneath went full steam ahead during the release
cycle.
:Pandaboard:
The in-kernel drivers needed to accommodate the Pandaboard, more specifically
the timer and interrupt controller, are now supported. So the Pandaboard can be
used with both 'base-hw' and 'base-foc'. Also, the higher-level platform
drivers for USB, HDMI, and SD-card that were introduced with the previous
release, are equally functional on both platforms.
:Freescale i.MX31:
We added principal support for the Freescale i.MX line of SoCs taking the
ARMv6-based i.MX31 as starting point. As of now, the degree of support is
limited to the devices needed by the kernel to operate. Pure software-based
scenarios are able to work, i.e., the nested init run script executes
successfully.
:TrustZone support:
The new VM session interface of core provides a way to execute software
in the normal world of a TrustZone system whereas Genode runs in the secure
world. From Genode's point of view, the normal world looks like a virtual
machine. Each time, the normal world produces a fault or issues a secure
monitor call, control gets transferred to the virtual machine monitor, which is
a normal user-level Genode process. The base-hw kernel has been enhanced to
perform world switches between the secure and normal world and with the ability
to handle fast interrupts (FIQs) in addition to normal interrupts. The latter
extension is needed to assign a subset of devices to either of both worlds.
Currently, the only TrustZone capable platform is the ARM CoreTile Express
CA9x4 for the Versatile Express board. For a virtual machine working properly
on top, some platform resources must be reserved. Therefore, there exist two
flavours of this platform now, one with the 'trustzone' spec-variable enabled
and one without. If 'trustzone' is specified, most platform resources (DDR-RAM,
and most IRQs) are reserved for the normal world and not available to the
secure Genode world.
:Memory attributes and caching:
We successively activated various levels of caching and improved the handling
of caching attributes propagated into the page tables. These changes resulted
in a significant boost in performance on non-emulated platforms.
Linux
=====
The Linux version of Genode was originally meant as a vehicle for rapid
development. It allows the framework components including core to be executed
as plain Linux processes. But in contrast to normal Linux programs, which
use the glibc, Genode's components interact with the kernel directly without
any C runtime other than what comes with Genode. We use the Linux version on a
regular basis to implement platform-agnostic functionality and protocols. Most
of Genode's code (except for device drivers) falls in this category. Because
the Linux version was meant as a mere tool, however, we haven't put much
thought into the principle way to implementing Genode's security concept on
this platform. Threads used to communicate over globally accessible Unix-domain
sockets and memory objects were represented as globally accessible files within
'/tmp'.
That said, even though Linux was not meant as a primary platform for Genode in
the first place, Genode can bring additional value to Linux. When considering
the implementation of a component-based system on Linux, there are several
possible approaches to take. For example, components may use DBus to
communicate, or components could pick from the manifold Unix mechanisms such as
named pipes, files, sysv-shared memory, signals, and others. Unfortunately
those mechanisms are not orthogonal and most of them live in the global name
space of the virtual file system. Whereas those mechanisms are principally able
to let processes communicate, questions about how processes get to know each
other, access-control policy, synchronization of the startup of processes are
left to the developer.
Genode, on the other hand, does provide an API for letting components
communicate but also answers those tricky questions concerning the composition
of components. This makes Genode an interesting option to build component based
applications, even on Linux. However, when used in such a context, the
limitations of the original Linux support need resolutions. Therefore, the
current release comes with a largely revised platform support for the Linux
base platform.
The changes can be summarized as follows:
:Using file descriptors as communication addresses:
Genode's synchronous RPC framework was using Unix domain sockets. Each RPC
entrypoint was represented by a pair of named files, one for sending and one
for receiving messages. In the new version, inter-process communication is
performed via file descriptors only.
:Transfer of communication rights via RPC only:
Capabilities used to be represented as a pair of the destination thread ID and
a global object ID. The thread ID has been replaced by a file descriptor that
points to the corresponding RPC entrypoint. When capabilities are transferred
as RPC arguments, those file descriptors are transferred via SCM rights
messages. This is in line with Genode's way of capability-based delegation of
access rights.
:Core-only creation of communication channels:
Communication channels used to be created locally by each process. The naming
of those channels was a mere convention. In contrast, now, communication
channels are created by core only and do not reside on the Linux virtual file
system. When creating an RPC entrypoint, core creates a socket pair and hands
out both ends to the creator of the entrypoint.
:Restricted access to memory objects:
Access to dataspace content was performed by mmap'ing a file. For a given
dataspace, the file name could be requested at core via a Linux-specific RPC
call. Now, core holds the file descriptors of all dataspaces, which are
actually unlinked files. A process that is in possession of a dataspace
capability can request the file descriptor for the content from core and mmap
the file locally. This way, access to memory objects is subjected to the
delegation of dataspace capabilities.
:Core-local process creation:
Genode used to create new processes by directly forking from the respective
Genode parent using the process library. The forking process created a PD
session at core merely for propagating the PID of the new process into core
(for later destruction). This traditional mechanism has the following
disadvantages:
First, the PID reported by the creating process to core cannot easily be
validated by core. Therefore core has to trust the PD client to not specify a
PID of an existing process, which would happen to be killed once the PD session
gets destructed. Second, there is no way for a Genode process to detect the
failure of any of its grandchildren. The immediate parent of a faulting process
could use the SIGCHLD-and-waitpid mechanism to observe its children but this
mechanism does not work transitively.
By performing the process creation exclusively within core, all Genode
processes become immediate child processes of core. Hence, core can respond to
failures of any of those processes and reflect such conditions via core's
session interfaces. Furthermore, the PID associated to a PD session is locally
known within core and cannot be forged anymore. In fact, there is actually no
need at all to make processes aware of any PIDs of other processes.
:Handling of chroot, user IDs, and group IDs:
With the move of the process creation into core, the original chroot trampoline
mechanism implemented in 'os/src/app/chroot' does not work anymore. A process
could simply escape the chroot environment by spawning a new process via core's
PD service. Therefore, chroot support has been integrated into core and the
chroot policy becomes a mandatory part of the process creation. For each process
created by core, core checks for a 'root' argument of the PD session. If a path
is present, core takes the precautions needed to execute the new process in the
specified chroot environment.
This conceptual change implies minor changes with respect to the Genode API and
the configuration of the init process. The API changes are the enhancement of
the 'Genode::Child' and 'Genode::Process' constructors to take the root path as
argument. Init supports the specification of a chroot per process by specifying
the new 'root' attribute to the '<start>' node of the process. In line with
these changes, the 'Loader::Session::start' function has been enhanced with the
additional (optional) PD argument.
In line with how the chroot path can be propagated into core, core has become
able to assign customized UIDs and GIDs to individual Genode processes or whole
Genode subsystems. The new 'base-linux/run/lx_uid.run' script contains an
example of how to use the feature.
Build system and tools
######################
The current release comes with a new tool chain based on GCC 4.7.2 and binutils
2.22. The tool-chain upgrade involved adapting the Genode code base and fixing
various issues in 3rd-party software. To obtain the new tool chain, please
refer to the tool-chain website:
:Genode tool chain:
[http://genode.org/download/tool-chain]

View File

@@ -1,941 +0,0 @@
===============================================
Release notes for the Genode OS Framework 13.02
===============================================
Genode Labs
Traditionally, the February release of Genode is focused on platform support.
The version 13.02 follows this tradition by vastly improving Genode for the
NOVA base platform and the extending the range of ARM SoCs supported by
both our custom kernel platform and the Fiasco.OC kernel.
The NOVA-specific improvements concern three major topics, namely the added
support for running dynamic workloads on this kernel, the use of IOMMUs, and
the profound integration of the Vancouver virtual machine monitor with the
Genode environment. The latter point is particularly exciting to us because
this substantial work is the first contribution by Intel Labs to the Genode
code base. Thanks to Udo Steinberg and Markus Partheymüller for making that
possible.
Beyond the x86 architecture, the new version comes with principal support for
the ARM Cortex-A15-based Exynos 5250 SoC and the Freescale i.MX53 SoC. The
Exynos 5250 SoC has been enabled for our custom kernel as well as for the
Fiasco.OC kernel. The most significant functional improvements are a new
facility to detect faulting processes and a new mechanism for file-system
notifications.
Besides those added functionalities, the release cycle was taken as an
opportunity to revisit several aspects under the hood of the framework. A few
examples are the reworked synchronization primitives, the simplified base
library structure, the completely redesigned audio-output interface, and a
modernized timer interface.
DMA protection via IOMMU
########################
Direct memory access (DMA) of devices is universally considered as the Achilles
heel of microkernel-based operating systems. The most compelling argument in
favour of using microkernels is that by encapsulating each system component
within a dedicated user-level address space, the system as a whole becomes more
robust and secure compared to a monolithic operating-system kernel. In the
event that one component fails due to a bug or an attack, other components
remain unaffected. The prime example for such buggy components are device
drivers. By empirical evidence, those remain the most prominent trouble makers
in today's operating systems. Unfortunately however, most commodity hardware
used to render this nice argumentation moot because it left one giant loophole
open, namely bus-master DMA.
Via bus-master DMA, a device attached to the system bus is able to directly
access the RAM without involving the CPU. This mechanism is crucial for all
devices that process large amounts of data such as network adapters, disk
controllers, or USB controllers. Because those devices can issue bus requests
targeting the RAM directly and not involving the CPU altogether, such requests
are naturally not subjected by the virtual-memory mechanism implemented in the
CPU in the form of an MMU. From the device's point of view there is just
physical memory. Hence, if a driver sets up a DMA transaction, let's say a disk
driver wants to read a block from the disk, the driver tells the device about
the address and size of a physical-memory buffer where the it wants to receive
the data. If the driver lives in a user-level process, as is the case for a
microkernel-based system, it still needs to know the physical address to
program the device correctly. Unfortunately, there is nothing to prevent the
driver from specifying any physical address to the device. Consequently, a
malicious driver could misuse the device to read and manipulate all parts of
the memory, including the kernel.
[image no_iommu]
Traditional machine without IOMMU. Direct memory accesses issued by the
disk controller are not subjected to the MMU. The disk controller can
access the entity of memory present in the system.
So - does this loop hole render the micro-kernel approach useless? Of course not.
Putting each driver in a dedicated address space is still beneficial in two
ways. First, classes of bugs that are unrelated to DMA remain confined in the
driver's address space. In practice most driver issues arise from issues like
memory leaks, synchronization problems, deadlocks, flawed driver logic, wrong
state machines, or incorrect device-initialization sequences. For those classes
of problems, the microkernel argument still applies. Second, executing a driver
largely isolated from other operating-system code minimizes the attack surface
of the driver. If the driver interface is rigidly small and well-defined, it is
hard to compromise the driver by exploiting its interface.
Still the DMA issue remains to be addressed. Fortunately, modern PC hardware
has closed the bus-master-DMA loophole by incorporating a so-called IOMMU into
the system. As depicted in the following figure, the IOMMU sits between the RAM
and the system bus where the devices are attached to. So each DMA request has
to pass the IOMMU, which is not only able to arbitrate the access of DMA
requests to the RAM but also able to virtualize the address space per device.
Similar to how a MMU confines each process running on the CPU within a distinct
virtual address space, the IOMMU is able to confine each device within a
dedicated virtual address space. To tell the different devices apart, the IOMMU
uses the PCI device's bus-device-function triplet as unique identification.
[image iommu]
An IOMMU arbitrates and virtualizes DMA accesses issued by a device to the
RAM. Only if a valid IOMMU mapping exists for a given DMA access, the memory
access is performed.
Of the microkernels supported by Genode, NOVA is the first kernel that supports
the IOMMU. NOVAs interface to the IOMMU is quite elegant. The kernel simply
applies a subset of the (MMU) address space of a process (aka protection domain
in NOVA speak) to the (IOMMU) address space of a device. So the device's
address space can be managed in the same way as we normally manage the address
space of a process. The only missing link is the assignment of device address
spaces to process address spaces. This link is provided by the dedicated system
call "assign_pci" that takes a process identifier and a device identifier as
arguments. Of course, both arguments must be subjected to a security policy.
Otherwise, any process could assign any device to any other process. To enforce
security, the process identifier is a capability to the respective protection
domain and the device identifier is a virtual address where the extended PCI
configuration space of the device is mapped in the specified protection domain.
Only if a user-level device driver got access to the extended PCI configuration
space of the device, it is able to get the assignment in place.
To make NOVA's IOMMU support available to Genode programs, we enhanced the
ACPI/PCI driver with the ability to hand out the extended PCI configuration
space of a device and added a NOVA-specific extension to the PD session
interface. The new 'assign_pci' function allows the assignment of a PCI device
to the protection domain.
[image iommu_aware]
NOVAs management of the IOMMU address spaces facilities the use of
driver-local virtual addresses as DMA addresses.
Even though these mechanisms combined principally
suffice to let drivers operate with the IOMMU enabled, in practice, the
situation is a bit more complicated. Because NOVA uses the same
virtual-to-physical mappings for the device as it uses for the process, the DMA
addresses the driver needs to supply to the device must be virtual addresses
rather than physical addresses. Consequently, to be able to make a device
driver usable on systems without IOMMU as well as on systems with IOMMU, the
driver needs to be IOMMU-aware and distinguish both cases. This is an
unfortunate consequence of the otherwise elegant mechanism provided by NOVA. To
relieve the device drivers from caring about both cases, we came up with a
solution that preserves the original device interface, which expects physical
addresses. The solution comes in the form of so called device PDs. A device PD
represents the address space of a device as a Genode process. Its sole purpose
is to hold mappings of DMA buffers that are accessible by the associated
device. By using one-to-one physical-to-virtual mappings for those buffers
within the device PD, each device PD contains a subset of the physical address
space. The ACPI/PCI server performs the assignment of device PDs to PCI
devices. If a device driver intends to use DMA, it asks the ACPI/PCI driver for
a new DMA buffer. The ACPI/PCI driver allocates a RAM dataspace at core,
attaches it to the device PD using the dataspace's physical address as virtual
address, and hands out the dataspace capability to the driver. If the driver
requests the physical address of the dataspace, the returned address will be a
valid virtual address in the associated device PD. From this design follows
that a device driver must allocate DMA buffers at the ACPI/PCI server (while
specifying the PCI device the buffer is intended for) instead of using core's
RAM service to allocate buffers anonymously. The current implementation of the
ACPI/PCI server assigns all PCI devices to only one device PD. However, the
design devises a natural way to partition devices into different device PDs.
[image iommu_agnostic]
By modelling a device address space as a dedicated process (device PD),
the traditional way of programming DMA transactions can be maintained,
even with the IOMMU enabled.
Because the changed way of how DMA buffers are allocated, our existing drivers
such as the AHCI disk driver, the OSS sound driver, the iPXE network driver,
and the USB driver had to be slightly modified. We also extended DDE Kit with
the new 'dde_kit_pci_alloc_dma_buffer' function for allocating DMA buffers.
With those changes, the complete Genode user land can be used on systems with
IOMMU enabled. Hence, we switched on the IOMMU on NOVA by default.
Full virtualization on NOVA/x86
###############################
Vancouver is a x86 virtual machine monitor that is designed to run as
user-level process on top of the NOVA hypervisor. In
[http://genode.org/documentation/release-notes/11.11#Faithful_x86_PC_Virtualization_enabled_by_the_Vancouver_VMM - Genode version 11.11],
we introduced the preliminary adaptation of Vancouver to Genode. This version
was meant as a mere proof of concept, which allowed the bootup of small Guest
OSes (such as Fiasco.OC or Pistachio) inside the VMM. However, it did not
support any glue code to Genode's session interface, which limited the
usefulness of this virtualization solution at that point. We had planned to
continue the integration of Vancouver with Genode once we observed public
demand.
The move of NOVA's development to Intel Labs apparently created this demand.
It is undeniable that combining the rich user land provided by Genode with the
capabilities of the Vancouver VMM poses an attractive work load for NOVA. So
the stalled line of the integration work of Vancouver with Genode was picked up
within Intel Labs, more specifically by Markus Partheymüller. We are delighted
to be able to merge the outcome of this undertaking into the mainline Genode
development. Thanks to Intel Labs and Markus in particular for this substantial
contribution!
The features added to the new version of Vancouver for Genode are as follows:
:VMX support:
Our initial version supported AMD's SVM technology only because this was
readily supported by Qemu. With the added support for Intel VMX, Vancouver
has become able to operate on both Intel and AMD processors with hardware
virtualization support.
:Timer support:
With added support for timer interrupts, the VMM has become able to
boot a complete Linux system.
:Console support:
With this addition, the guest VM can be provided with a frame buffer and
keyboard input.
For the frame-buffer size in Vancouver, the configuration value in the
machine XML node is used. It is possible to map the corresponding memory
area directly to the guest regardless if it comes from nitpicker, a virtual
frame buffer, or the VESA driver. The guest is provided with two modes (text
mode 3 and graphics mode 0x114 (0x314 in Linux).
Pressing LWIN+END while a VM has focus resets the virtual machine. Also,
RESET and DEBUG key presses will not be forwarded to the VM anymore.
It is possible to dump a VM's state by pressing LWIN+INS keys.
The text console is able to detect idle mode, unmaps the buffer from the
guest and stops interpreting. Upon the next page fault in this area, it
resumes operation again. The code uses a simple checksum mechanism instead
of a large buffer and 'memcmp' to detect an idle text console. False
positives don't matter very much.
:Network support:
The VMM has become able to use the Intel 82576 device model from the NUL
user land to give VMs access to the network via Genode's NIC bridge service
or a NIC driver.
:Disk support:
The VMM can now assign block devices to guests using Genode's block-session
interface. The machine has to be configured to use a specified drive, which
could be theoretically routed to different partitions or services via policy
definitions. Currently the USB driver only supports one device. Genode's AHCI
driver is untested.
:Real-time clock:
By using the new RTC session interface, Vancouver is able to provide the
wall-clock time to guest OSes.
To explore the new version of the Vancouver VMM, there exists a ready-to-use
run script at 'ports/run/vancouver.run'. Only the guest OS binaries such as a
Linux kernel image and a RAM disk must be manually supplied in the
'<build-dir>/bin' directory. The run script is able to start one or multiple
instances of the VMM using the graphical launchpad.
Low-latency audio output
########################
In version 10.05, we introduced an interface for the playback of audio data
along with an audio mixer component and ALSA-based sound drivers ported from
the Linux kernel. The original 'Audio_out' session interface was based on
Genode's packet stream facility, which allows the communication of bulk data
across address spaces via a combination of shared memory and signals. Whereas
shared memory is used to transfer the payload in an efficient manner without
the need to copy data via the kernel, signals are used to manage the data flow
between the information source and sink.
[image packet_stream]
Figure [packet_stream] displays the life cycle of a packet of information
transferred from the source to the sink. The original intent behind the
packet-stream facility was the transmission of networking packets and blocks
of block devices. At the time when we first introduced the 'Audio_out'
interface, the packet stream seemed like a good fit for audio, too. However, in
the meanwhile, we came to the conclusion that this is not the case when trying
to accommodate streamed audio data and sporadic audio output at the same time.
For the output of streamed audio data, a codec typically decodes a relatively
large portion of an audio stream and submits the sample data to the mixer. The
mixer, in turn, mixes the samples of multiple sources and forwards the result
to the audio driver. Each of those components the codec, the mixer, and the
audio driver live in a separate process. By using large buffer sizes between
them, the context-switching overhead is hardly a concern. Also, the driver can
submit large buffers of sample data to the sound device without any further
intervention needed.
In contrast, sporadic sounds are used to inform the user about an immediate
event. It is ultimately expected that such sounds are played back without much
latency. Otherwise the interactive experience (e.g., of games) would suffer.
Hence, using large buffers between the audio source, the mixer, and the driver
is not an option. By using the packet stream concept, we have to settle on a
specific buffer size. A too small buffer increases CPU load caused by many
context switches and the driver, which has to feed small chunks of sample data
to the sound device. A too large buffer, however, makes sporadic sounds at low
latencies impossible. We figured out that the necessity to find a sweet spot
for picking a buffer size is a severe drawback. This observation triggered us
to replace the packet-stream-based communication mechanism of the 'Audio_out'
session interface by a new solution that we specifically designed to
accommodate both corner cases of audio output.
[image audio_out]
Similarly to the packet-stream mechanism, the new interface is based on a
combination of shared memory and signals. However, we dropped the notion of
ownership of packets. When using the packet-stream protocol depicted as above,
either the source or the sink is in charge of handling a given packet at a
given time, not both. At the points 1, 2, and 4, the packet is owned by the
source. At the points 3 and 4, the packet is owned by the sink. By putting a
packet descriptor in the submit queue or acknowledgement queue, there is a
handover of responsibility. The new interface weakens this notion of ownership
by letting the source update once submitted audio frames even after submitting
them. If there are solely continuous streams of audio arriving at the mixer,
the mixer can mix those large batches of audio samples at once and pass the
result to the driver.
[image mixer_streaming]
The mixer processes incoming data from multiple streaming sources as batches.
Now, if a sporadic sound comes in, the mixer checks the
current output position reported by the audio driver, and re-mixes those
portions that haven't been played back yet by incorporating the sporadic sound.
So the buffer consumed by the driver gets updated with new data.
[image mixer_sporadic]
A sporadic occuring sound prompts the mixer to remix packets that are
already submitted in the output queue.
Besides changing the way of how packets are populated with data, the second
major change is turning the interface into a time-triggered concept. The
driver produces periodic signals that indicate the completeness of a
played-back audio packet. This signal triggers the mixer to become active,
which in turn serves as a time base for its clients. The current playback
position is denoted alongside the sample data as a field in the memory buffer
shared between source and sink.
The new 'Audio_out' interface has the potential to align the requirements of
both streamed audio with those of sporadic sounds. As a side benefit, the now
domain-specific interface has become simpler than the original packet-stream
based solution. This becomes nowhere as evident as in the implementation of the
mixer, which has become much simpler (30% less code). The interface change
is accompanied with updates of components related to audio output, in
particular the OSS sound drivers contained in 'dde_oss', the ALSA audio driver
for Linux, the avplay media player, and the libSDL audio back-end.
Base framework
##############
Signalling API improvements
===========================
The signalling API provided by 'base/signal.h' is fairly low level. For
employing the provided mechanism by application software, we used to craft
additional glue code that translates incoming signals to C++ method
invocations. Because the pattern turned out to be not only useful but a good
practice, we added the so called 'Signal_dispatcher' class template to the
signalling API.
In addition to being a 'Signal_context', a 'Signal_dispatcher' associates a
member function with the signal context. It is intended to be used as a member
variable of the class that handles incoming signals of a certain type. The
constructor takes a pointer-to-member to the signal handling function as
argument. If a signal is received at the common signal reception code, this
function will be invoked by calling 'Signal_dispatcher_base::dispatch'. This
pattern can be observed in the implementation of RAM file system
('os/src/server/ram_fs').
Under the hood, the signalling implementation received a major improvement with
regard to the life-time management of signal contexts. Based on the observation
that 'Signal' objects are often referring to non-trivial objects derived from
'Signal_context', it is important to defer the destruction of such objects to a
point when no signal referring to the context is in flight anymore. We solved
this problem by modelling 'Signal' type as a shared pointer that operates on a
reference counter embedded in the corresponding 'Signal_context'. Based on
reference counter, the 'Signal_receiver::dissolve()' function does not return
as long as the signal context to be dissolved is still referenced by one or
more 'Signal' objects.
Trimmed and unified framework API
=================================
A though-provoking
[http://sourceforge.net/mailarchive/forum.php?thread_name=CAGQ-%3Dq27%2B_UooBiJmz9RdTE1gDmVcg9v0w-8TNgEH5fzHYiA%2BQ%40mail.gmail.com&forum_name=genode-main - posting]
on our mailing list prompted us to explore the idea to make shared libraries
and dynamically linked executables binary compatible among different kernels.
This sounds a bit crazy at first but it is not downright infeasible.
As a baby step into this direction, we unified several public headers of the
Genode API and tried to make headers private to the framework where possible.
The latter is the case for the 'base/platform_env.h' header, which is actually
not part of the generic Genode API. Hence, it was moved to the
framework-internal 'src/base/env'. Another step was the removal of
platform-specific types that are not necessarily platform-dependent. We could
remove the 'Native_lock' type without any problems. Also, we were able to unify
the IPC API, which was formerly split into the two parts 'base/ipc_generic.h'
and 'base/ipc.h' respectively. Whereas 'base/ipc_generic.h' was shared among
all platforms, the 'base/ipc.h' header used to contain platform-specific IPC
marshalling and unmarshalling code. But by moving this code from the header to
the corresponding (platform-specific) IPC library, we were able to discard the
content of 'base/ipc.h' altogether. Consequently, the former
'base/ipc_generic.h' could be renamed to 'base/ipc.h'. These changes imply no
changes at the API level.
Simplified structure of base libraries
======================================
The Genode base API used to come in the form of many small libraries, each
covering a dedicated topic. Those libraries were 'allocator_avl', 'avl_tree',
'console', 'env', 'cxx', 'elf', 'env', 'heap', 'server', 'signal', 'slab',
'thread', 'ipc', and 'lock'. The term "library" for those bits of code was
hardly justified as most of the libraries consisted of only a few .cc files.
Still the build system had to check for their inter-dependencies on each run of
the build process. Furthermore, for Genode developers, specifying the list of
base libraries in their 'target.mk' files tended to be an inconvenience. Also,
the number of libraries and their roles (core only, non-core only, shared by
both core and non-core) were not easy to capture. Hence, we simplified the way
of how those base libraries are organized. They have been reduced to the
following few libraries:
* 'cxx.mk' contains the C++ support library
* 'startup.mk' contains the startup code for normal Genode processes
On some platform, core is able to use the library as well.
* 'base-common.mk' contains the parts of the base library that are
identical by core and non-core processes.
* 'base.mk' contains the complete base API implementation for non-core
processes
Consequently, the 'LIBS' declaration in 'target.mk' files becomes simpler as
well. In the normal case, only the 'base' library must be mentioned.
New fault-detection mechanism
=============================
Until now, it was hardly possible for a parent process to respond to crashes of
child processes in a meaningful way. If a child process crashed, the parent
would normally just not take notice. Even though some special use cases such as
GDB monitor could be accommodated by the existing
'Cpu_session::exception_handler' facility, this mechanism requires the
virtualization of the 'Cpu_session interface' because an exception handler used
to refer to an individual thread rather than the whole process. For ordinary
parents, this mechanism is too cumbersome to use. However, there are several
situations where a parent process would like to actively respond to crashing
children. For example, the parent might like to restart a crashed component
automatically, or enter a special failsafe mode.
To ease the implementation of such scenarios, we enhanced the existing
'Cpu_session::exception_handler' mechanism with the provision of a
default signal handler that is used if no thread-specific handler is installed.
The default signal handler can be set by specifying an invalid thread
capability and a valid signal-context capability. So for registering a signal
handler to all threads of a process, no virtualization of the 'Cpu_session'
interface is needed anymore. The new mechanism is best illustrated by the
'os/run/failsafe.run' script, which creates a system that repeatedly spawns a
crashing child process.
Reworked synchronization primitives
===================================
We reworked the framework-internal lock interface in order to be able to use
the 'futex' syscall on the Linux base platform. Previously, the lock
implementation on Linux was based on Unix signals. In the contention case, the
applicant for a contended lock would issue a blocking system call, which gets
canceled by the occurrence of a signal. We used 'nanosleep' for this purpose.
Once the current owner of the lock releases the lock, it sends a signal to the
next applicant of the lock. Because signals are buffered by the kernel, they
are guaranteed to be received by the targeted thread. However, in situations
with much lock contention, we observed the case where the signal was delivered
just before the to-be-blocked thread could enter the 'nanosleep' syscall. In
this case, the signal was not delivered at the next entrance into the kernel
(when entering 'nanosleep') but earlier. Even though the signal handler was
invoked, we found no elegant way to handle the signal such that the subsequent
'nanosleep' call would get skipped. So we decided to leave our signal-based
solution behind and went for the mainstream 'futex' mechanism instead.
Using this mechanism required us to re-design the internal lock API, which was
originally designed with the notion of thread IDs. The 'Native_thread_id' type,
which was previously used in the lock-internal 'Applicant' class to identify a
thread to be woken up, was not suitable anymore for implementing this change.
Hence, we replaced it with the 'Thread_base*' type, which also has the positive
effect of making the public 'base/cancelable_lock.h' header file
platform-independent.
In addition to reworking the basic locking primitives, we changed the
'Object_pool' data structure to become safer to use. The former 'obj_by_*'
functions have been replaced by 'lookup_and_lock' that looks up an object and
locks it in one atomic operation. Additionally, the case that an object may
already be in destruction is handled gracefully. In this case, the lookup will
return that the object is not available anymore.
Low-level OS infrastructure
###########################
Notification mechanism for the file-system interface
====================================================
To support dynamic system scenarios, we extended Genode's file-system interface
with the ability to monitor changes of files or directories, similar to the
inotify mechanism on Linux but simpler. The new 'File_system::sigh' function
can be used to install a signal handler for an open file node. When a node is
closed after a write operation, a prior registered signal handler for this file
gets notified. Signal handlers can also be installed for directories. In this
case, the signal handler gets informed about changes of immediate nodes hosted
in the directory, i.e., the addition, renaming, or removal of nodes.
The 'ram_fs' server has been enhanced to support the new interface. So any file
or directory change can now be observed by 'ram_fs' clients.
New adapter from file-system to ROM session interface
=====================================================
The new 'fs_rom' server translates the 'File_system' session interface to the
'ROM' session' interface. Each request for a ROM file is handled by looking
up an equally named file on the file system. If no such file can be found,
then the server will monitor the file system for the creation of the
corresponding file. Furthermore, the server reflects file changes as signals
to the ROM session.
There currently exist two limitations: First, symbolic links are not handled.
Second, the server needs to allocate RAM for each requested file. The RAM is
always allocated from the RAM session of the server. Thereby, the RAM quota
consumed by the server depends on the client requests and the size of the
requested files. Therefore, one instance of the server should not be used by
untrusted clients and trusted clients at the same time. In such situations,
multiple instances of the server could be used.
The most interesting feature of the 'fs_rom' server is the propagation of
file-system changes as ROM module changes. This clears the way to use this
service to supply dynamic configurations to Genode programs.
Dynamic re-configuration of the init process
============================================
The init process has become able to respond to configuration changes by
restarting the scenario using the new configuration. To make this feature
useful in practice, init must not fail under any circumstances. Even on
conditions that were considered previously as fatal and led to the abort of
init (such as ambiguous names of the children or misconfiguration in general),
init must stay alive and responsive to configuration changes.
With this change, the init process is one of the first use cases of the dynamic
configuration feature enabled via the 'fs_rom' service and the new file-system
notifications. By supplying the configuration of an init instance via the
'fs_rom' and 'ram_fs' services, the configuration of this instance gets fetched
from a file of the 'ram_fs' service. Each time, this file is changed, for
example via VIM running within a Noux runtime environment, the init process
re-evaluates its configuration.
In addition to the support for dynamic re-configurations, we simplified the use
of conditional session routing, namely the '<if-args>' mechanism. When matching
the 'label' session argument using '<if-args>' in a routing table, we can omit
the child name prefix because it is always the same for all sessions
originating from the child anyway. By handling the matching of session labels
as a special case, the expression of label-specific routing
becomes more intuitive.
Timer interface turned into asynchronous mode of operation
==========================================================
The 'msleep' function of 'Timer::Session' interface is one of the last relics
of blocking RPC interfaces present in Genode. As we try to part away from
blocking RPC calls inside servers and as a means to unify the timer
implementation across the many different platforms supported by Genode, we
changed the interface to an asynchronous mode of operation.
Synchronous blocking RPC interfaces turned out to be constant sources of
trouble and code complexity. E.g., a timer client that also wants to respond to
non-timer events was forced to be a multi-threaded process. Now, the blocking
'msleep' call has been replaced by a mechanism for programming timeouts and
receiving wakeup signals in an asynchronous fashion. Thereby signals
originating from the timer can be handled, along with signals from other signal
sources, by a single thread. Once a timer client has registered a signal
handler using the 'Timer::sigh' function, it can program timeouts using the
functions 'trigger_once' and 'trigger_periodic', which take an amount of
microseconds as argument. For maintaining compatibility and convenience, the
interface still contains the virtual 'msleep' function. However, it is not an
RPC function anymore but a mere client-side wrapper around the 'sigh' and
'trigger_once' functions. For use cases where sleeping at the granularity of
milliseconds is too coarse (such as udelay calls by device drivers), we added
a new 'usleep' call, which takes a number of microseconds as argument.
As a nice side effect of the interface changes, the platform-specific
implementations could be vastly unified. On NOVA and Fiasco.OC, the need to use
one thread per client has vanished. As a further simplification, we changed the
timer to use the build system's library-selection mechanism instead of
providing many timer targets with different 'REQUIRES' declarations. This
reduces the noise of the build system. For all platforms, the target at
'os/src/drivers/timer' is built. The target, in turn, depends on a 'timer'
library, which is platform-specific. The various library description files are
located under 'os/lib/mk/<platform>'. The common bits are contained in
'os/lib/mk/timer.inc'.
Since the 'msleep' call is still available from the client's perspective,
the change of the timer interface does not imply an API incompatibility.
However, it provides the opportunity to simplify clients in cases that required
the maintenance of a separate thread for the sole purpose of
periodic signal generation.
Loader
======
The loader is a service that enables its clients to dynamically create Genode
subsystems. Leveraging the new fault-detection support described in section
[New fault-detection mechanism], we enabled loader clients to respond to
failures that occur inside the spawned subsystem. This is useful for scenarios
where subsystems should be automatically restarted or in situations where the
system should enter a designated failsafe mode once an unexpected fault
happens.
The loader provides this feature by installing an optional client-provided
fault handler as default CPU exception handler and a RM fault handler for all
CPU and RM sessions of the loaded subsystem. This way, the failure of any
process within the subsystem gets reflected to the loader client as a signal.
The new 'os/run/failsafe.run' test illustrate this mechanism. It covers two
cases related to the loader, which are faults produced by the immediate child
of the loader and faults produced by indirect children.
Focus events for the nitpicker GUI server
=========================================
To enable a way for applications to provide visual feedback to changed keyboard
focus, we added a new 'FOCUS' event type to the 'Input::Event' structure. To
encode whether the focus was entered or left, the former 'keycode' member is
used (value 0 for leaving, value 1 for entering). Because 'keycode' is
misleading in this context, the former 'Input::Event::keycode' function was
renamed to 'Input::Event::code'. The nitpicker GUI server has been adapted to
deliver focus events to its clients.
NIC bridge with support for static IP configuration
===================================================
NIC bridge is a service that presents one physical network adaptor as many
virtual network adaptors to its clients. Up to now, it required each client
to obtain an IP address from a DHCP server at the physical network. However,
there are situations where the use of static IPs for virtual NICs is useful.
For example, when using the NIC bridge to create a virtual network between
the lighttpd web server and the Arora web browser, both running as Genode
processes without real network connectivity.
The static IP can be configured per client of the NIC bridge using a '<policy>'
node of the configuration. For example, the following policy assigns a static
address to a client with the session label "lighttpd".
!<start name="nic_bridge">
! ...
! <config>
! <policy label="lighttpd" ip_addr="10.0.2.55"/>
! </config>
!</start>
Of course, the client needs to configure its TCP/IP stack to use the assigned
IP address. This can be done via configuration arguments examined by the
'lwip_nic_dhcp' libc plugin. For the given example, the configuration for the
lighttpd process would look as follows.
!<start name="lighttpd">
! <config>
! <interface ip_addr="10.0.2.55"
! netmask="255.255.255.0"
! gateway="10.0.2.1"/>
! </config>
!</start>
Libraries and applications
##########################
New terminal multiplexer
========================
The new 'terminal_mux' server located at 'gems/src/server/terminal_mux' is able
to provide multiple terminal sessions over one terminal-client session. The
user can switch between the different sessions using a keyboard shortcut, which
brings up an ncurses-based menu.
The terminal sessions provided by terminal_mux implement (a subset of) the
Linux terminal capabilities. By implementing those capabilities, the server
is interchangeable with the graphical terminal ('gems/src/server/terminal').
The terminal session used by the server is expected to by VT102 compliant.
This way, terminal_mux can be connected via an UART driver with terminal
programs such as minicom, which typically implement VT102 rather than the Linux
terminal capabilities.
When started, terminal_mux displays a menu with a list of currently present
terminal sessions. The first line presents status information, in particular
the label of the currently visible session. A terminal session can be selected
by using the cursor keys and pressing return. Once selected, the user is able
to interact with the corresponding terminal session. Returning to the menu is
possible at any time by pressing control-x.
For trying out the new terminal_mux component, the 'gems/run/termina_mux.run'
script sets up a system with three terminal sessions, two instances of Noux
executing VIM and a terminal_log service that shows the log output of both Noux
instances.
New ported 3rd-party libraries
==============================
To support our forthcoming port of Git to the Noux runtime environment, we
have made the following libraries available via the libports repository:
* libssh-0.5.4
* curl-7.29.0 (for now the port is x86_* only because it depends on libcrypto,
which is currently not tested on ARM)
* iconv-1.14
Device drivers
##############
Besides the changes concerning the use of IOMMUs, the following device driver
have received improvements:
:UART drivers:
The OMAP4 platform support has been extended by a new UART driver, which
enables the use of up to 4 UART interfaces. The new driver is located at
'os/src/drivers/uart/omap4'.
All UART drivers implement the 'Terminal::Session' interface, which
provides read/write functionality accompanied by a function to determine
the terminal size. The generic UART driver code shared among the various
implementations has been enhanced to support the detection of the terminal
size using a protocol of escape sequences. This feature can be enabled by
including the attribute 'detect_size="yes"' in the policy of a UART client.
This is useful for combining UART drivers with the new 'terminal_mux'
server.
:ACPI support for 64-bit machines:
In addition to IOMMU-related modifications, the ACPI driver has been enhanced
to support 64-bit machines and MCFG table parsing has been added.
:PCI support for IOMMUs:
With the added support of IOMMUs, the 'Pci::Session' interface has been
complemented with a way to obtain the extended PCI configuration space in the
form of a 'Genode::Dataspace'. Also, the interface provides a way to allocate
DMA buffers for a given PCI device. Device drivers that are meant to be used
on system with and without IOMMUs should use this interface rather than
core's RAM session interface to allocate DMA buffers.
:Real-time clock on x86:
Up to now, the x86 real-time clock driver served as a mere example for
accessing I/O ports on x86 machines but the driver did not expose any service
interface. With the newly added 'os/include/rtc_session' interface and the
added support of this interface in the RTC driver, Genode programs have now
become able to read the real-time clock. Currently, the interface is used by
the Vancouver VMM.
:USB driver restructured, support for Arndale board added:
While adding support for the Exynos-5-based Arndale board, we took the
chance to restructure the driver to improve portability to new
platforms. The most part of the driver has become a library, which is
built in a platform-specific way. The build system automatically selects
the library that fits for the platform as set up for the build directory.
Platforms
#########
NOVA
====
The NOVA base platform received major improvements that address the kernel
as well as Genode's NOVA-specific code. We pursued two goals with this line
of work. The first goal was the use of NOVA in highly dynamic settings, which
was not possible before, mainly due to lacking kernel features. The second
goal was the use of IOMMUs.
NOVA is ultimately designed for accommodating dynamic workloads on top of the
kernel. But we found that the implementation of crucial functionality was
missing. In particular, the kernel lacked the ability to destroy all kinds of
kernel objects and to reuse memory of kernel objects that had been destroyed.
Consequently, when successively creating and destroying kernel objects such as
threads and protection domains, the kernel would eventually run out of memory.
This issue became a show stopper for running the Genode tool chain on NOVA
because this scenario spawns and destroys hundreds of processes. For this
reason, we complemented the kernel with the missing functionality. This step
involved substantial changes in the kernel code. So our approach of using the
upstream kernel and applying a hand full of custom patches started to show its
limitations.
To streamline our work flow and to track the upstream kernel in a structured
way, we decided to fork NOVA's Git repository and maintain our patches in our
fork. For each upstream kernel revision that involves kernel ABI changes, we
create a separate branch called "r<number>". This branch corresponds to the
upstream kernel with our series of custom patches applied (actually rebased) on
top. This way, our additions to the upstream kernel are well documented. The
'make prepare' mechanism in the base-nova repository automates the task of
checking out the right branch. So from the Genode user's point of view, this
change is transparent.
The highly dynamic application scenarios executed on NOVA triggered several
synchronization issues in Genode's core process that had not been present on
other base platforms. The reason for those issues to occur specifically on NOVA
lies in the concurrent page fault handling as employed on this base platform.
For all classical L4-like kernels and Fiasco.OC, we use one global pager thread
to resolve all page faults that occur in the whole Genode system. In contrast,
on NOVA we use one pager thread per user thread. Consequently, proper
fine-grained synchronization between those pager threads and the other parts of
core is mandated. Even though the immediate beneficiary of these changes is the
NOVA platform, many of the improvements refer to generic code. This paves the
ground for scaling the page-fault handling on other base platforms (such as
Fiasco.OC) to multiple threads. With these improvements in place, we are able
to successfully execute the 'noux_tool_chain_nova' scenario on the NOVA kernel
and build Genode's core on NOVA. That said, however, not all issues are covered
yet. So there is still a way left to go to turn base-nova into a base platform
that is suitable for highly dynamic scenarios.
The second goal was the use of NOVA's IOMMU support on Genode. This topic is
covered in detail in section [DMA protection via IOMMU].
To be able to use and debug Genode on NOVA on modern machines that lack legacy
comports, we either use UART PCI cards or the Intel's Active Management
Technology (AMT) mechanism. In both cases, the I/O ports to access the serial
interfaces differ from the legacy comports. To avoid the need for adjusting the
I/O port base addresses per platform, we started using the chain-boot-loader
called "bender" developed by the Operating Systems Group of TU Dresden,
Germany. This boot loader is started prior the kernel, searches the PCI bus for
the first suitable device and registers the corresponding I/O port base address
at the bios data area (BDA). Genode's core, in turn, picks the I/O port base
address up from the BDA and uses the registered i8250 serial controller for its
LOG service.
Execution on bare hardware (base-hw)
====================================
The base-hw platform enables the use of Genode on ARM-based hardware without
the need for a 3rd-party kernel.
With the new release, the range of supported ARM-based hardware has been
extended to cover the following additional platforms. With the previous
release, we introduced the support for Freescale i.MX family of SoC, starting
with i.MX31. The current release adds support for the i.MX53 SoC and adds
a user-level timer driver for this platform. With the Samsung Exynos 5, the
first Cortex-A15-based SoC has entered the list of supported SoCs. Thanks to
this addition, Genode has become able to run on the
[http://www.arndaleboard.org - Howchip Arndale board]. At the current state,
core and multiple instances of init can be executed but drivers for peripherals
are largely missing. Those will be covered by our ongoing work with this SoC.
The added platforms are readily available via the 'create_builddir' tool.
To make base-hw practically usable on real hardware (i.e., the Pandaboard),
support for caches has been implemented. Furthermore, the implementation of the
signalling API underwent a redesign, which leverage the opportunities that
arise with tailoring a kernel specifically to the Genode API. As a side-benefit
of this endeavour, we could unify the 'base/signal.h' header with the generic
version and thereby took another step towards the unification of the Genode
headers across different kernels.
Microblaze platform removed
===========================
The 'base-mb' platform has been removed because it is no longer maintained.
This platform enabled Genode to run directly on the Xilinx Microblaze softcore
CPU. For supporting the Microblaze CPU architecture in the future, we might
consider integrating support for this architecture into base-hw. Currently
though, there does not seem to be any demand for it.
Fiasco.OC forked, support for Exynos 5 SoC added
================================================
In the last release cycle, we went beyond just using the Fiasco.OC kernel and
started to engage with the kernel code more intensively. To avoid that the
management of a growing number of kernel patches goes out of hand, we forked
the Fiasco.OC kernel and conduct our development in our Fiasco.OC Git
repository. When using the 'make prepare' mechanism in the 'base-foc'
repository, the new Git repository will be used automatically. There exists a
dedicated branch for each upstream SVN revision that we use. We started with
updating Fiasco.OC to the current revision 47. Hence, the current branch used
by Genode is named "r47". The branch contains the unmodified state of the
upstream SVN repository with our modifications appearing as individual commits
on top. This makes it easy to keep track of the Genode-specific modifications.
Please note that the update to Fiasco.OC requires minor adaptations inside
the 'ports-foc' repository. So for using L4Linux, "make prepare" must be
issued in both repositories 'base-foc' and 'ports-foc'.
Speaking of engaging with the kernel code, the most profound improvement is
the support for the Samsung Exynos-5-based Arndale board that we added to the
kernel. This goes hand in hand with the addition of this platform to Genode.
For creating a build directory targeting the Arndale board, just specify
"foc_arndale" to the 'create_builddir' tool. At the time of the release,
several basic scenarios including the timer driver and the USB driver are
working. Also, both Cortex-A15 CPUs of the Exynos 5 SoC are operational.
However, drivers for most of the peripherals of the Exynos-5 SoC are missing,
which limits the current scope of Genode on this platform.
Linux
=====
Since the base-linux platform became used for more than a mere development
vehicle, we are revisiting several aspects of this base platform. In the last
release, we changed the synchronous inter-process-communication mechanism to
the use of SCM rights. For the current release, it was time to have a closer
look at the memory management within core. The Linux version of core used a
part of the BSS to simulate access to physical memory. All dataspaces would
refer to a portion of 'some_mem'. So each time when core would access the
dataspace contents, it would access its local BSS. For all processes outside of
core, dataspaces were represented as files. We have now removed the distinction
between core and non-core processes. Now, core uses the same 'Rm_session_mmap'
implementation as regular processes. This way, the 'some_mem' could be
abandoned. We still use a BSS variable for allocating core-local meta data
though. The major benefit of this change is the removal of the artificial
quota restriction that was imposed by the predefined size of the 'some_mem'
array. Now, the Linux base platform can use as much memory as it likes. Because
the Linux kernel implements virtual memory, we are not bound by the physical
memory. Hence, the available quota assigned to the init process is almost
without bounds.
To implement the fault-detection mechanism described in section
[New fault-detection mechanism] on Linux, we let core catch SIGCHLD signals of
all Genode processes. If such a signal occurs, core determines the process that
produced the signal by using 'wait_pid', looks up the CPU session that belongs
to the process and delivers an exception signal to the registered exception
handler. This way, abnormal terminations of Genode processes are reflected to
the Genode API in a clean way and Genode processes become able to respond to
terminating Genode child processes.
OKL4
====
The audio stub driver has been removed from OKLinux. Because of the changed
'Audio_out::Session' interface, we needed to decide on whether to adapt the
OKLinux stub driver to the changed interface or to remove the stub driver.
Given the fact that OKLinux is not actively used, we decided for the latter.

View File

@@ -1,943 +0,0 @@
===============================================
Release notes for the Genode OS Framework 13.05
===============================================
Genode Labs
With Genode 13.05, we have diverged quite a bit from the feature-laden plans
laid out in our [http://genode.org/about/road-map road map] as we realized
that consolidating and optimizing the current feature set will have a more
sustainable effect than functional enhancements at this point. In particular,
we addressed the problem that the ever growing diversity of platforms imposes
on the quality and coverage of testing. We also desired to extend our
systematic testing efforts to real hardware platforms, and to have a mechanism
for detecting performance regressions. Section
[Automated quality-assurance testing] details how we approached these
challenges, and how we went on analyzing Genode's network performance in
particular.
That said, we haven't completely restrained ourself from implementing new
features. Closely related to test automation but very useful in other
situations, we improved the terminal infrastructure in order to enable the
interactive use of dynamic system scenarios in headless situations. Section
[Terminal infrastructure] introduces a new command-line interface for managing
Genode subsystems.
With regard to platform support, the current release follows up on the
hardware support added in the previous releases. For Samsung Exynos-5-based
platforms, drivers for USB-3, fast-ethernet networking, gigabit networking,
eMMC, and SATA have been added. For Freescale i.MX53-based devices, new
drivers for display, touchscreen, and GPIO have become available. The
OMAP4 display driver has been enhanced to cover both LCD displays and HDMI.
Our custom base-hw kernel has been enabled on the Raspberry Pi
board. Finally, Linux/ARM was added to accompany Linux/x86 as a fully usable
Genode base platform.
Automated quality-assurance testing
###################################
One of the greatest challenges of the Genode OS Framework is preventing
regressions in the face of the growing number of supported platforms.
The challenge stems from the fact that the space of Genode scenarios grow
two-dimensional. On one axis, the software stack on top of Genode gets more
and more complex, which calls for contiguous testing. On the other axis, there
is a growing number of kernel and hardware platforms to support.
In principle, there are even more dimensions, for example the diversity
of tool chains or the diversity of the OS used on the development machine.
Luckily, the problem of tool-chain diversity could be mitigated with the
introduction of the Genode tool chain since version 11.11, which was a huge
relief. However, the mentioned two dimensions cannot be avoided. Because
manual testing of manifold scenarios of component compositions on top of many
different kernels became infeasible, we automated the task of building and
testing years ago.
The automated builder checks out the staging branch of Genode, prepares
the repositories that integrate 3rd-party code, and builds the software
for 12 different kernel/platform combinations. Not all 3rd-party software
packages are built for each combination though. But we make sure that each
piece of software is exposed to different combinations of CPU architectures
and kernels.
The build test is accompanied with automated runtime tests of various
run scripts on Qemu. Each run script listed in 'tool/autopilot.lst' is
executed on each kernel using the autopilot tool. The tests range from
stimulating low-level mechanisms (such as signal, timer, and ldso) to complex
scenarios (such as testing networking with L4Linux, or running Noux).
Both build and runtime tests are executed daily. If any of the
tests fail, the Genode developers receive a notification email.
Once all tests are passed, the staging branch can be merged into the master
branch. This way, we spare the users of Genode to deal with intermediate
problems introduced in the staging branch.
The build and runtime tests have become a fundamental tool for our
development work. With the growing variety of real hardware
(as opposed to hardware emulated via Qemu), however, our existing solution
was falling short. Even though our tests confirm that Genode is running
happily on Qemu, they won't help us to detect regressions in our device
drivers for non-Qemu hardware such as Pandaboard, Arndale, or modern PC
hardware. Furthermore, we are increasingly focussing on performance
considerations. In order to be a viable OS platform, Genode does not only need
to be able to do networking, but networking performance must be on par with
mainstream OSes. This raises the new challenge to extend our
continuous-testing tools to become continuous-benchmarking tools. The ultimate
goal is to monitor the performance of Genode on real hardware over long
periods of development.
In this release cycle, we attacked this problem in two steps. First, we
enabled Genode's run tool to target not only Qemu but real hardware, with the
premise that existing run scripts must not be changed. The second step is the
creation of new run scripts that perform benchmarks in an automated fashion.
By aggregating the results of this automatically executed benchmarks, we can
correlate performance effects with commits in our code repository.
Targeting real hardware via the run tool
========================================
In the following, we briefly describe the procedure to execute run scripts
on native hardware, for both Intel-based x86 machines and ARM-based platforms.
TFTP boot x86
~~~~~~~~~~~~~
The following description uses NOVA as an example to illustrate the usage.
Other base platforms are supported as well and can be configured analogously.
[http://os.inf.tu-dresden.de/~us15/pulsar/ - Pulsar] is a tiny boot loader
that uses PXE to fetch boot images via TFTP over the network. On the x86
architecture, Genode supports the automatic generation of Pulsar configuration
files, which can be placed directly onto a TFTP server. Genode can be booted
via Pulsar using the following steps:
* On the x86 test machine, enable "PXE boot feature" in the BIOS.
* When booting, the machine will look for a DHCP server announcing a TFTP server.
So you need to make sure to have both the DHCP server and the TFTP server
configured such that the 'pulsar' binary will be loaded as PXE binary.
* After the PXE BIOS of the test machine has loaded and started the pulsar
binary, Pulsar will look on the TFTP server for a file called
'config-XX-XX-XX-XX-XX-XX', where the sequence of 'XX' corresponds to the
MAC address of the test machine.
For example, if the MAC of the network card is 01:02:03:04:05:06, Pulsar
would request a file called 'config-01-02-03-04-05-06'.
* Using this configuration file, we direct Pulsar to the configuration
generated by the run tool. I.e., it should look as follows
! root /tftpboot/nova
! config config-00-00-00-00-00-00
The lines above tell pulsar to load another config file, which contains the
actual configuration. To instruct the run script to actually generate the
'config-00-00-00-00-00-00' file, set the following environment variables in
your shell prior executing the run script:
! export PXE_TFTP_DIR_BASE=/tftpboot
! export PXE_TFTP_DIR_OFFSET=/nova
The two-staged configuration of Pulsar may look overly complicated at first
sight but has the benefit that the run tool does not need to know the MAC
address of the test machine in order to generate the Pulsar configuration
file.
* Create a symbolic link '/tftpboot/nova' pointing to the corresponding
Genode build directory.
* The next time 'make run/printf' is invoked,
the run script will generate the 'config-00-00-00-00-00-00' in
'/tftpboot/nova'.
* When rebooting the test machine, it will load and start the printf test.
TFTP boot using U-Boot
~~~~~~~~~~~~~~~~~~~~~~
Configure your U-Boot boot loader to load the images via TFTP.
The remainder of the procedure is similar to the description for x86 above.
On ARM platforms, the run tool automatically generates the uBoot image and
creates a symbolic link into the TFTP directory.
* Pandaboard:
! export PXE_TFTP_DIR_BASE=/tftpboot
! export PXE_TFTP_DIR_OFFSET=/panda
! ln -s <genode-build-dir> /tftpboot/panda
! RUN_OPT="--target uboot" make run/printf
* Arndale board:
! export PXE_TFTP_DIR_BASE=/tftpboot
! export PXE_TFTP_DIR_OFFSET=/arndale
! ln -s <genode-build-dir> /tftpboot/panda
! RUN_OPT="--target uboot" make run/printf
Output and reset with Intel's AMT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Most modern x86-based machines lack a COM port, which is normally used for
kernel debug messages as well as LOG messages printed by Genode's core.
However, Intel's Advanced Management Technology (AMT) can be used to obtain
the serial output of the test machine and to reset the test machine. To use
AMT with Genode's run tool, install the 'amtterm' package (version 1.3 is
known to work well) and set the following environment variables, specifying
the IP address of the test machine and the AMT password.
! export AMT_TEST_MACHINE_IP=XXX.XXX.XXX.XXX
! export AMT_TEST_MACHINE_PWD=XXXXXXXXX
Via setting the RUN_OPT environment variable, we instruct the run tool to use
AMT instead of Qemu. The following command will reset the test machine, the test
machine will load the binaries of the printf run script via PXE, and we will be
able to see the serial output of the test machine through Intel's AMT Serial
Over Line (SOL),
! RUN_OPT="--target amt" make run/printf
Output via a COM port (UART)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the x86 test machine, Pandaboard or Arndale test board is connected
via UART, the run tool can use a specified command to interact with it.
For example, if the UART interface of the test machine is connected directly
to the host machine at /dev/ttyUSB3, and the picocom tool is available,
the following command can be used to establish a connection:
! RUN_OPT="--target serial --serial-cmd \"picocom -b 115200 /dev/ttyUSB3\"" make run/printf
Alternatively, if the board is connected to some remote machine, which exports
the corresponding serial line via TCP/IP, the socat tool can be used for
communicating with the remote test machine:
! RUN_OPT="--target serial --serial-cmd \"socat - tcp:10.0.0.1:2000\"" make run/printf
Reset via a IP power plug NETIO-230B from Koukaam
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At Genode Labs, we use a NETIO-230B power plug to automate power-cycling ARM
boards. This power plug can be controlled over the network. For example, if
the Pandaboard is connected to power port 3, the following command will
automatically turn on the board when the run script is started:
! RUN_OPT="--target uboot --target reset --reset-port 2 --reset-ip 10.0.0.1 --reset-user admin --reset-passwd secret" make run/printf
The '--target reset' option can be combined with '--target uboot' to
instruct the run tool to boot via TFTP (as described above) and take care
of power cycling. When the run script has finished, the specified port
will be automatically switched off by the run tool.
Of course, the IP address settings, as well as the actual user name and
password, to access the NETIO-230B power plug, have to be adjusted accordingly.
Automated benchmarking
======================
With the '--target' features added to the run tool, the road is paved to
obtain benchmark results in an automated fashion. Currently, we are most
interested in exploring the network-performance characteristics of Genode.
Network performance can be explored at different levels. We started with
looking at raw driver performance, then looked at the overhead of separating
the network application from the device driver (and thereby introducing
inter-process communication overhead), and finally explored the effects
of the TCP/IP stack.
For pursuing the packet-level performance measurements, we crafted a library
called 'net-stat', which contains the application logic of a low-level
benchmark operating at network-packet level. This library has been
successively incorporated into the 'dde_ipxe' NIC driver and the 'usb_drv'
(NIC driver via ethernet-over-USB) to measure the raw driver performance
without any microkernel overhead or TCP/IP protocol overhead.
To see the influence of the inter-process communication, namely the
packet-stream interface employed by Genode's NIC-session interface,
we implanted the same net-stat library into a NIC-session client. This
experiment enables us to compare the operation of the NIC driver
with the operation of a NIC driver separated from the NIC
application.
The raw networking tests can be executed automatically using the set
of 'network_test_nic*.run' scripts located at 'os/run'.
The scenario sends raw ethernet packets from the host machine to the
target machine. Three tests are provided:
The 'network_test_nic_raw.run' test measures the net-stat-instrumented driver
(of usb_drv and net_drv respectively) to observe the raw receive performance.
The 'network_test_nic_raw_client.run' test implements the benchmark in a
NIC-session client connected to the NIC driver running as a separate
component whereas the NIC driver is not instrumented.
The 'network_test_nic_raw_bridge_client.run' test further adds a NIC bridge
in-between the driver and the NIC-session client.
In addition to analyzing the performance on a low level, we investigated
the effects of TCP/IP for the application performance. This topic is
covered in more detail in Section [TCP/IP performance].
Terminal infrastructure
#######################
Closely related to the quality-assurance measures detailed in the previous
section, there is the arising need to interact with increasingly complex system
scenarios in headless settings. In particular when executing tests remotely on a
development board, manual user-interaction via a GUI
becomes impractical. We vastly prefer a low-bandwidth textual interface
in such situations. But how should a textual user interface for dynamic
systems comprised of many components look like? This is particularly difficult
because most development boards are equipped with merely a single UART
connector.
On a normal Genode system, the UART connector is typically used
by the kernel debugger to print debugging output, or for the interactive
use of a debugger. This leaves no interface for interacting with Genode
components. So how can we expose complex scenarios, such as concurrently
running several instances of Genode subsystems, to the user?
Our solution consists of three parts: A pseudo UART driver for Genode
that uses the kernel debugger as back end, a terminal-multiplexing
facility running on the reference platform, and a command-line based
tool for interacting with Genode. By combining those, the user
can interact with the kernel debugger, a Genode command line, and the
consoles of executed Linux instances over a single serial connection.
The pseudo UART driver called kdb_uart_drv is a Genode service that
implements the 'Uart::Session' interface. Therefore, it can be combined
with all components that use the 'Uart::Session' or the 'Terminal::Session'
interfaces, for example the Noux runtime environment, the terminal_log
service (for displaying LOG messages via the terminal interface), L4Linux, or
programs linked against the 'libc_terminal' plugin. The kdb_uart_drv component
is located at 'os/src/drivers/uart/kdb'. It does not access a real UART device
but rather uses the user-level bindings of the kernel debugger to indirectly
read and write data over the UART interface.
[image kdb_uart_drv 65%]
The kdb_uart_drv driver used for sharing one UART among the kernel
debugger, core's LOG service, and a terminal client application
running on Genode.
Figure [kdb_uart_drv] illustrates the relationship between the kernel
debugger, core's LOG service, and kdb_uart_drv. Because write operations
target the kernel debugger directly, core's LOG service gets bypassed. Output
written to the kdb_uart_drv will directly appear at the terminal program of
the host system. Because kdb_uart_drv has
direct access to the host terminal, it can leverage all facilities of the host
terminal, in particular various escape sequences for terminal manipulations.
For reading from the kernel debugger, there is no way to block for UART input.
Hence, the kdb_uart_drv periodically polls for new input with a period of 20
milliseconds. If new input is available, the driver reads as many characters as
available at once. So the runtime overhead of polling is negligible. To test
kdb_uart_drv as individual component, there is a run script provided at
'os/run/kdb_uart_drv.run'.
Thanks to kdb_uart_drv, both the kernel debugger and Genode can
share one single UART connection. So we have a principal way to let the user
interact with a Genode component that uses the 'Terminal::Session' interface.
However, typical system scenarios should accommodate not just a single program
but multiple Linux instances and native Genode applications simultaneously,
each requiring a dedicated 'Terminal::Session'. Hence, we need a way to
multiplex the 'Terminal::Session' interface between those clients. Our
multiplexing solution comes in the form of a component called terminal_mux,
which we just introduced in the
[http://genode.org/documentation/release-notes/13.02#New_terminal_multiplexer - previous release].
It uses a single terminal connection to implement a text-based user interface
to multiple virtual terminal consoles.
[image terminal_mux 40%]
Operation of the terminal_mux service.
Figure [terminal_mux] depicts the basic functioning of this component. For
terminal_mux clients, the service implements the Linux terminal capabilities.
For doing that, it shares large parts of the implementation of the existing
Genode terminal program. For each client, terminal_mux renders the client
output into a client-specific text-screen buffer. So any number of clients can
perform output on terminal_mux concurrently. According to the selection by
the user, terminal_mux periodically translates one client buffer (the
foreground buffer) to escape sequences as understood by the host terminal. This
translation is performed using the ncurses library. The user can pick the
foreground buffer using an interactive menu that can be activated via the
keyboard shortcut _Control-x_.
By combining kdb_uart_drv with terminal_mux, we created a flexible way
to let the user interact with many Genode applications. The last part
missing for a real dynamic system is a text-based command interface to
start and stop Genode subsystems. This functionality is provided by the
new cli_monitor component located at 'os/src/app/cli_monitor'.
It uses the 'Terminal::Session' interface to present a simple interactive
command line with commands for starting and stopping Genode subsystems,
entering the kernel debugger, and showing status information. It provides
tab completion and inline help to make it easily explorable. The cli_monitor
component is integrated in the scenario of the 'terminal_mux.run' script
mentioned above. Because cli_command is a 'Terminal::Session' client, it can
be interfaced with terminal_mux. This composition is illustrated by Figure
[uart_overview].
[image uart_overview 100%]
Overview of the terminal infrastructure as employed in the
demonstration scenario.
Note that in some situations, e.g., when killing subsystems, the kernel, core,
or the init process may print LOG messages. Because those messages are
naturally not routed through terminal_log, they will interfere with the
operation of terminal_mux and thereby result in visible inconsistencies.
Pressing _Control-x_ will clear such artifacts. This will bring up the
terminal_mux menu, which implicitly triggers the redraw of the entire terminal.
Base framework
##############
The current release comes with incremental improvements of the MMIO framework
API and a new utility to ease the synchronized accesses to otherwise
unsynchronized class interfaces.
:MMIO framework improvements:
For native Genode device drivers, we consistently use our
[http://genode.org/documentation/release-notes/12.02#MMIO_access_framework - MMIO framework API].
These utilities help us to safeguard the access to individual bit fields of
memory-mapped device registers and cleanly separate the declaration of device
registers from the driver logic. During the increased use of the API, we
observe that the 'Genode::Mmio' class template operates mostly on addresses
that belong to dataspaces provided by core's IO_MEM service. Those dataspaces
are typically obtained via the 'Attached_io_mem_dataspace' convenience class,
which requests the dataspace and attaches it to the local address
space at once. To further reduce repetitive code, we introduced the new
'Attached_mmio' class (located at 'os/attached_mmio.h'), which handles the
common case of making the content of a IO_MEM dataspace available through
register definitions using the 'Mmio' utility. Furthermore, the MMIO framework
API has been enhanced with a variant of the 'Mmio::wait_for()' function that
waits for whole register values rather than bits.
:Synchronized interfaces:
Most Genode programs are multi-threaded, which makes the proper use of locks
inevitable. For most data structures, Genode does not implicitly manage the
locking but expects the user of the data structures to know what he is doing.
This way, we can avoid the locking overhead if a data structure is known to be
accessed by a single thread only. If accessed by multiple threads, we usually
wrap such data structures within an accessor interface that takes care of the
locking. For example, for the 'Allocator' interface, there exists a
corresponding 'Synchronized_allocator' interface wrapper. This technique works
well as long as the number of interfaces is low -- as is the case for Genode's
base API. However, as the wrapper code is for the most part pretty dumb, we'd
like to avoid it. Also, when using the Genode API to implement programs on
top, we do not anticipate manually creating such accessor wrappers. To ease
the creation of synchronized interfaces, we introduced the new
'Synced_interface' class template. It takes a pointer to an existing interface
and a lock as arguments. An instance of a 'Synced_interface' provides
synchronized access to the wrapped interface functions via the 'operator ()'.
Because the 'Synced_interface' does not provide any means to obtain the
unsynchronized version of the interface, once wrapped, the interface cannot be
misused by subsystems that get handed over a reference to a
'Synced_interface'. To see how to employ this utility, please have a look of
how we realize the synchronization within the Vancouver VMM (in particular,
the access to the motherboard).
Low-level OS infrastructure
###########################
TCP/IP performance
==================
On the course of the automated benchmarking described in Section
[Automated quality-assurance testing], we conducted the following steps
to enable benchmarks and to improve performance at the TCP/IP level.
At application level, we desire to compare our network performance with the
performance on GNU/Linux using commodity benchmarks. For this reason, netperf
has been ported to run as native Genode using the lwIP stack. This benchmark
allows us to systematically compare our results with those achieved by Linux.
The port of netperf is available in the ports repository.
In addition to running a commodity benchmark, we pursue synthetic benchmarks
that model the behaviour of typical application scenarios, for example, a
web server that receive many small requests. This is where the added
'test-ping_client' and 'test-ping_server' tests come into play. The test
is located at 'libports/src/test/lwip/pingpong'. It is used by the
series of 'network_test_*.run' scripts located at 'libports/run'. The
run scripts exercise the test in various scenarios and thereby allow us to
systematically explore the impact of the libc and NIC bridge on the
application performance.
# Using raw lwIP without the libc
# Like the first test, but with an instance of the NIC bridge in between the
test program and the driver.
# Using lwIP with the libc socket bindings
# Like the third test, but with NIC bridge added
To keep track of the lwIP development more closely, we switched to the
Git version of lwIP instead of using a source snapshot.
Furthermore, we incorporated "window scaling" support (RFC 1323) into our
version of lwIP as we identify the TCP window size as a limiting factor
of the TCP throughput achieved via lwIP.
C runtime
=========
We added support for "resolv" functionality to the libc_lwip_nic_dhcp plugin.
Normally, a file called 'resolv.conf' is expected to be located at '/etc'.
On Genode, however, we don't have a global file system, which makes this
way of configuration cumbersome. To ease the provision of a simple default
'resolv.conf' configuration, the plugin hands out the file as a virtual file.
The configuration automatically provides the DNS server address acquired by
lwIP via DHCP. If, for some reason, this policy is not desired, the feature
can be disabled via:
! <libc resolv="no" />
*Note that the configuration of the C runtime has changed*
To foster consistency of the libc configuration, we moved the static
network "interface" attributes into the 'libc' XML node. A new configuration
of static networking would look as follows:
! <libc ip_addr="..." netmask="..." gateway="..." />
Terminal
========
Genode's custom terminal implementation has been improved to better handle
widely used escape sequences.
The new version is able to handle two-argument SGR commands with
attribute/color arguments in any order, and supports the ED, EL0, and
CUB commands.
Because the terminal classes do not rely on any 3rd-party code, they
have been moved to the os repository at 'os/include/terminal'. This way,
we can use those classes by other components of the os repository such
as the new CLI monitor.
FS-LOG service
==============
Using the new FS-LOG service residing at 'libports/os/src/server/fs_log', log
messages of different processes can be redirected to files on a file-system
service. The assignment of processes to files can be expressed in the
configuration as follows:
! <start name="fs_log">
! <resource name="RAM" quantum="2M"/>
! <provides><service name="LOG"/></provides>
! <config>
! <policy label="noux" file="/noux.log" />
! <policy label="noux ->" file="/noux_process.log" />
! </config>
! </start>
In this example, all messages originating from the noux process are directed
to the file '/noux.log'. All messages originating from children of the noux
process end up in the file '/noux_process.log'.
Liquid FB
=========
Liquid FB is a virtual framebuffer service that uses the nitpicker GUI
server as back end. The virtual framebuffer is presented as a movable
window with a title bar. Until now, we used it primarily for demonstration
purposes, i.e., it is part of Genode's default demo scenario.
Thanks to our forthcoming adaptation of Qt5 to Genode, which requires a
very similar solution to interface Qt5's platform-abstraction layer (QPA) to
Genode, liquid FB got in the spotlight of this release.
First, we took the chance to update its configuration parameters to
become more consistent with similar services such as nit_fb. As liquid_fb was
originally conceived at a time when Genode's XML parser did not support
XML attributes, its configuration syntax used to be a bit arcane. This
has changed now. Apart from this cosmetic refinement, there are two prominent
new features: Support for resizing the framebuffer window with the
mouse and support for dynamic reconfiguration of the virtual framebuffer
via Genode's configuration mechanism.
When the liquid FB window gets resized by the user, the virtual framebuffer
emits a mode-changed signal to its client, which, in turn can handle the
event by re-acquiring the frame-buffer dataspace.
The added support for dynamic reconfiguration allows for changing the
properties of a liquid FB instance via Genode's configuration mechanism.
For example, the window position and size can be manipulated this way.
Furthermore, two new configuration options have been added. The
'resize_handle' option shows or hides the resize handle widget at the
lower-right window corner (by default, it is hidden). The 'decoration' option
defines whether window decorations should be visible (default is yes). Both
options can have the values "on" or "off".
3rd-party libraries
###################
The following 3rd-party libraries have been added or updated:
* To complement libSDL, we have added ports of SDL_ttf, SDL_image,
SDL_image, SDL_mixer, and SDL_loadso. Those additions to libSDL
are used by popular libSDL-based applications such as Tuxpaint.
They are now available at the libports repository.
* GNU FriBidi 0.19.5 added to the libports repository
* Qt4 updated to version 4.8.4
* zlib updated to version 1.2.8
Device drivers
##############
Unified driver names
====================
The growing diversity of supported hardware platforms calls for improved
conventions of how to name device drivers. Otherwise, run scripts that are
meant to support a wide range of platforms will eventually become more
and more complicated due to platform-dependent conditional configuration
snippets. For example, the default framebuffer drivers of the respective
platforms used to be called "vesa_drv" (for x86), "omap4_fb_drv", or "pl11x_drv".
In order to support the different platforms, run scripts that were otherwise
platform-agnostic had to explicitly deal with those differences.
To solve this issue, we introduced a generic SPEC values for device types, for
which a default driver is expected to exist. If a platform features a
framebuffer driver, it includes the SPEC value "framebuffer". On each
platform, the default driver for the respective device has the same name. So
each of "vesa_drv", "pl11x_drv", and "omap4_fb_drv" had been renamed to
"fb_drv". This is possible because the use of those drivers is mutually
exclusive.
The same convention has been applied to GPIO drivers as well. The
corresponding SPEC value is called "gpio". The driver binaries are called
"gpio_drv".
ATAPI
=====
LBA48 support has been added to the ATAPI driver. Thanks to Ivan Loskutov!
KDB UART driver for L4/Fiasco and Fiasco.OC
===========================================
The new KDB UART driver at 'os/src/drivera/uart/kdb' uses the kernel debugger
console as backend for input and output. This is useful in the case that only
one UART is available as described in Section [Terminal infrastructure].
Examples for using the kdb_uart_drv are available in the form of the run scripts
'ports-foc/run/l4linux.run' and 'os/run/kdb_uart_drv.run'.
Revised GPIO session interface
==============================
The original design of the GPIO session interface enabled the client of a
single session to interact with any number GPIO pins. Each function of the
interface took a GPIO number as first argument, which addressed the GPIO pin.
To simplify the interface and to enable fine-grained GPIO-assignment policies,
the interface has been changed to provide access to a single GPIO pin per
session only. At session creation time, the client specifies a single GPIO
pin, to which the session refers. This information can be evaluated for the
session routing. So access-control policies can be easily implemented per GPIO
pin. The server stores the pin as part of the session context and implicitly
uses the pin for operations on the session interface.
Furthermore, a generic driver interface for GPIO-class-device drivers
has been introduced. The new interface at 'os/include/gpio' alleviates the
need to implement the boilerplate code to interface the driver with Genode.
The existing GPIO drivers for OMAP4 and i.MX53 are the first beneficiaries of
these changes.
Exynos 5 SoC
============
After principally enabling the Exynos 5 SoC platform in the previous
release, we moved on with extending the device-driver coverage of this SoC. In
particular, we addressed USB networking, XHCI (USB-3), Gigabit networking over
USB-3, eMMC, and SATA.
The development of those device drivers follows our rationale that guided our
[http://genode.org/documentation/articles/pandaboard - previous work on the OMAP4 platform].
For the USB driver, we employed the device-driver-environment (DDE) approach
for reusing the Linux USB stack and the host controller drivers. In contrast,
the eMMC and SATA drivers are built as genuine Genode drivers with no
3rd-party code used.
Technically, the addition of Exynos-5 support to our USB driver was
an evolutionary step. It required us to add the corresponding EHCI
controller and to supply a few additions to the device-driver
environment. To simplify the driver, we decided to let the driver
rely on the platform initialization as performed by the U-Boot boot
loader. Since the initialization is performed during the boot process
already, there is no need to do this work twice. Because the platforms
supported by the USB driver become more and more diverse, we re-organized the
internal structure of the 'dde_linux' repository to keep those platforms well
separated. Furthermore, we reworked the memory management of the USB driver to
improve the utilization of the available RAM. The new solution employs Genode's
concept of managed dataspaces to manage a part of the local address-space
layout manually. This helps us to implement a fast translation of driver-local
virtual addresses to physical addresses as needed for issuing DMA requests.
The eMMC driver builds upon our protocol implementation for the SD-card
protocol, which was originally developed for the OMAP4 SD-card driver.
Because we kept the SD-card protocol implementation well separated
from the host-controller driver, it was possible to leverage parts of our
existing work for the eMMC driver. Because the eMMC protocol is an extension
of the SD-card protocol, however, we needed to enhance the protocol
implementation accordingly. The extension comprises support for the
MMC_SEND_EXT_CSD, MMC_SEND_OP_COND, and STOP_TRANSMISSION commands as well as
the MMC detection. The host controller driver was implemented from scratch
with the help of I/O access traces gathered from instrumenting the U-Boot boot
loader and the Linux kernel. The driver operates the eMMC in high-speed, 8-bit
mode at 52 MHz using DMA. The implementation can be found at
'os/src/drivers/sd_card/exynos5'.
The initial version of our new SATA driver for Exynos 5 has been implemented
from the ground up. Even though it is at an early stage, it has been
successfully tested with a UDMA-133 disk, e.g., our generic block test
is passed and the disk can be attached as a block device to an instance of
L4Linux.
Freescale i.MX SoC
==================
The support for the Freescale i.MX53 SoC has been extended by a number of
devices. All drivers reside in the os repository under the 'os/src/drivers'
subdirectory.
The general-purpose I/O (GPIO) driver located at 'gpio/imx53' implements the
revised GPIO-session interface.
The i.MX53 input driver provides support for the input devices featured on the
i.MX53 SABRE tablet. The tablet uses an Egalaxy touchscreen and Freescale's
MPR121 capacitative touch buttons. Both are supported by the new driver. The
driver is located at 'input/imx53'.
The new framebuffer driver for the i.MX53 quick-start board (QSB) as well as
the SABRE tablet comes with special support for using the
hardware overlay feature provided by the i.MX53 image processing unit (IPU)
Access to the overlay is implemented via an IPU-specific extension
of the framebuffer-session interface. To combine the driver well with
nitpicker using alpha-channels, optional support for double-buffering
is provided. The driver is located at 'framebuffer/imx53'.
As an abstraction of platform features that need to be accessed by
multiple drivers, a so-called platform driver has been introduced.
The platform driver safeguards the access to global resources such
as clocks and system-configuration bits. It can be found at 'platform/imx53'.
OMAP4 SoC
=========
The OMAP4 framebuffer driver used to support HDMI only, which was used
for connecting a display to the Pandaboard. To make the driver usable on
phones and tablets, the driver has been enhanced to support LCD output. Thanks
to Alexander Tarasikov for the patch and the insightful story about
[http://allsoftwaresucks.blogspot.com/2013/05/porting-genode-to-commercial-hardware.html - porting Genode to the B&N Nook HD+ tablet]!
USB
===
The USB driver of the 'dde_linux' repository has received substantial
improvements both feature-wise and under the hood.
First and foremost, the Linux device-driver environment, on which the
driver is based on, has been updated from kernel version 3.2 to version
3.9 as the latter version includes drivers for recent host controllers
such as DWC3 out of the box.
DWC3 is the host controller employed on the Exynos-5-based
Arndale platform for USB 3. We added the support needed to operate this
controller in XHCI mode and added support for Gigabit networking through
the ASIX AX88179 Gigabit-Ethernet Adapter as well as USB storage support.
Apart from extending the device-driver coverage, we revised the driver
internally. The back-end allocators for DMA buffers and normal memory have been
rewritten to allocate RAM more sparingly. Furthermore, we enabled the USB
driver for 64-bit x86 machines and improved the support for HID keyboards,
including the application of quirks to cherry keyboards.
*Note the change of the USB configuration*
With the addition of XHCI, the USB driver supports a growing number
of host controllers. In some situations, it is desirable to constrain the
driver to a subset of controllers only. For example, on the Arndale platform,
we desire to use a dedicated USB stack for XHCI, which operates completely
independent from the USB stack accessing USB-2. This way, gigabit networking
over USB-3 won't interfere with the operation of USB-2. To make this
possible, we added new configuration options to the USB driver.
With the new scheme, host controllers must be explicitly enabled in the
configuration. Supported config attributes are: 'uhci', 'ehci', and 'xhci'.
For example, a configuration snippet to enable UHCI and EHCI looks as
follows:
! <config uhci="yes" ehci="yes">
Updated iPXE device-driver environment
======================================
The iPXE device-driver environment was update to the most recent
iPXE upstream Git version in order to benefit from upstream improvements
of the Intel E1000 NIC driver.
Runtime environments
####################
Vancouver VMM on NOVA
=====================
Vancouver is the user-level virtual-machine monitor that accompanies the
NOVA hypervisor for hosting unmodified guest operating systems.
The most active line of development is led by Julian Stecklina at TU Dresden
via a fork called Seoul. In contrast to the original version of Vancouver,
this fork is open for outside contributions. Hence, it represents an ideal
platform for those parties with a stake in Vancouver to collaborate, i.e.,
the NUL userland, the NOVA runtime environment of TUD, and Genode.
In the current state of the transition, the Hip structure from Genode
is reused. String functions, which were formerly taken from NUL are now
provided by a stripped-down version of the C library called
'seoul_libc_support'. The nul/config.h is replaced by just using a constant
value in the one place where the file was needed.
The Genode-specific back ends of Vancouver, as largely introduced with the
previous Genode release, have been improved in several respects:
* CPUID 0x40000000: This instruction is issued by Linux when the KVM
guest support is compiled in. We have to return deterministic values to let
the Linux kernel survive.
* Replaced busy thread startup synchronization by proper locking.
* New locking scheme: We replaced the error-prone manual locking with the
use of the freshly introduced 'Synced_interface' for the motherboard and the
VCPU dispatcher. Also, all globally visible locks have been removed. They are
explicitly passed to subsystems only when needed.
* Improved PS/2 mouse back-end:
The previous version of the PS/2 mouse back end managed mouse-motion
events in a strange way, effectively throwing away most information
about the motion vector. Furthermore, the tracking of the mouse-button
states were missing. So drag-and-drop in a guest OS won't work. The new
version fixes those issues. For the transformation of input events to
PS/2 packets, the 'Genode::Register' facility is used, which greatly
simplifies the code.
L4Linux on Fiasco.OC
====================
We improved the memory management of L4Linux on Genode in two ways.
The first improvement is concerned about the upper limit of memory per Linux
instance. The corresponding discussion can be found at
[https://github.com/genodelabs/genode/issues/414 - issue #414].
We changed our L4Re emulation library to match the semantics of the original
L4Re more closely. Furthermore, we removed a heuristic in the L4Linux kernel,
which assumed that all kernel-local addresses above 0x8000000 refer to device
resources. In our version of L4Linux, there exist no MMIO resources. In
contrary, the virtual addresses above this addresses are used for normal
memory. By removing this artificial restriction with regard to the virtual
memory layout of the L4Linux kernel, we can host a larger kernel memory area.
The second improvement is concerned with the allocation of L4Linux
memory at Genode's core. Until now, L4Linux used to allocate its memory
as one contiguous RAM dataspace at core's RAM service. Core tries to
naturally align the allocation to improve the likelihood for large-page
mappings. So a dataspace is likely to be physically located at a
power-of-two boundary larger or equal than the dataspace size. For example,
the allocation of a 100 MiB RAM dataspace for a Linux instance will
be located at a 128 MiB boundary. If multiple of such allocations happen
sub-sequentially, this allocation strategy results in 28 MiB gaps between
100 MiB dataspaces. This memory cannot be used for large contiguous
allocations anymore. So even if the available memory capacity is far
larger than 100 MiB, an allocation of a 100 MiB block may fail.
To relieve this problem, we weakened the requirement for contiguous memory
by assembling L4Linux memory from multiple chunks of small dataspaces.
For example, by using a chunk size of 16 MiB, core's best-fit allocator
will have a better chance to find a more suited position for allocation
when aligning the block to a 16 MiB boundary compared to the allocation
of a larger block. Furthermore, slack memory can be used more efficiently
because smaller gaps (such as a 20 MiB gap) remain to be usable for L4Linux.
The discussion of this topic and the individual patch can be found at
[https://github.com/genodelabs/genode/issues/695 - issue #695].
Furthermore, the L4Linux block driver has been improved to support large
partitions.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Raspberry Pi
~~~~~~~~~~~~
Principal support for the Raspberry Pi platform has been added to the base-hw
kernel. The popular Raspberry Pi board is based on an ARMv6 Broadcom BCM2835
SoC. The current scope of the platform support comprises:
* IRQ controller driver: Because the interrupt controller uses a cascade of
registers, we settled on the following IRQ enumeration scheme.
IRQ numbers 0..7 refer to the basic IRQs.
IRQ numbers 8..39 refer to GPU IRQs 0..31.
IRQ numbers 40..71 refer to GPU IRQs 32..63.
* The kernel employs the so-called system timer for the preemptive scheduling.
* Core's LOG messages are printed over the PL011-based UART.
* The user-level timer driver uses the so-called ARM timer, which is a
slightly modified SP804 timer device.
Up to this point, a few device driver are missing to use Genode on the
Raspberry Pi in practice, most notably USB.
To build and run Genode on the Raspberry Pi, create a new build directory
via the 'create_builddir' tool, specifying 'hw_rpi' as platform.
User-level timer driver for Arndale platform
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By adding our new Exynos 5250 PWM timer driver, the base-hw kernel can now
be used for executing meaningful scenarios on the Arndale board including
the USB stack and networking.
Linux
=====
Until now, Genode on Linux supported x86-based platforms only.
The newly added 'linux_arm' platform clears the way to run Genode directly on
Linux-based ARM platforms. Genode's entire software stack is supported,
including the dynamic linker, graphical applications, and Qt4.
As a known limitations, the libc 'setjmp()'/'longjmp()' doesn't currently
save/restore floating point registers.
Build system and tools
######################
The run tool has been enhanced as detailed in Section
[Automated quality-assurance testing].

View File

@@ -1,995 +0,0 @@
===============================================
Release notes for the Genode OS Framework 13.08
===============================================
Genode Labs
The release of version 13.08 marks the 5th anniversary of the Genode OS
framework. We celebrate this anniversary with the addition of three major
features that we have much longed for, namely the port of Qt5 to Genode,
profound multi-processor support, and a light-weight event tracing
framework. Additionally, the new version comes with new device drivers for
SATA 3.0 and power management for the Exynos-5 SoC, improved virtualization
support on NOVA on x86, updated kernels, and integrity checks for
downloaded 3rd-party source code.
Over the course of the past five years, Genode's development was primarily
motivated by adding and cultivating features to make the framework fit for as
many application areas as possible. Now that we have a critical mass of
features, the focus on mere functionality does not suffice anymore. The
question of what Genode can do ultimately turns into the question of how well
Genode can do something: How stable is a certain workload? How does networking
perform? How does it scale to multi-processor systems? Because we are lacking
concise answers to these kind of questions, we have to investigate.
When talking about stability, our recently introduced automated testing
infrastructure makes us more confident than ever. Each night, over 200
automated tests are performed, covering various kernels and several hardware
platforms. All those tests are publicly available in the form of so-called run
scripts and are under continues development.
Regarding performance investigations, recently we have begun to benchmark
application performance focusing on network throughput. Interestingly, our
measurements reveal significant differences between the used kernels, but
also shortcomings in our software stack. For example, currently we see that
our version of lwIP performs poorly with gigabit networking. To thoroughly
investigate such performance issues, the current version adds support
for tracing the behaviour of Genode components. This will allow us to get a
profound understanding of all inter-component interaction that are on the
critical path for the performance of complex application-level workloads.
Thanks to the Genode architecture, we could come up with a strikingly simple,
yet powerful design for a tracing facility. Section
[Light-weight event tracing] explains how it works.
When it comes to multi-processor scalability, we used to shy away from such
inquiries because, honestly, we haven't paid much consideration to it. This
view has changed by now. With the current release, we implemented the
management of CPU affinities right into the heart of the framework, i.e.,
Genode's session concept. Additionally, we cracked a damn hard nut by enabling
Genode to use multiple CPUs on the NOVA hypervisor. This kernel is by far the
most advanced Open-Source microkernel for the x86 architecture. However,
NOVA's MP model seemed to inherently contradict with the API design of Genode.
Fortunately, we found a fairly elegant way to go forward and we're able to
tame the beast. Section [Enhanced multi-processor support] goes into more
detail.
Functionality-wise, we always considered the availability of Qt on Genode as a
big asset. With the current release, we are happy to announce that we finally
made the switch from Qt4 to Qt5. Section [Qt5 available on all kernels] gives
insights into the challenges that we faced during porting work.
In addition to those highlights, the new version comes with improvements all
over the place. To name a few, there are improved support for POSIX threads,
updated device drivers, an updated version of the Fiasco.OC kernel and
L4Linux, and new device drivers for Exynos-5. Finally, the problem of
verifying the integrity of downloaded 3rd-party source codes has been
addressed.
Qt5 available on all kernels
############################
Since its integration with Genode version 9.02, Qt4 is regarded as
one of the most prominent features of the framework. For users, combining Qt
with Genode makes the world of sophisticated GUI-based end-user applications
available on various microkernels. For Genode developers, Qt represents by far
the most complex work load natively executed on top of the framework API,
thereby stressing the underlying system in any way imaginable. We have been
keeping an eye on Qt version 5 for a while and highly anticipate the direction
where Qt is heading. We think that the time is right to leave Qt4 behind to
embrace Qt5 for Genode.
For the time being, both Qt4 and Qt5 are available for Genode, but Qt4 is
declared as deprecated and will be removed with the upcoming version 13.11.
Since Qt5 is almost API compatible to Qt4, the migration path is relatively
smooth. So we recommend to move your applications over to Qt5 during the
next release cycle.
In the following, we briefly describe the challenges we faced while adding Qt5
support to Genode, point you to the place where to find Qt5 in the source
tree, and give quick-start instructions for getting a Qt5 application
scenario running.
We found that the biggest architectural difference between version 4 and
version 5 is the use of the so-called Qt Platform Abstraction (QPA) interface,
which replaces the former Qt Window System (QWS).
Moving from QWS to QPA
======================
With Qt4, we relied on QWS
to perform the window handling. A Qt4 application used to create a session to
Genode's GUI server (called nitpicker) and applied its graphical output onto a
virtual framebuffer. The virtual framebuffer was not visible per se. To make
portions of the virtual framebuffer visible on screen, the application had to
create so-called nitpicker views. A view is a rectangular area of the physical
screen that displays a (portion of) the virtual framebuffer. The position,
size, and stacking order of views is managed by the application. For each Qt
window, the application would simply create a corresponding nitpicker view and
maintain the consistency of the view with the geometry of the Qt window. Even
though each Qt application seemingly operated as a full-screen application
with the windows managed by the application-local QWS, the use of nitpicker
views still allowed the integration of any number of Qt applications into one
windowed environment.
With the advent of compositing window managers, the typical way of how an
application interacts with the window system of the OS changed. Whereas
old-generation GUIs relied on a tight interplay of the application with the
window server in order to re-generate newly exposed window regions whenever
needed (e.g., revealing the window content previously covered by another
window), the modern model of a GUI server keeps all pixels of all windows in
memory regardless of whether the window is visible or covered by other
windows. The use of one pixel buffer per window seems wasteful with respect to
memory usage when many large windows are overlapping each other. On the other
hand, this technique largely simplifies GUI servers and makes the
implementation of fancy effects, like translucent windows, straight forward.
Since memory is cheap, the Qt developers abandoned the old method and fully
embraced the buffer-per-window approach by the means of QPA.
For Genode, we faced the challenge that we don't have a window server
in the usual sense. With nitpicker, we have a GUI server, but with a more
radical design. In particular, nitpicker leaves the management of window
geometries and stacking to the client. In contrast, QPA expects the window
system to provide both means for a user to interactively change the window
layout and a way for an application to define the properties (such as the
geometry, title, and visibility) of its windows.
The obviously missing piece was the software component that deals with window
controls. Fortunately, we already have a bunch of native nitpicker applications
that come with client-side window controls, in particular the so-called liquid
framebuffer (liquid_fb). This nitpicker client presents a virtual framebuffer
in form of a proper window on screen and, in turn, provides a framebuffer and
input service. These services can be used by other Genode processes, for
example, another nested instance of nitpicker.
This way, liquid_fb lends itself to be the interface between the nitpicker
GUI server and QPA.
For each QPA window, the application creates a new liquid_fb instance as a
child process. The liquid_fb instance will request a dedicated nitpicker
session, which gets routed through the application towards the parent of the
application, which eventually routes the request to the nitpicker GUI server.
Finally, the liquid_fb instance announces its input and framebuffer services
to its parent, which happens to be the application. Now, the application is
able to use those services in order to access the window. Because the
liquid_fb instances are children of the application, the application can
impose control over those. In particular, it can update the liquid_fb
configuration including the window geometry and title at any time. Thanks to
Genode's dynamic reconfiguration mechanism, the liquid_fb instances are able
to promptly respond to such reconfigurations.
Combined, those mechanisms give the application a way to receive user input
(via the input services provided by the liquid_fb instances), perform
graphical output (via the virtual framebuffers provided by the liquid_fb
instances), and define window properties (by dynamically changing the
respective liquid_fb configurations). At the same time, the user can use
liquid_fb's window controls to move, stack, and resize application windows as
expected.
[image qt5_screenshot]
Steps of porting Qt5
====================
Besides the switch to QPA, the second major change was related to the build
system. For the porting work, we use a Linux host system to obtain the
starting point for the build rules. The Qt4 build system would initially
generate all Makefiles, which could be inspected and processed at once. In
contrast, Qt5 generates Makefiles during the build process whenever needed.
When having configured Qt for Genode, however, the build on Linux will
ultimately fail. So the much-desired intermediate Makefiles won't be created.
The solution was to have 'configure' invoke 'qmake -r' instead of 'qmake'.
This way, qmake project files will be processed recursively. A few additional
tweaks were needed to avoid qmake from backing out because of missing
dependencies (qt5_configuration.patch). To enable the build of the Qt tools
out of tree, qmake-specific files had to be slightly adapted
(qt5_tools.patch). Furthermore, qtwebkit turned out to use code-generation
tools quite extensively during the build process. On Genode, we perform this
step during the 'make prepare' phase when downloading and integrating the Qt
source code with the Genode source tree.
For building Qt5 on Genode, we hit two problems. First, qtwebkit depends on
the ICU (International Components for Unicode) library, which was promptly
ported and can be found in the libports repository. Second, qtwebkit
apparently dropped the support of the 'QThread' API in favor of
POSIX-thread support only. For this reason, we had to extend the coverage
of Genode's pthread library to fulfill the needs of qtwebkit.
Once built, we entered the territory of debugging problems at runtime.
* We hit a memory-corruption problem caused by an assumption of 'QArrayData'
with regard to the alignment of memory allocated via malloc. As a
work-around, we weakened the assumptions to 4-byte alignment
(qt5_qarraydata.patch).
* Page faults in QWidgetAnimator caused by
use-after-free problems. Those could be alleviated by adding pointer
checks (qt5_qwidgetanimator.patch).
* Page faults caused by the slot function 'QWidgetWindow::updateObjectName()'
with a 'this' pointer of an incompatible type 'QDesktopWidget*'.
As a workaround, we avoid this condition by delegating the
'QWidgetWindow::event()' that happened to trigger the slot method to
'QWindow' (base class of 'QWidgetWindow') rather than to a
'QDesktopWidget' member (qt5_qwidgetwindow.patch).
* We observed that Arora presented web sites incomplete, or including HTTP
headers. During the evaluation of HTTP data, a signal was sent to another
thread, which activated a "user provided download buffer" for optimization
purposes. On Linux, the receiving thread was immediately scheduled and
everything went fine. However, on some kernels used by Genode, scheduling
is different, so that the original thread continued to execute a bit longer,
ultimately triggering a race condition. As a workaround, we disabled the
"user provided download buffer" optimization.
* Page faults in the JavaScript engine of Webkit. The JavaScript
'RegExp.exec()' function returned invalid string objects. We worked around
this issue by deactivating the JIT compiler for the processing of
regular expressions (ENABLE_YARR_JIT).
The current state of the Qt5 port is fairly complete. It covers the core, gui,
jscore, network, script, scriptclassic, sql, ui, webcore, webkit, widgets,
wtf, and xml modules. That said, there are a few known limitations and
differences compared to Qt4. First, the use of one liquid_fb instance per
window consumes more memory compared to the use of QWS in Qt4. Furthermore,
external window movements are not recognized by our QPA implementation yet.
This can cause popup menus to appear at unexpected positions. Key repeat is
not yet handled. The 'QNitpickerViewWidget' is not yet adapted to Qt5. For this
reason, qt_avplay is not working yet.
Test drive
==========
Unlike Qt4, which was hosted in the dedicated 'qt4' repository, Qt5 is
integrated in the libports repository. It can be downloaded and integrated
into the Genode build system by issuing 'make prepare' from within the
libports repository. The Qt5 versions of the known Qt examples are located at
libports/src/app/qt5. Ready-to-use run scripts for those examples are available
at libports/run.
Migration away from Qt4 to Qt5
==============================
The support for Qt4 for Genode has been declared as deprecated. By default,
it's use is inhibited to avoid name aliasing problems between both versions.
Any attempt to build a qt4-based target will result in a message:
!Skip target app/qt_launchpad because it requires qt4_deprecated
To re-enable the use of Qt4, the SPEC value qt4_deprecated must be defined
manually for the build directory:
!echo "SPECS += qt4_deprecated" >> etc/specs.conf
We will keep the qt4 repository in the source tree during the current
release cycle. It will be removed with version 13.11.
Light-weight event tracing
##########################
With Genode application scenarios getting increasingly sophisticated,
the need for thorough performance analysis has come into spotlight.
Such scenarios entail the interaction of many components.
For example, with our recent work on optimizing network performance, we
have to consider several possible attack points:
* Device driver: Is the device operating in the proper mode? Are there
CPU-intensive operations such as allocations within the critical path?
* Interface to the device driver: How frequent are context switches between
client and device driver? Is the interface designed appropriately for
the access patterns?
* TCP/IP stack: How does the data flow from the raw packet level to the
socket level? How dominant are synchronization costs between the involved
threads? Are there costly in-band operations performed, e.g., dynamic
memory allocations per packet?
* C runtime: How does integration of the TCP/IP stack with the C runtime
work, for example how does the socket API interfere with timeout
handling during 'select' calls?
* Networking application
* Timer server: How often is the timer consulted by the involved components?
What is the granularity of timeouts and thereby the associated costs for
handling them?
* Interaction with core: What is the profile of the component's interaction
with core's low-level services?
This example is just an illustration. Most real-world performance-critical
scenarios have a similar or even larger scope. With our traditional
tools, it is hardly possible to gather a holistic view of the scenario. Hence,
finding performance bottlenecks tends to be a series of hit-and-miss
experiments, which is a tiresome and costly endeavour.
To overcome this situation, we need the ability to gather traces of component
interactions. Therefore, we started investigating the design of a tracing
facility for Genode one year ago while posing the following requirements:
* Negligible impact on the performance, no side effects:
For example, performing a system call per traced event
is out of question because this would severely influence the flow of
control (as the system call may trigger the kernel to take a scheduling
decision) and the execution time of the traced code, not to speak of
the TLB and cache footprint.
* Kernel independence: We want to use the same tracing facility across
all supported base platforms.
* Accountability of resources: It must be clearly defined where the
resources for trace buffers come from. Ideally, the tracing tool should be
able to dimension the buffers according to its needs and, in turn, pay for
the buffers.
* Suitable level of abstraction: Only if the trace contains information at
the right level of abstraction, it can be interpreted for large scenarios.
A counter example is the in-kernel trace buffer of the Fiasco.OC kernel,
which logs kernel-internal object names and a few message words when tracing
IPC messages, but makes it almost impossible to map this low-level
information to the abstraction of the control flow of RPC calls. In
contrast, we'd like to capture the names of invoked RPC calls (which is an
abstraction level the kernel is not aware of). This requirement implies the
need to have useful trace points generated automatically. Ideally those
trace points should cover all interactions of a component with the outside
world.
* (Re-)definition of tracing policies at runtime: The
question of which information to gather when a trace point is passed
should not be solely defined at compile time. Instead of changing static
instrumentations in the code, we'd prefer to have a way to configure
the level of detail and possible conditions for capturing events at runtime,
similar to dtrace. This way, a series of different hypotheses could be
tested by just changing the tracing policy instead of re-building and
rebooting the entire scenario.
* Straight-forward implementation: We found that most existing tracing
solutions are complicated. For example, dtrace comes with a virtual
machine for the sandboxed interpretation of policy code. Another typical
source of complexity is the synchronization of trace-buffer accesses.
Because for Genode, low TCB complexity is of utmost importance, the
simplicity of the implementation is the prerequisite to make it an
integral part of the base system.
* Support for both online and offline analysis of traces.
We are happy to report to have come up with a design that meets all those
requirements thanks to the architecture of Genode. In the following, we
present the key aspects of the design.
The tracing facility comes in the form of a new TRACE service implemented
in core. Using this service, a TRACE client can gather information about
available tracing subjects (existing or no-longer existing threads),
define trace buffers and policies and assign those to tracing subjects,
obtain access to trace-buffer contents, and control the tracing state
of tracing subjects. When a new thread is created via a CPU session, the
thread gets registered at a global registry of potential tracing sources. Each
TRACE service manages a session-local registry of so-called trace subjects.
When requested by the TRACE client, it queries new tracing sources from the
source registry and obtains references to the corresponding threads. This way,
the TRACE session becomes able to control the thread's tracing state.
To keep the tracing overhead as low as possible, we assign a separate trace
buffer to each individually traced thread. The trace buffer is a shared memory
block mapped to the virtual address space of the thread's process. Capturing
an event comes down to a write operation into the thread-local buffer. Because
of the use of shared memory for the trace buffer, no system call is needed and
because the buffer is local to the traced thread, there is no need for
synchronizing the access to the buffer. When no tracing is active, a thread
has no trace buffer. The buffer gets installed only when tracing is started.
The buffer is not installed magically from the outside of the traced process
but from the traced thread itself when passing a trace point. To detect
whether to install a new trace buffer, there exists a so-called trace-control
dataspace shared between the traced process and its CPU service. This
dataspace contains control bits for each thread created via the CPU session.
The control bits are evaluated each time a trace point is passed by the
thread. When the thread detects a change of the tracing state, it actively
requests the new trace buffer from the CPU session and installs it into its
address space. The same technique is used for loading the code for tracing
policies into the traced process. The traced thread actively checks for
policy-version updates by evaluating the trace-control bits. If an update is
detected, the new policy code is requested from the CPU session. The policy
code comes in the form of position-independent code, which gets mapped into
the traced thread's address space by the traced thread itself. Once mapped,
a trace point will call the policy code. When called, the policy
module code returns the data to be captured into the trace buffer. The
relationship between the trace monitor (the client of TRACE service), core's
TRACE service, core's CPU service, and the traced process is depicted in
Figure [trace_control].
[image trace_control]
There is one trace-control dataspace per CPU session, which gets accounted
to the CPU session's quota. The resources needed for the
trace-buffer dataspaces and the policy dataspaces are paid-for by the
TRACE client. On session creation, the TRACE client can specify the amount
of its own RAM quota to be donated to the TRACE service in core. This
enables the TRACE client to define trace buffers and policies of arbitrary
sizes, limited only by its own RAM quota.
In Genode, the interaction of a process with its outside world is
characterized by its use of inter-process communication, namely synchronous
RPC, signals, and access to shared memory. For the former two types of
inter-process communication, Genode generates trace points automatically. RPC
clients generate trace points when an RPC call is issued and when a call
returned. RPC servers generate trace points in the RPC dispatcher, capturing
incoming RPC requests as well as RPC replies. Thanks to Genode's RPC
framework, we are able to capture the names of the RPC functions in the RPC
trace points. This information is obtained from the declarations of the RPC
interfaces. For signals, trace points are generated for submitting and
receiving signals. Those trace points form a useful base line for gathering
tracing data. In addition, manual trace points can be inserted into the code.
State of the implementation
===========================
The implementation of Genode's tracing facility is surprisingly low complex.
The addition to the base system (core as well as the base library) are
merely 1500 lines of code. The mechanism works across all base platforms.
Because the TRACE client provides the policy code and trace buffer to the
traced thread, the TRACE client imposes ultimate control over the traced
thread. In contrast to dtrace, which sandboxes the trace policy, we express
the policy module in the form of code executed in the context of the traced
thread. However, in contrast to dtrace, such code is never loaded into a large
monolithic kernel, but solely into the individually traced processes. So the
risk of a misbehaving policy is constrained to the traced process.
In the current form, the TRACE service of core should be considered as a
privileged service because the trace-subject namespace of each session
contains all threads of the system. Therefore, TRACE sessions should be routed
only for trusted processes. In the future, we plan to constrain the
namespaces for tracing subjects per TRACE session.
The TRACE session interface is located at base/include/trace_session/.
A simple example for using the service is available at os/src/test/trace/
and is accompanied with the run script os/run/trace.run. The test
demonstrates the TRACE session interface by gathering a trace of a thread
running locally in its address space.
Enhanced multi-processor support
################################
Multi-processor (MP) support is one of those features that most users take for
granted. MP systems are so ubiquitous, even on mobile platforms, that a
limitation to utilizing a single CPU only is almost a fallacy.
That said, MP support in operating systems is hard to get right. For this
reason, we successively deferred the topic on the agenda of Genode's
road map.
For some base platforms such as the Linux or Codezero kernels, Genode
always used to support SMP because the kernel would manage the affinity
of threads to CPU cores transparently to the user-level process. So on
these kernels, there was no need to add special support into the framework.
However, on most microkernels, the situation is vastly different. The
developers of such kernels try hard to avoid complexity in the kernel and
rightfully argue that in-kernel affinity management would contribute to kernel
complexity. Another argument is that, in contrast to monolithic kernels that
have a global view on the system and an "understanding" of the concerns of the
user processes, a microkernel is pretty clueless when it comes to the roles
and behaviours of individual user-level threads. Not knowing whether a thread
works as a device driver, an interactive program, or a batch process, the
microkernel is not in the position to form a reasonably useful model of the
world, onto which it could intelligently apply scheduling and affinity
heuristics. In fact, from the perspective of a microkernel, each thread does
nothing else than sending and receiving messages, and causing page faults.
For these reasons, microkernel developers tend to provide the bootstrapping
procedure for the physical CPUs and a basic mechanism to assign
threads to CPUs but push the rest of the problem to the user space, i.e.,
Genode. The most straight-forward way would make all physical CPUs visible
to all processes and require the user or system integrator to assign
physical CPUs when a thread is created. However, on the recursively
structured Genode system, we virtualize resources at each level, which
calls for a different approach. Section [Management of CPU affinities]
explains our solution.
When it comes to inter-process communication on MP systems, there is a
certain diversity among the kernel designs. Some kernels allow the user land
to use synchronous IPC between arbitrary threads, regardless of whether both
communication partners reside on the same CPU or on two different CPUs. This
convenient model is provided by Fiasco.OC. However, other kernels do not offer
any synchronous IPC mechanism across CPU cores at all, NOVA being a poster
child of this school of thought. If a user land is specifically designed for
a particular kernel, those peculiarities can be just delegated to the
application developers. For example, the NOVA user land called NUL is designed
such that a recipient of IPC messages spawns a dedicated thread on each
physical CPU. In contrast, Genode is meant to provide a unified API that
works well across various different kernels. To go forward, we had four
options:
# Not fully supporting the entity of API semantics across all base platforms.
For example, we could stick with the RPC API for synchronous communication
between threads. Programs just would happen to fail on some base platforms
when the called server resides on a different CPU. This would effectively
push the problem to the system integrator. The downside would be the
sacrifice of Genode's nice feature that a program developed
on one kernel usually works well on other kernels without any changes.
# Impose the semantics provided by the most restrictive kernel onto all
users of the Genode API. Whereas this approach would facilitate that
programs behave consistently across all base platforms, the restrictions
would be artificially imposed onto all Genode users, in particular the
users of kernels with less restrictions. Of course, we don't change
the Genode API lightheartedly, which attributes to our hesitance to go
into this direction.
# Hiding kernel restrictions behind the Genode API. This approach could come
in many different shapes. For example, Genode could transparently spawn a
thread on each CPU when a single RPC entrypoint gets created, following
the model of NUL. Or Genode could emulate synchronous IPC using the core
process as a proxy.
# Adapting the kernel to the requirements of Genode. That is, persuading
kernel developers to implement the features we find convenient, i.e., adding
a cross-CPU IPC feature to NOVA. History shows that our track record in
doing that is not stellar.
Because each of those options is like opening a different can of worms, we
used to defer the solution of the problem. Fortunately, however, we finally
kicked off a series of practical experiments, which led to a fairly elegant
solution, which is detailed in Section
[Adding multi-processor support to Genode on NOVA].
Management of CPU affinities
============================
In line with our experience of supporting
[http://www.genode.org/documentation/release-notes/10.02#Real-time_priorities - real-time priorities]
in version 10.02, we were seeking a way to express CPU affinities such that
Genode's recursive nature gets preserved and facilitated. Dealing with
physical CPU numbers would contradict with this mission. Our solution
is based on the observation that most MP systems have topologies that can
be represented on a two-dimensional coordinate system. CPU nodes close
to each other are expected to have closer relationship than distant nodes.
In a large-scale MP system, it is natural to assign clusters of closely
related nodes to a given workload. Genode's architecture is based on the
idea to recursively virtualize resources and thereby lends itself to the
idea to apply this successive virtualization to the problem of clustering
CPU nodes.
In our solution, each process has a process-local view on a so-called affinity
space, which is a two-dimensional coordinate space. If the process creates a
new subsystem, it can assign a portion of its own affinity space to the new
subsystem by imposing a rectangular affinity location to the subsystem's CPU
session. Figure [affinity_space] illustrates the idea.
[image affinity_space]
Following from the expression of affinities as a rectangular location within a
process-local affinity space, the assignment of subsystems to CPU nodes
consists of two parts, the definition of the affinity space dimensions as used
for the process and the association of sub systems with affinity locations
(relative to the affinity space). For the init process, the affinity space is
configured as a sub node of the config node. For example, the following
declaration describes an affinity space of 4x2:
! <config>
! ...
! <affinity-space width="4" height="2" />
! ...
! </config>
Subsystems can be constrained to parts of the affinity space using the
'<affinity>' sub node of a '<start>' entry:
! <config>
! ...
! <start name="loader">
! <affinity xpos="0" ypos="1" width="2" height="1" />
! ...
! </start>
! ...
! </config>
As illustrated by this example, the numbers used in the declarations for this
instance of the init process are not directly related to physical CPUs. If
the machine has just two cores, init's affinity space would be mapped
to the range [0,1] of physical CPUs. However, in a machine
with 16x16 CPUs, the loader would obtain 8x8 CPUs with the upper-left
CPU at position (4,0). Once a CPU session got created, the CPU client can
request the physical affinity space that was assigned to the CPU session
via the 'Cpu_session::affinity()' function. Threads of this CPU session
can be assigned to those physical CPUs via the 'Cpu_session::affinity()'
function, specifying a location relative to the CPU-session's affinity space.
Adding multi-processor support to Genode on NOVA
================================================
The NOVA kernel has been supporting MP systems for a long time. However
Genode did not leverage this capability until now. The main reason was that
the kernel does not provide - intentionally by the kernel developer - the
possibility to perform synchronous IPC between threads residing on different
CPUs.
To cope with this situation, Genode servers and clients would need to make
sure to have at least one thread on a common CPU in order to communicate.
Additionally, shared memory and semaphores could be used to communicate across
CPU cores. Both options would require rather fundamental changes to the Genode
base framework and the API. An exploration of this direction should in any
case be pursued in evolutionary steps rather than as one big change, also
taking into account that other kernels do not impose such hard requirements on
inter-CPU communication. To tackle the challenge, we conducted a series of
experiments to add some kind of cross-CPU IPC support to Genode/NOVA.
As a general implication of the missing inter-CPU IPC, messages between
communication partners that use disjoint CPUs must take an indirection through
a proxy process that has threads running on both CPUs involved. The sender
would send the message to a proxy thread on its local CPU, the proxy process
would transfer the message locally to the CPU of the receiver by using
process-local communication, and the proxy thread on the receiving CPU would
deliver the message to the actual destination. We came up with three options
to implement this idea prototypically:
# Core plays the role of the proxy because it naturally has access to all
CPUs and emulates cross-CPU IPC using the thread abstractions of the
Genode API.
# Core plays the role of the proxy but uses NOVA system calls directly
rather than Genode's thread abstraction.
# The NOVA kernel acts as the proxy and emulates cross-CPU IPC directly
in the kernel.
After having implemented the first prototypes, we reached the following
conclusions.
For options 1 and 2 where core provides this service: If a client can not
issue a local CPU IPC, it asks core - actually the pager of the client
thread - to perform the IPC request. Core then spawns or reuses a proxy thread
on the target CPU and performs the actual IPC on behalf of the client. Option
1 and 2 only differ in respect to code size and the question to whom to
account the required resources - since a proxy thread needs a stack and some
capability selectors.
As one big issue for option 1 and 2, we found that in order to delegate
capabilities during the cross-CPU IPC, core has to receive capability mappings
to delegate them to the target thread. However, core has no means to know
whether the capabilities must be maintained in core or not. If a capability is
already present in the target process, the kernel would just translate the
capability to the target's capability name space. So core wouldn't need to
keep it. In the other case where the target receives a prior unknown
capability, the kernel creates a new mapping. Because the mapping gets
established by the proxy in core, core must not free the capability.
Otherwise, the mapping would disappear in the target process. This means that
the use of core as a proxy ultimately leads to leaking kernel resources
because core needs to keep all transferred capabilities, just for the case a
new mapping got established.
For option 3, the same general functionality as for option 1 and 2 is
implemented in the kernel instead of core. If a local CPU IPC call
fails because of a BAD_CPU kernel error code, the cross-CPU IPC extension
will be used. The kernel extension creates - similar as to option 1 and 2 - a
semaphore (SM), a thread (EC), and a scheduling context (SC) on the remote
CPU and lets it run on behalf of the caller thread. The caller thread
gets suspended by blocking on the created semaphore until the remote EC has
finished the IPC. The remote proxy EC reuses the UTCB of the suspended caller
thread as is and issues the IPC call. When the proxy EC returns, it wakes up
the caller via the semaphore. Finally, the proxy EC and SC de-schedule
themselves and the resources get to be destroyed later on by the kernel's RCU
mechanism. Finally, when the caller thread got woken up, it takes care to
initiate the deconstruction of the semaphore.
The main advantage of option 3 compared to options 1 and 2 is that we don't
have to keep and track the capability delegations during a cross-CPU IPC.
Furthermore, we do not have potentially up to two additional address space
switches per cross-CPU IPC (from client to core and core to the server).
Additionally, the UTCB of the caller is reused by the proxy EC and does not
need to be allocated separately as for option 1 and 2.
For these reasons, we decided to go for the third option. From Genode's API
point of view, the use of cross-CPU IPC is completely transparent. Combined
with the affinity management described in the previous section, Genode/NOVA
just works on MP systems.
As a simple example for using Genode on MP systems, there is a ready-to-use
run script available at base/run/affinity.run.
Base framework
##############
Affinity propagation in parent, root, and RPC entrypoint interfaces
===================================================================
To support the propagation of CPU affinities with session requests, the
parent and root interfaces had to be changed. The 'Parent::Session'
and 'Root::Session' take the affinity of the session as a new argument.
The affinity argument contains both the dimensions of the affinity space
used by the session and the session's designated affinity location within
the space. The corresponding type definitions can be found at
base/affinity.h.
Normally, the 'Parent::Session' function is not used directly but indirectly
through the construction of a so-called connection object, which represents an
open session. For each session type there is a corresponding connection type,
which takes care of assembling the session-argument string by using the
'Connection::session()' convenience function. To maintain API compatibility,
we kept the signature of the existing 'Connection::session()' function using a
default affinity and added a new overload that takes the affinity as
additional argument. Currently, this overload is used in
cpu_session/connection.h.
For expressing the affinities of RPC entrypoints to CPUs within the affinity
space of the server process, the 'Rpc_entrypoint' takes the desired affinity
location of the entrypoint as additional argument. For upholding API
compatibility, the affinity argument is optional.
CPU session interface
=====================
The CPU session interface underwent changes to accommodate the new event
tracing infrastructure and the CPU affinity management.
Originally the 'Cpu_session::num_cpus()' function could be used to
determine the number of CPUs available to the session. This function
has been replaced by the new 'affinity_space' function, which returns the
bounds of the CPU session's physical affinity space. In the simplest case of
an SMP machine, the affinity space is one-dimensional where the width
corresponds to the number of CPUs. The 'affinity' function, which is used to
bind a thread to a specified CPU, has been changed to take an affinity
location as argument. This way, the caller can principally express the
affiliation of the thread with multiple CPUs to guide load-balancing in a CPU
service.
New TRACE session interface
===========================
The new event tracing mechanism as described in Section
[Light-weight event tracing] is exposed to Genode processes in the form
of the TRACE service provided by core. The new session interface
is located under base/include/trace_session/. In addition to the new session
interface, the CPU session interface has been extended with functions for
obtaining the trace-control dataspace for the session as well as the trace
buffer and trace policy for a given thread.
Low-level OS infrastructure
###########################
Event-driven operation of NIC bridge
====================================
The NIC bridge component multiplexes one physical network device among
multiple clients. It enables us to multiplex networking on the network-packet
level rather than the socket level and thereby take TCP/IP out of the
critical software stack for isolating network applications. As it
represents an indirection in the flow of all networking packets, its
performance is important.
The original version of NIC bridge was heavily multi-threaded. In addition to
the main thread, a timer thread, and a thread for interacting with the NIC
driver, it employed one dedicated thread per client. By merging those flows of
control into a single thread, we were able to significantly reduce the number
of context switches and improve data locality. These changes reduced the
impact of the NIC bridge on the packet throughput from 25% to 10%.
Improved POSIX thread support
=============================
To accommodate qtwebkit, we had to extend Genode's pthread library with
working implementations of condition variables, mutexes, and thread-local
storage. The implemented functions are attr_init, attr_destroy, attr_getstack,
attr_get_np, equal, mutex_attr, mutexattr_init, mutexattr_destroy,
mutexattr_settype, mutex_init, mutex_destroy, mutex_lock, mutex_unlock,
cond_init, cond_timedwait, cond_wait, cond_signal, cond_broadcast, key_create,
setspecific, and getspecific.
Device drivers
##############
SATA 3.0 on Exynos 5
====================
The previous release featured the initial version of our SATA 3.0 driver for
the Exynos 5 platform. This driver located at os/src/drivers/ahci/exynos5 has
reached a fully functional state by now. It supports UDMA-133 with up to
6 GBit/s.
For driver development, we set the goal to reach a performance equal to
the Linux kernel. To achieve that goal, we had to make sure to
operate the controller and the disks in the same ways as Linux does.
For this reason, we modeled our driver closely after the behaviour of the
Linux driver. That is, we gathered traces of I/O transactions to determine the
initialization steps and the request patterns that Linux performs to access
the device, and used those behavioral traces as a guide for our
implementation. Through step-by-step analysis of the traces, we not only
succeeded to operate the device in the proper modes, but we also found
opportunities for further optimization, in particular regarding the error
recovery implementation.
This approach turned out to be successful. We measured that our driver
generally operates as fast (and in some cases even significantly faster)
than the Linux driver on solid-state disks as well as on hard disks.
Dynamic CPU frequency scaling for Exynos 5
==========================================
As the Samsung Exynos-5 SoC is primarily targeted at mobile platforms,
power management is an inherent concern. Until now, Genode did not pay
much attention to power management though. For example, we completely
left out the topic from the scope of the OMAP4 support. With the current
release, we took the first steps towards proper power management on ARM-based
platforms in general, and the Exynos-5-based Arndale platform in particular.
First, we introduced a general interface to regulate clocks and voltages.
Priorly, each driver did its own part of configuring clock and power control
registers. The more device drivers were developed, the higher were the chances
that they interfere when accessing those clock, or power units.
The newly introduced "Regulator" interface provides the possibility to enable
or disable, and to set or get the level of a regulator. A regulator might be
a clock for a specific device (such as a CPU) or a voltage regulator.
For the Arndale board, an exemplary implementation of the regulator interface
exists in the form of the platform driver. It can be found at
os/src/drivers/platform/arndale. Currently, the driver implements
clock regulators for the CPU, the USB 2.0 and USB 3.0 host controller, the
eMMC controller, and the SATA controller. Moreover, it provides power
regulators for SATA, USB 2.0, and USB 3.0 host controllers. The selection of
regulators is dependent on the availability of drivers for the platform.
Otherwise it wouldn't be possible to test that clock and power state doesn't
affect the device.
Apart from providing regulators needed by certain device drivers, we
implemented a clock regulator for the CPU that allows changing the CPU
frequency dynamically and thereby giving the opportunity to scale down
voltage and power consumption. The possible values range from 200 MHz to
1.7 GHz whereby the last value isn't recommended and might provoke system
crashes due to overheating. When using Genode's platform driver for Arndale
it sets CPU clock speed to 1.6 GHz by default. When reducing
the clock speed to the lowest level, we observed a power consumption
reduction of approximately 3 Watt. Besides reducing dynamic power consumption
by regulating the CPU clock frequency, we also explored the gating of the clock
management and power management to further reduce power consumption.
With the CPU frequency scaling in place, we started to close all clock gates
not currently in use. When the platform driver for the Arndale board gets
initialized, it closes everything. If a device driver enables its clock
regulator, all necessary clock gates for the device's clock are opened. This
action saves about 0.7 Watt. The initial closing of all unnecessary power
gates was much more effective. Again, everything not essential for the working
of the kernel is disabled on startup. When a driver enables its power
regulator, all necessary power gates for the device are opened. Closing all
power gates saves about 2.6 Watt.
If we consider all measures taken to save power, we were able to reduce power
consumption to about 59% without performance degradation. When measuring power
consumption after boot up, setting the CPU clock to 1.6 GHz, and fully load
both CPU cores without the described changes, we measured about 8 Watt. With
the described power saving provisions enabled, we measured about 4.7 Watt.
When further reducing the CPU clock frequency to 200 MHz, only 1.7 Watt were
measured.
VESA driver moved to libports
=============================
The VESA framebuffer driver executes the initialization code located
in VESA BIOS of the graphics card. As the BIOS code is for real mode,
the driver uses the x86emu library from X11 as emulation environment.
We updated x86emu to version 1.20 and moved the driver from the 'os'
repository to the 'libports' repository as the library is third-party
code. Therefore, if you want to use the driver, the 'libports'
repository has to be prepared
('make -C <genode-dir>/libports prepare PKG=x86emu') and enabled in
your 'etc/build.conf'.
Runtime environments
####################
Seoul (aka Vancouver) VMM on NOVA
=================================
Since we repeatedly received requests for using the Seoul respectively
Vancouver VMM on NOVA, we improved the support for this virtualization
solution on Genode. Seoul now supports booting from raw hard disk images
provided via Genode's block session interface. Whether this image is actually
a file located in memory, or it is coming directly from the hard disk, or just
from a partition of the hard disk using Genode's part_blk service, is
completely transparent thanks to Genode's architecture.
Additionally, we split up the one large Vancouver run script into several
smaller Seoul run scripts for easier usage - e.g. one for disk, one for
network testing, one for automated testing, and one we call "fancy". The
latter resembles the former vancouver.run script using Genode's GUI to let the
user start VMs interactively. The run scripts prefixed with 'seoul-' can be
found at ports/run. For the fancy and network scripts, ready-to-use VM images
are provided. Those images are downloaded automatically when executing the run
script for the first time.
L4Linux on Fiasco.OC
====================
L4Linux has been updated from version 3.5.0 to Linux kernel version 3.9.0 thus
providing support for contemporary user lands running on top of L4Linux on both
x86 (32bit) and ARM platforms.
Noux runtime for Unix software
==============================
Noux is our way to use the GNU software stack natively on Genode. To improve
its performance, we revisited the address-space management of the runtime to
avoid redundant revocations of memory mappings when Noux processes are cleaned
up.
Furthermore, we complemented the support for the Genode tool chain to
cover GNU sed and GNU grep as well. Both packages are available at the ports
repository.
Platforms
#########
Fiasco.OC updated to revision r56
=================================
Fiasco.OC and the required L4RE parts have been updated to the current SVN
revision (r56). For us, the major new feature is the support of Exynos SOCs in
the mainline version of Fiasco.OC (www.tudos.org). Therefore Genode's
implementation of the Exynos5250 platform could be abandoned leading to less
maintenance overhead of Genode on Fiasco.OC.
Furthermore, Genode's multi-processor support for this kernel has been
improved so that Fiasco.OC users benefit from the additions described in
Section [Enhanced multi-processor support].
NOVA updated
============
In the process of our work on the multi-processor support on NOVA, we updated
the kernel to the current upstream version. Additionally, our customized branch
(called r3) comes with the added cross-CPU IPC system call and improvements
regarding the release of kernel resources.
Integrity checks for downloaded 3rd-party software
##################################################
Even though Genode supports a large variety of 3rd-party software, its
source-code repository contains hardly any 3rd-party source code. Whenever
3rd-party source code is needed, Genode provides automated tools for
downloading the code and integrating it with the Genode environment. As of
now, there exists support for circa 70 software packages, including the
tool chain, various kernels, libraries, drivers, and a few applications. Of
those packages, the code for 13 packages comes directly from their respective
Git repositories. The remaining 57 packages are downloaded in the form of tar
archives from public servers via HTTP or FTP. Whereas we are confident with
the integrity of the code that comes from Git repositories, we are less so
about the archives downloaded from HTTP or FTP servers.
Fortunately, most Open-Source projects provide signature files that allow
the user to verify the origin of the archive. For example, archives of
GNU software are signed with the private key of the GNU project. So the
integrity of the archive can be tested with the corresponding public key.
We used to ignore the signature files for many years but
this has changed now. If there is a signature file available for a package,
the package gets verified right after downloading. If only a hash-sum file
is provided, we check it against a known-good hash sum.
The solution required three steps, the creation of tools for validating
signatures and hashes, the integration of those tools into Genode's
infrastructure for downloading the 3rd-party code, and the definition of
verification rules for the individual packages.
First, new tools for downloading and validating hash sums and signatures were
added in the form of the shell scripts download_hashver (verify hash sum) and
download_sigver (verify signature) found at the tool/ directory. Under the
hood, download_sigver uses GNU GPG, and download_hashver uses the tools
md5sum, sha1sum, and sha256sum provided by coreutils.
Second, hooks for invoking the verification tools were added to the
tool-chain build script as well as the ports and the libports repositories.
The third and the most elaborative step, was going through all the packages,
looking for publicly available signature files, and adding corresponding
package rules. As of now, this manual process has been carried out for 30
packages, thereby covering the half of the archives.
Thanks to Stephan Mueller for pushing us into the right direction, kicking off
the work on this valuable feature, and for the manual labour of revisiting all
the 3rd-party packages!

View File

@@ -1,791 +0,0 @@
===============================================
Release notes for the Genode OS Framework 14.02
===============================================
Genode Labs
During the release cycle of version 14.02, our development has been focused on
storage and virtualization. It goes without saying that proper support for
block-device access and file systems is fundamental for the use of
Genode as general-purpose OS. Virtualization is relevant as well because
it bridges the gap between the functionality we need and the features
natively available on Genode today.
Our work on the storage topic involved changes of the block-driver APIs to an
asynchronous mode of operation, overhauling most of the existing block-level
components, as well as the creation of new block services, most importantly a
block cache. At file-system level, we continued our line of work on FUSE-based
file systems, adding support for NTFS-3g. A new highlight, however, is a new
file-system service that makes the file systems of the NetBSD kernel available
to Genode. This is made possible by using rump kernels as described in Section
[NetBSD file systems using rump kernels].
Virtualization on Genode has a long history, starting with the original
support of OKLinux on the OKL4 kernel (OKLinux is no longer supported), over
the support of L4Linux on top of the Fiasco.OC kernel, to the support of the
Vancouver VMM on top of NOVA. However, whereas each of those variants has
different technical merits, all of them were developed in the context of
university research projects and were never exposed to real-world scenarios.
We were longing for a solution that meets the general expectations from a
virtualization product, namely the support for a wide range of guest OSes,
guest-host integration features, ease of use, and an active development.
VirtualBox is one of the most popular commodity virtualization products as of
today. With the current release, we are happy to announce the availability of
VirtualBox on top of Genode/NOVA. Section
[VirtualBox on top of the NOVA microhypervisor] gives insights into the
background of this development, the technical challenges we had to overcome,
and the current state of the implementation.
In addition to addressing storage and virtualization, the current release
comes with a new pseudo file system called trace_fs that allows the
interactive use of Genode's tracing facilities via Unix commands,
a profound unification of the various graphics back ends used throughout
the framework, a new facility for propagating status reports, and
improvements of the Noux runtime for executing Unix software on Genode.
VirtualBox on top of the NOVA microhypervisor
#############################################
Virtualization is an important topic for Genode for two distinct reasons.
It is repeatedly requested by users of the framework who consider
Genode as a microkernel-based hosting platform for virtual machines,
and it provides a smooth migration path from using Linux-based systems
towards using Genode as day-to-day OS.
Why do people consider Genode as a hosting platform for virtual machines
if there is an abundance of mature virtualization solutions on the market?
What all existing popular solutions have in common is the staggering complexity
of their respective trusted-computing base (TCB). The user of a virtual
machine on a commodity hosting platform has to trust millions of lines of
code. For example, with Xen, the TCB comprises the hypervisor and the Linux
system running as DOM0. For security-sensitive application areas, it is
almost painful to trust such a complex foundation. In contrast, the TCB of a
hosting platform based on Genode/NOVA is two orders of magnitude less complex.
Lowering the complexity reduces the likelihood for vulnerabilities and thereby
mitigates the attack surface of the system. It also enables the assessment of
security properties by thorough evaluation or even formal verification. In the
light of the large-scale privacy issues of today, the desire for systems that
are resilient against malware and zero-day exploits has never been higher.
Microkernel-based operating systems promise a solution. Virtualization enables
compatibility to existing software. Combining both seems natural. This is what
Genode/NOVA stands for.
From the perspective of us Genode developers who are in the process of
migrating from Linux-based OSes to Genode as day-to-day OS, we consider
virtualization as a stop-gap solution for all those applications that
do not exist natively on Genode, yet. Virtualization makes our transition
an evolutionary process.
Until now, NOVA was typically accompanied with a co-developed virtual machine
monitor called Seoul (formerly called Vancouver), which is executed as a
regular user-level process on top of NOVA. In contrast to conventional wisdom
about the performance of microkernel-based systems, the Seoul VMM on top of
NOVA is extremely fast, actually faster then most (if not all) commonly used
virtualization solutions. However, originating from a research project, Seoul
is quite challenging to use and not as mature as commodity VMMs that were
developed as real-world products. For example, there is a good chance that an
attempt to boot an arbitrary version of a modern Linux distribution might just
fail. In our experience, it takes a few days to investigate the issues, modify
the guest OS configuration, and tweak the VMM here and there, to run the OS
inside the Seoul VMM. That is certainly not a show stopper in appliance-like
scenarios, but it rules out Seoul as a general solution. Running Windows
OS as guest is not supported at all, which further reduces the application
areas of Seoul. With this in mind, it is unrealistic to propose the use
of Genode/NOVA as an alternative for popular VM hosting solutions.
Out of this realization, the idea was born to combine NOVA's virtualization
interface with a time-tested and fully-featured commodity VMM. Out of the
available Open-Source virtualization solutions, we decided to take a closer
look at VirtualBox, which attracted us for several reasons: First, it is
portable, supporting various host OSes such as Solaris, Windows OS, Linux,
and Mac OS X. Second, it has all the guest-integration features we could
wish for. There are extensive so-called guest additions for popular guest
OSes that vastly improve the guest-OS performance and allow a tight
integration with the host OS using shared folders or a shared clipboard.
Third, it comes with sophisticated device models that support all
important popular guest OSes. And finally, it is actively developed and
commercially supported.
However, moving VirtualBox over to NOVA presented us with a number of
problems. As a precondition, we needed to gain a profound understanding
of the VirtualBox architecture and the code base. To illustrate the challenge,
the source-code distribution of VirtualBox comprises 2.8 million lines of
code. This code contains build tools, the VMM, management tools, several
3rd-party libraries, middleware, the guest additions, and tests. The pieces
that are relevant for the actual VMM amount to 700 thousand lines. By
reviewing the architecture, we found that the part of VirtualBox that
implements the hypervisor functionality (the world switch) runs in the
kernel of the host OS (it is loaded on demand by the user-level VM process
through the _/dev/vboxdrv_ interface into the host OS kernel). It is
appropriately named VMMR0. Once installed into the host OS kernel, it
takes over the control over the machine. To put it blatantly simple, it runs
"underneath" the host OS. The VMMR0 code is kernel agnostic, which explains
the good portability of VirtualBox across various host OSes. Porting
VirtualBox to a new host OS comes down to finding a hook for installing the
VMMR0 code into the host OS kernel and adapting the VirtualBox runtime API
to the new host OS.
In the context of microkernel-based systems, however, it becomes clear that
this classical approach of porting VirtualBox would subvert the microkernel
architecture. Not only would we need to punch a hole into NOVA for loading
additional kernel code, but also the VMMR0 code would inflate the amount of
code executed in privileged mode by more than factor 20. Both implications
are gross violations of the microkernel principle. Consequently, we needed to
find a different way to marry NOVA with VirtualBox.
Our solution was the creation of a drop-in replacement of the VMMR0 code that
runs solely at user level and interacts with NOVA's virtualization
interface. Our VMMR0 emulation code is co-located with the VirtualBox
VM process. Architecturally, the resulting solution is identical to the
use of Seoul on top of NOVA. There is one VM process per virtual machine,
and each VM process is isolated from others by the NOVA kernel. In
addition to creating the VMMR0 emulation code, we needed to replace some parts
of the VirtualBox VMMR3 code with custom implementations because they
overlapped with functionality provided by NOVA's virtualization interface,
in particular the provisioning of guest-physical memory. Finally, we needed
to interface the VM process with Genode's API to let the VM process
interact with Genode's input, file-system, and framebuffer services.
The result of this undertaking is available at the _ports_ repository.
VirtualBox can be downloaded and integrated with Genode via the following
command issued from within the repository:
! make prepare PKG=virtualbox
To illustrate the integration of VirtualBox into a Genode system, there
is run script located at _ports/run/virtualbox.run_. It expects a
bootable ISO image containing a guest OS at _<build-dir>/bin/test.iso_.
The configuration of the VirtualBox process is as simple as
! <config>
! <image type="iso" file="/iso/test.iso" />
! </config>
VirtualBox will try to obtain the specified ISO file via a file-system
session. Furthermore, it will open a framebuffer session and an input session.
The memory assigned to the guest OS depends on the RAM quota assigned to the
VirtualBox process. Booting a guest OS stored in a VDI file is supported. The
image type must be changed to "vdi" accordingly.
Please note that this first version of VirtualBox is far from being complete
as it lacks many features (SMP, guest-addition support, networking), is not
optimized, and must be considered as experimental. However, we could
successfully run GNU/Linux, Android, Windows XP, Windows 7, HelenOS, Minix-3,
GNU Hurd, and of course Genode inside VirtualBox.
One point we are pretty excited about is that the porting effort to
Genode/NOVA did not require any change of Genode. From Genode's point of
view, VirtualBox is just an ordinary leaf node of the process tree, which
can happily co-exist with other processes - even if it is the Seoul VMM.
[image seoul-vbox-win7-tinycore]
In the screenshot above, VirtualBox is running besides the Seoul VMM on top of
Genode/NOVA. Seoul executes Tinycore Linux as guest OS. VirtualBox executes MS
Windows 7. Both VMMs are using hardware virtualization (VT-x) but are plain
user-level programs with no special privileges.
NetBSD file systems using rump kernels
######################################
In the previous release, we made FUSE-based file systems available to Genode
via a custom implementation of the FUSE API. Even though this step made
several popular file systems available, we found that the file systems most
important to us (such as ext) are actually not well supported by FUSE. For
example, write support on ext2 is declared as an experimental feature. In
hindsight it is clear why: FUSE is primarily being used for accessing file
systems not found in the Linux kernel. So it shines with supporting NTFS
but less so with file systems that are well supported by the Linux kernel.
Coincidentally, when we came to this realization, we stumbled upon the
wonderful work of Antti Kantee on so-called rump kernels:
:[http://wiki.netbsd.org/rumpkernel/]:
Rump kernel Wiki
The motivation behind the rump kernels was the development of
NetBSD kernel subsystems (referred to as "drivers") in the NetBSD user land.
Such subsystems like file systems, device drivers, or the TCP/IP stack are
linked against a stripped-down version of the NetBSD kernel that can be
executed in user mode and uses a fairly small "hypercall" interface to
interact with the outside world. A rump kernel contains everything needed to
execute NetBSD kernel subsystems but hardly anything else. In particular, it
does not support the execution of programs on top. From our perspective,
having crafted device-driver environments (DDEs) for Linux, iPXE, and OSS over
the years, a rump kernel sounded pretty much like a DDE for NetBSD. So we
started exploring rump kernels with the immediate goal of making time-tested
NetBSD file systems available to Genode.
To our delight, the integration of rump kernels into the Genode system went
fairly smooth. The most difficult part was the integration of the NetBSD build
infrastructure with Genode's build system. The glue between rump kernels and
Genode is less than 3,000 lines of code. This code enables us to reuse all
NetBSD file systems on Genode. A rump kernel instance that contains several
file systems such as ext2, iso9660, msdos, and ffs takes about 8 MiB of memory
when executed on Genode.
The support for rump kernels comes in the form of the dedicated _dde_rump_
repository. For downloading and integrating the required NetBSD source code,
the repository contains a Makefile providing the usual 'make prepare'
mechanism. To build the file-system server, make sure to add the _dde_rump_
repository to the 'REPOSITORIES' declaration of your _etc/build.conf_ file
within your build directory. The server then can be built via
! make server/rump_fs
There is a run script located at _dde_rump/run/rump_ext2.run_ to execute
a simple test scenario:
! make run/rump_ext2
The server can be configured as follows:
!<start name="rump_fs">
! <resource name="RAM" quantum="8M" />
! <provides><service name="File_system"/></provides>
! <config fs="ext2fs"><policy label="" root="/" writeable="yes"/></config>
!</start>
On startup, it requests a service that provides a block session. If
there is more than one block session in the system, the block session must be
routed to the right block-session server. The value of the _fs_ attribute of
the '<config>' node can be one of the following: _ext2fs_ for EXT2, _cd9660_ for
ISO-9660, or _msdos_ for FAT file-system support. _root_ defines the directory
of the file system as seen as root directory by the client. The server hands
most of its RAM quota to the rump kernel. This means the larger the quota is,
the larger the internal block caches of the rump kernel will be.
Base framework
##############
The base API has not underwent major changes apart from the addition of
a few new utilities and minor refinements. Under the hood, however, the inner
workings of the framework received much attention, including an extensive
unification of the startup code and stack management.
New 'construct_at' utility
==========================
A new utility located at 'base/include/util/construct_at.h' allows for the
manual placement of objects without the need to have a global placement new
operation nor the need for type-specific new operators.
New utility for managing volatile objects
=========================================
Throughout Genode, we maintain a programming style that largely avoids dynamic
memory allocations. For the most part, higher-level objects aggregate
lower-level objects as class members. For example, the nitpicker GUI server
is actually a compound of such aggregations (see
[https://github.com/genodelabs/genode/blob/master/os/src/server/nitpicker/main.cc#L803 - Nitpicker::Main]).
This functional programming style leads to robust programs but it poses a
problem for programs that are expected to adopt their behaviour at runtime.
For the example of nitpicker, the graphics back end of the GUI server takes
the size of the screen as constructor argument. If the screen size changes,
the once constructed graphics back end becomes inconsistent with the new
screen size. We desire a way to selectively replace an aggregated object by a
new version with updated constructor arguments. The new utilities found in
'os/include/util/volatile_object.h' solve this problem. A so-called
'Volatile_object' wraps an object of the type specified as template argument.
In contrast of a regular object, a 'Volatile_object' can be re-constructed any
number of times by calling 'construct' with the constructor arguments. It is
accompanied with a so-called 'Lazy_volatile_object', which remains
unconstructed until 'construct' is called the first time.
Changed interface of 'Signal_rpc_member'
========================================
We unified the 'Signal_rpc_member' interface to be more consistent with the
'Signal_rpc_dispatcher'. The new version takes an entrypoint as argument and
cares for dissolving itself from the entrypoint when destructed.
Filename as default label for ROM connections
=============================================
Since the first version of Genode, ROM services used to rely on a "filename"
provided as session argument. In the meanwhile, we established the use of the
session label to select routing policies as well as server-side policies.
Strictly speaking, the name of a ROM module is used as a key to a server-side
policy of ROM services. So why not to use the session label to express the
key as we do with other services? By assigning the file name as label for ROM
sessions, we may become able to remove the filename argument in the future by
just interpreting the last part of the label as filename. By keeping only the
label, we won't need to consider conditional routing (via '<if-arg>') based on
session arguments other than the label anymore, which would simplify Genode
configurations in the long run. This change is transparent at API level but
may be taken into consideration when configuring Genode systems.
New 'Genode::Deallocator' interface
===================================
By splitting the new 'Genode::Deallocator' interface from the former
'Genode::Allocator' interface, we become able to restrict the accessible
operations for code that is only supposed to release memory, but not
perform any allocations.
Closely related to the allocator interface, we introduced variants of the
'new' operator that take a reference (as opposed to a pointer) to a
'Genode::Allocator' as argument.
Unified main-stack management and startup code among all platforms
==================================================================
In contrast to the stacks of regular threads, which are located within a
dedicated virtual-address region called thread-context area, the stack of
the main thread of a Genode program used to be located within the BSS
segment. If the stack of a normal thread overflows, the program produces
an unresolvable page fault, which can be easily debugged. However,
an overflowing main stack would silently corrupt the BSS segment. With
the current release, we finally resolved this long-standing problem by
moving the main stack to the context area, too. The tricky part was that
the context area is created by the main thread. So we hit a hen-and-egg
problem. We overcame this problem by splitting the process startup
into two stages, both called from the crt0 assembly code. The first
stage runs on a small stack within the BSS and has the sole purpose
of creating the context area and a thread object for the main thread.
This code path (and thereby the stack usage) is the same for all programs.
So we can safely dimension the stage-1 stack. Once the first stage
returns to the crt0 assembly code, the stack pointer is loaded with the
stack that is now located within the context area. Equipped with the
new stack, the actual startup code ('_main') including the global
constructors of the program is executed.
This change paved the ground for several further code unifications and
simplifications, in particular related to the dynamic linker.
Low-level OS infrastructure
###########################
Revised block-driver framework
==============================
Whereas Genode's block-session interface was designed to work asynchronously
and supports the out-of-order processing of requests, those capabilities
remained unused by the existing block services as those services used to
operate synchronously to keep their implementation simple. However, this
simplicity came at the prize of two disadvantages: First, it prevented us
to fully utilize native command queuing of modern disk controllers. Second,
when chaining components such as a block driver, the part_blk server, and
a file system, latencies accumulated along the chain of services. This
hurts the performance of random access patterns.
To overcome this limitation, we changed the block-component framework to work
asynchronously and to facilitate the recently introduced server API.
Consequently, all users of the API underwent an update. The affected
components are rom_loopdev, atapi_drv, fb_block_adapter, http_block, usb_drv,
and part_blk. For some components, in particular part_blk, this step led to a
complete redesign.
Besides the change of the block-component framework, the block-session
interface got extended to support logical block addresses greater than
32bit (LBA48). Thereby, the block component framework can now support
devices that exceed 2 TiB in size.
Block cache
===========
The provisioning of a block cache was one of the primary motivations behind the
[http://www.genode.org/documentation/release-notes/13.11#Dynamic_resource_balancing - dynamic resource balancing]
concept that was introduced in Genode 13.11. We are now introducing the first
version of such a cache.
The new block cache component located at _os/src/server/blk_cache/_ is both
a block-session client as well as a block-session server serving a single
client. It is meant to sit between a block-device driver and a file-system
server. When accessing the block device, it issues requests at a granularity
of 4K and thereby implicitly reads ahead whenever a client requests a smaller
amount of blocks. Blocks obtained from the device or written by the client
are kept in memory. If memory becomes scarce, the block cache first tries
to request further memory resources from its parent. If the request
gets denied, the cache evicts blocks from memory to the block device following
a least-recently-used replacement strategy. As of now, the block cache supports
dynamic resource requests to grow on demand but support for handling yield
requests is not yet implemented. So memory once handed out to the block cache
cannot be regained. Adding support for yielding memory on demand will be
complemented in the next version.
To see how to integrate the block cache in a Genode scenario, there is a
ready-to-use run script available at _os/run/blk_cache.run_.
File-system infrastructure
==========================
In addition to the integration of NetBSD's file systems, there are
file-system-related improvements all over the place.
First, the 'File_system::Session' interface has been extended with a 'sync'
RPC function. This function allows the client of a file system to force
the file system to write back its internal caches.
Second, we extended the FUSE implementation introduced with the previous
release.
Since file systems tend to have a built-in caching mechanism, we need to
sync these caches at the end of a session when using the fuse_fs server.
Therefore, each FUSE file system port has to implement a 'Fuse::sync_fs()'
function that executes the necessary actions if requested. Further
improvements are related to the handling of symbolic links and error
handling. Finally, we added a libc plugin for accessing NTFS file systems
via the ntfs-3g library.
Third, we complemented the family of FUSE-based libc plugins with a family of
FUSE-based file-system servers. To utilize a FUSE file system, there is a
dedicated binary (e.g., _os/src/server/fuse_fs/ext2_) for each FUSE
file-system server.
Note that write support is possible but considered to be experimental at this
point. For now, using it is not recommended.
To use the ext2_fuse_fs server in Noux, the following configuration snippet
may be used:
! <start name="ext2_fuse_fs">
! <resource name="RAM" quantum="8M"/>
! <provides> <service name="File_system"/> </provides>
! <config>
! <policy label="noux -> fuse" root="/" writeable="no" />
! </config>
! </start>
Finally, the libc file-system plugin has been extended to support 'unlink'.
Trace file system
=================
The new _trace_fs_ server provides access to a trace session by providing a
file-system session as front end. Combined with Noux, it allows for the
interactive exploration and tracing of Genode's process tree using
traditional Unix tools.
Each trace subject is represented by a directory ('thread_name.subject') that
contains specific files, which are used to control the tracing process of the
thread as well as storing the content of its trace buffer:
:'enable': The tracing of a thread is activated if there is a valid policy
installed and the intend to trace the subject was made clear by writing '1'
to the 'enable' file. The tracing of a thread may be deactivated by writing a
'0' to this file.
:'policy': A policy may be changed by overwriting the currently used one in the
'policy' file. In this case, the old policy is replaced by the new one and
automatically used by the framework.
:'buffer_size': Writing a value to the 'buffer_size' file changes the size of
the trace buffer. This value is evaluated only when reactivating the tracing
of the thread.
:'events': The trace-buffer contents may be accessed by reading from the
'events' file. New trace events are appended to this file.
:'active': Reading the file will return whether the tracing is active (1) or
not (0).
:'cleanup': Nodes of untraced subjects are kept as long as they do not change
their tracing state to dead. Dead untraced nodes are automatically removed
from the file system. Subjects that were traced before and are now untraced
can be removed by writing '1' to the 'cleanup' file.
To use the trace_fs, a configuration similar to the following may be used:
! <start name="trace_fs">
! <resource name="RAM" quantum="128M"/>
! <provides><service name="File_system"/></provides>
! <config>
! <policy label="noux -> trace"
! interval="1000"
! subject_limit="512"
! trace_quota="64M" />
! </config>
! </start>
:'interval': sets the period the Trace_session is polled. The
time is given in milliseconds.
:'subject_limit': specifies how many trace subjects should by acquired at
max when the Trace_session is polled.
:'trace_quota': is the amount of quota the trace_fs should use for the
Trace_session connection. The remaining amount of RAM quota will be used
for the actual nodes of the file system and the 'policy' as well as the
'events' files.
In addition, there are 'buffer_size' and 'buffer_size_limit' that define
the initial and the upper limit of the size of a trace buffer.
A ready-to-use run script can by found in 'ports/run/noux_trace_fs.run'.
Unified interfaces for graphics
===============================
Genode comes with several programs that perform software-based graphics
operations. A few noteworthy examples are the nitpicker GUI server,
the launchpad, the scout tutorial browser, or the terminal. Most of those
programs were equipped with their custom graphics back end. In some
cases such as the terminal, nitpicker's graphics back end was re-used.
But this back end is severely limited because its sole purpose is the
accommodation of the minimalistic (almost invisible) nitpicker GUI server.
The ongoing work on Genode's new user interface involves the creation of
new components that rely on a graphics back end. Instead of further
diversifying the zoo of graphics back ends, we took the intermediate step
to consolidate the existing back ends into one unified concept such that
application-specific graphics back ends can be created and extended using
modular building blocks. The new versions of nitpicker, scout, launchpad,
liquid_fb, nitlog, and terminal have been changed to use the new common
interfaces:
:os/include/util/geometry.h: Basic data structures and operations needed
for 2D graphics.
:os/include/util/color.h: Common color representation and utilities.
:os/include/os/pixel_rgba.h: Class template for representing a pixel.
:os/include/os/pixel_rgb565.h: Template specializations for RGB565 pixels.
:os/include/os/surface.h: Target surface, onto which graphics operations
can be applied.
:os/include/os/texture.h: Source texture for graphics operations that
transfer 2D pixel data to a surface.
The former _os/include/nitpicker_gfx/_ directory is almost deserted. The only
remainders are functors for the few graphics operations actually required by
nitpicker. For the scout widgets, the corresponding functors have become
available at the public headers at _demo/include/scout_gfx/_.
Because the scout widget set is used by at least three programs and will
most certainly play a role in new GUI components, we undertook a major
cleanup of the parts worth reusing. The result can be found at
_demo/include/scout/_.
New session interface for status reporting
==========================================
Genode has a uniform way of how configuration information is passed from
parents to children within the process tree by the means of "config" ROM
modules. Using this mechanism, a parent is able to steer the behaviour of
its children, not just at their start time but also during runtime.
Until now, however, there was no counterpart to the config mechanism, which
would allow a child to propagate runtime information to its parent. There
are many use cases for such a mechanism. For example, a bus-controller driver
might want to propagate a list of devices attached to the bus. When a new
device gets plugged in, this list should be updated to let the parent
take the new device resource into consideration. Another use case would be the
propagation of status information such as the feature set of a plugin.
Taken to the extreme, a process might expose its entire internal state to its
parent in order to allow the parent to kill and restart the process, and
feed the saved state back to the new process instance.
To cover these use cases, we introduced the new report-session interface. When
a client opens a report session, it transfers a part of its RAM quota to the
report server. In return, the report server hands out a dataspace dimensioned
according to the donated quota. Upon reception of the dataspace, the client
can write its status reports into the dataspace and inform the server about
the update via the 'submit' function. In addition to the mere reporting of
status information, the report-session interface is designed to allow the
server to respond to reports. For example, if the report mechanism is used to
implement a desktop notification facility, the user may interactively respond
to an incoming notification. This response can be reflected to the originator
of the notification via the 'response_sigh' and 'obtain_response' functions.
The new _report_rom_ component is both a report service and a ROM service. It
reflects incoming reports as ROM modules. The ROM modules are named
after the label of the corresponding report session.
Configuration
-------------
The report-ROM server hands out ROM modules only if explicitly permitted by a
configured policy. For example:
! <config>
! <rom>
! <policy label="decorator -> pointer" report="nitpicker -> pointer"/>
! <policy ... />
! ...
! </rom>
! </config>
The label of an incoming ROM session is matched against the 'label' attribute
of all '<policy>' nodes. If the session label matches a policy label, the
client obtains the data from the report client with the label specified in the
'report' attribute. In the example above, the nitpicker GUI server sends
reports about the pointer position to the report-ROM service. Those reports
are handed out to a window decorator (labeled "decorator") as ROM module.
XML generator utility
=====================
With the new report-session interface in place, comes the increased
need to produce XML data. The new XML generator utility located at
_os/include/util/xml_generator.h_ makes this extremely easy, thanks to
C++11 language features. For an example application, refer to
_os/src/test/xml_generator/_ and the corresponding run script at
_os/run/xml_generator.run_.
Dynamic ROM service for automated testing
=========================================
The new _dynamic_rom_ service provides ROM modules that change during the
lifetime of a ROM session according to a timeline. The main purpose of this
service is the automated testing of programs that are able to respond to ROM
module changes, for example configuration changes.
The configuration of the dynamic ROM server contains a '<rom>' sub node per
ROM module provided by the service. Each '<rom>' node hosts a 'name' attribute
and contains a sequence of sub nodes that define the timeline of the ROM
module. The possible sub nodes are:
:'<inline>': The content of the '<inline>' node is assigned to the content
of the ROM module.
:'<sleep>': Sleeps a number of milliseconds as specified via the 'milliseconds'
attribute.
:'<empty>': Removes the ROM module.
At the end of the timeline, it re-starts at the beginning.
Nitpicker GUI server
====================
The nitpicker GUI server has been enhanced to support dynamic screen
resizing. This is needed to let nitpicker respond to screen-resolution
changes, or when using a nested version of nitpicker within a resizable
virtual framebuffer window.
To accommodate Genode's upcoming user-interface concept, we introduced the
notion of a parent-child relationship between nitpicker views. If an existing
view is specified as parent at construction time of a new view, the parent
view's position is taken as the origin of the child view's coordinate space.
This allows for the grouping of views, which can be atomically repositioned by
moving their common parent view. Another use case is the handling of popup
menus in Qt5, which can now be positioned relative to their corresponding
top-level window. The relative position is maintained transparently to Qt when
the top-level window gets repositioned.
Libraries and applications
##########################
Noux runtime for executing Unix software
========================================
Noux plays an increasingly important role for Genode as it allows the use
of the GNU software stack. Even though it already supported a variety of
packages including bash, gcc, binutils, coreutils, make, and vim, some
programs were still limited by Noux' not fully complete POSIX semantics,
in particular with regard to signal handling. For example, it was not
possible to cancel the execution of a long-running process via Control-C.
To overcome those limitations, we enhanced Noux by adding the _kill_ syscall,
reworking the _wait_ and _execve_ syscalls, as well as adding
signal-dispatching code to the Noux libc. Special attention had to be paid to
the preservation of pending signals during the process creation via _fork_ and
_execve_.
The current implementation delivers signals each time a Noux syscall
returns. Signal handlers are executed as part of the normal control flow. This
is in contrast to traditional Unix implementations, which allow the
asynchronous invocation of signal handlers out of band with the regular
program flow. The obvious downside of our solution is that a program that got
stuck in a busy loop (and thereby not issuing any system calls) won't respond
to signals. However, as we regard the Unix interface just as a runtime and not
as the glue that holds the system together, we think that this compromise is
justified to keep the implementation simple and kernel-agnostic. In the worst
case, if a Noux process gets stuck because of such a bug, we certainly can
live with the inconvenience of restarting the corresponding Noux subsystem.
To complement our current activities on the block and file-system levels,
the e2fsprogs-v1.42.9 package as been ported to Noux. To allow the
block-device utilities to operate on Genode's block sessions, we added a new
"block" file system to Noux. Such a block file system can be mounted using a
'<block>' node within the '<fstab>'. By specifying a label attribute, each
block session request can be routed to the proper block session provider:
! <fstab>
! ...
! <dir name="dev">
! <block name="blkdev0" label="block_session_0" />
! </dir>
! ...
! </fstab>
In addition to this file system, support for the DIOCGMEDIASIZE ioctl
request was added. This request is used by FreeBSD and therefore by our
libc to query the size of the block device in bytes.
Qt5 refinements
===============
Our port of Qt5 used to rely on custom versions of synchronization
primitives such as 'QWaitCondition' and 'QMutex'. However, since most of the
usual pthread synchronization functions as relied on by Qt5's regular POSIX
back end have been added to Genode's pthread library by now, we could replace
our custom implementations by Qt5's POSIX version.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
The development of our base-hw kernel platform during this release cycle was
primarily geared towards adding multi-processor support. However, as we
haven't exposed the code to thorough testing yet, we deferred the integration
of this feature for the current release.
We increased the number of usable ARM platforms by adding basic support for
the ODROID XU board.
NOVA microhypervisor
====================
The port of VirtualBox to Genode prompted us to improve the NOVA platform in
the following respects.
NOVA used to omit the propagation of the FPU state of the guest OS to the
virtual machine monitor (VMM) during the world switch between the guest OS and
the VMM. With the Vancouver VMM, which is traditionally used on NOVA, this
omission did not pose any problem because Vancouver would never touch the FPU
state of the guest. So the FPU context of the guest was always preserved
throughout the handling of virtualization events. However, in contrast to the
Vancouver VMM, VirtualBox relies on the propagation of the FPU state between
the guest running in VT-X non-root mode and the guest running within the
VirtualBox recompiler. Without properly propagating the FPU state between both
virtualization back ends, both the guest OS in non-root mode and VirtualBox's
recompiler would corrupt each other's FPU state. After first implementing an
interim solution in our custom version of the kernel, the missing FPU context
propagation had been implemented in the upstream version of NOVA as well.
In contrast to most kernels, NOVA did not allow a thread to yield its current
time slice to another thread. The only way to yield CPU time was to block on
a semaphore or to perform an RPC call. Unfortunately both of those instruments
require the time-receiving threads to explicitly unblock the yielding thread
(by releasing the semaphore or replying to the RPC call). However, there are
situations where the progress of a thread may depend on an external
condition or a side effect produced by another (unknown) thread. One
particular example is the spin lock used to protect (an extremely short)
critical section of Genode's lock metadata. Apparently VirtualBox presented
us with several more use cases for thread-yield semantics. Therefore, we
decided to extend NOVA's kernel interface with a new 'YIELD' opcode to the
'ec_control' system call.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,899 +0,0 @@
===============================================
Release notes for the Genode OS Framework 15.02
===============================================
Genode Labs
Genode's [http://genode.org/about/road-map - roadmap] for this year puts a
strong emphasis on the consolidation and cultivation of the existing feature
set. With the first release of the year, version 15.02 pays tribute to this
mission by stepping up to extensive and systematic automated testing. As
a precondition for scaling up Genode's test infrastructure, the release
features a highly modular tool kit for exercising system scenarios on a growing zoo
of test machines. Section [Modular tool kit for automated testing] explains
the new tools in detail. In the spirit of improving the existing feature
set, Genode 15.02 vastly improves the performance and stability of our version of
VirtualBox running on the NOVA microhypervisor, solves long-standing shortcomings
of memory management on machines with a lot of RAM, addresses NOVA-related
scalability limitations, stabilizes our Rump-kernel-based file-system server,
and refines the configuration interface of the Intel wireless driver.
As the most significant new feature, the new version introduces virtualization
support for ARM to our custom base-hw kernel. Section [Virtualization on ARM]
outlines the design and implementation of this feature, which was greatly
inspired by NOVA's virtualization architecture and has been developed over the
time span of more than a year.
With respect to platform support, we are happy to accommodate the upcoming
USB-Armory board, which is a computer in the form factor of a USB
stick especially geared towards security applications. Section
[Support for the USB-Armory board] covers the background and the current
state of this line of work.
Virtualization on ARM
#####################
The ARMv7 architecture of recent processors like Cortex-A7, Cortex-A15, or
Cortex-A17 CPUs support hardware extensions to facilitate virtualization of
guest operating systems. With the current release, we enable the use of these
virtualization extensions in our custom base-hw kernel when running on the
Cortex-A15-based Arndale board.
While integrating ARM's virtualization extension, we aimed to strictly follow
microkernel-construction principles. The primary design is inspired by the
[http://hypervisor.org/ - NOVA OS Virtualization Architecture]. It is based on a
microhypervisor that provides essential microkernel mechanisms along with
basic primitives to switch between virtual machines (VMs). On top of the
microhypervisor, classical OS services are implemented as
ordinary, unprivileged user-level components. Those services can be used by other
applications. Services may be shared between applications or instantiated
separately, according to security and safety needs. Correspondingly,
following the NOVA principles, each VM has its own associated virtual-machine
monitor (VMM) that runs as an unprivileged user-level component. VMM implementations
can range from simple ones that just emulate primary device requirements to highly
complex monitors including sophisticated device models, like VirtualBox. The
NOVA approach allows to decouple the TCB complexity of one VM with respect to
another, as well as with respect to all components not related to
virtualization at all.
Along those lines, we extended the base-hw kernel/core conglomerate with API
extensions that enable user-level VMM components to create and control virtual
machines.
Design
======
The ARM virtualization extensions are based on the so-called security
extensions, commonly known as
[http://genode.org/documentation/articles/trustzone - TrustZone].
The ARM designers did not follow the
Intel approach to split the CPU into a "root" and a "guest" world while having all prior
existing CPU modes available in both worlds. Instead, ARM added a new privilege level
to the non-secure side of TrustZone that sits underneath the ordinary kernel
and userland privilege levels. It is subjected to a hypervisor-like kernel. All
instructions used to prepare a VM's environment have to be executed in this so
called "hyp" mode. In hyp mode, some instructions
differ from their regular behaviour on the kernel-privilege level.
For this reason, prior-existing kernel code cannot simply be reused in
hyp mode without modifications.
The base-hw kernel is meant to execute Genode's core component on bare hardware.
Core, which is an ordinary user-level component, is
linked together with a slim kernel library that is executed in privileged kernel
mode. To enable ARM hardware virtualization, we pushed this approach
even further by executing core in three different privilege levels. Thereby,
core shares the same view on hardware resources and virtual memory across all
levels. A code path is executed on a higher privilege level only if the code
would fail to execute on a lower privilege level.
Following this approach, we were able to keep most of the existing kernel code
with no modifications.
[image avirt_overview]
Genode's ARM kernel (core) runs across all privilege levels
The hypervisor part of core is solely responsible to switch between VMs and the
host system. Therefore, it needs to load/store additional CPU state that
normally remains untouched during context switches of ordinary tasks. It also needs to
configure the VM's guest-physical to host-physical memory translations. Moreover, the
virtualization extensions of the ARMv7 architecture are not related to the CPU
cores only. The interrupt controller and the CPU-local timers are also
virtualization-aware. Therefore, the hypervisor has to load/store state specific
to those devices, too. Nevertheless, the hypervisor merely reloads those
devices. It does not interpret their state.
In contrast to the low-complexity hypervisor, a user-level VMM can be complex
without putting the system's security at risk. It contains potentially complex
device-emulation code and assigns hardware resources such as memory and
interrupts to the VM. The VMM is an ordinary user-level component running
unprivileged. Of course, as a plain user-level component, it is not able to
directly access hardware resources. Hence an interface between VMMs and the
kernel is needed to share the state of a virtual machine. In the past, we faced a similar
problem when building a VMM for our former TrustZone experiments. It was natural
to build upon the available solution and to extend it where necessary. Core
provides a so-called VM service. Each VM corresponds to a session of this
service. The session provides the following extended interface:
:CPU state:
The CPU-state function returns a dataspace containing the virtual machine's
state. The state is initialized by the VMM before bootstrapping the VM, gets updated
by the hypervisor whenever it switches away from the VM, and can be used by
the VMM to interpret the behavior of the guest OS. Moreover, the CPU state can be
updated after the virtual machine monitor emulated instructions
for the VM.
:Exception handler:
The second function is used to register a signal handler that gets informed
whenever the VM produces a virtualization fault.
:Run:
The run function starts or resumes the execution of the VM.
:Pause:
The pause function removes the VM from the kernel's scheduler.
:Attach:
This function attaches a given RAM dataspace to a designated area of the
guest-physical address space.
:Detach:
The detach function invalidates a designated area of the guest-physical
address space.
:Attach_pic: Tells the hypervisor to attach the CPU's virtual interface of the
virtualization-aware interrupt controller to a designated area of the
guest-physical address space.
Implementation
==============
By strictly following the micro-kernel construction principles when integrating the
hypervisor into the base-hw kernel, we reached a minimally invasive solution. In
doing so, we took the time to separate TrustZone-specific code that was formerly
an inherent part of the kernel on ARMv7 platforms. Now, TrustZone- and
virtualization-specific aspects are incorporated into the kernel only if
actually used. The change in complexity of the whole core component expressed in
lines of code is shown in the table below. As can be seen, the additional code in
the root of the trusted computing base when using virtualization is about 700-800
LOC.
Platform | with TrustZone, no VT | TrustZone/VT optional
-----------------------------------------------------------------
hw_arndale | 17970 LOC | 18730 LOC
----------------------------------------------------------------
hw_imx53_qsb | 17900 LOC | 17760 LOC
----------------------------------------------------------------
hw_imx53_qsb_tz | 18260 LOC | 18320 LOC
----------------------------------------------------------------
hw_rpi | 17500 LOC | 17430 LOC
----------------------------------------------------------------
hw_panda | 18040 LOC | 17880 LOC
----------------------------------------------------------------
hw_odroid_xu | 17980 LOC | 18050 LOC
Besides the VM world switch, we enabled support for the so-called "large
physical address extension" (LPAE), which is obligatory when using
virtualization. It allows for addressing a 40-bit instead of only 32-bit physical
address space. Moreover, to execute in hypervisor mode, the bootstrap code of
the kernel had to be set up properly. Hence, when booting on the Arndale board,
the kernel now prepares the non-secure TrustZone world first, and finally leaves the
secure world forever.
To test and showcase the ARM virtualization features integrated in base-hw, we
implemented a minimal, exemplary VMM. It can be found in
_repos/os/src/server/vmm_. The VMM emulates a simplified variant of ARM's
Versatile Express Cortex-A15 development platform. Currently, it only comprises
support for the CPU, the timer, the interrupt controller, and a UART device. It is
written in 1100 lines of C++ in addition to the base Genode libraries. The VMM
is able to boot a vanilla Linux kernel compiled with a slightly modified
standard configuration (no-SMP), and a device tree description stripped down to
the devices provided by the VMM. This release includes an automated run test that
executes the Linux kernel on top of the VMM on Genode. It can be started via:
! make run/vmm
[image avirt_screen]
Three Linux serial consoles running in parallel on top of Genode
Modular tool kit for automated testing
######################################
In
[http://genode.org/documentation/release-notes/13.05#Automated_quality-assurance_testing - Genode version 13.05],
we already introduced comprehensive support for the automated testing of
Genode scenarios. Since then, Genode Labs has significantly widened the scope
of its internal test infrastructure, both in terms of the coverage of the test
scenarios as well as the variety of the used hardware platforms.
The centerpiece of our test infrastructure is the so-called run tool. Steered
by a script (run script), it performs all the steps necessary to test drive
a Genode system scenario. Those steps are:
# *Building* the components of a scenario
# *Configuration* of the init component
# Assembly of the *boot directory*
# Creation of the *boot image*
# *Powering-on* the test machine
# *Loading* of the boot image
# Capturing the *LOG output*
# *Validation* of the scenario behavior
# *Powering-off* the test machine
Each of those steps depends on various parameters such as the
used kernel, the hardware platform used to run the scenario, the
way the test hardware is connected to the test infrastructure
(e.g., UART, AMT, JTAG, network), the way the test hardware is powered or
reseted, or the way of how the scenario is loaded into the test hardware.
Naturally, to accommodate the growing variety of combinations of those
parameters, the complexity of the run tool increased over time.
This growth of complexity prompted us to eventually turn the run tool into a
highly modular and extensible tool kit.
Originally, the run tool consisted of built-in rules that could be
extended and tweaked by a kernel-specific supplement called run environment.
The execution of a run script used to depend on the policies built into
the run tool, the used run environment, and optional configuration
parameters (run opts).
The new run tool kit replaces most of the formerly built-in policies by the
ability to select and configure different modules for the various steps.
The selection and configuration of the modules is expressed in the run-tool
configuration. There exist the following types of modules:
:boot-dir modules:
These modules contain the functionality to populate the boot directory
and are specific to each kernel. It is mandatory to always include the
module corresponding to the used kernel.
_(the available modules are: linux, hw, okl4, fiasco, pistachio, nova,_
_codezero, foc)_
:image modules:
These modules are used to wrap up all components used by the run script
in a specific format and thereby prepare them for execution.
Depending on the used kernel, different formats can be used. With these
modules, the creation of ISO and disk images is also handled.
_(the available modules are: uboot, disk, iso)_
:load modules:
These modules handle the way the components are transfered to the
target system. Depending on the used kernel there are various options
to pass on the components. For example, loading from TFTP or via JTAG is handled
by the modules of this category.
_(the available modules are: tftp, jtag, fastboot)_
:log modules:
These modules handle how the output of a currently executed run script
is captured.
_(the available modules are: qemu, linux, serial, amt)_
:power_on modules:
These modules are used for bringing the target system into a defined
state, e.g., by starting or rebooting the system.
_(the available modules are: qemu, linux, softreset, powerplug, amt)_
:power_off modules:
These modules are used for turning the target system off after the
execution of a run script.
_(the available modules are: powerplug)_
When executing a run script, only one module of each category must be used.
Each module has the form of a script snippet located under the
_tool/run/<step>/_
directory where _<step>_ is a subdirectory named after the module type.
Further instructions about the use of each module (e.g., additional
configuration arguments) can be found in the form of comments inside the
respective script snippets.
Thanks to this modular structure,
the extension of the tool kit comes down to adding a file at the corresponding
module-type subdirectory. This way, custom work flows (such as tunneling JTAG
over SSH) can be accommodated fairly easily.
Usage examples
==============
To execute a run script, a combination of modules may be used. The combination
is controlled via the RUN_OPT variable used by the build framework. Here are a
few common exemplary combinations:
Executing NOVA in Qemu:
!RUN_OPT = --include boot_dir/nova \
! --include power_on/qemu --include log/qemu --include image/iso
Executing NOVA on a real x86 machine using AMT for resetting the target system
and for capturing the serial output while loading the files via TFTP:
!RUN_OPT = --include boot_dir/nova \
! --include power_on/amt --power-on-amt-host 10.23.42.13 \
! --power-on-amt-password 'foo!' \
! --include load/tftp --load-tftp-base-dir /var/lib/tftpboot \
! --load-tftp-offset-dir /x86 \
! --include log/amt --log-amt-host 10.23.42.13 \
! --log-amt-password 'foo!'
Executing Fiasco.OC on a real x86 machine using AMT for resetting, USB serial
for output while loading the files via TFTP:
!RUN_OPT = --include boot_dir/foc \
! --include power_on/amt --amt-host 10.23.42.13 --amt-password 'foo!' \
! --include load/tftp --tftp-base-dir /var/lib/tftpboot \
! --tftp-offset-dir /x86 \
! --include log/serial --log-serial-cmd 'picocom -b 115200 /dev/ttyUSB0'
Executing base-hw on a Raspberry Pi using powerplug to reset the hardware,
JTAG to load the image and USB serial to capture the output:
!RUN_OPT = --include boot_dir/hw \
! --include power_on/powerplug --power-on-powerplug-ip 10.23.42.5 \
! --power-on-powerplug-user admin \
! --power-on-powerplug-password secret \
! --power-on-powerplug-port 1
! --include power_off/powerplug --power-off-powerplug-ip 10.23.42.5 \
! --power-off-powerplug-user admin \
! --power-off-powerplug-password secret \
! --power-off-powerplug-port 1
! --include load/jtag \
! --load-jtag-debugger /usr/share/openocd/scripts/interface/flyswatter2.cfg \
! --load-jtag-board /usr/share/openocd/scripts/interface/raspberrypi.cfg \
! --include log/serial --log-serial-cmd 'picocom -b 115200 /dev/ttyUSB0'
After the run script was executed successfully, the run tool will print the
string 'Run script execution successful.". This message can be used to check
for the successful completion of the run script when doing automated testing.
Meaningful default behaviour
============================
To maintain the ease of use of creating and using a build directory, the
'create_builddir' tool equips a freshly created build directory with a meaningful
default configuration that depends on the selected platform. For example, if
creating a build directory for the Linux base platform, RUN_OPT
is initially defined as
! RUN_OPT = --include boot_dir/linux \
! --include power_on/linux --include log/linux
Low-level OS infrastructure
###########################
Improved management of physical memory
======================================
On machines with a lot of memory, there exist constraints with regard to
the physical address ranges of memory:
* On platforms with a non-uniform memory architecture, subsystems should
preferably use memory that is local to the CPU cores the subsystem is using.
Otherwise the performance is impeded by costly memory accesses to
the memory of remote computing nodes.
* Unless an IOMMU is used, device drivers program physical addresses
into device registers to perform DMA operations. Legacy devices such as
USB UHCI controllers expect a 32-bit address. Consequently, the memory
used as DMA buffers for those devices must not be allocated above 4 GiB.
* When using an IOMMU on NOVA, Genode represents the address space
accessible by devices (by the means of DMA) using a so-called device PD
([http://genode.org/documentation/release-notes/13.02#DMA_protection_via_IOMMU]).
DMA transactions originating from PCI devices are subjected to the virtual
address space of the device PD.
All DMA buffers are identity-mapped with their physical addresses within
the device PD. On 32-bit systems with more than 3 GiB of memory, this
creates a problem. Because the device PD is a regular user-level component, the
upper 1 GiB of its virtual address space is preserved for the kernel. Since
no user-level memory objects can be attached to this
area, the physical address range to be used for DMA buffers is limited
to the lower 3 GiB.
Up to now, Genode components had no way to influence the allocation of
memory with respect to physical address ranges. To solve the problems outlined
above, we extended core's RAM services to take allocation constraints
as session arguments when a RAM session is created. All dataspaces created
from such a session are subjected to the specified constraints. In particular,
this change enables the AHCI/PCI driver to allocate DMA buffers at suitable
physical address ranges.
This innocent looking feature to constrain RAM allocations raises a problem
though: If any component is able to constrain RAM allocations in
arbitrary ways, it would become able to scan the physical address space for
allocated memory by successively opening RAM sessions with the constraints set
to an individual page and observe whether an allocation succeeds or not. Two
conspiring components could use this information to construct a covert storage
channel.
To prevent such an abuse, the init component filters out allocations
constrains from RAM-session requests unless explicitly permitted. The
permission is granted by supplementing the RAM resource assignment of
a component with a new 'constrain_phys' attribute. For example:
! <resource name="RAM" quantum="3M" constrain_phys="yes"/>
Init component
==============
Most of Genode's example scenarios in the form of run scripts support
different platforms. However, as the platform details vary, the run scripts
have to tweak the configuration of the init component according to the
features of the platform.
For example, when declaring an explicit route to a framebuffer driver named
"fb_drv", the run script won't work on Linux because on this platform, the
framebuffer driver is called "fb_sdl".
Another example is the role of the USB driver. Depending on the platform, the
USB driver is an input driver, a block driver, a networking driver, or a
combination of those.
Consequently, run scripts with support
for a great variety of platforms tend to become convoluted with
platform-specific conditionals.
To counter this problem, we enhanced init to support aliases for component
names. By defining the following aliases in the init configuration
! <alias name="nic_drv" child="usb_drv"/>
! <alias name="input_drv" child="usb_drv"/>
! <alias name="block_drv" child="usb_drv"/>
the USB driver becomes reachable for session requests routed to either "usb_drv",
"nic_drv", "input_drv", and "block_drv". Consequently, the routing
configuration of components that use either of those drivers does no longer
depend on any platform-intrinsic knowledge.
RTC session interface
=====================
Until now, the RTC session interface used an integer to return the current
time. Although this is preferable when performing time-related
calculations, a structured representation is more convenient to use, i.e., if
the whole purpose is showing the current time. This interface change is only
visible to components that use the RTC session directly.
Since the current OS API of Genode lacks time-related functions, most users
end up using the libc, which already converts the structured time stamp
internally, or provide their own time related functions.
Update of rump-kernel-based file systems
========================================
We updated the rump-kernel support to a newer rump-kernel version (as of mid of
January 2015). This way, Genode is able to benefit from upstream stability
improvements related to the memory management. Furthermore, we revised the
Genode backend to allow the rump_fs server to cope well with a large amount of
memory assigned to it. The latter is useful to utilize the block cache of the
NetBSD kernel.
Libraries and applications
##########################
As a stepping stone in the
[https://github.com/genodelabs/genode/issues/1399 - forthcoming community effort]
to bring the Nix package manager to Genode, ports of libbz2 and sqlite have
been added to the _repos/libports/_ repository.
Runtime environments
####################
VirtualBox on NOVA
==================
Whereas our previous efforts to run VirtualBox on Genode/NOVA were mostly
concerned with enabling principal functionality and with the addition of
features, we took the release cycle of Genode 15.02 as a chance to focus
on performance and stability improvements.
:Performance:
Our goal with VirtualBox on NOVA is to achieve a user experience
comparable to running VirtualBox on Linux. Our initial port of VirtualBox used
to cut a lot of corners with regards to performance and timing accuracy
because we had to concentrate on more fundamental issues of the porting
work first. Now, with the feature set settled, it was time to revisit
and solidify our interim solutions.
The first category of performance improvements is the handling of timing,
and virtual guest time in particular. In our original version,
we could observe a substantial drift of the guest time compared to the host time.
The drift is not merely inconvenient but may even irritate the guest OS
because it violates its assumptions about the behaviour of certain virtual devices.
The drift was caused by basing the timing on a simple jiffies counter
that was incremented by a thread after sleeping for a fixed period. Even
though the thread almost never executes, there is still a chance that it gets
preempted by the kernel and resumed only after the time slices of
concurrently running threads have elapsed. This can take tens of milliseconds.
During this time, the jiffies counter remains unchanged. We could
significantly reduce the drift by basing the timing on absolute time values
requested from the timer driver. Depending on the used guest OS, however,
there is still a residual inaccuracy left, which is subject to ongoing
investigations.
The second type of improvements is related to the handling of virtual
interrupts. In its original habitat, VirtualBox relies on so-called
external-interrupt virtualization events. If a host interrupt occurs while the
virtual machine is active, the virtualization event is forwarded by the
VirtualBox hypervisor to the virtual machine monitor (VMM).
On NOVA, however, the kernel does not propagate this
condition to the user-level VMM because the occurrence of host interrupts should
be of no matter to the VMM. In the event of a host interrupt, NOVA takes
a normal scheduling decision (eventually activating the user-level device driver
the interrupt belongs to) and leaves the virtual CPU (vCPU) in a runnable
state - to be rescheduled later. Once the interrupt is handled, the vCPU gets
resumed. The VMM remains out of the loop. Because the update of the VirtualBox
device models ultimately relies on the delivery of external-interrupt
virtualization events, the lack of this kind of event introduced huge delays
with respect to the update of device models and the injection of virtual
interrupts. We solved this problem by exploiting a VirtualBox-internal
mechanism called POKE. By setting the so-called POKE flag, an I/O thread is
able to express its wish to force the virtual machine into the VMM. We only
needed to find the right spots to set the POKE flag.
Another performance-related optimization is the caching of RTC time
information inside VirtualBox. The original version of the gettimeofday
function used by VirtualBox contacted the RTC server for obtaining the
wall-clock time on each call. After the update to VirtualBox 4.3, the rate of those
calls increased significantly. To reduce the costs of these calls, our
new version of gettimeofday combines infrequent calls to the RTC driver
with a component-local time source based on the jiffies mechanism mentioned above.
With these optimizations in place,
simple benchmarks like measuring the boot time of Window 7 or the time of
compiling Genode within a Debian VM suggest that our version of VirtualBox
has reached a performance that is roughly on par with the Linux version.
:Stability:
Since the upgrade to VirtualBox 4.3.16 in release 14.11, we fixed several
regression issues caused by the upgrade. Beside that, we completed the
support to route serial output of guests to Genode, lifted the restriction
to use just one fixed VESA mode, and enabled support for 32-bit Windows 8
guests on 64-bit Genode/NOVA. The 64-bit host restriction stems from
the fact that Windows 8 requires support for the non-executable bit (NX)
feature of page tables. The 32-bit version of the NOVA kernel does not leverage
the physical address extension (PAE) feature, which is a pre-requisite for
using NX on 32-bit.
In the course of the adaptation, our port of VirtualBox now evaluates the
PAE and HardwareVirtExUX XML tags of .vbox files:
!<VirtualBox xmlns=...>
! <Machine uuid=...>
! <Hardware ..>
! <CPU ...>
! <HardwareVirtExUX enabled="true"/>
! <PAE enabled="true"/>
! ...
The PAE tag specifies whether to report PAE capabilities to the guest
or not. The HardwareVirtExUx tag is used by our port to decide whether to stay
for non-paged x86 modes in Virtualbox's recompiler (REM) or not. Until now, we used REM
to emulate execution when the guest was running in real mode and protected mode
with paging disabled. However, newer Intel machines support the unrestricted guest
feature, which makes the usage of REM in non-paged modes not strictly
necessary anymore. Setting the HardwareVirtExUx tag to false accommodates
older machines with no support for the unrestricted-guest feature.
Device drivers
##############
iPXE-based network drivers
==========================
We enabled and tested the driver with Intel I218-LM and I218-V PCI devices.
Intel wireless stack
====================
In this release, several small issues regarding the wireless stack are fixed.
From now on, the driver only probes devices on the PCI bus that correspond to
the PCI_CLASS_NETWORK_OTHER device class. Prior to that, the driver probed all
devices attached to the bus resulting in problems with other devices, e.g.
the GPU, when accessing their extended PCI config space.
Since the driver uses cooperative scheduling internally, it must never block
or, in case it blocks, must schedule another task. Various sleep functions
lacked this scheduling call and are now fixed. Furthermore, a bug in the timer
implementation has been corrected, which caused the scheduling of wrong timeouts.
In addition to these fixes, patches for enabling the support for
Intel 7260 cards were incorporated.
Up to now, the configuration of the wireless driver was rather inconvenient because
it did not export any information to the system. The driver now creates two
distinct reports to communicate its state and information about the wireless
infrastructure to other components. The first one is a list of all available
access points. The following exemplary report shows its structure:
!<wlan_accesspoints>
! <accesspoint ssid="skynet" bssid="00:01:02:03:04:05" quality="40"/>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:06" quality="70" protection="WPA-PSK"/>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:07" quality="10" protection="WPA-PSK"/>
!</wlan_accesspoints>
Each '<accesspoint>' node has attributes that contain the SSID and the BSSID
of the access point as well as the link quality (signal strength). These
attributes are mandatory. If the network is protected, the node will also
have an attribute describing the type of protection in addition.
The second report provides information about the state of the connection
with the currently associated access point:
!<wlan_state>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:06" quality="70"
! protection="WPA-PSK" state="connected"/>
!</wlan_state>
Valid state values are 'connected', 'disconnected', 'connecting' and
'disconnecting'.
The driver obtains its configuration via a ROM module. This ROM
module contains the selected access point and can be updated during runtime.
To connect to an access point, a configuration like the following is used:
!<selected_accesspoint ssid="foobar" bssid="01:02:03:04:05:06"
! protection="WPA-PSK" psk="foobar123!"/>
To disconnect from an access point, an empty configuration can be set:
!<selected_accesspoint/>
For now, the prevalent WPA/WPA2 protection using a pre-shared key is supported.
Improved UART driver for Exynos5
================================
The UART driver for the Exynos5 SoC has been enhanced by enabling the RX
channel. This improvement was motivated by automated tests, where a run script
needs to interact with some component via a terminal connection.
Touchscreen support
===================
We enabled support of Wacom USB touchscreen devices via dde_linux - a port of
Linux USB driver to Genode. In order to make touchscreen coordinates
usable by Genode's input services, they must be calibrated
to screen-absolute coordinates. The screen resolution is not determined
automatically by the USB driver. It can, however, be configured as a sub
node of the '<hid>' XML tag of the USB driver's configuration:
!<start name="usb_drv">
! ...
! <config uhci=... ohci=... xhci=...>
! <hid>
! <screen width="1024" height="768"/>
! </hid>
! ...
USB session interface
=====================
We enhanced our USB driver with the support of remote USB sessions. This
feature makes it possible to implement USB-device drivers outside the USB
server using a native Genode API. The new USB session can be found under
_repos/os/include/usb_session_ and can be used to communicate with the USB
server, which merely acts as a host controller and HUB driver in this scenario.
Under _repos/os/include/usb_, there are a number of convenience
and wrapper functions that operate directly on top of a USB session. These
functions are meant to ease the task of USB-device-driver programming by hiding
most of the USB session management, like packet-stream handling.
We also added a USB terminal server, which exposes a Genode terminal session to
its clients and drives the popular PL2303 USB to UART adapters using the new
USB-session interface.
A practical use case for this component is the transmission of logging data on
systems where neither UART, AMT, nor JTAG are available. A run script
showcasing this feature can be found at _repos/dde_linux/run/usb_terminal.run_.
RTC proxy driver for Linux
==========================
There are a handful of run scripts that depend on the RTC service. So far,
it was not possible to run these tests on Linux due to the lack of an RTC
driver on this platform. To address this problem, we created a proxy driver
that uses the time() system call to provide a
reasonable base period on Linux.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Support for the USB-Armory board
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With [https://www.crowdsupply.com/inverse-path/usb-armory - USB Armory],
there is an intriguing hardware platform for Genode on the horizon.
In short, USB Armory is a computer in the form factor of a USB
stick. It is meant for security applications such as VPNs,
authentication tokens, and encrypted storage. It is based on the
FreeScale i.MX53 SoC, which is well supported by Genode, i.e.,
Genode can be used as secure-world OS besides Linux running in the
normal world.
Apart from introducing a novel form factor, this project is
interesting because it strives to be an 100% open platform, which
includes hardware, software, and firmware. This motivated us to
bring Genode to this platform.
The underlying idea is to facilitate
[http://genode.org/documentation/articles/trustzone - ARM TrustZone] to
use Genode as a companion to a Linux-based OS on the platform.
Whereas Linux would run in the normal world of TrustZone, Genode runs
in the secure world. With Linux, the normal world will control the
communication over USB and provide a familiar environment to implement
USB-Armory applications. However, security-critical functions and data like
cryptographic keys will reside exclusively in the secure world. Even in
the event that Linux gets compromised, the credentials of the user
will stay protected.
The support of the USB Armory platform was added in two steps:
First, we enabled our base-hw kernel to run as TrustZone monitor with
Genode on the "secure side". Since the USB Armory is based on the
FreeScale i.MX53 SoC, which Genode already supported, this step went
relatively straight-forward.
Second, we enabled a recent version of the Linux kernel (3.18) to run in the
normal world. The normal world is supervised by a user-level Genode component
called tz_vmm (TrustZone Virtual Machine Monitor). The tz_vmm is, among
others, responsible for providing startup and hardware information to the
non-secure guest. The Linux kernel version we used previously as TrustZone
guest on i.MX53 boards expected this information to be communicated via
so-called ATAGs. The new version, however, expects this to be done via a
device tree blob. As a consequence, the tz_vmm had to be adapted to properly
load this blob into the non-secure RAM. The original USB-Armory device tree
was modified to blind out the RAM regions that get protected by the TrustZone
hardware. This way, Linux won't attempt to access them. Furthermore,
to keep basic user interaction simple, our device tree tells Linux to use the
same non-secure UART as Genode for console I/O.
The kernel itself received some modifications, for two reasons. First,
we don't want Linux to rely on resources that are protected to keep
the secure world secure. This is why the driver for the interrupt controller
that originally made use of the TrustZone interrupt configuration, had to be
adapted. Second, to prevent Linux from disturbing Genode activities, we
disabled most of the dynamic clock and power management as it may sporadically
gear down or even disable hardware that Genode relies on. Furthermore, we
disabled the Linux drivers for I2C interfaces and the GPIO configuration as
these are reserved for Genode.
IPC helping
~~~~~~~~~~~
In traditional L4 microkernels, scheduling parameters (like time-slice
length and priority) used to be bound to threads. Usually, those parameters
are defined at thread creation time. The initial version
of base-hw followed this traditional approach. However, it has a few problems:
* For most threads, the proper *choice of scheduling parameters* is very
difficult if not impossible. For example, the CPU-time demands of a
server thread may depend on the usage patterns of its clients. Most
theoretical work in the domain of scheduling presumes the knowledge of
job lengths in advance of computing a schedule. But in practice and in
particular in general-purpose computing, job lengths are hardly known a priori.
As a consequence, in most scenarios, scheduling parameters are
set to default values.
* With each thread being represented as an independent schedulable entity,
the kernel has to take a scheduling decision each time a thread performs an
IPC call because the calling thread gets blocked and the called thread
may get unblocked. In a microkernel-based system, those events occur at a
much higher rate than the duration of typical time slices, which puts the
scheduler in a *performance-critical* position.
* Regarding IPC calls, a synchronous flow of control along IPC call chains is
desired. Ideally, an IPC call should have the same characteristics as
a function call with respect to scheduling. When a client thread performs an
IPC call, it expects the server to immediately become active to
handle the request. But if the kernel treats each thread independently,
it may pick any other thread and thereby introduce *high latencies* into
IPC operations.
To counter those problems, the NOVA microhypervisor introduced a new approach
that decouples scheduling parameters from threads. Instead of selecting
threads for execution, the scheduler selects so-called scheduling contexts.
For a selected scheduling context, the kernel dynamically determines a
thread to execute by taking IPC relationships into account. When a thread
performs an IPC, the thread's scheduling context will be used to execute
the called server. In principle, a server does not need CPU time on its own
but always works with CPU resources provided by clients.
The new version of the base-hw kernel adapts NOVA's approach with slight
modifications. Each thread owns exactly one scheduling context for its entire
lifetime. However, by the means of "helping" during an IPC call, the caller
lends its scheduling context to the callee. Even if the callee is still busy
and cannot handle the IPC request right away, the caller helps because it
wants the callee to become available for its request as soon as
possible. Consequently, a thread has potentially many scheduling contexts at
its disposal, its own scheduling context plus all scheduling contexts
provisioned by helpers. This works transitively.
Purged outdated platforms
~~~~~~~~~~~~~~~~~~~~~~~~~
We removed the support for two stale platforms that remained unused for
more than a year, namely FreeScale i.MX31 and the TrustZone variant
of the Coretile Versatile Express board.
NOVA
====
On Genode/NOVA, we used to employ one pager thread in core for each thread
in the system. We were forced to do so because not every page
fault can be resolved immediately. In some situations, core asynchronously
propagates the fault to an external component for the resolution.
In the meantime, the
pager thread leaves the page fault unanswered. Unfortunately, the kernel
provides no mechanism to support this scenario besides just blocking the
pager thread using a semaphore. This, in turn, means that the pager thread is not
available for other page-fault requests. Ultimately, we had to setup a
dedicated pager per thread.
This implementation has the downside of "wasting" memory for a lot of
pager threads. Moreover, it becomes a denial-of-service vector as soon as more
threads get created than core can accommodate. The number of threads is
limited per address space - also for core - by the size of Genode's context
area, which typically means 256 threads.
To avoid the downsides mentioned, we extended the NOVA IPC reply syscall to
specify an optional semaphore capability. The NOVA kernel validates the
capability and blocks the faulting thread in the semaphore. The faulted thread
remains blocked even after the pager has replied to the fault message. But
the pager immediately becomes available for other
page-fault requests. With this change, it suffices to maintain only one pager
thread per CPU for all client threads.
The benefits are manifold. First, the base-nova implementation converges more
closely to other Genode base platforms. Second, core can not run out of threads
anymore as the number of threads in core is fixed for a given setup. And the
third benefit is that the helping mechanism of NOVA can be leveraged for
concurrently faulting threads.
Build system and tools
######################
Tools for convenient handling of port contrib directories
=========================================================
We supplemented our tools for the ports mechanism with two convenient
scripts:
:_tool/ports/shortcut_:
Creates a symbolic link from _contrib/<port-name>-<hash>_ to
_contrib/<port-name>_. This is useful when working on the third-party
code contained in the _contrib_ directory.
:_tool/ports/current_:
Prints the current contrib directory of a port. When switching
branches back and forth, the hash of the used port might change.
The script provides a shortcut to looking up the hash file for a
specific port within the repositories and printing its content.

File diff suppressed because it is too large Load Diff

View File

@@ -1,791 +0,0 @@
===============================================
Release notes for the Genode OS Framework 15.08
===============================================
Genode Labs
The version 15.08 marks the beginning of Genode as day-to-day OS as one of the
project's core developers switched to using Genode/NOVA on his machine,
stressing the OS infrastructure we created over the course of the last seven
years. Thanks to components like VirtualBox, the Noux runtime for GNU software,
the Linux wireless stack and Rump-kernel-based file systems, the transition
went actually much smoother than expected. So other members of the team plan
to follow soon. Section [Genode as day-to-day operating system] gives an
overview of the taken approach. Genode's use as general-purpose OS provided
the incentive for most of the improvements featured by the current release,
starting with the addressing of the long-standing kernel-memory management
deficiencies of the NOVA kernel (Section [NOVA kernel-resource management]),
over enhancements of Genode's tracing and file-system facilities, to vast
improvements of the guest-host integration of VirtualBox when running on
Genode.
The release is accompanied with a second line of work led by our friends
at Codelabs: Enabling Genode to run on top of their Muen separation
kernel as described in Section [Genode on top of the Muen Separation Kernel].
Muen is a low-complexity kernel for the 64-bit x86 architecture that
statically partitions the machine into multiple domains. In contrast to
microkernels like the ones already supported by Genode, the assignment
of physical resources (such as memory, CPU time, and devices) happens at
system-integration time. Since an isolation kernel does not have to deal
with dynamic resource management at runtime, it is less complex than
a general-purpose microkernel. This makes it relatively easy to reason about
its strong isolation properties, which, in turn, makes it attractive for
high-assurance computing. With Genode being able to run within a Muen
domain, the rich component infrastructure of Genode can be combined with
the strong isolation guarantees of Muen.
Genode on top of the Muen Separation Kernel
###########################################
_This section was written by Adrian-Ken Rueegsegger and Reto Buerki who_
_conducted the described line of work independent from Genode Labs._
After completing our x86_64 port of the Genode base-hw kernel, which was
featured in the
[http://genode.org/documentation/release-notes/15.05#Principal_support_for_the_64-bit_x86_architecture - previous release (15.05)],
we immediately started working on our main goal: running a Genode system as
guest on the Muen Separation Kernel (SK). This would enable the Muen platform
to benefit from the rich ecosystem of Genode.
For those who have not read the 15.05 Genode release notes, [http://muen.sk - Muen]
is an Open-Source microkernel, which uses the [http://spark-2014.org/ - SPARK]
programming language to enable light-weight formal methods for high assurance.
The 64-bit x86 kernel, currently consisting of a little over 5'000 LOC, makes
extensive use of the latest Intel virtualization features and has been formally
proven to contain no runtime errors at the source-code level.
The new 'hw_x86_64_muen' platform, as the name implies, extends the 'hw_x86_64'
base-hw kernel by replacing the PIC and timer drivers with paravirtualized
variants.
In contrast to other kernels supported by Genode, the architecture with Muen is
different in the sense that the entire 'hw_x86_64_muen' Genode system runs as
guest VM in VMX non-root mode on the SK. From the perspective of Muen, Genode
is executed on top of the kernel like any other guest OS without special
privileges.
[image muen_system_overview]
Genode running on top of the Muen Separation Kernel alongside other subjects
This loose coupling of Muen and Genode base-hw enables the robust combination
of a static, low-complexity SK with a feature-rich and extensive OS framework.
The result is a flexible platform for the construction of component-based
high-assurance systems.
People interested in giving the 'hw_x86_64_muen' platform a spin can find a
small tutorial at _repos/base-hw/doc/x86_64_muen.txt_.
NOVA kernel-resource management
###############################
For several years, the NOVA kernel has served as Genode's primary base
platform on x86. The main reasons for this choice are: the kernel provides -
among the supported x86 kernels - the richest feature set like the support of
IOMMUs, virtualization, and SMP. It also offers a clean design and a stable
kernel interface. The available kernel-interface specification and the
readable and modern source base are a pleasure to work with. Hence, Genode
Labs is able to fully commit to the maintenance and further evolution of this
kernel.
Nevertheless, since the beginning, the vanilla kernel lacks one essential
feature to reliably host Genode as user-land, namely the proper management of
the memory used by the kernel itself (in short kernel-memory management). In
the past, we already extended the kernel to free up kernel resources when
destroying kernel objects, e.g., protection domains and page-tables, threads,
semaphores, and portals. Still, on Genode/NOVA, a component may trigger
arbitrary kernel-memory consumption during RPC by delegating memory,
capabilities, or by creating other components via Genode's core component. If
the kernel memory gets depleted, the kernel panics with an "Out of memory"
message and the entire Genode scenario stops.
In principal, the consumption of kernel memory can be deliberately provoked by
a misbehaving (greedy) component. But also during the regular day-to-day usage
of Genode, can such a situation occur when the system is used in a highly
dynamic fashion. For example, compiling and linking source code within the
noux environment constantly creates and destroys protection domains, threads,
and memory mappings. Our nightly test of compiling Genode within noux triggers
this condition every once in a while.
The main issue here is that the consumption of kernel memory is not accounted
by Genode. The kernel interface does not support such a feature. Kernels like
seL4 as well as Genode's custom base-hw kernel show how this problem can be
solved.
To improve the current situation - where the overall kernel memory is a fixed
amount - we extended NOVA in the following ways: First, the NOVA kernel
accounts any kernel memory consumption per protection domain. Second, each
process has a limited amount of kernel-memory quota it can use. Last, the
kernel detects when the quota limit of a protection domain is reached.
If the third condition occurs, the kernel stops the offending thread and
(optionally) notifies a handler thread. This so called out-of-memory (OOM)
handler thread receives information about the current situation and may
respond to it in the following ways:
* Stop the thread of the depleted protection domain, or
* Transfer kernel-memory quota between protection domains (upgrading the limit
if desired), or
* Free up kernel memory if possible, e.g., revoke memory delegations, which
can be re-created.
We implemented the steps above inside the NOVA kernel and extended Genode's
core component to handle such OOM situations. All system calls beside the IPC
call/reply may now return an error code upon depletion of the quota. Most of
these system calls can solely be performed by core and are handled inside
core's NOVA-specific platform code.
In the case of IPC call/reply operations, we desired to handle OOM cases
transparently to Genode user-level components. Therefore, each thread in
Genode/NOVA now gets constructed with an OOM IPC portal attached. This portal
is served by the pager thread in core and is traversed on OOM occurrences
during IPC operations. If a pager thread receives such an OOM IPC, it decodes
the involved IPC sender and IPC receiver and locates the appropriate
core-internal paging objects. The currently implemented out-of-memory policy
tries to upgrade the quota. If this is not possible, an attempt to revoke
memory mappings from the OOM-causing protection domain is made. This
implicitly frees-up some kernel memory (e.g., mapping nodes). If none of the
responses suffices, the handler stops the OOM-causing thread and writes a
message to the system log.
The current policy implementation constitutes a rather rough heuristic, which
may not suffice under all circumstances. In the future, we would like to
specify a distinct policy per component, e.g. depending on prior known memory
usage patterns. For example, some components follow well-known usage patterns
and therefore a fixed upper quota limit can be specified. Other components are
highly dynamic and desire quota upgrades on demand. There are many more
combinations imaginable.
Our current plan is to collect more experience over the next months with this
new kernel mechanism. Based on our observations, we may externalize such
policy decisions and possibly make them configurable per component.
The current implementation however, already avoids the situation that the
kernel goes out of service if a single component misbehaves
kernel-memory-wise.
Genode as day-to-day operating system
#####################################
At the beginning of June, Genode reached the probably most symbolic milestone
in the project's history: Norman - one of the core developers - replaced his
Linux-based working environment with a Genode-based system. This system is
composed of the following ingredients:
[image turmvilla_scenario]
The machine used is a Lenovo Thinkpad X201. We settled on this five-year-old
machine for several reasons. First, it is a very solid platform with a nice
form factor. Second, it features Intel's AMT (Active Management Technology),
which is handy to obtain low-level system logs in the case something goes
wrong. Third, refurbished machines of this type can be obtained for as little
as 200 EUR. Finally, an older machine reinforces the need for good performance
of the operating system. So it creates a natural incentive for Norman to find
and address performance bottlenecks.
Our modified version of the NOVA microhypervisor is the used kernel.
The user interface is based on our custom GUI stack including the nitpicker
GUI server as well as the window manager and its companion components
(decorator, layouter, pointer) we introduced in
[http://genode.org/documentation/release-notes/14.08#New_GUI_architecture - version 14.08].
The display is driven by the VESA driver. User input is handled by the PS/2
driver for handling the laptop keyboard and trackpoint, and the USB driver for
handling an externally connected keyboard and mouse.
Network connectivity is provided by our port of the Intel Wireless stack that
we introduced with the version
[http://genode.org/documentation/release-notes/14.11#Intel_wireless_stack - 14.11].
Our custom AHCI driver provides access to the physical hard disk. File-system
access is provided by our
[http://genode.org/documentation/release-notes/14.02#NetBSD_file_systems_using_rump_kernels - Rump-kernel-based file-system server].
A simple Genode shell called CLI monitor allows the user to start and kill
subsystems dynamically. Initially, the two most important subsystems are
VirtualBox and Noux.
VirtualBox executes a GNU/Linux-based guest OS that we refer to as "rich OS".
The rich OS serves as a migration path from GNU/Linux to Genode. It is used
for all tasks that cannot be accomplished directly on Genode yet. At the
beginning of the transition, the daily routine still very much depends on the
rich OS. By moving more and more functionality over to the Genode world, we
will eventually be able to make the rich OS obsolete step by step. Thanks to
VirtualBox' excellent host-guest-integration features, the VirtualBox window
can be dynamically resized and the guest mouse cursor integrates seamlessly
with Genode's pointer. VirtualBox is directly connected to the wireless
network driver. So common applications like Firefox can be used.
The noux runtime allows us to use command-line-based GNU software directly on
Genode. Coreutils and Bash are used for managing files. Vim is used for
editing files. Unlike the rich OS, the noux environment has access to the
Genode partition of the hard disk. In particular, it can be used to update the
Genode system. It has access to a number of pseudo files that contain status
information of the underlying components, e.g., the list of wireless access
points. Furthermore, it has limited access to the configuration interfaces of
the base components. For example, it can point the wireless driver to the
access point to use, or change the configuration of the nitpicker GUI server
at runtime.
As a bridge between the rich OS and the Genode world, we combine VirtualBox'
shared-folder mechanism with Genode's VFS infrastructure. The shared folder is
represented by a dedicated instance of a RAM file system, which is mounted in
both the VFS of VirtualBox and the VFS of noux.
As evidenced by Norman's use since June, the described system setup is
sufficient to be productive. So other members of the Genode team plan to
follow in his footsteps soon. At the same time, the continued use of the
system from day to day revealed a number of shortcomings, performance
limitations, and rough edges, which we eventually eliminated. It goes without
saying that this is an ongoing effort. Eating our own dog food forces us to
address the right issues to make the daily life more comfortable.
Feature-wise the switch to Genode motivated three developments, namely the
enhancement of Genode's CLI monitor, the improvement of the window manager,
and the creation of a CPU-load monitoring tool.
Interactive management of subsystem configurations
==================================================
The original version of CLI monitor obtained the configuration data of its
subsystems at start time via the Genode::config mechanism. But for managing
complex scenarios, the config node becomes very complex. Hence, it is
preferable to have a distinct file for each subsystem configuration.
The new version of CLI monitor scans the directory '/subsystems' for files
ending with ".subsystem". Each file has the same syntax as the formerly used
subsystem nodes. This change has the welcome implication that subsystem
configurations can be changed during the runtime of the CLI monitor, e.g., by
using a concurrently running instance of noux with access to the _subsystems/_
directory. This procedure has become an essential part of the daily work flow
as it enables the interactive evolution of the Genode system.
Window-management improvements
==============================
To make the window manager more flexible while reducing its complexity at the
same time, we removed the formerly built-in policy hosting the decorator and
layout components as children of the window manager. Those components are no
longer child components but siblings. The relationship of the components is
now solely expressed by the configuration of their common parent, i.e., init.
This change clears the way to dynamically replace those components during
runtime (e.g., switching between different decorators).
To improve the usability of the windowed GUI, we enabled the layouter to
raise windows on click and to let the keyboard focus follow the pointer.
Furthermore, the window manager, the decorator, and the floating window
layouter became able to propagate the usage of an alpha channel from the
client application to the decorator. This way, the decorator can paint the
decoration elements behind the affected windows, which would otherwise be
skipped. Consequently, partially transparent windows can be properly displayed.
CPU-load monitoring
===================
During daily system use, we started to wish to know in detail where the CPU
cycles are spent. For example, the access of a file by the rich OS involves
several components, including the guest OS itself, VirtualBox, rump_fs (file
system), part_blk (partition access), ahci_drv (SATA device access), core, and
NOVA. Investigating performance issues requires a holistic view of all those
components. For this reason, we enhanced our existing tracing infrastructure
(Section [Enhanced tracing facilities]) to allow the creation of CPU-load
monitoring tools. The first tool in this category is the graphical CPU-load
monitor located at _gems/app/cpu_load_display/_, which displays a timeline of
the CPU load where each thread is depicted with a different color. Thanks to
this tool, we have become able to explore performance issues in an interactive
way. In particular, it helped us to identify and resolve a long-standing
inaccuracy problem in our low-level timer service.
Base framework and low-level OS infrastructure
##############################################
Improved audio support
======================
In the previous release, we replaced our old audio driver with a new one that
provided the same audio-out session interface. Complementing the audio-out
session, we are now introducing a new audio-in session interface that can be
used to record audio frames. It is modeled after the audio-out interface in
the way how it handles the communication between the client and the server. It
uses shared memory in the form of the Audio_in::Stream to transport the frames
between the components. A server component captures frames and puts them into
a packet queue, which is embedded in the Audio_in::Stream. The server
allocates packets from this queue to store the recorded audio frames. If the
queue is already full, the server will override already allocated packets and
will notify the client by submitting an 'overrun' signal. The client has to
cope with this situation, e.g., by consuming packets more frequently. A client
can install a signal handler to respond to a progress signal, which is sent by
the server when a new Audio_in::Packet has been submitted to the packet queue.
For now, all audio-in server components only support one channel (left)
although the audio-in session interface principally supports multiple
channels.
The _dde_bsd_ audio_drv is the first and currently only audio driver component
that was extended to provide the audio-in session. To express this fact, the
driver was renamed from _audio_out_drv_ to _audio_drv_. In contrast to its
playback functionality, which is enabled by default, recording has to be
enabled explicitly by setting the configuration attribute 'recording' to
'yes'. If the need arises, playback may be disabled by setting 'playback' to
'no'. In addition, it is now possible to configure the driver by adjusting the
mixer in the driver's configuration node. For the time being, the interface as
employed by the original OpenBSD mixer utility is used.
The following snippet shows how to enable and configure recording on a
Thinkpad X220 where the headset instead of the internal microphone is used as
source:
! <start name="audio_drv">
! <resource name="RAM" quantum="8M"/>
! <provides>
! <service name="Audio_out"/>
! <service name="Audio_in"/>
! </provides>
! <config recording="yes">
! <mixer field="outputs.master" value="255"/>
! <mixer field="record.adc-0:1_source" value="sel2"/>
! <mixer field="record.adc-0:1" value="255"/>
! </config>
! </start>
In addition to selecting the recording source, the playback as well as the
recording volume are raised to the maximum. Information about all available
mixers and settings in general may be obtained by specifying the 'verbose'
attribute in the config node.
The enriched driver is accompanied by a simple monitor application, which
directly plays back all recorded audio frames and shows how to use the
audio-in session. It can be tested by executing the
_repos/dde_bsd/run/audio_in.run_ run script.
There are also changes to the audio-out session itself. The length of a period
was reduced from 2048 to 512 samples to accommodate for a lower latency when
mixing audio-out packets. A method for invalidating all packets in the queue
was also added.
File-system infrastructure
==========================
Unlike traditional operating systems that rely on a global name space for
files, each Genode component has a distinct view on files. Many low-level
components do not even have the notion of files. Whereas traditional operating
systems rely on a virtual file system (VFS) implemented in the OS kernel,
Genode's VFS has the form of a library that can optionally be linked to a
component. The implementation of this library originated from the noux runtime
introduced in version
[http://genode.org/documentation/release-notes/11.02#Noux_-_an_execution_environment_for_the_GNU_userland - 11.02],
and was later integrated into our C runtime in version
[http://genode.org/documentation/release-notes/14.05#Per-process_virtual_file_systems - 14.05].
With the current release, we take the VFS a step further by making it
available to components without a C runtime. Thereby, low-complexity
security-sensitive components such as CLI monitor become able to benefit from
the powerful VFS infrastructure.
The VFS itself received a welcome improvement in the form of private RAM file
systems. A need for process-local storage motivated a conversion of the
existing ram_fs server component to an embeddable VFS file system. This
addition to the set of VFS plugins enables components to use temporary file
systems without relying on the resources of an external component.
Unified networking components
=============================
Having had a good experience with our Block::Driver implementation, which
wraps the block-session interface and takes care of the packet-stream
handling, thus easing the implementation of driver and other block components,
we observed that this approach did not provide enough flexibility for
NIC-session servers. For example, NIC servers are bi-directional and when a
network packet arrives the server has to make sure that there are enough
resources available to dispatch the network packet to the client. This has to
be done because the server must never block, e.g., by waiting for allocations
to succeed or for an empty spot in the packet queue of a client. Therefore,
such a non-blocking NIC server needs to validate all preconditions for
dispatching the packet in advance and, if they cannot be met, drop the network
packet.
In order to implement this kind of behavior, NIC-session servers must have
direct access to the actual NIC session. For this reason, we removed the
Nic::Driver interface from Genode and added a Nic::Session_component that
offers common basic packet-stream-signal dispatch functionality. Servers may
now inherit from this component and implement their own policy.
We adjusted all servers that implement NIC sessions to the new interface
(dde_ipxe, wifi, usb, nic_bridge, OpenVPN, ...), and thereby unified all
networking components within Genode.
Enhanced tracing facilities
===========================
Recent Genode-based system scenarios like the one described in Section
[Genode as day-to-day operating system] consist of dozens of components that
interact with each other. For reasoning about the behaviour of such scenarios
and identifying effective optimization vectors, tools for gathering a holistic
view of the system are highly desired.
With the introduction of our light-weight
[http://genode.org/documentation/release-notes/13.08#Light-weight_event_tracing - event-tracing facility]
in version 13.08, we laid the foundation for such tools. The current release
extends core's TRACE service with the ability to obtain statistics about CPU
utilization. More specifically, it enables clients of core's TRACE service to
obtain the execution times of trace subjects (i.e., threads). The execution
time is delivered as part of the 'Subject_info' structure. In addition to the
execution time, the structure delivers the information about the affinity of
the subject with a physical CPU.
At the current stage, the feature is available solely on NOVA since this is
our kernel of choice for using Genode as our day-to-day OS. On all other base
platforms, the returned execution times are 0. To give a complete picture of
the system's threads, the kernel's idle threads (one per CPU) are featured as
trace subjects as well. Of course, idle threads cannot be traced but their
corresponding trace subjects allow TRACE clients to obtain the idle time of
each CPU.
By obtaining the trace-subject information in periodic intervals, a TRACE
client is able to gather statistics about the CPU utilization attributed to
the individual threads present (or no longer present) in the system. One
instance of such a tool is the new trace-subject reporter located at
_os/src/app/trace_subject_reporter_. It acts as a TRACE client, which delivers
the gathered trace-subject information in the form of XML-formatted data to a
report session. This information, in turn, can be consumed by a separate
component that analyses the data. In contrast to the low-complexity
trace-subject reporter, which requires access to the privileged TRACE services
of core, the (potentially complex) analysing component does not require access
to core's TRACE service. So it isn't as critical as the trace-subject monitor.
The first representative of a consumer of trace-subject reports is the
CPU-load display mentioned in Section [CPU-load monitoring] and depicted in
Figure [nano3d].
In addition to the CPU-monitoring additions, the tracing facilities received
minor refinements. Up to now, it was not possible to trace threads that use a
CPU session other than the component's initial one. A specific example is
VirtualBox, which employs several CPU sessions, one for each priority. This
problem has been solved by associating the event logger of each thread with
its actual CPU session. Consequently, the tracing mechanism has become able to
trace VirtualBox, which is pivotal for our further optimizations.
Low-complexity software rendering functions
===========================================
Our ambition to use Genode as our day-to-day OS raises the need for custom
graphical applications. Granted, it is principally possible to base such
applications on Qt5, which is readily available to native Genode components.
However, for certain applications like status displays, we prefer to avoid the
dependency on an overly complex GUI tool kit. To accommodate such
applications, Genode hosts a small collection of low-complexity graphics
functions called painters. All of Genode's low-complexity graphical components
such as nitpicker, launchpad, window decorator, or the terminal are based on
this infrastructure.
With the current release, we extend the collection with two new painters
located at _gems/include/polygon_gfx_. Both draw convex polygons with an
arbitrary number of points. The shaded-polygon painter interpolates the color
and alpha values whereas the textured-polygon painter applies a texture to the
polygon. The painters are accompanied by simplistic 3D routines located at
_gems/include/nano3d/_ and a corresponding example (_gems/run/nano3d.run_).
[image nano3d]
With the nano3d demo and our new CPU load display, the screenshot above shows
two applications that make use of the new graphics operations.
Device drivers
##############
Completing the transition to the new platform driver
====================================================
Until now, the platform driver on x86-based machines was formed by the ACPI
and PCI drivers. The ACPI driver originally executed the PCI driver as a slave
(child) service. The ACPI driver parsed the ACPI tables and provided the
relevant information as configuration during the PCI-driver startup. We
changed this close coupling to the more modern and commonly used
[http://genode.org/documentation/release-notes/14.02#New_session_interface_for_status_reporting - report_rom mechanism].
When the new ACPI driver finishes the ACPI table parsing, it provides the
information via a report to any interested and registered components. The
report contains among other the IRQ re-routing information. The PCI driver is
a component, which - according to its session routing configuration - plays
the role of a consumer of the ACPI report.
With this change of interaction of ACPI and PCI driver, the policy for devices
must be configured solely at the PCI driver and not at the ACPI driver. The
syntax, however, stayed the same as introduced with release 15.05.
Finally, the PCI driver 'pci_drv' got renamed to 'platform_drv' as already
used on most ARM platforms. All files and session interfaces containing
PCI/pci in the names were renamed to Platform/platform. The x86 platform
interfaces moved to _repos/os/include/platform/x86/_ and the implementation of
the platform driver to _repos/os/src/drivers/platform/x86/_.
An example x86 platform configuration snippet looks like this:
!<start name="acpi_drv" >
! <resource .../>
! <route>
! ...
! <service name="Report"> <child name="acpi_report_rom"/> </service>
! </route>
!</start>
!
!<start name="acpi_report_rom" >
! <binary name="report_rom"/>
! <resource .../>
! <provides> <service name="ROM" /> <service name="Report" /> </provides>
! <config>
! <rom> <policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/> </rom>
! </config>
! <route> ... </route>
!</start>
!
!<start name="platform_drv" >
! <resource name="RAM" quantum="3M" constrain_phys="yes"/>
! <provides> <service name="Platform"/> </provides>
! <route>
! <service name="ROM">
! <if-arg key="label" value="acpi"/> <child name="acpi_report_rom"/>
! </service>
! ...
! </route>
! <config>
! <policy label="ps2_drv"> <device name="PS2"/> </policy>
! <policy label="nic_drv"> <pci class="ETHERNET"/> </policy>
! <policy label="fb_drv"> <pci class="VGA"/> </policy>
! <policy label="wifi_drv"> <pci class="WIFI"/> </policy>
! <policy label="usb_drv"> <pci class="USB"/> </policy>
! <policy label="ahci_drv"> <pci class="AHCI"/> </policy>
! <policy label="audio_drv"> <pci class="AUDIO"/> <pci class="HDAUDIO"/> </policy>
! </config>
!</start>
In order to unify and simplify the writing of run scripts, we added the
commonly used platform configuration to the file
_repos/base/run/platform_drv.inc_. This file may be included by any test run
script in order to setup a default platform driver configuration.
In addition, the snippet provides the following functions:
'append_platform_drv_build_components', 'append_platform_drv_config' and
'append_platform_drv_boot_modules'. The functions add necessary information to
the 'build_components', 'config' and 'boot_modules' run variables. The
_platform_drv.inc_ also contains the distinction between various ARM/x86
platforms and includes the necessary pieces. Hence, run scripts are largely
relieved from platform-specific peculiarities.
The body of an example run script looks like this:
! set build_components { ... }
!
! source ${genode_dir}/repos/base/run/platform_drv.inc
! append_platform_drv_build_components
!
! build $build_components
!
! create_boot_directory
!
! set config { ... }
!
! append_platform_drv_config
!
! append config { ... }
!
! install_config $config
!
! append_platform_drv_boot_modules
!
! build_boot_image $boot_modules
!
! run_genode_until ...
BCM57cxx network cards
======================
During Hack'n Hike 2015, we had access to a server that featured a Broadcom
network card. Therefore Guido Witmond performed the first steps to enable
Broadcom's BCM 57cxx cards. With this preliminary work in place, we were
quickly able to perform the additional steps required to add BCM 57cxx support
to Genode.
VESA driver refinements
=======================
The VESA driver now reports the frame buffer's line width instead of the
visible width to the client. This fixes a possible distortion if these widths
differ, at the cost that content in the right-most area might be invisible in
such cases.
VirtualBox
##########
Policy-based mouse pointer
==========================
In the previous release, we implemented support for the transparent
integration of the guest mouse pointer with nitpicker via the VirtualBox guest
additions and the vbox_pointer component, which is capable of rendering
guest-provided mouse-pointer shapes. Now, we extended vbox_pointer by a
policy-based configuration that allows the selection of ROMs containing the
actual mouse shape based on the nitpicker session label or domain. With this
feature in place, it is possible to integrate several VirtualBox instances as
well as dedicated pointer shapes for specific components. To see the improved
vbox_pointer in action give _run/vbox_pointer_ a shot.
Dynamic adaptation to screen size changes
=========================================
VirtualBox now notifies the guest operating system about screen-size changes
(for example if the user resizes a window, which shows the guest frame
buffer). The VirtualBox guest additions can use this information to adapt the
guest frame buffer to the new size.
SMP support
===========
Guest operating systems can now use multiple virtual CPUs, which are mapped to
multiple host CPUs. The number of virtual CPUs can be configured in the
'.vbox' file.
Preliminary audio support
=========================
At some point, the use of VirtualBox as a stop-gap solution for using Genode
as everyday OS raises the need to handle audio. With this release, we address
this matter by enabling preliminary audio support in our VirtualBox port. A
back end that uses the audio-out and audio-in sessions to playback and record
sound samples has been added. It disguises itself as the OSS back end that is
already used by vanilla VirtualBox. Since Genode pretends to be FreeBSD in the
eyes of VirtualBox (because Genode's libc is based on FreeBSD's libc), the
provisioning of an implementation of the OSS back end as used on FreeBSD host
systems is the most natural approach. The audio support is complemented by
adding the necessary device models for the virtual HDA as well as the AC97
devices to our VirtualBox port.
For now, it is vital to have the guest OS configure the virtual device in a
way that considers the current implementation. For example, we cannot
guarantee distortion-free playback or recording if the guest OS uses a period
that is too short, typically 10ms or less. There are also remaining issues
with the mixing/filtering code in VirtualBox. Therefore, we bypass it to
achieve better audio quality. As a consequence, the device model of the VM has
to use the same sample rate as is used by the audio-out and audio-in sessions
(44.1kHz).
Enabling audio support is done be adding
! <AudioAdapter controller="HDA" driver="OSS" enabled="true"/>
to the .vbox file manually or configuring the VM accordingly by using the GUI.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Bender chain loader on base-hw x86_64
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On Intel platforms, we use the Bender chain loader from the
[https://github.com/alex-ab/morbo - Morbo multiboot suite] to detect available
COM ports of PCI plug-in cards, the AMT SOL device, or as fall back the
default comport 1. The loader stores the I/O port information of the detected
cards into the BIOS data area (BDA), from where it is retrieved by core on
boot and subsequently used for logging. With this release, we added the BDA
parsing to base-hw on x86-64 and enabled the feature in the run tool. As a
prerequisite, we had to fix an issue in bender triggered by the loading of
only one (large) multi-boot kernel. Consequently, its binary in
_tool/boot/bender_ was updated.
Revised page-table handling
~~~~~~~~~~~~~~~~~~~~~~~~~~~
One of the main advantages of the base-hw platform is that the memory trading
concept of Genode is universally applied even with regard to kernel objects.
For instance, whenever a component wants to create a thread, it pays for the
thread's stack, UTCB, and for the corresponding kernel object. The same
applies to objects needed to manage the virtual address space of a component
with the single exception of page tables.
Normally, when the quota, which was donated by a component to a specific
service, runs out, the component receives an exception the next time it tries
to invoke the service. The component can respond by upgrading the respective
session quota. However, in the context of page-fault resolution, this is
particularly difficult to do. The allocation and thereby the shortage of
memory becomes evident only when the client produces a page fault. Therefore,
there is no way to inform the component to upgrade its session quota before
resolving the fault.
Instead of designing a sophisticated protocol between core and the other
components to solve this problem, we decided to simplify the current
page-fault resolution by using a static set of page-tables per component.
Formerly, page tables were dynamically allocated from core's memory allocator.
Now, an array of page tables gets allocated during construction of a
protection domain. When a component runs out of page tables, all of its
mappings get flushed, and the page tables are populated from scratch. This
change greatly simplifies the page-table handling inside of base-hw.
Dynamic interrupt mode setting on x86_64
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On x86-based hardware, user-level device drivers have become able to specify
the trigger mode and polarity of the interrupts when requesting an IRQ
session. On ARM, those session parameters are ignored. This change enables the
x86_64 platform to support devices, which use arbitrary trigger modes and
polarity settings, e.g., AHCI on QEMU and real hardware.
Fiasco.OC
=========
Genode's device-driver support when using the Fiasco.OC kernel as base
platform received an upgrade.
First, principle support for the Raspberry Pi was added. To make this platform
useful in practice, a working USB driver is important. I.e., the network
interface is connected via USB. Hence the USB driver got enabled for
Fiasco.OC, too. As a result, Genode's software stack can now be used on the
Raspberry Pi by using either our custom base-hw kernel or Fiasco.OC.
Second, support for the Odroid-X2 platform using the Exynos4412 SoC was added,
which includes the drivers for clock management (CMU), power management
(PMU) as well as USB.
Thanks to Reinier Millo Sánchez and Alexy Gallardo Segura for having
contributed this line of work.
Removal of deprecated features
##############################
We dropped the support for the *ARM Versatile Express* board from the Genode
source tree to relieve our automated testing infrastructure from supporting a
platform that remained unused for more than two years.
The device driver environment kit (DDE Kit) was originally intended as a
common API among the execution environments of ported user-level device
drivers. However, over the course of the past years, we found that this
approach could not fulfill its promise while introducing a number of new
problems. We reported our experiences in the release notes of versions
[http://genode.org/documentation/release-notes/12.05#Re-approaching_the_Linux_device-driver_environment - 12.05] and
[http://genode.org/documentation/release-notes/14.11#Roundup - 14.11].
To be able to remove the DDE-Kit API, we reworked the USB driver, our port of
the Linux TCP/IP stack, and the wireless driver accordingly.

File diff suppressed because it is too large Load Diff

View File

@@ -1,652 +0,0 @@
===============================================
Release notes for the Genode OS Framework 16.02
===============================================
Genode Labs
With version 16.02, we add RISC-V to Genode's supported CPU architectures,
enable the secure pass-through of individual USB devices to virtual machines,
and update the support for the Muen and seL4 kernels.
Trustworthy hardware becomes an increasingly pressing problem. With each new
generation of today's commodity hardware comes a dramatic increase of
complexity, the addition of proprietary companion processors, and opaque
firmware blobs. Even with a perfectly secure operating system, the user's
privacy and security remains at risk as there is no way to assess the
trustworthiness of our underlying hardware. RISC-V is a new hardware
architecture that tries to overcome this problem by the means of open source
and transparency. It is designed to scale from micro controllers to
general-purpose computers, and to be both synthesizable as FPGA softcores and
implementable in ASICs. The prospect of a scalable and trustworthy open-source
hardware platform motivated us to add RISC-V to Genode's supported CPU
architectures. Section [New support for the RISC-V CPU architecture] gives a
brief overview of this line of work.
Thanks to the growing number of our regular developers using Genode as day to
day OS, we create a natural incentive to address typical desktop-OS work
flows. In particular, the new version comes with the ability to assign
individual USB devices to VirtualBox instances. Conceptually, this looks like
a relatively straight-forward feature. But as discussed in Section
[Assignment of USB devices to virtual machines], we had to overcome a number of
challenging problems caused by the inherently dynamic nature of USB-device
hot-plugging. Also on the account of day-to-day computing, the GUI stack
received welcomed usability improvements like keyboard shortcuts for certain
window-management operations.
With respect to Genode's underlying base platforms, we are happy to announce
the updates of the Muen and seL4 kernels. The Muen separation kernel received
an update to version 0.7, which accommodates Genode's regular work flows (via
run scripts) much better than the previous version. As described in Section
[Muen separation kernel], this change clears the way to subject Muen to
Genode's regular automated tests. The seL4 kernel represents an exciting
playground as a future base platform for Genode. We have updated the kernel to
version 2.1, which prompted us to fundamentally revisit the low-level resource
management of Genode on this kernel. A summary of this undertaking is presented
in Section [seL4 version 2.1].
According to the [http:/about/road-map - road map], we originally planned to
revise the framework API in this release. Even though this topic is
[https://github.com/genodelabs/genode/issues/1832 - very actively pursued], we
decided to not rush it. We find it important to provide a smooth migration path
from the old API to the new one. Determining the best path is actually trickier
than revising the API, though. To let our decisions settle a bit, we postpone
the transition to the upcoming release.
Assignment of USB devices to virtual machines
#############################################
As a migration strategy for running Genode on a daily basis, using VirtualBox
to execute a feature-rich OS is vital. In release
[http://genode.org/documentation/release-notes/15.05#USB-device_pass-through_support - 15.05],
we added USB pass-through support to VirtualBox by enabling its integrated USB
proxy service. Since we use the open-source edition of VirtualBox, we were
merely able to use the OHCI device model and were therefore limited to using
USB 1.x devices in low and full speed mode only. To make matters worse, when
using the OHCI controller model, it is difficult if not impossible to access
USB mass-storage devices. Usually, VirtualBox facilitates the EHCI or xHCI
device models for the pass-through of storage devices. Unfortunately, those
models are only available as a proprietary extension, which cannot be used by
our VirtualBox port.
Having support for the pass-through of high-speed and super-speed USB devices
is a must in such controller models. Therefore, we either have to implement
these models ourselves or port existing ones from another VMM or emulator to
fill the gap. We went for porting existing models first because device-model
development from scratch could end up being time consuming if we want to
guarantee them to work with a variety of different OS drivers.
QEMU xHCI device model
----------------------
QEMU features a NEC xHCI (UPD720200) device model that works well with Windows
guests. For this reason, we decided to give porting this device model a shot.
We applied the DDE approach and started by creating a QEMU emulation
environment so that only the bare minimum amount of source code needed to be
taken from the QEMU sources. It came down to a handful of source files, mainly
the USB core and the xHCI device model files. We iteratively extended the
emulation environment until the QEMU sources compiled and linked fine. One
particular cumbersome issue we had to overcome was the emulation of the QEMU
Object Model. Since QEMU is written in C, it uses its own object model to
implement inheritance. This object model is used throughout QEMU. We took the
easy way out and just used a C++ wrapper class that contains all QEMU objects
that are used in the USB subsystem.
The next step was to develop a USB host device model. This model connects a
USB device attached to Genode's USB host-controller driver to the xHCI device
model. Lucky for us, QEMU already contains a USB host device model that uses
libusb, which we could use as blueprint. We implemented a USB host device that
leverages Genode's custom USB session interface. This host device reacts to a
USB device report coming from another component such as the host-controller
driver. It tries to claim all devices it finds in that report and then creates
a QEMU USB device for each of them that is attached to the xHCI device model.
The xHCI device model needs infrastructure that normally is provided by QEMU
itself such as a timer queue and PCI device handling. We introduced a QEMU
USB controller interface _repos/libports/include/qemu/usb.h_ whose back-end
library interface has to be implemented by a component, i.e. the VMM, that
wants to use the library.
In the end, this work resulted in a small library that contains the xHCI
device model and works in a standalone way. All required resources have to be
provided by the component using the library. This makes it easy to integrate
the library in different VMMs because the user of the library is not forced to
employ the library in a certain way but free to use it any way he chooses.
xHCI device model wrapper in VirtualBox
---------------------------------------
We implemented an xHCI device model _repos/port/src/virtualbox/devxhci.cc_ in
VirtualBox that merely wraps the QEMU USB library and provides the back-end
functionality required by the library to glue QEMU's xHCI device model to
VirtualBox. For now, this device is always part of a VM because there is
currently no way to disable it from within the VirtualBox configuration
front end. Therefore, it is necessary to always give VirtualBox access to a
_usb_devices_ ROM module.
We removed the afore mentioned USB proxy service from our VirtualBox port
because it became redundant with the advent of our xHCI device model.
USB device report filter
------------------------
With the xHCI support in VirtualBox in place, we had to come up with a
mechanism to select, which USB devices it may access. Since USB devices are
usually hot-plugged by the user of the system, we need to be able to configure
the access permissions dynamically at run-time. On this account, we created a
component that intercepts the report from the USB host-controller driver. On
the one hand, this USB device report-filter component screens the device
report coming from the USB host-controller driver by checking each reported
device against a given white list of devices. Only approved devices are
reported to a consumer of the report, i.e. VirtualBox. On the other hand, this
component generates a new configuration for the USB host-controller driver.
The configuration has to be changed each time the filter component finds a
suitable device because the driver will hand out access to a given device to a
client only if there is a valid policy. As we do not know in advance, which
devices might be plugged in, this policy must be maintained dynamically. The
report filter will send the device report only if the host-controller driver
has changed its configuration. This ensures that a matching policy will be in
effect at the time when the client component tries to access the device.
The configuration of the report-filter component can also be changed at run
time.
See _repos/os/src/app/usb_report_filter/README_ for more details on how the
USB device report filter may be configured.
Example configuration
---------------------
The following figure illustrates the interplay and configuration of the
involved components:
[image qemu_xhci]
When the user plugs in a USB device, the USB host-controller driver generates
a device report that is consumed by the USB device report-filter component
(1). The filter component then examines the report and checks if it contains a
device it should report to its report consumer. It then reconfigures the
host-controller driver (2). Afterwards it sends a report to its consumer (3).
The consumer, in this case a VMM, then accesses the USB device (4).
New support for the RISC-V CPU architecture
###########################################
We became aware of [http://riscv.org - RISC-V] when attending several talks
about the project at [https://fosdem.org - FOSDEM] in 2015. RISC-V aims to be
an open-source hardware architecture and is now complemented by many projects
that target the release of real hardware or ASICs (for example,
[http://lowrisc.org - the LowRISC project]). We have experience with various
major CPU architectures and many systems on a chip and, therefore, embrace a
sharp eye on certain platform properties. Intel's ME and ARM's Trustzone
practically lock out operating systems of certain hardware and firmware
features. The true nature of these mechanisms becomes increasingly dubious,
especially when trying to build a secure open-source operating system. Intel's
AMT technology for instance comes with a complete TCP/IP stack that intercepts
packets from the integrated NIC and a VNC server that can magically expose a
mouse and a keyboard at the USB controller. If you are interested in more
details about this topic
[http://blog.invisiblethings.org/papers/2015/x86_harmful.pdf - Intel x86 considered harmful]
by Joanna Rutkowska is a very good read. We decided to have a deeper look at
the RISC-V architecture as an alternative open hardware platform. Especially,
since the LowRISC project promises a completely open system on chip, including
the peripherals.
RISC-V comes with a lot of optional features, so it can cover a large field of
applications reaching from simple I/O processors to general-purpose computing.
For example, there are 64 and 32 bit ISA (instruction set architecture)
versions, three page table formats with the option to omit paging at all, up
to four privilege modes, and a minimal integer core ISA (I). Everything else,
like multiplication and division (M), atomic instructions (A), and floating
point support (F) are subject to ISA extensions and are completely optional
for a specific hardware implementation.
For Genode, we chose to add the RISC-V support to our custom _base-hw_ kernel.
Since Genode may be used as a general purpose OS, we implemented the kernel
using the 64 bit RISC-V version, the Sv39 three-level page table format, and
the so-called general-purpose extension (G), which is the abbreviation for the
IAMF extensions. The current implementation provides the kernel and the
necessary adaptations of the user level part of core.
For testing, we used the RISC-V instruction emulator called
[https://github.com/riscv/riscv-isa-sim - Spike]. There also exists a RISC-V
implementation for various Zynq FPGAs. Genode's Zynq board support has kindly
been added and contributed by Mark Vels.
In the current state, basic Genode applications including core, init, and
components that use shared libraries can be executed on top of our RISC-V
port. We did not enable the libc and postponed further activity as the
platform currently does not specify the interaction with peripherals.
Steps to test Genode on RISC-V
------------------------------
# Building the instruction emulator
! # download the front end server
! git clone https://github.com/ssumpf/riscv-fesvr.git
!
! # build the front end server
! cd riscv-fesvr
! mkdir build
! cd build
! export RISCV=<installation path>
! ../configure --prefix=$RISCV
! (sudo) make install
!
! # download the instruction emulator
! cd ../../
! git clone https://github.com/ssumpf/riscv-isa-sim.git
! cd riscv-isa-sim
!
! # build the emulator
! mkdir build
! cd build
! ../configure --prefix=$RISCV --with-fesvr=$RISCV
! (sudo) make install
!
! # add $RISCV/bin to path
! export PATH=$RISCV/bin:$PATH
# Building Genode and running a test scenario
! # download Genode
! cd ../../
! git clone https://github.com/genodelabs/genode.git
!
! # build the Genode tool chain
! cd genode
! ./tool/tool_chain riscv
!
! # create RISC-V build directory
! ./tool/create_builddir hw_riscv
! cd build/hw_riscv
!
! # build and execute the printf run script
! make run/printf
GUI stack usability improvements
################################
Motivated by the daily use of Genode as desktop OS by an increasingly number
of developers, the window-layouter component of the
[http://genode.org/documentation/release-notes/15.11#GUI_stack - GUI stack]
received welcomed usability improvements.
Configurable window placement
-----------------------------
The policy of the window layouter can be adjusted via its configuration. For
a given window label, the window's initial position and its maximized state
can be defined as follows:
! <config>
! <policy label="mupdf" maximized="yes"/>
! <policy label="nit_fb" xpos="50" ypos="50"/>
! </config>
Keyboard shortcuts
------------------
The window layouter has become able to respond to key sequences. However,
normally, the layouter is not a regular nitpicker client but receives only
those input events that refer to the window decorations. It never owns the
keyboard focus. In order to propagate global key sequences to the layouter,
nitpicker must be explicitly configured to direct key sequences initiated with
certain keys to the decorator. For example, the following nitpicker
configuration routes key sequences starting with the left windows key to the
decorator. The window manager, in turn, forwards those events to the layouter.
! <start name="nitpicker">
! ...
! <config>
! ...
! <global-key name="KEY_LEFTMETA" label="wm -> decorator" />
! ...
! </config>
! ...
! </start>
The response of the window layouter to key sequences can be expressed in the
layouter configuration as follows:
! <config>
! <press key="KEY_LEFTMETA">
! <press key="KEY_TAB" action="next_window">
! <release key="KEY_TAB">
! <release key="KEY_LEFTMETA" action="raise_window"/>
! </release>
! </press>
! <press key="KEY_LEFTSHIFT">
! <press key="KEY_TAB" action="prev_window">
! <release key="KEY_TAB">
! <release key="KEY_LEFTMETA" action="raise_window"/>
! </release>
! </press>
! </press>
! <press key="KEY_ENTER" action="toggle_fullscreen"/>
! </press>
! </config>
Each '<press>' node defines the policy when the specified 'key' is pressed.
It can be equipped with an 'action' attribute that triggers a window action.
The supported window actions are:
:next_window: Focus the next window in the focus history.
:prev_window: Focus the previous window in the focus history.
:raise_window: Bring the focused window to the front.
:toggle_fullscreen: Maximize/unmaximize the focused window.
By nesting '<press>' nodes, actions can be tied to key sequences. In the
example above, the 'next_window' action is executed only if TAB is pressed
while the left windows-key is kept pressed. Furthermore, key sequences can
contain specific release events. In the example above, the release of the left
windows key brings the focused window to front, but only if TAB was pressed
before.
Device drivers
##############
USB host-controller driver enhancements
=======================================
The _usb_drv_ component now solely uses a policy to grant other components
access to USB devices exposed by its raw interface (USB session). On the basis
of the 'label' attribute, it will choose a pre-configured device that is
identified by either the 'bus' and 'dev' or the 'vendor' and 'product'
attribute tuple. To accommodate policy decisions made at run time, the USB
driver is now able to reload its configuration on demand. The USB device
report now contains a 'bus' and a 'dev' attribute as well in order to identify
a USB device more precisely. In addition to that, there is also a generated
'label' attribute in form of 'usb-<bus>-<dev>' that may be used to form
policies while configuring the system dynamically, e.g., when using the
_usb_report_filter_ component.
USB mass-storage driver
=======================
Up to now, access to USB storage devices was provided by the USB
host-controller driver only. However, its ability to do so is limited. E.g.,
it only supports one storage device and the storage device cannot be changed
at run-time. With this release we add a USB mass-storage driver that supports
UMS bulk-only devices that use the SCSI Block Commands set (direct-access).
This is still most common for USB sticks. Devices using different command
sets, e.g SD/HC devices or some external disc drives, will not work properly
if at all. The driver uses the USB session interface to access the USB device
and provides its service as block session to its client.
This component is part of the first step providing the ability to mount and
use USB sticks dynamically when using Genode as a general purpose OS. In the
future, the _usb_drv_ component should solely be the host-controller driver
while other tasks are handled by dedicated USB driver components such as this
one.
Audio output on Linux
=====================
The audio-out driver for Linux was modernized by replacing its multi-threaded
architecture by an event-driven architecture using Genode's server API. In
addition, the playback is now driven by a timer. For now it is a periodic
timer that triggers every 11 ms which is roughly the current audio-out period.
The driver now also behaves like the other BSD-based audio-out driver, i.e.,
it always advances the play pointer. That is vital for the audio-out stack
above the driver to work properly (e.g., the mixer).
Libraries and applications
##########################
New Genode-world repository
===========================
With a growing number of users and contributors comes the desire to bring more
and more existing software to Genode. Most of such libraries and applications,
however, are outside of the scope of Genode as an OS framework. In contrast to
device drivers, protocol stacks, and low-level OS services, which we subject
to our regular automated tests, most 3rd-party software is pretty independent
from Genode. The attempt to integrate the growing pool of such diverse
software into the main repository does not scale.
For this reason, we introduce the new
[https://github.com/genodelabs/genode-world - Genode World] repository, which
is the designated place for hosting ported applications, libraries, and games.
To use it, you first need to obtain a clone of Genode:
! git clone https://github.com/genodelabs/genode.git genode
Now, clone the _genode-world.git_ repository to _genode/repos/world:_
! git clone https://github.com/genodelabs/genode-world.git genode/repos/world
By placing the _world_ repository under the _repos/_ directory, Genode's tools
will automatically incorporate the ports provided by the _world_ repository.
For building software of the _world_ repository, the build-directory
configuration _etc/build.conf_ must be extended with the following line:
! REPOSITORIES += $(GENODE_DIR)/repos/world
*Word of caution*
In contrast to the components found in the mainline Genode repository, the
components within the _world_ repository are not subjected to the regular
quality-assurance measures of Genode Labs. Hence, problems are to be expected.
If you encounter bugs, build problems, or stability issues, please report them
to the [https://github.com/genodelabs/genode-world/issues - issue tracker] or
the [http://genode.org/community/mailing-lists - mailing list].
Updated 3rd-party software
==========================
The following 3rd-party code packages of the _ports_ and _libports_
repositories have been ported or updated:
* Lynx 2.8.8rel.2 (noux package)
* OpenSSH 7.1p1 (noux package)
* tar-1.27 (noux package)
* libssh 0.7.2
* Lighttpd 1.4.38
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Within the last months, the initialization code of our custom kernel got
re-arranged to simplify the addition of new architectures, e.g., the RISC-V
port (Section [New support for the RISC-V CPU architecture]) while also making
its implementation leaner. A positive side effect of this work was the
generalization of multi-processor and L2-cache support for ARM's Cortex-A9
CPUs. For instance, the Wandboard (Freescale i.MX6 SoC) is now driven with all
four cores, and its memory can be accessed with full speed.
Besides those feature additions, we fixed an extremely rare and tricky race
condition in the implementation of the kernel-protected capabilities,
introduced in release 15.05. A capability's lifetime within a component is
tracked by a reference-counting like mechanism that is under control of the
component itself. When the kernel transfered a capability to a component, and
the very same capability was deleted within the component simultaneously, the
received capability was marked as invalid, which led to diverse, sporadic
faults. This deficit in the capabilities reference-counting is solved with the
current release.
Muen separation kernel
======================
Build integration
-----------------
Building Genode scenarios running on top of the
[http://muen.sk - Muen separation kernel] has been greatly simplified by
properly integrating the Muen system build process into the Genode build system.
As described in the
[http://genode.org/documentation/release-notes/15.08#Genode_on_top_of_the_Muen_Separation_Kernel - 15.08 release notes],
the architecture with Muen is different since the entire hw_x86_64_muen Genode
system runs as a guest VM on top of the separation kernel. This means that the
Genode base-hw image must itself be packaged into the final Muen system image
as an additional step after the Genode system build.
The packaging process of a Muen system image is performed by the new
_image/muen_ run-tool plugin, which processes the following RUN_OPT parameters.
:--image-muen-external-build:
Muen system is built automatically or externally
:--image-muen-system:
Muen system policy
:--image-muen-components:
Muen system components required for the given system policy
:--image-muen-hardware:
Muen target hardware platform
:--image-muen-gnat-path:
Path to GNAT toolchain
:--image-muen-spark-path:
Path to SPARK toolchain
The options are automatically added to the _etc/build.conf_ file for the
hw_x86_64_muen base-hw platform. The
[http://genode.org/documentation/platforms/muen - documentation] has been
updated to reflect the new, simplified build process.
A port file was added to facilitate the download of the Muen sources v0.7 and
to check the required dependencies.
Using the new _image/muen_ script in combination with iPXE allows to run the
Genode test suite via the autopilot tool.
MSI support
-----------
Muen employs Intel VT-d interrupt remapping (IR) besides DMA remapping for
secure device assignment. As a consequence, PCI devices using Message Signaled
Interrupts (MSI) must be programmed to trigger requests in remappable format
(see Intel VT-d specification, Section 5.1.2.2 for further details).
To enable the use of MSIs with the base-hw kernel, a platform-specific
function has been introduced that returns the necessary MSI parameters for a
given PCI device. If either the platform or the specific device does not
support MSI, the function returns false.
On hw_x86_64_muen, the function consults the Muen subject info page to supply
the appropriate information to the IRQ session. This allows Genode device
drivers to transparently use MSIs for passed-through PCI devices.
seL4 version 2.1
================
By the end of 2015, the [http://sel4.systems/ - seL4 kernel] version 2.0 was
published. With the current release, we update Genode's preliminary support
for this kernel from the experimental branch of one year ago to the master
branch of version 2.1. Note that this line of work is still considered as an
exploration. As of now, there is still a way to go until we can leverage seL4
as a fully featured base platform. Under the hood of Genode, the transition to
the version 2.1 master branch had the following implications.
In contrast to the experimental branch, the seL4 master branch has no way to
manually define the allocation of kernel objects within untyped memory ranges.
Instead, the kernel maintains a built-in allocation policy. This policy rules
out the deallocation of once-used parts of untyped memory. The only way to
reuse memory is to revoke the entire untyped memory range. Consequently, we
cannot share a large untyped memory range for kernel objects of different
protection domains. In order to reuse memory at a reasonably fine granularity,
we need to split the initial untyped memory ranges into small chunks that can
be individually revoked. Those chunks are called "untyped pages". An untyped
page is a 4 KiB untyped memory region.
The bootstrapping of core has to employ a two-stage allocation approach now.
For creating the initial kernel objects for core, which remain static during
the entire lifetime of the system, kernel objects are created directly out of
the initial untyped memory regions as reported by the kernel. The so-called
"initial untyped pool" keeps track of the consumption of those untyped memory
ranges by mimicking the kernel's internal allocation policy. Kernel objects
created this way can be of any size. For example the CNode, which is used to
store page-frame capabilities is 16 MiB in size. Also, core's CSpace uses a
relatively large CNode.
After the initial setup phase, all remaining untyped memory is turned into
untyped pages. From this point on, newly created kernel objects cannot exceed
4 KiB in size because one kernel object cannot span multiple untyped memory
regions. The capability selectors for untyped pages are organized similarly to
those of page-frame capabilities. There is a new 2nd-level CNode
(UNTYPED_CORE_CNODE) that is dimensioned according to the maximum amount of
physical memory (1M entries, each entry representing 4 KiB). The CNode is
organized such that an index into the CNode directly corresponds to the
physical frame number of the underlying memory. This way, we can easily
determine an untyped page selector for any physical addresses, i.e., for
revoking the kernel objects allocated at a specific physical page. The
downside is the need for another 16 MiB chunk of meta data. Also, we need to
keep in mind that this approach won't scale to 64-bit systems. We will
eventually need to replace the PHYS_CORE_CNODE and UNTYPED_CORE_CNODE by CNode
hierarchies to model a sparsely populated CNode. The following figure
illustrates the layout of core's capability space.
[image sel4_core_cspace_master]
Organization of core's capability space on seL4
For each protection domain, core maintains a so-called VM CSpace that holds
capability selectors for page frames and page tables. The size constraint of
kernel objects has the immediate implication that the VM CSpaces of protection
domains must be organized via several levels of CNodes. I.e., as the top-level
CNode of core has a size of 2^12, the remaining 20 PD-specific CSpace address
bits are organized as a 2nd-level 2^4 padding CNode, a 3rd-level 2^8 CNode,
and several 4th-level 2^8 leaf CNodes. The latter contain the actual selectors
for the page tables and page-table entries of the respective PD.
As another slight difference from the experimental branch, the master branch
requires the explicit assignment of page directories to an ASID pool.
Functionality-wise the update to version 2.1 brings no changes. The
preliminary support is still limited to Genode's most fundamental mechanisms
like the bootstrapping, the creation of protection domains, the execution of
threads, and inter-component communication. User-level device drivers are not
supported yet. Such functional improvements are scheduled for Genode 16.08.
Linux
=====
We started to experience crashes of our dynamic linker (ldso) when using
Genode's _base-linux_ platform on recent Linux kernels. Ldso is primarily a
shared object, which is linked to dynamic binaries. But ldso is also an
executable, which, once started loads the dynamically-linked binary along with
all shared libraries required by the binary. Up to now, ldso had to be loaded
at a link address defined at compilation time, which we enforced through
linker-script magic. Unfortunately, this does not work any longer on recent
Linux versions. The kernel notices that ldso is a shared object and loads it
at an arbitrary (randomized) address, which ultimately results in a
segmentation fault during ldso initialization. We found a fix for this issue
by marking ldso as an executable in the ELF header. But since ldso is linked
to all dynamic binaries (it contains Genode's base libraries) the GNU linker
then refused to link because ldso was not marked as a shared object.
Therefore, we decided to implement true self relocation within ldso. This
feature only works on Genode's base-linux platform as it requires some
symbol-address magic.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,729 +0,0 @@
===============================================
Release notes for the Genode OS Framework 16.11
===============================================
Genode Labs
In contrast to most parts of the framework, the fundamental low-level
protocols, which define the interaction between parent and child components
have remained unchanged since the very first Genode version. From this
interplay, the entire architecture follows. That said, certain initial design
choices were not perfect. They partially resulted from limitations of the
kernels we used during Genode's early years and from our pre-occupation with a
certain style of programming. Over the years, the drawbacks inherent in our
original design became more and more clear and we drafted rough plans to
overcome them. However, reworking the fundamental protocols of a system that
already accommodates hundreds of component implementations cannot be taken
lightly. Because of this discomfort, we repeatedly deferred the topic -
until now. With the rapidly growing workloads carried by Genode, we
deliberately decided to address long-standing deficiencies rather than adding
the features we originally planned according to the
[https://genode.org/about/road-map - road map].
Section [Asynchronous parent-child interactions] presents the reworking of
Genode's component interplay at the lowest level. With this change in place,
we feel much more comfortable to scale up our workloads in the upcoming
releases.
Functionality-wise, the most prominent topic of the current release is the
vastly improved NIC-routing component. Since we introduced the first version
of the NIC router in the previous release, we took an iterative approach to
shape the component according to its most prominent use cases. Section
[Further improved virtual networking] summarizes the changes and the
motivation behind them.
Even though we added support for seL4 in the previous release, the NOVA
hypervisor is still our go-to kernel for x86-based hardware because of its
feature set. For this reason, we continuously improve this kernel and the
NOVA-specific components like VirtualBox. Section [NOVA hypervisor] covers
the introduction of an asynchronous map operation to NOVA.
Further topics of the current release range from added smart-card support,
over a new timeout API, to a VFS-based time-based password generator. With
respect to the road map, we postponed most topics originally planned. In
particular, we intended to enable the use of Genode on top of Xen by following
the footsteps of the existing Muen support - using our custom
base-hw kernel within a Xen DomU domain. However, before proceeding this
route, we decided to modernize the kernel design, in particular with respect
to bootstrapping and address-space management. Some parts of this line of work
are already present in the current release, for example the unification of the
boot-module handling as explained in Section
[Unified handling of boot modules].
Asynchronous parent-child interactions
######################################
When Genode was born in 2006, the L4 microkernels of the time universally
lacked an asynchronous inter-process-communication (IPC) mechanism.
Consequently, we designed the first version of Genode with the presumption
that components had to interact solely synchronously. To us, this seemed to be
the "right" way because the synchronous low-footprint IPC was presumably the
key for L4's good performance. It felt natural to leverage this benefit to the
maximum extent possible.
To illustrate the implications of this line of thinking for Genode, let's take
a look at a simple scenario where a parent component hosts two children and one
child provides a service to the other child.
[image simple_scenario]
During the creation of a session, the kernel's IPC mechanism serves three
purposes. First, it is used to communicate information between different
protection domains, in this case the parent, the client, and the server.
Second, it implicitly dictates the flow of control between the involved
parties because the caller blocks until the callee replies to the IPC call.
Third, the IPC is the mechanism to delegate authority (like the authority to
access the server's session object) between protection domains. The latter is
realized with the kernel's ability to carry capabilities as IPC message
payload. If this sounds a bit too abstract, please consider reviewing Section
3.1. "Capability-based security" of the
[https://genode.org/documentation/genode-foundations-16-05.pdf - Genode Foundations].
Using solely a synchronous IPC mechanism, the sequence of establishing a
session in the given scenario is as follows. In the context of Genode,
we usually refer to synchronous IPC as RPC (remote procedure call).
[image sync_session_seq]
The sequence looks straightforward:
# The client issues an RPC call to its parent, requesting a session for a
service of the given type while also passing a number of session-construction
arguments along with the request.
# Given the service name as provided with the session request, the parent
determines the server to ask for a new session. It requests a session
on behalf of the client by performing an RPC call to the server's prior
registered "root" capability. This capability refers to an interface for
creating and closing sessions.
# The server responds to the invocation of its root interface by creating
a new session object along with a session capability.
Whereas the session object is local to the server, the corresponding
session capability can be passed (delegated) to other components.
Each component in possession of the session capability is able to interact
with the server's corresponding session object via RPC calls.
The server returns the session capability to the parent as the result of the
parent's RPC call.
# The parent forwards the session capability to the client as the result of
the client's original RPC call.
Even though the simplicity of this protocol seems nice, it has inherent
limitations:
First, as the parent performs a synchronous RPC call to the server on behalf
of the client, it must trust the server to eventually respond to the RPC call.
If the server doesn't, the parent may block forever. In contrast to the client
that actually uses the service and thereby relies on the liveliness of the
server, the parent should not need to trust the server to be responsive. To
deal with the risk of an unresponsive server, Genode's existing runtime
environments (like the init component), maintain a dedicated thread for each
child. The session requests originating from a child are handled by the
corresponding parent-local child thread. In the worst case - if the server
fails to respond - only a single child thread stays blocked but the other
parts of the runtime environment remain unaffected. Consequently, runtime
environments have to be multi-threaded components. This, in turn, comes at the
cost of added complexity, in particular the need for error-prone inter-thread
synchronization.
Second, the approach keeps the parent's state implicitly stored in the stacks
of the parent's threads. This becomes a problem in dynamic runtime
environments that need to kill subsystems at arbitrary times. E.g., imagine
the situation where the client component is to be destroyed while the parent's
call to the server's root interface is still pending. The safe destruction of
the child - including its associated parent-local child thread - requires the
parent to abort the RPC call, which is a complex and - again - error-prone
operation.
Third, even though not inherent to synchronous RPC, Genode's original design
facilitated the use of a session capability as argument for requesting the
parent to close a specific session. However, the use of capabilities as
re-identifiable tokens is not well supported by most kernels, including seL4
([http://sel4.systems/pipermail/devel/2014-November/000114.html - discussion]
on the seL4 mailing list).
Asynchronous communication throughout Genode
--------------------------------------------
In 2008, we acknowledged the sole reliance on synchronous RPC as too limiting
and introduced an
[https://genode.org/documentation/release-notes/8.11#Asynchronous_notifications - API for asynchronous notifications].
On the traditional L4 kernels, we implemented the API by using Genode's
core component as a proxy for signal delivery. The use of asynchronous
notifications soon became natural and wide-spread throughout Genode. Today,
most session interfaces combine three forms of inter-component communication,
namely synchronous RPC calls, asynchronous notifications, and shared memory.
The new Genode API introduced in
[https://genode.org/documentation/release-notes/16.05#The_great_API_renovation - version 16.05]
further cultivated the modeling of Genode components as single-threaded state
machines instead of multi-threaded programs.
Still, until now, the most fundamental mechanism of Genode - the protocol
between parent and child components - has remained synchronous. The reasons
are twofold. First, our workaround for realizing runtime environments in a
multi-threaded way worked too well. So we were not constantly bothered by this
design problem. Second and more importantly, redesigning the fundamental
mechanism of the framework while not breaking the more than 300 existing
components is quite scary. But in anticipation of the rapidly scaling
workloads imposed on Genode, we had to take on the problem sooner or later.
We figured that now - with the modernized framework API in place - it's the
right time. From redesigning the interplay of parent and child components, we
will become able to create single-threaded runtime environments that behave
completely deterministically while consuming less resources than
multi-threaded programs. By the explicit enumeration of possible states, we
greatly ease the validation/evaluation of such crucial components.
New session-creation procedure
------------------------------
Following the asynchronous approach, the sequence of creating a session now
looks as follows:
[image async_session_seq]
The dotted lines are asynchronous notifications, which have fire-and-forget
semantics. A component that triggers a signal does not block.
The following points are worth noting:
* Sessions are identified via IDs, which are plain numbers as opposed to
capabilities. The IDs as seen by the client and server belong to different
ID name spaces.
IDs of sessions requested by the client are allocated by the client. IDs
of sessions requested at the server are allocated by the parent.
* The parent does no longer need to perform RPC calls to any of its children.
Hence, the need for multiple threads in runtime environments disappears.
* Each activation of the parent merely applies a state change of the session's
meta data structures maintained at the parent, which capture the entire
state of session requests. There is no hidden state stored on the parent's
stack.
* The information about pending session requests is communicated from the
parent to the server via a ROM session. At startup, the server requests
a ROM session for the ROM module "session_requests" from its parent. The
parent implements this ROM session locally. Since ROM sessions support
versions, the parent can post version updates of the "session_requests"
ROM with the regular mechanisms already present in Genode.
* The involved parties can potentially run in parallel.
Outcome and current state
-------------------------
Intuitively, the sequence of steps required to establish a session has
become more complicated. However, for the users of the framework, the entire
procedure is completely transparent. With a few tricks, we were actually able
to implement this fundamental change while keeping almost all existing
components untouched. One trick is the introduction of a server-local proxy
mechanism, which translates the requests obtained from the "session_requests"
ROM to component-local RPC calls on the server's root interface. So from the
perspective of an existing server component, a session request still looks
like a synchronous RPC request from the outside. Of course, the proxy is meant
as an intermediate solution until we have crafted a convenient front-end API
for the asynchronous mode of operation.
Even though the biggest share of components remains unaffected by the change,
this is not true for all components. In particular, runtime environments had
to be reworked, in some cases quite fundamentally. These include core, init,
noux, the loader, GDB monitor, launcher, CLI monitor, and the platform driver.
The change does not only affect the interplay between components but also
required a reconsideration of the child-creation procedure.
Besides the architectural improvement, this line of work had two welcome
effects.
First, in contrast to the original design, which relied on capabilities as
re-identifiable tokens, the new version greatly alleviates the need for
re-identifying capabilities on seL4. So we are able to eliminate a
long-standing problem with Genode on this kernel.
Second, the work called for new data structures for the safe interaction with
ID spaces (_base/id_space.h_) and object registries (_base/registry.h_). Those
data structures will possibly be useful in a lot of places that currently use
plain (and fairly unsafe) AVL trees or lists.
At the API level, the change is almost transparent to regular components,
except for two details. The upgrading of session quota is no longer
possible by a mere RPC call to the parent. Instead, 'Connection' objects
received a new 'upgrade_ram' method that must be used instead. Speaking
of 'Connection' objects, we had to remove the (fairly obscure) 'KEEP_OPEN'
feature, which is conceptually incompatible with the new design.
Further improved virtual networking
###################################
The
[https://genode.org/documentation/release-notes/16.08#Virtual_networking_and_support_for_TOR - previous release]
introduced the NIC router - a component that individually routes IP
packets between multiple NIC sessions, translates between different IP
subnets, and also supports port forwarding and NAT. For the first version of
the NIC router, we focused on the technical realization. Now, besides
some optimization and restructuring, we took the chance to polish the
configuration interface of the component. The goal was to make the interface
more intuitive and reduce pitfalls to a minimum. Roughly speaking, the
handling of the NIC router became more tailored to its/our typical use cases.
Let's create a practical setup to explain the changes in detail. Assume that
there are two virtual subnets 192.168.1.0/24 and 192.168.2.0/24 within our
Genode system. They connect as Virtnet A and B to the router. The standard
gateway of the virtual networks is the NIC router with IP 192.168.*.1 . The
router's uplink, on the other hand, is connected to the NIC driver. It
interfaces the machine with our real-world home network 10.0.2.0/24. The home
network is connected to the internet through its standard gateway 10.0.2.1.
[image nic_router_basic]
The basic router configuration for this setup without any routing rules would
be as follows:
! <policy label_prefix="virtnet_a" domain="virtnet_a" />
! <policy label_prefix="virtnet_b" domain="virtnet_b" />
!
! <domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1" />
! <domain name="virtnet_a" interface="192.168.1.1/24" />
! <domain name="virtnet_b" interface="192.168.2.1/24" />
The first thing to notice is the changed usage of the policy tag. Previously,
the policy label - normally solely designated to correlate sessions with
configuration domains - was misused also as unique peer identifier in the
routing rules. This approach disregarded advanced label-matching techniques
such as the 'label_prefix' used above. Now, the whole NIC-router-specific
enhancement of the policy tag moved to the new '<domain>' tag, leaving the
policy tag only with its original purpose to select policies. Note that even
if this modification gives the impression, the router is not yet capable of
handling multiple NIC sessions at one domain at a time.
In the domain tag, the 'interface' attribute replaces the old policy attribute
named 'src'. That means, it tells the router which IP identity to use when
talking as itself to the domain. But in addition to that, the 'interface'
attribute also defines which subnet this identity and the domain belong to.
This reflects a basic decision we made during the reworking process: The new
NIC router is aware of subnets. Sessions of the same subnet have the same
configuration domain. We came to this conclusion as it solves some fundamental
problems with the old version. First, the equivalence of domain and subnet
enables us to link a default gateway to a subnet by adding the 'gateway'
attribute to the domain tag. In our example, this is done in the uplink
domain. The 'gateway' attribute is optional for a domain and replaces the
former 'via' attributes of the different routing rules. It is more efficient
and natural to have this value set only once at the corresponding subnet than
having it scattered all over the routing rules of the remote domains as done
before. If a domain has no default gateway, it drops all packets with a
foreign recipient.
The second advantage of a domain being equivalent to a subnet is that handling
ARP broadcasts becomes easy. It can be excluded that such ARP broadcasts
concern sessions outside the source domain anymore. And as sessions in the
same domain are not distinguishable to the routing, the broadcast can be sent
to all of them without breaking any rules.
Now, let's enhance our example by some routing rules. One pretty complicated
thing to do with the old NIC router was port forwarding. You had to combine
different routing rules, explicitly enable the back routing at the remote
side, and take care that NAT was applied - a lot of opportunities for
mistakes. With the new version, it became easier. Let's assume we have an HTTP
server in Virtnet A and an NTP server in Virtnet B. We want the NIC router to
act as proxy for their services in our home network.
[image nic_router_servers]
In order to achieve this, the uplink domain must be enhanced by two rules:
! <policy label_prefix="virtnet_a" domain="virtnet_a" />
! <policy label_prefix="virtnet_b" domain="virtnet_b" />
!
! <domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1" />
! <tcp-forward port="443" domain="virtnet_a" to="192.168.1.2" />
! <udp-forward port="123" domain="virtnet_b" to="192.168.2.2" />
! </domain>
!
! <domain name="virtnet_a" interface="192.168.1.1/24" />
! <domain name="virtnet_b" interface="192.168.2.1/24" />
The TCP forwarding rule for port 443 (HTTP+TLS/SSL) redirects to IP address
192.168.1.2 in Virtnet A and the UDP forwarding rule for port 123 (NTP)
redirects to IP address 192.168.2.2 in Virtnet B. The Virtnet domains remain
empty as the router keeps track of the redirected transfers and routes back
reply packets automatically. Also automatically, the router applies NAT for the
server as it is in the nature of port forwarding.
Next, we add some clients to Virtnet B that like to talk to our home network
and the internet. We want them to be hidden via NAT when they do so. For
internet communication, they shall furthermore be limited to HTTP+TLS/SSL and
IMAP+TLS/SSL.
[image nic_router_client]
This is what the router configuration looks now:
! <policy label_prefix="virtnet_a" domain="virtnet_a" />
! <policy label_prefix="virtnet_b" domain="virtnet_b" />
!
! <domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1" />
! <tcp-forward port="443" domain="virtnet_a" to="192.168.1.2" />
! <udp-forward port="123" domain="virtnet_b" to="192.168.2.2" />
! <nat domain="virtnet_b" tcp-ports="1000" udp-ports="1000">
! </domain>
!
! <domain name="virtnet_a" interface="192.168.1.1/24" />
! <domain name="virtnet_b" interface="192.168.2.1/24" >
! <tcp dst="10.0.2.0/24"> <permit-any domain="uplink" /> </tcp>
! <udp dst="10.0.2.0/24"> <permit-any domain="uplink" /> </udp>
! <tcp dst="0.0.0.0/0">
! <permit port="443" domain="uplink" />
! <permit port="993" domain="uplink" />
! </tcp>
! </domain>
There are several new tag types. One of them is the NAT configuration for
Virtnet B in the uplink domain. In contrast to the former NIC-router version
where NAT settings were part of the source domain, NAT is now configured in
the target domain with a sub-tag for each source. This has the advantage
of supporting heterogeneous NAT configurations for a packet source depending
on which domain it talks to. Besides, it is more intuitive to read. Apart from
that, the NAT settings haven't changed.
Furthermore, there are the new TCP and UDP tags in the Virtnet-B domain. The
first two of them have a 'permit-any' sub-tag. With this combination, we open
all ports to IP addresses of the 10.0.2.0/24 subnet, our home network, and
route them to the uplink domain. TCP packets that don't match these first two
rules may fall back to the third. This TCP rule doesn't have all ports opened
but only 443 (HTTP+TLS/SSL) and 993 (IMAP+TLS/SSL). Both ports are again bound
to the uplink domain. As the IP filter 0.0.0.0/0 of the surrounding rule isn't
restrictive, we now also route packets to a foreign destination. The NIC
router redirects such packets to the default gateway of our home network.
Compared to the old router version where IP and UDP/TCP routing had to be
combined for this purpose, the new TCP and UDP rules with their
port-permission sub-rules have some notable advantages. Like port-forwarding
rules, TCP and UDP rules always imply link-state tracking in order to route
back reply packets automatically. This can be seen also in our example as no
further routing rules had to be added to the uplink domain. This aspect is
clear from the outermost rule and not dependent on sub-rules anymore.
Furthermore, the strict separation of UDP and TCP routing prevents
configuration faults and increases readability. Last but not least, the
'permit-any' rule allows something new. Opening all ports for an address range
was previously only possible without link-state tracking as it could be
expressed only on the IP level.
At this point, we have thoroughly discussed the layer-3 routing abilities of
the new NIC router and our focus has indeed moved more into this direction.
Even though IP routing is still available, we found that it should be more
clearly separated from the rest. To illustrate this feature, we enhance our
example again. We want the Virtnets to be allowed to communicate to each other
without any restrictions. For that purpose, we add two more rules to the
router configuration:
! <policy label_prefix="virtnet_a" domain="virtnet_a" />
! <policy label_prefix="virtnet_b" domain="virtnet_b" />
!
! <domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1" />
! <tcp-forward port="443" domain="virtnet_a" to="192.168.1.2" />
! <udp-forward port="123" domain="virtnet_b" to="192.168.2.2" />
! <nat domain="virtnet_b" tcp-ports="1000" udp-ports="1000">
! </domain>
!
! <domain name="virtnet_a" interface="192.168.1.1/24" />
! <ip dst="192.168.2.0/24" domain="virtnet_b"/>
! </domain>
!
! <domain name="virtnet_b" interface="192.168.2.1/24" >
! <tcp dst="10.0.2.0/24"> <permit-any domain="uplink" /> </tcp>
! <udp dst="10.0.2.0/24"> <permit-any domain="uplink" /> </udp>
! <tcp dst="0.0.0.0/0">
! <permit port="443" domain="uplink" />
! <permit port="993" domain="uplink" />
! </tcp>
! <ip dst="192.168.1.0/24" domain="virtnet_a"/>
! </domain>
As you can see, each of the new IP rules in the Virtnet domains match the
addresses of the opposite subnet and route to the corresponding domain. As
mentioned, the new IP rules and UDP/TCP rules are not combined anymore to
clearly distinguish IP routing from layer-3 routing because this decision has
far-reaching effects. First, in contrast to UDP and TCP routing, IP routing is
stateless. Thus, for each IP routing rule one has to be sure to have a
back-routing rule at the remote domain or else bidirectional communication
won't happen. And second, NAT does not apply to IP-routed packets. So, if
you're not aware of such packets, you may unintentionally reveal information
about a private network.
For more details on the new NIC router, you may refer to the comprehensive
documentation in the _repos/os/src/server/nic_router/README_ file and the
basic NIC-router test at _libports/run/nic_router.run_ .
Base framework
##############
Improved RPC mechanism
======================
Since we introduced Genode's current API for synchronous RPCs in
[https://genode.org/documentation/release-notes/11.05#New_API_for_type-safe_inter-process_communication - version 11.05],
inter-component communication within Genode has become almost a child's play.
The RPC framework leverages the C++ type system and templates to a great
effect. In contrast to the traditional use of IDL compilers, the interaction
with RPC objects provided by other components is robust and natural because
no language boundaries need to be crossed.
Still, a few differences between RPC calls and regular function calls remain.
In particular, there exist a few restrictions with regard to the types of
RPC function arguments. Those types did not just need to be POD (plain old
data) types but they had to be default-constructible, too. Whereas the former
restriction still applies (non-POD objects that include references or
vtables cannot be used as arguments), the latter limitation has been lifted
now. Generally, non-default-constructible types are a way to attain
simpler code because the special case of an "invalid" object does not need
to be considered. I.e., values of such types can be kept as constants as
opposed to variables. If an object exists (as equivalent to successful
instantiation), it is valid. With the improved RPC mechanism, the RPC
framework does no longer stay in the way in this respect.
Thanks to Edgard Schmidt for this welcome contribution!
Unification and tightening of session labels
============================================
In Genode, each session requested by a client component is labeled according
to the components that intermediate the session request. The client can
optionally specify a label of choice along with the session request. Its
parent prefixes the client-provided label by a label of its own. If the
session request is further passed to the parent's parent, the grandparent
prepends its own label. This works recursively. Consequently, the final label
as seen by the server is the product of the labeling policies of all
components on the route of the session request.
The label is used for two purposes. First, the server uses the label as
a key for a server-side policy selection. E.g., depending on the session label
received by the disk-partition server, the server decides which partition to
hand out to the client. Second, the label is used by intermediate components
to take session-routing decisions. E.g., based on the label of a file-system
session request, a parent component may route the request to one of several
file-system servers.
Originally, Genode did not impose a specific way of how labels are formed.
It was up to each intermediate component to filter the label of a session
request in any way desired. However, in practice, this freedom remained unused
and the very simple successive prefixing of labels prevails in all our use
cases. Each intermediate node concatenates its own label in front of the label
supplied by the originator of the session request. The different parts of the
label are separated with the character sequence '" -> "'. Some corner cases
were handles specially for aesthetic reasons. For example, if a client
provided no label, the parent would skip the pending separator. That said,
since each intermediate component had to provide the labeling policy, not all
components were consistent in these respects. Since we found no use for
arbitrary labeling policies, we decided to make the only prominent way of
session labeling mandatory for all intermediate components. We thereby removed
the aesthetically motivated corner cases and possible ambiguities. I.e., with
the original policy, it was not possible to distinguish a unlabeled session
requested by a client from a labeled session requested by the client's parent.
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).
Transition to new framework API
===============================
Since we fundamentally revised Genode's API in
[http://genode.org/documentation/release-notes/16.05#The_great_API_renovation - version 16.05],
we gradually adapt our existing components. Given that Genode comes with
over 300 components, this is no small feat. But with 30 percent of the
components converted, we already made substantial progress.
In some respects, the conversion is actually nearly complete. In particular,
the move away from format-string-based text output to our new type-safe output
facility has been applied to almost all components now. The former 'PDBG'
macro that is quite useful for temporary debug messages has been replaced with
a new version that must be manually included via the _base/debug.h_ header
file. Like the regular log functions, the new PDBG facility uses the type-safe
text-output facility.
Minor API adjustments
---------------------
While applying Genode's new API, we refined the API in the following respects:
We added a dedicated 'String' constructor overload to better accommodate
string literals. This overload covers the common case for initializing a
string from a literal without employing the 'Output' mechanism. This way, such
strings can by constructed without calling virtual functions, which in turn
makes the 'String' usable during the self-relocation phase of the dynamic
linker.
Up till now, several Genode components still rely on the use of 'snprintf'
whenever strings must be assembled out of smaller pieces. As we like to shun
format strings from Genode altogether, we needed an alternative mechanism.
Since we introduced the new type-safe text-output facilities in Genode 16.05,
there is an obvious solution: Let the 'String' constructor accept an arbitrary
list of arguments, which are turned into their respective textual
representation and appear concatenated in the resulting string. Consequently,
strings can be assembled with the same flexibility as log output. For the
construction of 'String' objects from character buffers of a known size, the
'Cstring' utility can be used, which takes a 'char const *' and an optional
length as arguments.
Several low-level types received support for the new output facilities, e.g.,
'Xml_node' or the network-related headers in _os/net/_.
In anticipation of the forthcoming package-management infrastructure, we try
to unify Genode's executable binaries across kernels and architectures
wherever reasonable. Of course, the latter is not possible with respect to the
used instructions. But unifying symbol information is deemed worthwhile. For
this reason, we changed the 'Genode::size_t' type to be always defined as an
'unsigned' 'long'. This is in contrast to GCC's built-in '__SIZE_TYPE__',
which is defined as 'unsigned int' on 32-bit architectures but 'unsigned long'
on 64-bit architectures.
OS-level infrastructure and device drivers
##########################################
New timeout-handing API
=======================
The new timeout API offers tools for easily multiplexing a single time
source among different timeouts. In general, the time source can be
implemented individually but we expect that the most prominent use case will
be the multiplexing of timer sessions. Thus, the timeout library also provides
a convenience tool for this use case. A library-usage example can be found
under _os/src/test/timeout_. If you're interested in implementing
your own time source, you can find an example at _os/include/os/timer.h_ .
Support for smart cards
=======================
We ported the [http://pcsclite.alioth.debian.org/pcsclite.html - PC/SC Lite]
library to Genode, which provides a commonly used API for communicating with
smart cards. It supports USB smart card readers, using the
[http://pcsclite.alioth.debian.org/ccid.html - CCID] library as driver.
The CCID driver itself requires [http://libusb.info - libusb] to access the
USB device.
Vanilla PC/SC Lite is structured as a client-server architecture, consisting
of the 'pcscd' daemon, which runs on a privileged user account and manages all
card reader devices, and one or more non-privileged client applications, which
communicate with pcscd to access the card readers. On Genode, pcscd's role as
privileged device manager is not really needed, since the devices can also be
managed using Genode's configuration mechanisms. For this reason, we merged
the part of pcscd which implements the API with the pcsc-lite client library.
In the current state, a Genode application using PC/SC Lite can access a single
card reader device, which is selected using its USB product ID and vendor ID in
the application's configuration and in the policy of the USB driver.
More configuration details can be found in the README files of the PC/SC Lite,
CCID, and libusb libraries in the libports repository and in the accompanying
_smartcard.run_ script.
Libraries and applications
##########################
Time-based password generation
==============================
A time-based one-time password authentication client that adheres to the
Google Authenticator standard has been introduced into the
[https://github.com/genodelabs/genode-world - world repository].
Single use, time-based passwords are commonly used as an additional
authentication step for web-based services. In this scheme, a user generates
and presents a six digit passcode to a service generated using a shared secret
and a timestamp. This short passcode length makes manual entry convenient so
that the shared secret may be stored on a separate device than the service
client, such as a smartphone, layering the security properties of both
devices.
The 'gtotp' VFS plugin provides these passcodes by embedding the generator as
a special file in the file-system layer of a component. This approach provides
readily available passcodes for programmatic and manual use without enlarging
the code base to encompass a GUI, command-line, or networked interface.
At the time of this release, the common use case is to manually retrieve codes
for clients running in VirtualBox by reading special files with an isolated
instance of the Noux runtime. Storing the shared secret on the same device
contradicts the recommendations of the standard but the trade-off is that the
software stack required to host the shared secret is significantly smaller
than that found on a mobile device.
Random number generator testing
===============================
No random number generator can be proved to be good, but empirical statistical
tests can prove that some are bad. A port of the TestU01 RNG test suite is
provided in the world repository. The TestU01 batteries give independent
assurance of the fitness of Genode's CPU jitter based RNG and are available
for testing future physical and non-phyical RNGs.
VirtualBox on top on the NOVA hypervisor
########################################
Both VirtualBox-based virtual machine monitors on Genode got updated to the
latest revision as provided by Oracle, namely 4.3.40 and 5.1.10 - mainly to
stay close to the upstream versions.
Platforms
#########
Unified handling of boot modules
================================
Until now, the way of passing boot modules from the boot procedure to the core
component, which core provides as ROM modules, varied from platform to
platform. Either we used a multiboot-compliant bootloader that accepts
multiple modules, or the platform provided some specific way of linking binary
modules together with the kernel, e.g., the Elfweaver tool of OKL4.
By unifying the boot-module handover, we further reduce platform specific core
code. Thereby, maintenance costs are decreased, and code analysis becomes
easier. With this new solution, when issuing to build the core component:
! make core
within the build system, only a core library gets built. Not until all
binaries needed by a run-script are available, a final image is linked
together using the core library and all additional binaries. The core
component now can access its ROM modules directly via addresses contained in
its binary. As a side effect of this change, there is no core binary in the
'bin' or 'core' directory of the corresponding build directory available
anymore. Instead, you will find the core binary with no ROM modules, but
including debug information under 'var/run/*.core' within your build
directory. The concrete name depends on the name of the run-script.
The new approach is used on all platforms except Linux where the ROM modules
still need to be accessed via the file-system.
NOVA hypervisor
===============
We extended the kernel to support the asynchronous delegation of kernel
resources. Up to now, resources could only be delegated during RPC or during
the initial protection-domain construction. With this extension, the
construction and setup of new protection domains, threads, and especially
virtual CPUs for the VirtualBox VMM became more straightforward and several
quirks inside the 'core' component could be dropped. The added kernel syscall
expects the NOVA-kernel capabilities of the source and target protection
domains, which effectively renders the operation solely available to 'core' -
as only holder of the NOVA protection domain capabilities.
Additionally, we changed the CPU ID enumeration in Genode/NOVA to a
predictable order. The lower CPU IDs used via the Genode 'Cpu_session'
interface now correspond to the first hyper-thread of all physical CPU cores.
For example, on a quad-core machine with hyper-threading enabled Genode's CPU
IDs 0-3 refer to the first hyper-threads of all physical cores and IDs 4-7 to
the second hyper-threads.

File diff suppressed because it is too large Load Diff

View File

@@ -1,651 +0,0 @@
===============================================
Release notes for the Genode OS Framework 17.08
===============================================
Genode Labs
The flagship feature of Genode 17.08 has been in the works for more than a
year: The support for hardware-accelerated graphics on Intel Gen-8 GPUs. This
is an especially challenging topic because it is riddled with terminology,
involves highly complex software stacks, carries a twisted history with it,
and remains to be a moving target. It took up a lot of patience to build up a
profound understanding of the existing driver architectures and the mechanisms
offered by modern graphics hardware. On the other hand, with the proliferation
of hardware-based sandboxing features like virtual GPU memory and hardware
contexts, we found that now is the perfect time for a clean-slate design of a
microkernelized GPU driver.
Section [Hardware-accelerated graphics for Intel Gen-8 GPUs] introduces this
work, which includes our new GPU multiplexer as well as the integration with
the client-side Mesa protocol stack.
The second focus of the current release is the extension of Genode's supported
base platforms. Most prominently, we upgrade the seL4 kernel to version 6.0
while extending the architecture support from 32-bit x86 to ARM and 64-bit
x86 (Section [The seL4 kernel on ARM and 64-bit x86 hardware]). To bring
Genode closer to cloud-computing scenarios, we added basic support for
executing Genode scenarios as Xen DomU domains (Section [Genode as Xen DomU]).
Furthermore, the Muen separation kernel has been updated to a current version.
As a cross-kernel effort, there is work under way to boot Genode-based
systems via UEFI, currently addressing the NOVA, base-hw, and seL4 kernels.
Among the many other functional additions are a new VFS plugin for accessing
FAT file systems, new components like _sequence_ and _fs_report_ that aid new
system compositions, and our evolving custom package-management
infrastructure.
Hardware-accelerated graphics for Intel Gen-8 GPUs
##################################################
The ability to leverage hardware-accelerated graphics is generally taken for
granted in modern commodity operating systems. The user experience of
modern desktop environments, web-browser performance, and obviously games
depend on it. On the other hand, the benefit of hardware-accelerated graphics
comes at the expense of tremendous added complexity in the lower software
stack, in particular in system components that need to be ultimately trusted.
For example, with circa 100 thousand lines of code, the Intel GPU driver in
the Linux kernel is an order of magnitude more complex than a complete modern
microkernel. In a monolithic-kernel-based system, this complexity is
generally neglected because the kernel is complex anyway. But in
microkernel-based scenarios optimized for a trusted computing base in the
order of a few ten thousand lines of code, it becomes unacceptable.
Fortunately, recent generations of graphics hardware provide a number of
hardware features that promise to solve this conflict, which prompted us to
investigate the use of these features for Genode.
During this year's Hack'n'Hike event, we ported the ioquake3 engine to Genode.
As preliminary requirement, we had to resurrect OpenGL support in our aging
graphics stack and enable support for current Intel HD Graphics devices (IGD).
We started by updating Mesa from the old 7.8.x to a more recent 11.2.2 release.
Since we focused mainly on supporting Intel devices, we dropped support for the
Gallium back end as Intel still uses the old DRI infrastructure. This decision,
however, also influenced the choice of the software rendering back end. Rather
than retaining the softpipe implementation, we now use swrast. In addition, we
changed the available OpenGL implementation from OpenGL ES 2.x to the fully
fledged OpenGL 4.5 profile, including the corresponding shader language
version. As with the previous Mesa port, EGL serves as front end API for
system integration and loads a DRI back-end driver (i965 or swrast). EGL
always requests the back-end driver 'egl_drv.lib.so' in form of a shared
object. Genode's relabeling features are used to select the proper back end
via a route configuration. The following snippet illustrates such a
configuration for software rendering:
! <start name="gears" caps="200">
! <resource name="RAM" quantum="32M"/>"
! <route>
! <service name="ROM" label="egl_drv.lib.so">
! <parent label="egl_swrast.lib.so"/>
! </service>
! <any-service> <parent/> <any-child/> </any-service>
! </route>
! </start>
With the graphics-stack front end in place, it was time to take care of the
GPU driver. In our case this meant implementing the DRM interface in our
ported version of the Intel i915 DRM driver. Up to now, this driver was solely
used for mode setting while we completely omitted supporting the render
engine.
[image mesa_genode]
With this new and adapted software stack, we successfully could play ioquake3
on top of Genode with a reasonable performance in 1080p on a Thinkpad X250.
During this work, we gathered valuable insights into the architecture of a
modern 3D-graphics software stack as well as into recent Intel HD Graphics
hardware. We found that the Intel-specific Mesa driver itself is far more
complex than its kernel counter part. The DRM driver is mainly concerned with
resource and execution management whereas the Mesa driver programs the GPU.
For example, amongst others, Mesa compiles the OpenGL shaders into a
GPU-specific machine code that is passed on to the kernel for execution.
While inspecting the DRM driver, it became obvious that one of the reasons for
its complexity is the need to support a variety of different HD Graphics
generations as well as different features driven by software-usage patterns.
For our security related use cases, it is important to offer a clear isolation
and separation mechanism per client. Hardware features provided by modern
Intel GPUs like per-process graphics translation tables (PPGTT) and hardware
contexts that are unique for each client make it possible to fulfill these
requirements.
By focusing on this particular feature set and thus limiting the supported
hardware generations, the development of a maintainable GPU multiplexer for
Genode became feasible. After all, we strive to keep all Genode components as
low complex as possible, especially resource multiplexers like such a GPU
multiplexer.
[image intel_gpu_drv]
This image shows multiple GPU-session clients and the resources they are
using. The fence registers as well as the aperture is partitioned between
them, the PPGTT is backed by the system memory, and the contexts are located
in disjoint GGTT regions.
Within four months, we implemented an experimental GPU multiplexer for Intel
HD Graphics Gen8 (Broadwell class) devices. We started out defining a GPU
session interface that is sufficient to implement the API used by the DRM
library. For each session, the driver creates a context consisting of a
hardware context, a set of page tables (PPGTT), and a part of the aperture.
The client may use the session to allocate and map memory buffers used by the
GPU. Each buffer is always eagerly mapped 1:1 into the PPGTT by using the
local virtual address of the client. Special memory buffers like an image
buffer are additionally mapped through the aperture to make use of the
hardware-provided de-tiling mechanism. As is essential in Genode components,
the client must donate all resources that the driver might need to fulfill the
request, i.e., quota for memory and capability allocations. Clients may
request the execution of their workload by submitting an execution buffer. The
GPU multiplexer will then enqueue the request and schedule all pending
requests sequentially. Once the request is completed, the client is notified
via a completion signal.
[image multi_gl]
Example scenario of multiple OpenGL programs that use the new GPU multiplexer
for hardware-accelerated rendering.
We consider this first version of the GPU driver as experimental. As of now,
it only manages the render engine of the GPU. Mode-setting or rather display
handling must be performed by another component. Currently, the VESA driver is
used for this purpose. It also lacks any power-management functionality and
permanently keeps the GPU awake. Both limitations will be addressed in future
releases and support for Gen9+ (Skylake) and newer devices might be added.
In its current incarnation, the GPU multiplexer component consists of about
4,200 lines of code whereas the Mesa DRI i965 driver complements the driver at
the client side with about 78,000 lines of code.
The seL4 kernel on ARM and 64-bit x86 hardware
##############################################
With the 16.08 release, we brought the seL4 support to a level to be
considered being on par with the other supported kernels. At the time,
Genode's use of seL4 was limited to 32-bit x86 platforms.
In the current release, we extend the platform support to ARM and 64-bit x86.
We started this line of work with an incremental kernel upgrade from version
3.2.0 to 5.2.0 and finally to seL4 6.0. Through these upgrades, we were able
to drop several Genode-specific seL4 patches, which were required in the 16.08
release. One major improvement of version 6.0 compared to earlier versions is
the handling of device-memory announcements by the kernel to Genode's roottask
_core_.
With the kernel update in place, we inspected the x86-specific part thoroughly
while splitting and separating it properly into architecture-agnostic and
architecture-dependent parts. Upon this work, we added the
architecture-specific counterparts for x86_64 and ARM. One major work item was
to make the page-table handling in Genode's core aware and generic enough to
handle the different page-table sizes of the three architectures.
For the ARM support, we decided to enable the i.MX6 FreeScale based SoC,
namely the Wandboard Quad board. Since the seL4 kernel interface provides no
timeout support, we revived a user-level timer driver that we originally
developed for our custom base-hw kernel: The so-called EPIT timer, which is
part of most i.MX SoCs.
We finished the essential work for the mentioned three platforms in
less time than expected and, thereby, had spare time to address additional
features.
First, we enabled multiprocessor support for Genode/seL4 on x86 and
thread-priority support for all seL4 platforms. Additionally, we were able to
utilize the seL4 benchmark interface for Genode's trace infrastructure in
order to obtain utilization information about threads and CPUs. The Genode
components _top_ (text-based) and _cpu_load_monitor_ (graphical) are now
usable on Genode/seL4.
Finally, as we are currently exploring the support for booting various kernels
via UEFI on x86, we took the chance to investigate the steps needed to boot
seL4 via UEFI. UEFI firmware does not always provide a compatibility support
module (CSM) for legacy BIOS boot support. Hence, we extended the seL4 kernel
for Genode according to the Multiboot2 specification, which enables us to
start Genode/seL4 together with GRUB2 - as an UEFI capable bootloader - on
machines missing CSM support.
Base framework and OS-level infrastructure
##########################################
Simplified IOMMU handling
=========================
When IOMMUs are used on x86, all host memory targeted via direct memory
accesses (DMA) by devices must eagerly be registered in the respective I/O
page table of the device. Up to now, Genode supports IOMMUs on NOVA only. On
this kernel, a device protection domain is represented as a regular protection
domain with its virtual memory layout being used for both the CPU's MMU and
the device. Traditionally, mappings into such virtual memory spaces are
inserted on demand as responses to page faults. However, as there are no page
faults for DMA transactions, DMA buffers must always be eagerly mapped. The
so-called device PD hid this gap for NOVA. In anticipation of adding IOMMU
support for more kernels, we desired to generalize the device-PD mechanism by
introducing an explicit way to trigger the insertion of DMA memory into the
proper page tables.
We extended the PD-session interface by a 'map' function, which takes a
virtual memory region of the PD's virtual address space as argument. The page
frames of the previously attached dataspaces are added eagerly by core to the
IOMMU page-tables. With this explicit 'map' support, we were able to replace
the Genode/NOVA-specific device-PD implementation with a generic one, which
will easily accommodate other kernels in the future.
New report server for capturing reports to files
================================================
The report session is a simple mechanism for components to publish structured
data without the complexity of a file-system layer. In the simplest case, a
client component will produce a report and communicate it directly to a
component acting as a server. The disadvantage is that the report client
becomes reliant on the liveliness and presence of the consumer component. So
in the more robust case, the _report_rom_ component acts as the server hosting
the report service as well as a ROM service for components consuming reports.
The _report_rom_ server permits ROM access only to clients matching an
explicit configuration policy. This is good for security but opaque to a user.
Reports can only be read where an explicit policy is in place and only a
single report session can report to an active ROM session.
The new _fs_report_ component is a friendlier and more flexible report server.
Reports are written to a file system using a file and directory hierarchy that
expresses session routing. This allows for intuitive report inspection and
injection via a file system. When used with the _ram_fs_ and _fs_rom_ servers,
it can also replicate the functionality of _report_rom_.
New runtime environment for starting components sequentially
============================================================
The _init_ component is a prime example of software with an emphasis on
function over features. It is the fundamental building block for combining
components yet its behavior is simple and without heuristics. Like other
contemporary init managers, it starts components in parallel, but to a more
extreme degree in that it has no concept of "runlevels" or "targets", all
components are started as soon as possible. The concrete sequence of execution
is instead determined by when server components make service announcements and
how quickly they respond to client requests.
In some cases, the execution of one component must not occur until the
execution of another component ends, be it that the first produces output that
is consumed by the second, or that the two contend for a service that cannot
be multiplexed. Init contains no provisions to enforce ordering. But we are
free to define new behaviors in other management components.
The solution to the problem of ordering is the _sequence_ component. Sequence
walks a list of children and executes them in order, one at a time. With only
one child active, there is no need for any local resource or routing
management. By applying the same session label transformations as init,
external routing and policy handling are unchanged.
An example of ordering a producer and consumer within an init configuration
follows:
! <start name="sequence">
! <resource name="RAM" quantum="128M"/>
! <config>
! <start name="producer">
! <config .. />
! </start>
! <start name="consumer">
! <config .. />
! </start>
! </config>
! <route>
! <service name="LOG" label_prefix="producer">
! <child name="log_a"/> </service>
! <service name="LOG" label_prefix="consumer">
! <child name="log_b"/> </service>
! <any-service> <parent/> <any-child/> </any-service>
! </route>
! </start>
Support for boot-time initialized frame buffer
==============================================
UEFI-based systems do not carry along legacy BIOS infrastructure, on which
our generic VESA driver depends. Hence, when booting via UEFI, one has to use
either a hardware-specific driver like our Intel-FB driver or - alternatively -
facilitate generic UEFI mechanisms.
Instead of booting in VGA text mode and leaving the switch to a graphics mode
(via real-mode SVGA BIOS subroutines) to the booted OS, UEFI employs the
so-called graphics output protocol as a means to setup a reasonable default
graphics mode prior booting the operating system. In order to produce
graphical output, the operating system merely has to know the physical address
and layout of the frame buffer. Genode's core exposes this information as the
_platform_info_ ROM module. The new _fb_boot_drv_ driver picks up this
information to provide a Genode framebuffer session interface. Hence, on
UEFI-based systems, it can be used as a drop-in replacement for the VESA
driver. In contrast to the VESA driver, however, it is not able to switch
graphics modes at runtime.
The new component is located at _os/src/drivers/framebuffer/boot/_. Thanks
to Johannes Kliemann for this contribution.
Extended non-blocking operation of the VFS
==========================================
In
[https://genode.org/documentation/release-notes/17.02#VFS_support_for_asynchronous_I_O_and_reconfiguration - version 17.02],
we added support for non-blocking reads from the VFS in the form of the
'read_ready()', 'queue_read()', and 'complete_read()' functions. Since then,
it has become obvious that blocking within the VFS is not only problematic in
the VFS server itself when multiple clients are connected, but also when the
VFS is deployed in a multi-threaded environment and a VFS plugin needs to
reliably wait for I/O-completion signals.
For this reason, we reworked the interface of the VFS even more towards
non-blocking operation and adapted the existing users of the VFS accordingly.
The most important changes are:
* Directories are now created and opened with the 'opendir()' function and
the directory entries are read with the 'queue_read()' and 'complete_read()'
functions.
* Symbolic links are now created and opened with the 'openlink()' function and
the link target is read with the 'queue_read()' and 'complete_read()'
functions and written with the 'write()' function.
* The 'write()' function does not wait for signals anymore. This can have the
effect that data written by a VFS library user has not been processed by a
file-system server when the library user asks for the size of the file or
closes it (both done with RPC functions at the file-system server). For this
reason, a user of the VFS library should request synchronization before
calling 'stat()' or 'close()'. To make sure that a file-system server has
processed all write request packets that a client submitted prior the
synchronization request, synchronization is now requested at the file-system
server with a synchronization packet instead of an RPC function. Because of
this change, the synchronization interface of the VFS library has been split
into the 'queue_sync()' and 'complete_sync()' functions.
Making block sessions read-only by default
==========================================
Genode server components are expected to apply the safest and strictest
behavior when exposing cross-component state or persistent data. In practice
block and file-system servers only allow access to clients with explicitly
configured local policies. The file-system servers enforce an additional
provision that sessions are implicitly read-only unless overridden by policy.
This release introduces a similar restriction to the AHCI driver and partition
multiplexer. Clients of these servers require an affirmative 'writeable'
attribute on policies to permit the writing of blocks. Write permission at
these servers may also be revoked by components that forward block-session
requests by placing 'writeable="no"' into session-request arguments.
All users of _ahci_drv_ and _part_blk_ are advised that this change may break
existing configurations without explicit 'writeable' policies.
Refined time handling
=====================
Release 17.05 introduced a
[https://genode.org/documentation/release-notes/17.05#New_API_for_user-level_timing - new API for user-level timing]
named _timeout framework_. Together with this new framework came a
comprehensive test that stresses all aspects of the interface. During the past
few months, this test has turned out to be an enrichment for Genode far beyond
its original scope. As the test significantly raised the standards in
user-level timing, it also sharpened our view on the measurement precision of
various timer drivers and timestamps, which act as input for the framework.
This revealed several problems previously unidentified. For instance, we
improved the accuracy and stability of the time values provided by the drivers
for the Raspberry-Pi timer, the Cortex-A9 timer, the PIT, and the LAPIC. We
also were able to further optimize the calibration of the TSC in the NOVA
kernel.
Additionally, the test also helped us to refine the timeout framework itself.
The initial calibration of the framework - that previously took about 1.5
seconds - is now performed much quicker. This makes microseconds-precise time
available immediately after the timer connection switched to the modern
fine-grained mode of operation, which is a prerequisite for hardware drivers
that need such precision during their early initialization phase. The
calculations inside the framework also became more flexible to better fit the
characteristics of all the hardware and kernels Genode supports.
Finally, we were able to extend the application of the timeout framework. Most
notably, our C runtime uses it as timing source to the benefit of all
libc-using components. Another noteworthy case is the USB driver on the
Raspberry Pi. It previously couldn't rely on the default Genode timing but
required a local hardware timer to reach the precision that the host
controller expected from software. With the timeout framework, this workaround
could be removed from the driver.
FatFS-based VFS plugin
======================
Genode has supported VFAT file-systems since the 9.11 release when the
[http://elm-chan.org/fsw/ff/00index_e.html - FatFS] library was first ported.
The 11.08 release fit the library into the libc plugin architecture and
in 12.08 FatFS was used in the _ffat_fs_ file-system server. Now, the 17.08
release revisits FatFS to mold the library into the newer and more flexible
VFS plugin system. The _vfs_fatfs_ plugin may be fitted into the VFS server or
used directly by arbitrary components linked to the VFS library. As the
collection of VFS plugins in combination with the VFS file-system server has a
lower net maintenance cost than multiple file-system servers, the _ffat_fs_
server will be retired in a future release.
Enhanced GUI primitives
=======================
Even though we consider Qt5 as the go-to solution for creating advanced
graphical user interfaces on top of Genode, we also continue to explore an
alternative approach that facilitates Genode's component architecture to an
extreme degree. The so-called menu-view component takes an XML description of
a dialog as input and produces rendered pixels as output. It also gives
feedback to user input such as the hovered widget at a given pointer position.
The menu view does not implement any application logic but is meant to be
embedded as a child component into the actual application. This approach
relieves the application from the complexity (and potential bugs) of widget
rendering. It also reinforces a rigid separation of a view and its underlying
data model.
The menu view was first introduced in
[https://genode.org/documentation/release-notes/14.11#New_menu_view_application - version 14.11].
The current release improves it in the following ways:
* The new '<float>' widget aligns a child widget within a
larger parent widget by specifying the boolean attributes 'north', 'south',
'east', and 'west'. If none is specified, the child is centered. If opposite
attributes are specified, the child is stretched.
* A new '<depgraph>' widget arranges child widgets in the form of a
dependency graph, which will be the cornerstone for Genode's upcoming
interactive component-composition feature. As a prerequisite for
implementing the depgraph widget, Genode's set of basic graphical primitives
received new operations for drawing sub-pixel-accurate anti-aliased lines
and bezier curves.
* All geometric changes of the widget layout are animated now. This includes
structural changes of the new '<depgraph>' widget.
[image depgraph]
The menu-view component is illustrated by the run script at
_gems/run/menu_view.run_.
C runtime
=========
The growing number of ported applications used on Genode is accompanied by the
requirement of extensive POSIX compatibility of our C runtime. Therefore, we
enhanced our implementation by half a dozen features (e.g., O_ACCMODE
tracking) during the past release cycle. We thank the contributors of patches
and test cases and will continue our efforts to accommodate more ported
open-source components in the future.
Libraries and applications
##########################
Mesa adjustments
================
The Mesa update required the adaption of all components that use OpenGL.
In particular that means the Qt5 framework. Furthermore, we also enabled
OpenGL support in our SDL1 port.
As playground, there are a few OpenGL examples. The demos are located under
_repos/libports/src/test/mesa_demos_, which use the EGLUT bindings. There
are also some SDL based examples in the world repository under
_repos/world/src/test/sdl_opengl_.
Package management
==================
The previous release featured the initial version of Genode's
[https://genode.org/documentation/release-notes/17.05#Package_management - custom package-management tools].
Since then, we continued this line of work in three directions.
First, we refined the depot tools and the integration of the depot with our
custom work-flow ("run") tool. One important refinement is a simplification of
the depot's directory layout for library binaries. We found that the initial
version implied unwelcome complexities down the road. Instead of placing
library binaries in a directory named after their API, they are now placed
directly in the architecture directory along with regular binaries.
Second, driven by the proliferated use of the depot by more and more run
scripts, we enhanced the depot with new depot recipes as needed.
Third, we took the first steps to use the depot on-target. The experimentation
with on-target depots is eased by the new 'create_tar_from_depot_binaries'
function of the run tool, which allows one to assemble a new depot in the form
of a tar archive out of a subset of packages. Furthermore, the new
_depot_query_ component is able to scan an on-target depot for runtime
descriptions and returns all the information needed to start a subsystem based
on the depot content. The concept is exemplified by the new
_gems/run/depot_deploy.run_ script, which executes the "fs_report" test case
supplied via a depot package.
Platforms
#########
Genode as Xen DomU
==================
We want to widen the application scope of Genode by enabling users to easily
deploy Genode scenarios on Xen-based cloud platforms.
As a first step towards this goal, we enhanced our run tool to support running
Genode scenarios as a local Xen DomU, managed from within the Genode build
system on Linux running as Xen Dom0.
The Xen DomU runs in HVM mode (full virtualization) and loads Genode from an
ISO image. Serial log output is printed to the text console and graphical
output is shown in an SDL window.
To use this new target platform, the following run options should be defined in
the 'build/x86_*/etc/build.conf' file:
! RUN_OPT = --include boot_dir/$(KERNEL)
! RUN_OPT += --include image/iso
! RUN_OPT += --include power_on/xen
! RUN_OPT += --include log/xen
! RUN_OPT += --include power_off/xen
The Xen DomU is managed using the 'xl' command line tool and it is possible to
add configuration options in the 'xen_args' variable of a run script. Common
options are:
* Disabling the graphical output:
! append xen_args { sdl="0" }
* Configuring a network device:
! append xen_args { vif=\["model=e1000,mac=02:00:00:00:01:01,bridge=xenbr0"\] }
* Configuring USB input devices:
! append xen_args { usbdevice=\["mouse","keyboard"\] }
Note that the 'xl' tool requires super-user permissions. Interactive
password input can be complicated in combination with 'expect' and is not
practical for automated tests. For this reason, the current implementation
assumes that no password input is needed when running 'sudo xl', which can
be achieved by creating a file '/etc/sudoers.d/xl' with the content
! user ALL=(root) NOPASSWD: /usr/sbin/xl
where 'user' is the Linux user name.
Execution on bare hardware (base-hw)
====================================
UEFI support
------------
Analogously to our work on the seL4 and NOVA kernels in this release, we
extended our base-hw kernel to become a Multiboot2 compliant kernel. When used
together with GRUB2, it can be started on x86 UEFI machines missing legacy
BIOS support (i.e., CSM).
RISC-V
------
With Genode version 17.05, we updated base-hw's RISC-V support to privileged
ISA revision 1.9.1. Unfortunately, this implied that dynamic linking was not
supported on the RISC-V architecture anymore. Since dynamic linking is now
required for almost all Genode applications by default, this became a severe
limitation. Therefore, we revisited our RISC-V implementation - in particular
the kernel entry code - to lift the limitation of being able to execute only
statically linked binaries.
Additionally, we integrated the Berkeley Boot Loader (BBL), which bootstraps
the system and implements the machine mode, more closely into our build
infrastructure. We also added a new timer implementation to base-hw by using
the _set timeout SBI_ call of BBL.
What still remains missing is proper FPU support. While we are building the
Genode tool chain with soft float support, we still encounter occasions where
FPU code is generated, which in turn triggers compile time errors. We will
have to investigate this behavior more thoroughly, but ultimately we want to
add FPU support for RISC-V to our kernel and enable hardware floating point in
the tool chain.
Muen separation kernel
======================
Besides updating the Muen port to the latest kernel version as of end of June,
Muen has been added to Genode's automated testing infrastructure. This
includes the revived support for VirtualBox 4 on top of this kernel.
NOVA microhypervisor
====================
The current release extends NOVA to become a Multiboot2 compliant kernel. Used
together with GRUB2, NOVA can now be started on x86 UEFI machines missing
legacy BIOS support (called CSM).
GRUB2 provides the initial ACPI RSDP (Root System Description Pointer) to a
Multiboot2 kernel. The RSDP contains vital information required to bootstrap
the kernel and the operating system in general on today's x86 machines. To
make this information available to the user-level ACPI and ACPICA drivers, the
kernel propagates the RSDP to Genode's core, which - in turn - exposes it to
the user land as part of the _platform_info_ ROM module.
In order to ease the setup of an UEFI bootable image, we added a new image
module to our run-tool infrastructure. The run option 'image/uefi' can be used
instead of 'image/iso' in order to create a raw image that contains a EFI
system partition in a GUID partition table (GPT). The image is equipped by the
new 'image/uefi' module with the GRUB2 boot loader, a GRUB2 configuration, and
the corresponding Genode run scenario. The final image can be copied with 'dd'
to a bootable USB stick. Additionally, we added support to boot such an image
on Qemu leveraging [http://www.tianocore.org - TianoCore's] UEFI firmware.
As a side project, minor virtualization support for AMD has been added to
Virtualbox 4 and to the NOVA kernel on Genode. This enables us to run a 32-bit
Windows 7 VM on a 32-bit Genode/NOVA host on an (oldish) AMD Phenom II X4 test
machine.

View File

@@ -1,898 +0,0 @@
===============================================
Release notes for the Genode OS Framework 18.02
===============================================
Genode Labs
After being developed for over a decade, Genode remained a mystery for many
people who looked at the project from a distance as it does not seem to fit
any established category of software. In 2018 - declared as the Year of Sculpt
on our [https://genode.org/about/road-map - roadmap] - this will hopefully
change. Genode 18.02 features the first revision of Sculpt, which is a
Genode-based operating system for general-purpose computing. After being used
as day-to-day OS by the entire team of Genode Labs for several months, we feel
that the time is right to share the system with a broader audience (Section
[Sculpt for Early Adopters]).
One fundamental feature of Sculpt is the ability to install and deploy
software from within the running operating system, which is universally
expected from any modern general-purpose OS. Section
[On-target package installation and deployment] presents Genode's unique
take on the topic of software installation and deployment.
Besides Sculpt, the current release has no shortage of other improvements.
Genode's growing arsenal of 3rd-party software received profound updates and
additions, including VirtualBox, Muen, seL4, several GNU packages, and
libraries. Also the user-level networking stack - including the Linux-based
LxIP stack and our custom NIC-router component - received a lot of attention.
Thanks to the added network driver for i.MX-based hardware, this networking
infrastructure becomes usable on embedded platforms based on this SoC.
Furthermore, the current release continues the cultivation of the Nim
programming language for Genode components.
Sculpt for Early Adopters
#########################
The current release features the first revision of Sculpt, which is a
Genode-based operating system for general-purpose computing. This initial
version is called Sculpt for Early Adopters (EA). Its target audience are
enthusiasts who are already familiar with Genode and are eager to use a
Genode-based operating system on their machines. As outlined on the
[https://genode.org/about/road-map - roadmap], later versions will become
increasingly approachable.
[image sculpt_overview]
Please refer to the official
[https://genode.org/documentation/articles/sculpt-ea - Sculpt documentation]
to step right into the adventure.
On-target package installation and deployment
#############################################
In May last year, we introduced the package-management concept for Genode to
pursue two goals. First, to overcome the naturally limited scalability of
composing Genode systems solely from source. This limit became evident in
complex system scenarios that incorporate a huge amount of 3rd party software.
Thanks to the introduced _depot_ concept and its integration in Genode's
workflow - in particular the run tool - the work of system integration became
much more structured (by caring about packages instead of individual build
targets), robust (by avoiding conditions in run scripts), and quick (by the
accelerated test cycle when using pre-built packages).
The second goal is the ability to update and extend a running Genode system on
the fly. We are happy to have reached this goal with the current release. As
exemplified by the Sculpt scenario, packages cannot only be used as building
blocks for system images but also as subsystems dynamically installed and
deployed on target. Even though installation and deployment are closely
related topics, both involve distinct challenges, which allow Genode to shine.
Installation / update
=====================
In traditional operating systems, the installation and update of system
software is the job of privileged programs. For example, a package manager in
a GNU/Linux system is typically executed with root privileges. This is
troublesome because the functionality of such a program is extremely complex.
In particular it is exposed to the network and has to parse content
originating from potentially untrusted parties. Therefore, potential software
vulnerabilities should be expected. However, in modern OSes, these programs
are just assumed to behave correctly. If this overly optimistic assumption
doesn't hold, the entire system is at risk.
Genode helps us to mitigate this problem by modelling each installation step
as a distinct component composition where each component has a well-defined
and extremely narrow role. The installation is an iterative sequence that
is orchestrated by the so-called download-manager component
(Figure [depot_download]).
[image depot_download]
Initially, the download manager receives a list of content to be installed
into the local depot, which is stored on the file system. The depot may
already be populated with (portions of) this content. In the first step, the
download manager must determine the parts that are missing. To do that, it
does not access the file system directly but instead hands over this task to a
disposable helper component called _depot-query_ that is spawned within a
dynamic init instance. This indirection has two benefits. First, the download
manager is not bothered with the complexity of accessing the file system. It
does not even have any notion of files. Second, the download manager is
effectively shielded from the file system. Should the file system misbehave,
the liveliness of the download manager remains unaffected.
[image depot_download_query_deps]
The depot-query component reports its findings to a report session. The report
eventually reaches the download manager as an updated ROM module. Given the
list of missing content, the download manager has to determine the information
of where to obtain the content from and the public key of the content creator.
This information is contained within the depot. So the download manager issues
another request to the depot-query component in order to obtain it.
[image depot_download_query_url]
Once the depot-query component has responded, the download manager knows what
content to get, where to get it, and how to verify it. To download the
content, it changes the dynamic init instance as follows.
[image depot_download_fetch]
The depot-query component is now gone. Actually, the entire depot has moved
out of sight. Instead, a fresh _fetchurl_ component is spawned. This component
is connected to the network as well as the writeable download directory
_public/_. Internally, fetchurl employs a complex software stack, which
includes the C runtime, curl, libssl, and libssh. Hence, we expect this
component to be vulnerable. Since it is facing the network, we assume that
vulnerabilities are exploitable. In the worst case where the component is
completely in the hands of an attacker, it may write wrong content into the
_public/_ location. But compared to executing curl or wget as root on a
traditional Unix system, the reach of an attack is quite limited. For example,
the mere existence of the download manager remains completely out of view of
fetchurl. However, the content of _public/_ must not be trusted. To reinforce
trust in the downloaded content, the content is accompanied with cryptographic
signatures created by the content creator. Before we touch the content, we
first check its authenticity. To perform this verification step, the download
manager reshapes the dynamic init instance as follows.
[image depot_download_verify]
Note that fetchurl exists no more and network connectivity is cut, effectively
disposing any form of malware that might have infected fetchurl. Next a new
_verify_ component enters the picture. It is configured with a list of content
to check, the signatures of the content, and the public key of the content's
presumed creator. Since it accesses the _public/_ location exclusively, it is
not prone to any potential time-of-check to time-of-use problems during the
verification. Under the hood, the _verify_ component employs a hugely complex
implementation based on GnuPG. It would be naive to fully trust this code.
However, when embedded in our scenario, the reach of a bug is limited because
the verify component has no access to any mutable system state. It could
merely give the wrong answer (which is of course bad but there is no way we
can magically solve this).
Knowing that the downloaded content is indeed the same content as intended
by the creator, it is time for extraction. For this step, the download
manager - again - reshapes the dynamic init instance:
[image depot_download_extract]
This time, both the _public/_ location as well as the trusted _depot/_ are
visible and a new _extract_ component is spawned. As the depot may host
content from multiple sources, which potentially distrust each other, the
content of each content provider resides in a dedicated subdirectory within
the depot. Instead of handing over access to the entire depot to the extract
tool, we mediate the file-system access via a _chroot_ component that limits
the view to the depot-provider's respective subdirectory. In the worst case
where a misbehaving content provider delivers a forged (but correctly signed)
archive to exploit a vulnerability of the extract component, the reach of the
attack remains limited to the content provider's space within the depot.
After the extraction step has completed, the depot is populated with the new
content, which may - in turn - include new dependency information. At this
point, the download manager starts a new iteration. This iterative process
terminates as soon as the depot-query component signals that no content of
the software installation is missing.
The bottom line here is that we are able to use complex and useful software
like curl, libarchive, liblzma, and GnuPG while largely distrusting it. In
contrast to this software that sums up to hundreds of thousand lines of code,
the download manager comprises less than 1000 lines of code. The software
installation procedure described above is implemented by the 'depot_download'
subsystem hosted in the gems repository and illustrated by an equally named
run script. It also forms the basis of the install/update mechanism of the
Sculpt scenario.
Deployment
==========
Once software has entered the system in the form of depot content, the
remaining question is how to turn this content into running subsystems. The
answer is given by the following illustration.
[image sculpt_deploy_runtime]
Like for the installation process described above, the scenario employs a
dynamic init instance that is accompanied by an orchestrating component. The
latter is called _depot-deploy_. The depot-deploy component queries
information from the depot using the same depot-query component that was used
during the installation. Based on the returned _blueprint_ information for the
to-be-deployed subsystems, it generates the configuration for the dynamic init
instance. The subsystems hosted within this init instance access the depot
content via mere ROM sessions as provided by the FS-ROM component. This makes
the use of the depot transparent to the hosted subsystems.
The depot-deploy component is located in the gems repository and accompanied
by a same-named run script. More importantly, it is featured in the deploy
runtime of the Sculpt system.
Base framework and OS-level infrastructure
##########################################
Increased default warning level
===============================
For building Genode components written in C++, the compiler flags -Wextra,
-Weffc++, and -Werror are now enabled in addition to -Wall by default.
If this strict warning level is inapplicable for a given component or
library, it is possible to explicitly disable the strictness in the
respective build-description file by adding the following line:
! CC_CXX_WARN_STRICT =
We adjusted almost all the code of the base, base-<kernel>, os, and demo
repositories to comply with this new warning level. For most components
hosted in the higher-level repositories (libports, ports, dde_*, gems),
the strictness is disabled as of now and will be enabled component-wise
wherever feasible.
While adjusting our code base, we identified the following patterns worth
mentioning:
* A class with virtual functions can no longer publicly inherit base
classes without a vtable. The inherited object may either be moved
to a member variable, or inherited privately. The latter would be
used for classes that inherit 'List::Element' or 'Avl_node'. In order
to enable the 'List' and 'Avl_tree' to access the meta data, the
'List' must become a friend.
* Instead of adding a virtual destructor to abstract base classes,
we inherit the new 'Interface' class, which contains a virtual
destructor. This way, single-line abstract base classes can stay
as compact as they are. The 'Interface' utility resides in
_base/include/util/interface.h_.
* With the new warning level, all member variables must be explicitly
initialized. Basic types may be initialized with '='. All other types
are initialized with braces '{ ... }' or as class initializers. If
basic types and non-basic types appear in a row, it is nice to only
use the brace syntax (also for basic types) and align the braces.
* If a class contains pointers as members, it must now also provide a
copy constructor and assignment operator. In most cases, one
would make them private, effectively disallowing the objects to be
copied. Unfortunately, this warning cannot be fixed by inheriting
our existing 'Noncopyable' class (the compiler fails to detect that
the inheriting class cannot be copied and still gives the error).
For now, we have to manually add declarations for both the copy
constructor and the assignment operator as private class members.
Those declarations should be prepended with a comment like this:
! /*
! * Noncopyable
! */
! Thread(Thread const &);
! Thread &operator = (Thread const &);
In the future, we plan to revisit these occurrences and try to replace
the pointers with references. In the presence of at least one
reference member, the compiler would no longer implicitly generate
a copy constructor. So we could remove the manual declaration.
The following caveats are expected, even if you disable the strictness
in your component:
* If your component has a class called 'Interface', it may collide with
the new 'Genode::Interface' class. You may have to disambiguate the
names.
* The 'Genode::Rpc_client' is no longer a 'Genode::Capability'. Hence,
classes inherited from 'Genode::Rpc_client' cannot refer to a
'Capability' but must refer to 'Genode::Capability'.
* The 'Surface' class is no longer copyable, which led to API
changes of users of this class. E.g., the 'Nitpicker_buffer'
utility does no longer offer accessors for the contained surfaces
but a new 'apply_to_surface' method that takes a lambda function as
argument.
Init
====
Init selects session routes based on the requested service and the client's
label. The latter can be matched as 'label' (exact match), 'label_prefix', or
'label_suffix' (either end of the label matches). With the new version, these
options are complemented with an additional 'label_last' attribute that covers
the prominent case where the last part of the label identifies a requested
resource at the server. A typical example is the routing of a ROM session
based on the name of the requested ROM module.
Reflecting the core log to the application level
================================================
Core records now log messages in a ring buffer and exports this
memory as ROM named 'core_log'. User applications may monitor this ring buffer
and present or transfer the content as appropriate. The example component in
_repos/os/src/app/log_core_ transforms the content into normal log
messages, which may be routed to graphical terminals or stored on
file systems, e.g. by using the fs_log server.
NIC-router improvements
=======================
During the past three months, the NIC router has received several improvements
that were mainly inspired by our daily experience with the component as part
of our Sculpt based working environments.
The most notable new feature is the support for multiple NIC sessions at one
domain. If multiple NIC-session clients connect to one domain, the NIC router
acts as a simple hub between them. I.e., for every packet that is routed to
the domain, each connected session receives a copy of the packet. The same
applies for domain-local packets, meaning packets that target an IP address
inside the IP subnet of the domain they came from. This domain-local
forwarding applies before considering any other routing rules. So, in other
words, it is not possible to route such traffic to another domain.
Furthermore, the logging features of the NIC router were improved. First, the
router is now capable of periodically sending a report via Genode's report
session. This can be activated by adding the new '<report>' node to the router
configuration:
! <config>
! <report interval_sec="5" bytes="yes" config="yes">
! ...
! </config>
So far, the report provides per-domain information about the amount of sent
and received data ('bytes' attribute) and the current IPv4 configuration like
IP address, subnet mask, and gateway address ('config' attribute).
Second, there is a new verbosity option in the '<config>' node:
! <config verbose_domain_state="yes">
When this option is set, the NIC router will output a short message to the log
for each general state change of a domain. Currently, this includes the
IP-configuration state (IP address, subnet mask, gateway address) and the
number of connected NIC sessions. This is a useful addition because the
purpose of the regular verbose option is to give a very deep insight into
almost every activity of the router, which is vital for debugging
sophisticated problems but normally floods the log. Therefore, the regular
verbose option is not viable for complex setups like a Sculpt desktop
environment. In such a context, the new domain-state verbosity is pretty
discreet but already gives a good hint on why, for instance, packets get
dropped despite the routing rules being correct.
Last but not least, the timeout configuration of the NIC router has been
reworked and now allows for a much more precise adaption to the network
environment. The former 'rtt_sec' attribute of the '<config>' node has been
replaced by the following new attributes (default values shown):
! <config dhcp_discover_timeout_sec="10"
! dhcp_request_timeout_sec="10"
! dhcp_offer_timeout_sec="10"
! udp_idle_timeout_sec="30"
! tcp_idle_timeout_sec="600"
! tcp_max_segm_lifetime_sec="30">
Details about the new attributes can be found in the
_os/src/server/nic_router/README_ file. The default values should be
appropriate for the common use case so that specifying them is normally not
necessary.
New watch mechanism for file-system session
===========================================
The file-system session already provided a way for watching files or
directories for changes. However, the original mechanism was arguably hard to
use. In addition to opening the to-be-watched file-system node, the client had
to submit a so-called content-changed request into the session's request
queue. In turn, the server delivered the change notification by acknowledging
this request.
The new mechanism is much less bureaucratic. A file or directory can be
watched by opening a watch handle rather than submitting a 'CONTENT_CHANGED'
packet to the server. Whenever a change happens at a node with an open watch
handle, a CONTENT_CHANGED packet will be sent from the server to the client.
This serializes the registration with other handle operations and separates
I/O handle state from notification handle state.
C runtime
=========
We changed libc's handling of 'clock_gettime' to be explicitly configurable
rather than relying on built-in heuristics. With the new version, the libc
opens a timer session as a time source only if the 'rtc' attribute of the
'<libc>' configuration node is defined. If not configured, 'clock_gettime'
returns 0.
This change may require the adjustment of components that implicitly rely on
the libc as time source. To enable such a component to use relative time
(based on a timer session) but no wall-clock time, one can manually provide a
pseudo real-time clock value as follows:
! <vfs>
! <dir name="dev">
! <log/> <null/> <inline name="rtc">2000-01-01 00:00</inline>
! </dir>
! </vfs>
! <libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
GUI stack and terminal improvements
===================================
Nit-FB improvements
-------------------
The nit_fb component provides a framebuffer and input service while using the
nitpicker GUI server as back end. The new version adds the 'initial_width' and
'initial_height' attributes, which accommodate the use case where nit_fb is
used in a dynamic fashion like as a client of a window system. Here, the
initial dimensions define the initial window size but - in contrast to the
existing 'width' and 'height' attributes - the actual size can change
afterwards.
Terminal resizing
-----------------
The terminal-session interface gained the ability to propagate resize events
from the server to the client. The new version of the graphical terminal uses
this mechanism to support window resizing as well as dynamically changing the
font size. At the client side, noux has become able to reflect terminal-size
changes to noux applications. Applications based on ncurses (e.g., vim) are
able to gracefully respond to such changes now.
Using chroot to enforce read-only file-system access
====================================================
By placing a chroot component in-between a file-system client and server, the
client's view on the file system can be limited to a specific directory. With
the current release, chroot can additionally be used to restrict a writeable
file-system session to become read-only. This is accomplished by the new
'writeable' attribute of chroot's policy nodes. By default, it is set to "no".
API changes
===========
Noncopyable AVL node/tree
-------------------------
Copying an AVL node generally violates the integrity of the corresponding
tree. To rule out subtle bugs where AVL nodes are accidentally copied, AVL
nodes are no longer copyable.
New 'Buffered_xml' utility
--------------------------
The 'Buffered_xml' utility located at _os/buffered_xml.h_ simplifies the
implementation of dynamically reconfigurable components that need to keep a
verbatim copy of certain parts of their configuration during configuration
updates.
New 'List_model' utility
------------------------
More and more components respond to dynamic configuration updates. For most
components, such updates are quite simple: replace an old internal state by a
new one. But in cases like init, menu_view, or window decorator, a
differential update is in order. Until now, each of these components employed
custom code for this task. As this code is not trivial, a common solution is
preferable. This solution comes in the form of the new 'List_model' utility
located at _base/include/util/list_model.h_. It introduces a light-weight
formalism to feed a component-internal data model from an externally-provided
XML structure.
Dynamically expandable reporter utility
---------------------------------------
In many cases, components that generate reports don't explicitly handle the
situation where the default buffer size of 4096 bytes is exceeded by the
report. This problem is easy to miss because reports are often small at
testing time but become larger when deployed in complex scenarios. In most
cases, the best way to handle an 'Xml_generator::Buffer_exceeded' exception is
upgrading the report session. The new 'Expanding_reporter' that accompanies
the original 'Reporter' in _os/reporter.h_ eases the handling of this common
case.
Languages and runtime environments
##################################
Nim programming language
========================
A new Nim library for constructing Genode servers is now available in the
World repository. This module provides utilities for the asynchronous
session-creation procedure introduced in the
[https://genode.org/documentation/release-notes/16.11#New_session-creation_procedure - 16.11]
release. Some introductory code snippets are provided here for the
adventurous.
An example of server creation using the 'genodeservers' module:
! import romclient, genodeservers
!
! var
! sessionsRom = newRomClient "session_requests"
! # synchronously open a ROM client to the parent
! romContent = sessionsRom.stream.readAll()
! # copy the ROM content to a heap string
! requestsParser = initSessionRequestsParser(romContent)
! # a state machine for parsing 'session_requests' XML
!
! for id, service, label in requestsParser.create:
! # the `create` iterator provider for the parser
! # hides the details of parsing the XML data
! discard txBufSize = requestsParser.argInt "tx_buf_size"
! # extract typed session arguments from the current parser state
! discard label.lastLabelElement()
! # label handling utilities are provided
! if service == "MyService":
! myCreateSessionProc(id, label)
!
This module streamlines the handling of session metadata, but the developer
must still provide hand-crafted wrappers over the C++ methods for managing
RPC objects and passing session capabilities to the parent. Most notoriously
a global pointer symbol, `genodeEnv`, is used to expose the component
environment object. In the future, this will be replaced by a typed object
passed from runtime to an application entry procedure.
! type MySessionCapability {.
! importcpp: "My_session::Session_capability",
! header: "my_session/capability.h".}
! # import a capability type
!
! type MyNativeSessionBase {.
! importcpp: "My_session::Session_rpc_object",
! header: "my_session/rpc_object.h".}
! # import C++ session RPC object
!
! type MyNativeSession = Constructible[MyNativeSessionBase]
! # apply the C++ Constructible template to defer calling
! # the object constructor
!
! proc construct(cppObj: MyNativeSession) {.
! importcpp: "#.construct(*genodeEnv)".}
! # call the C++ constructor, passing the global Genode::Env
!
! proc manage(cppObj: MyNativeSession): MySessionCapability {.
! importcpp: "genodeEnv->ep().manage(*#)".}
! # call a method from the gobal Env, dereferencing
! # thru the Constructible template
!
! type MyNimSessionObj = ref object
! cppImpl: MyNativeSession
! cap: MySessionCapability
! id: SessionId
! # C++ RPC objects are best kept in native
! # reference-counted Nim objects
!
! proc manage(obj: MyNimSessionObj) =
! obj.cppImpl.construct() # call our wrapped constructor
! GC_ref(obj)
! # manually increase the reference count on our session
! # object to prevent the component entrypoint from
! # referencing an RPC object that has been lost and
! # freed from the heap
! obj.cap = obj.cppImpl.manage() # store our capability
!
! proc myCreateSessionProc(id: SessionId): MyNimSessionObj =
! result = new MyNimSessionObj
! # create our object on the heap
! result.manage()
! # construct and manage our RPC object
! result.id = id
! # store the session id from our parent
Procedures for calling Nim code from an RPC object, dissolving
and destructing RPC objects, and managing the session lifetime
are exercises left to the reader.
Updated VirtualBox
==================
Our VirtualBox port got updated from version 5.1.22 to version 5.1.32 in order
to leverage the security updates and improved audio support. Additionally the
boot time of Linux guests got improved by adjusting our custom virtualization
back end.
Libraries and applications
##########################
New trace-logging component
===========================
The new trace-logger component can be used to easily gather, process, and
export different types of tracing data. Furthermore, it marks the next step
towards a user framework that makes access to Genode's manifold tracing
abilities
([https://genode.org/documentation/release-notes/13.08#Light-weight_event_tracing - 13.08],
[https://genode.org/documentation/release-notes/13.11#Improved_event_tracing - 13.11],
[https://genode.org/documentation/release-notes/15.08#Enhanced_tracing_facilities - 15.08])
intuitive and convenient.
The component can filter the available tracing subjects according to session
label policies and thread names. The processing of the tracing data can then
be configured for each selected subject individually, for groups of subjects,
or for all subjects together. The resulting data is exported as log output.
This is an example configuration of the trace logger, which shows the default
value for each attribute (except policy.thread and policy.label):
! <config verbose="no"
! session_ram="10M"
! session_arg_buffer="4K"
! session_parent_levels="0"
! period_sec="5"
! activity="no"
! affinity="no"
! default_policy="null"
! default_buffer="4K">
!
! <policy label="init -> timer" />
! <policy label_suffix=" -> ram_fs" />
! <policy label_prefix="init -> encryption -> "
! thread="worker"
! policy="null"
! buffer="4K" />
! </config>
The most important features so far when it comes to processing the traced
data are:
* Trace CPU activity and affinity ('activity' and 'affinity' attribute),
* Install individual policies for the creation of further tracing data
('policy' attributes) for instance, 'rpc_name' for a log of issued RPC calls),
* Dimensioning the subject-local trace buffers and the frequency of Trace Logger
data examination ('buffer' and 'period' attributes), and
* Configure the session to the Tracing server ('session' attributes).
A comprehensive documentation of the trace-logger component can be found in
_os/src/app/trace_logger/README_. An example of how to use the component is
given through the run script _os/run/trace_logger.run_.
New component for extracting archives
=====================================
The new 'extract' component located at _libports/src/app/extract_ extracts
the content of an arbitrary number of tar.xz archives according to its
configuration. It is used by the depot-download subsystem described in
Section [On-target package installation and deployment]. The component
is accompanied by the run script _libports/run/extract.run_ that illustrates
its use.
New signature-checking tool based on GnuPG
==========================================
The on-target installation of software packages requires a way to verify
cryptographic signatures of downloaded content within a Genode system.
The new 'verify' component located at _ports/src/app/verify_ facilitates the
code of GnuPG to verify detached OpenPGP signatures against public keys.
Since GnuPG depends on libgcrypt and libgpg-error, ports of those libraries
were added to the libports repository. The component comes with the run
script _ports/run/verify.run_ that demonstrates its usage.
Fetchurl component for downloading files
========================================
Fetchurl is a component for downloading files from the network, based
on the curl library. It used to reside in the genode-world repository.
Since it has become a mandatory part of Genode's on-target software
installation mechanism, we have moved it to the _libports_ repository now.
Besides this relocation, fetchurl received a welcome modernization. In
particular, the new version uses the modern socket-fs infrastructure of
the libc instead of relying on the deprecated libc_lwip plugin as a hard-wired
dependency.
New interactive FLIF image viewer
=================================
A simple image viewing application for the FLIF lossless image format was
written from scratch using the FLIF reference decoder library. The viewer can
be used to interactively view a directory of images and supports animation of
GIF-like FLIF files.
Ported 3rd-party software
=========================
With the current release, the following 3rd-party software becomes available
on Genode:
:[https://www.libarchive.org/ - libarchive]: is a library for uncompressing
and extracting various archive formats. It nicely wraps format-specific
libraries like zlib behind a unified and easy-to-use API. The port can
be found in the _libports_ repository.
:[https://lz4.github.io/lz4/ - lz4] and [https://tukaani.org/xz/ - liblzma]:
implement modern compression algorithms as supported by libarchive.
Thanks to Ben Larson for contributing the port of these libraries.
:[https://www.tcl.tk/ - Tcl]: is used as scripting language for various
Genode tools. With the new 'check_abi' tool described in Section
[Automated ABI consistency checks], the Tcl shell 'tclsh' has become
a dependency of the build system. Therefore, we made 'tclsh' available as
noux package. Note, however, that this port comprises solely the
functionality needed for simple scripting.
:[http://flif.info/ - FLIF]: is a library for the Free Lossless Image
Format. Thanks to Emery Hemingway for making it available in the
genode-world repository.
:[https://github.com/json-c/json-c/wiki - JSON-C]:
is a library for processing JSON-formatted data. Thanks to
Johannes Kliemann for contributing the port to the genode-world
repository.
:[https://www.nlnetlabs.nl/projects/ldns/ - Drill (ldns)]:
provides a utility for DNS testing. Thanks to Emery Hemingway for adding it
to the genode-world repository as a side activity of improving Genode's
network stack.
Updated packages for the Noux runtime environment
=================================================
The current release updates the following noux packages: less (version 487),
grep (version 3.1), coreutils (version 8.29), tar (version 1.30), findutils
(version 4.6), which (version 2.21), sed (version 4.4), and bash (version
4.4.18). Thanks to Hinnerk van Bruinehsen for this welcome contribution.
Device drivers
##############
Ethernet-driver for i.MX-based Wandboard
========================================
The current release contains a port of the Linux kernel driver for the
Ethernet card family originally produced by Freescale. We followed our
established approach to tailor an independent device-driver environment (DDE)
for the specific driver. To profit from synergies with the existing drivers of
the _dde_linux_ repository, we took the Linux kernel 4.4.3 as reference.
For now the current version is limited to support the Wandboard Quad as this
is the i.MX-based board that is nightly tested by our infrastructure. The
support of other boards using the same IP core is planned for future releases.
The driver can be found in _dde_linux/src/drivers/nic/fec_. To test the driver,
no further configuration is needed and you can have a look at one of the
automatic network tests, like _lwip.run_, as a reference.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Thanks to Johannes Schlatow from the TU Braunschweig, the support of the
Zynq-7000 boards by our base-hw kernel got extended. It is now possible to use
all CPU cores instead of only the primary one.
Updated Muen separation kernel
==============================
The Muen SK port has been updated to the latest development version 0.9. The
most notable features and improvements are the Crash Audit facility and support
for MirageOS/Solo5 subjects which may be executed alongside Genode/base-hw.
Thanks to this feature, the Muen project has reached a milestone by
self-hosting the [https://muen.sk] website on a Muen system. Currently, the
network driver is provided by a Linux subject but with some work it should be
possible to replace it with a Genode/base-hw nic_drv in the future.
Further details regarding Muen v0.9 can be found in the project's release
notes [https://groups.google.com/forum/#!topic/muen-dev/FPL9sc4yaBE].
Updated seL4 kernel
===================
Our remaining patches regarding UEFI framebuffer support got integrated into
the upstream codebase of the seL4 kernel. Hence, we updated our seL4 port to
the upstream version containing our patches.
Build system and tools
######################
Package management
==================
The package-management tools introduced last year have become a vital part
of Genode's workflow.
:Package management documentation:
[https://genode.org/documentation/developer-resources/package_management]
Prompted by the development of the on-target installation and deployment
mechanism featured in the current release, the tools received the following
refinements:
:Use of tar.xz as archive format: This change significantly reduces the size of
published depot content compared to the previously used tar.gz format.
:Subdirectories for archive versions:
In the original version of the depot layout, archives were named as
'<archive-name>-<version>'. Hence, the depot - in particular the download
location - had directories that grew in two dimensions. First, when new
archives were added. Second, when new versions of existing archives were
added (usually corresponding to Genode's release cycle). In the mid-term,
this would have resulted in a huge number of directory entries, e.g., in the
_src/_ subdirectory. To avoid this problem, the new version uses the scheme
'<archive-name>/<version>' instead. This way, at the _src/_ level, each
archive has one subdirectory (the number of subdirectories corresponds to
the number of archives). Inside the subdirectory, there is one entry per
version.
:Controlled rebuild of binary archives:
When calling the depot/create tool for a binary archive with 'FORCE=1', the
underlying source archives are re-extracted and the binary archive is
rebuilt. This is usually done after local changes in the source tree to
apply version updates to depot archives as needed. However, the implicit
rebuild is superfluous whenever the source-version remains the same. This is
particular inconvenient when re-creating pkg archives that refer to a large
number of src archives. Here, all binaries referenced by the pkg archive are
rebuilt each time. The new 'REBUILD' argument allows the user to skip
superfluous rebuilds in such situations. Normally, 'FORCE=1' implies
'REBUILD=1'. However, by explicitly specifying 'REBUILD=', existing binary
archives whose versions remain unchanged are kept instead of being rebuilt.
Offline validation of XML configurations
========================================
The _tool/run_ tool now automatically checks configurations against
target-specific XML schemes. Each component may define a configuration
scheme-file in its _target.mk_ file as follows:
! CONFIG_XSD = my_config.xsd
When the run tool checks the configuration of an instance of Genode's init
component, it additionally iterates through all start nodes of this
configuration. For each start node, it checks whether the according component
provides a configuration-scheme file and, if so, applies it to the
configuration inside the start node. This is done recursively. I.e., also the
child configurations of a sub-init of a sub-init ... of the top-level init
are covered this way.
Whenever the run tool detects an error in one of the checked configurations,
it stops and points out the location of the error. By now, there exist
configuration schemes for the init, the NIC router, and the trace logger
components. Our intention is that every component that interprets its
configuration will eventually be accompanied by such a scheme - not only to
validate actual configuration input but also to serve as documentation for
users of the component.
Automated ABI consistency checks
================================
In [https://genode.org/documentation/release-notes/17.02#Genode_Application_Binary_Interface - version 17.02],
we introduced a kernel-agnostic ABI, which ultimately paved the ground for
Genode's package management. For the time being, the ABI is not set in stone.
It is expected to evolve for some time until it hopefully approaches ABI
stability in the mid term. Whenever Genode's API changes, the ABI may be
affected. For example, symbol sizes may grow. Until now, side effects on the
ABI had to be curated manually. In practice, however, such side effects are
too easy to miss. Therefore, the current release adds a mandatory ABI checking
step to the build process. A new _tool/check_abi_ tool is invoked whenever a
shared object is built. It reports flaws in the ABI definition (such as
duplicated symbols) as well as inconsistencies between a shared object and its
ABI.

View File

@@ -1,766 +0,0 @@
===============================================
Release notes for the Genode OS Framework 18.05
===============================================
Genode Labs
The driver behind the release 18.05 is the rapid evolution of the Sculpt
general-purpose OS. Following the initial version from February, which was
targeted at early adopters, the new Sculpt for The Curious (TC) introduces a
much more welcoming and empowering user experience (Section
[Sculpt for The Curious]).
It goes without saying that the interactive and dynamic nature of the Sculpt
scenario puts a lot more pressure on Genode's components compared to static
workloads. For example, Sculpt calls for the dynamic adjustment of user-level
network routing, the dynamic detection and management of partitions and file
systems, the support of USB storage devices from diverse vendors, and a way to
adapt the visual appearance to a great variety of screen resolutions. Most
improvements described below are our responses to these challenges.
That said, the release is not short of new features either. E.g., it features
the initial port of OpenJDK's HotSpot VM for executing Java programs on Genode
directly (Section [Java language support]), improves the support for the NXP
i.MX family of SoCs (Section [NXP i.MX SoC]), and enhances the VFS with new
plugins for copy-on-write and the auditing of file accesses
(Section [New VFS plugins]).
The release is complemented by the annual update of the Genode Foundations
book (PDF), which covers the fundamentals of the framework in great detail
(Section [New revision of the Genode Foundations book]).
Sculpt for The Curious
######################
With Sculpt for The Curious (TC), Genode 18.05 features the second revision of
the Sculpt general-purpose OS. Compared to the initial version for Early
Adopters (EA), it features a new interactive system-management component that
streamlines common tasks like the management of storage devices, or
configuring the network connectivity. The highlights of the new version of the
base system image are:
* Live-customization of almost all aspects of the system,
* The ability to install and run software in memory only,
* Hotplugging of USB storage devices,
* New support for NVMe storage devices in addition to SATA disks,
* Interactive network configuration including Wifi connectivity,
* Interactive management and inspection of storage devices and partitions,
* The option to host a complete and customized Sculpt installation on a
USB stick,
* Automated on-demand installation of software packages with visual feedback,
* Scalable fonts that are automatically adjusted to the screen resolution, and
* UEFI boot supported by default.
The base image is extensible by downloadable software packages that may
originate from different sources, safeguarded by cryptographic signatures.
It contains several example subsystems as a starting point:
* Basic GUI components like a window manager, a scalable backdrop, a
font server, and a simple software-rendering demo,
* A light-weight noux runtime for executing command-line-based software
such as GNU coreutils, bash, and vim.
* A package for downloading the installer and a suitable virtual-machine
configuration for Debian Linux,
* VirtualBox running Debian Linux,
* An example for running libretro-based games,
* A disposable VM that runs Firefox on TinyCore Linux, executed either in
VirtualBox or the light-weight Seoul virtual-machine monitor,
* A Qt5-based text editor.
Please refer to the updated
[https://genode.org/documentation/articles/sculpt-tc - Sculpt documentation]
to explore Sculpt TC.
The Sculpt version included with the current release requires the user to
build a boot image by hand. Following the steps described in the
documentation, this procedure takes a few minutes. We plan to provide
downloadable boot images a few weeks down the road once Sculpt TC received
intensive day-to-day testing by the early adopters. Your feedback is very
welcome!
New revision of the Genode Foundations book
###########################################
The "Genode Foundations" book received its annual revision, which reflects
the evolution of the framework over the past year. Specifically, the changes
since the last year's edition are:
: <div class="visualClear"><!-- --></div>
: <p>
: <div style="clear: both; float: left; margin-right:20px;">
: <a class="internal-link" href="https://genode.org">
: <img class="image-inline" src="http://genode.org/documentation/genode-foundations-title.png">
: </a>
: </div>
: </p>
* Changed boot-loader infrastructure on PC hardware
* Package management
* Structural changes of Genode's custom base-hw kernel
* API improvements: Unicode handling, support for XML-based data models,
timeout-handling API
: <div class="visualClear"><!-- --></div>
To examine the changes in detail, please refer to the book's
[https://github.com/nfeske/genode-manual/commits/master - revision history].
Storage infrastructure
######################
VFS library and plugin interface
================================
The VFS (Virtual-File-System) library was expanded to meet new requirements
for the Sculpt scenario. The traditional file-system medium for component
state and configuration sculpting is the *ram_fs* server, but with the
limitation that files stored in the server are ephemeral. Any changes to
the initial state are lost when a system is shut down or the *ram_fs* server
is restarted. Now that persistent storage is usually served by a VFS plugin
hosted by the VFS server, it was a natural progression to introduce a means
for indicating VFS changes with 'File_system' session notifications. To this
end the VFS server was amended to send session notifications, and notification
support was added to the Rump and FatFs VFS plugins, allowing Ext2 and FAT
file-systems to host dynamic component state and configuration information.
Using the VFS for serving font data produced from files stored in the VFS made
it practical to allow VFS plugins to introspect the file system. Plugins now
have the means to access arbitrary paths from the file-system root or they may
host and expose their own internal file systems.
While the core of the VFS library is small compared to contemporaries in other
operating systems, the moment came to promote the VFS from a static to a
shared library. Components that use the C runtime have always loaded the VFS
dynamically as a subsystem of _libc.lib.so_, but native components carried the
bulk of its implementation. The VFS library is now provided as a shared
library and is included with the front-end server in the _src/vfs_ depot
archive. This change affects components that have been rebuilt against the
shared library but do not have their ROM policies updated to allow access to
the _vfs.lib.so_ ROM.
New VFS plugins
===============
File-system introspection has made two additional plugins possible, the *audit*
and *cow* plugins.
The *audit* plugin logs VFS paths as they are accessed to a dedicated LOG
session. This is useful for finding the files required by third-party
components without relying on documentation or auditing source code.
The *cow* plugin emulates copy-on-write behavior by copying the contents of
files lying in a read-only path to a read-write path as they are opened. This
plugin is considered a proof-of-concept and under-performing, but opens a way
of experimenting with seeding user-managed file-systems from immutable
file-system archives.
Plugins of this kind are most appropriately instantiated in the VFS server
with policies to restrict the intended components into paths provided by the
plugins. This prevents a component from escaping the effect of the plugin. An
example of "auditing" a libc component follows:
! <start name="audit_fs">
! <binary name="vfs"/>
! <config>
! <vfs>
! <dir name="data"> <!-- source files -->
! <tar "data.tar"/>
! <ram/>
! </dir>
! <dir name="audit"> <!-- virtual path that captures /data -->
! <audit path="/data"/>
! </dir>
! </vfs>
! <!-- route into virtual audit path -->
! <policy label_suffix="audit" root="/audit" writeable="yes"/>
! </config>
! </start>
!
! <start name="app">
! <config>
! <libc stdout="/log" stderr="/log"/>
! <vfs>
! <log/>
! <fs label="audit"/>
! </vfs>
! </config>
! </start>
Improved disk-partition discovery and access
============================================
The 'part_blk' component, which parses the partition table on a block device
and provides access to each partition through a block session, was extended to
make it easier to implement a management component on top of it. It now
features additional attributes in its report. For one the block size of each
partition as well as the type of the file system on the partition are
reported. The file system probing implementation is minimal and only contains
file systems that are commonly used on Genode systems, i.e., FAT32 and Ext2.
Furthermore, on GPT formatted disks, each partition has an 'expandable'
attribute that contains the number of blocks by which the partition can be
grown. The following exemplary report illustrates the adjustments:
!<partitions type="gpt" total_blocks="500118192" gpt_total="500118125" gpt_used="302254080">
! <partition number="1" name="BIOS boot partition"
! type="21686148-6449-6e6f-744e-656564454649" guid="db0701aa-02ae-474d-92d0-82738bfce5d2"
! start="2048" length="2048" block_size="512"/>
! <partition number="2" name="EFI System"
! type="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" guid="74e43226-2afb-4575-bdda-83bf72f5a6e7"
! start="4096" length="262144" block_size="512" file_system="FAT32"/>
! <partition number="3" name="GENODE"
! type="0fc63daf-8483-4772-8e79-3d69d8477de4" guid="a950091d-87ba-4800-85bf-7b6a58abe6d5"
! start="235147264" length="67108864" block_size="512" file_system="Ext2"
! expandable="197862064"/>
!</partitions>
The heuristics of how the component probes the partition table were also
loosened. Instead of explicitly enabling support for GPT, the component will
now always try to parse the MBR as well as the GPT. It will bail out if both
are considered valid since using GPT/MBR hybrid tables is not supported and it
should be up to the user to make an educated decision. In cases where there is
no partition table, a 'partitions' report of 'type="disk"' will be generated
in which the complete disk is presented as partition number '0'. This is
needed as compatibility fallback for Sculpt EA installations.
Creating and modifying GUID partition tables
============================================
Part of the enhancements of Sculpt TC is the ability to manipulate the block
device used by Sculpt. We implemented a component called 'gpt_write', which
can create and modify a GPT and its entries. It considers alignment
constraints to make better use of 512e devices. It will, however, not perform
any boundary checking. It does not handle overlapping partitions and only when
applying a partition, it makes sure that the partition will fit. The following
configuration illustrates its operation:
!<start name="gpt_write">
! <resource name="RAM" quantum="2M"/>
! <config verbose="yes" initialize="yes" align="4K">
! <actions>
! <add entry="1" type="BIOS" label="GRUB BIOS" start="2048" size="1M"/>
! <add entry="2" type="EFI" label="EFI System" start="4096" size="16M"/>
! <add entry="3" type="Linux" label="GENODE" start="36864" size="128M"/>
! <add type="BDP" label="FAT32 Data" size="max"/>
! <delete entry="1"/>
! <delete label="FAT32 Data"/>
! <modify label="GENODE" new_label="GENODE*" new_size="max"/>
! </actions>
! </config>
!</start>
Please read _repos/gems/src/app/gpt_write/README_ for more detailed information
on how to use the component and feel free to check out the run script
_repos/gems/run/gpt_write.run_.
User-level networking
#####################
NIC router
==========
The NIC router has received major improvements that were mainly motivated by
our daily experience with the Sculpt scenario where the router serves as NAPT
component in front of the virtual machines that host our work OS's. In this
role, it is subject to a permanent load driven by real-world tasks.
Furthermore, it has to have a user interface that makes it a pleasant
experience to deploy in a dynamic environment. This led to our primary goal:
We had to overcome the need to restart the NIC router, and thereby all
components that depend on it, whenever its configuration changes and while
doing so, not to interrupt the communication of its client unnecessarily.
We managed to make the NIC router fully re-configurable at runtime in a way
that it always tries to keep as much state information as possible throughout
the process. This means that network communication going through the NIC
router is not affected by a configuration update unless the configuration
change affects parts that were involved in an existing communication channel.
One prerequisite for this feature was that NIC session clients can connect at
any time to the NIC router regardless of whether there is a matching domain
for the session or not. As long as a session has no domain, the NIC router
does not send any packet to it and drops all packets coming from it. But, at
least, the session and the corresponding client component stay alive, even if
their already assigned domain disappears with a new configuration.
At the uplink, in contrast, the lifetime of the session remains bound to the
lifetime of the domain. The uplink domain-tag received a new attribute
named 'label' (only considered at the domain-tag of the uplink). It denotes
the label of the uplink session. With these two particularities of the uplink
domain, one can now easily switch between different NIC session servers. The
NIC router will close and request the corresponding NIC session with the
current 'label' value if the 'domain' node is removed/added or the label
changes. Thereby, the NIC router can now be used to dynamically switch between
network interfaces like wireless and wired adapters.
Furthermore, we improved the NIC router's ability to handle DNS server
information. Domains can wait for the DNS server info of the DHCP client of
another domain. This is done with the new attribute 'dns_server_from' in the
'<dhcp_server>' tag. Each time the DNS server info of the remote domain
changes, the DHCP server with the 'dns_server_from' attribute will toggle the
link state of each session at its domain. This can be used by clients as a
hint to request their DHCP info anew from the NIC router and thereby receive
the updated DNS server information.
When it comes to protocols, the most notable change is that the NIC router now
also supports routing and NAPT for ICMP. With the new '<icmp>' sub node of the
'<domain>' tag, ICMP routes to other domains can be created. Instead of ports,
the ICMP IDs are used for NAPT. Similar to the 'udp-ports' and 'tcp-ports'
attributes, the size of the ID space for each NAPT client is configured via
the new 'icmp-ids' attribute in the '<nat>' tag.
Last but not least, the following small features were also added to the NIC
router:
:Attribute 'verbose_packets' for the '<config>' and the '<domain>' node:
Toggles the logging of most important protocol header fields globally or
domain-locally. The 'verbose' attribute does not affect this kind of debug
output anymore.
:Report DNS server info:
If the 'config' attribute in the '<report>' node is enabled, the NIC router
will now also report the DNS server info for each domain.
:Attribute 'config_triggers' in the '<report>' node:
Toggles whether the NIC router immediately sends a report whenever the IPv4
configuration of a domain changes, regardless of any timeouts.
:IPv4 point-to-point support:
If a domain receives an IP configuration with a subnet mask of
255.255.255.255 it will switch to point-to-point IPv4 (requires a valid
gateway address at the domain).
:ICMP destination unreachable on non-routable packets:
The NIC router now responds with an ICMP "destination unreachable" packet to
packets that are not routable at an interface with a domain.
For more information, have a look at the _os/src/server/nic_router/README_
file. Examples can be found in the run scripts
_dde_linux/run/nic_router_uplinks.run_,
_libports/run/nic_router_dyn_config.run_, and _os/run/ping_nic_router.run_.
NIC dump
========
The output level of the NIC dump component can now be configured per protocol
by using the protocol names as attributes: 'eth', 'arp', 'ipv4', 'dhcp',
'udp', 'icmp', and 'tcp'.
The available debug levels are:
:no: Do not print out this protocol.
:name: Print only the protocol name.
:default: Print a short summary of the most important header values.
:all: Print all available header values.
Additionally, you can set a default debug level for protocols that are not
configured using the 'default' attribute.
For more information, please refer to _os/src/server/nic_dump/README_.
GUI stack
#########
With Sculpt becoming more and more end-user oriented, Genode's GUI stack came
into focus. It was time to reconsider several interim solutions that worked
well in the past but would not scale up to a modern general-purpose OS. Two
concrete examples are the support of scalable fonts and Unicode characters. In
the past, Genode used to restrict textual output to the Latin-1 character set
and employed pixel-based fonts only. The current release overcomes these
limitations by featuring completely new text-output facilities.
UTF-8 support and improved text rendering
=========================================
The UTF-8 text encoding overcomes the severely limited code-point range of the
ASCII and Latin-1 character sets by representing characters by a varying
number of bytes. Today, UTF-8 is generally considered as the standard encoding
for text. The new UTF-8 decoder at _os/util/utf8.h_ clears the path for
Genode's native GUI components to follow suit. The first beneficiary is
Genode's graphical terminal, which has become able to display Unicode
characters and pass user input as UTF-8-encoded data to its terminal-session
client.
Terminal enhancements
=====================
Speaking of the graphical terminal, the current incarnation got a welcome
overhaul. First, we reduced its complexity by removing obsolete features like
built-in keyboard-layout handling, which are no longer needed when combining
the terminal with our modern input-filter component. Furthermore, the terminal
has become dynamically resizeable, forwarding screen-size changes to the
terminal client. Should the client be a Noux runtime, such a change is
reflected to the running application as a SIG_WINCH signal. The application -
e.g., Vim - responds to the signal by requesting the new terminal size.
Finally, the terminal protocol was changed from 'linux' escape sequences to
'screen' escape sequences in the anticipation of making the terminal more
flexible in the future.
Text rendering
==============
Throughout Genode, many GUI components reused the text-output utilities
of the nitpicker GUI server. These utilities, however, relied on a simple
pixel font format. To make the text output more flexible, nitpicker's text
painter located at _nitpicker_gfx/text_painter.h_ has been replaced by a
completely new implementation that decouples the font format from the
glyph rendering and takes UTF-8 strings as input. In the process, the glyph
rendering got a lot more sophisticated, supporting horizontal sub-pixel
positioning and filtering.
Font-format support
===================
To remove the omnipresent use of fixed-size pixel fonts throughout Genode,
the following new components entered the picture:
First, the new 'ttf_font' library implements nitpicker's font interface by
using the TrueType renderer of the STB single-header library.
Second, the new 'vfs_ttf' VFS plugin uses the 'ttf_font' library to export a
rendered TrueType font as a virtual file system. The various font properties
as well as the actual glyph images become accessible as regular files. This
way, an application that needs to draw text can read the glyph data directly
from its VFS instead of depending on a font-rendering library.
Third, the new 'Vfs_font' utility located at _gems/include/gems/vfs_font.h_
implements nitpicker's font interface by obtaining the glyphs from the
component-local VFS. It is complemented by the 'Cached_font' utility, which
implements an LRU glyph cache.
With this infrastructure in place, several existing GUI components could
be updated, most prominently the graphical terminal and the menu-view
widget-rendering engine. By facilitating the VFS as interface for propagating
glyph data, components no longer need to manage fonts and their configuration
individually. They just access their VFS. When integrating the component into
a scenario, one can decide whether to mount a font-rendering library directly
at the component, or - alternatively - route a file-system session to a
central font server. The latter is just a regular VFS server with the fonts
mounted as pseudo file systems. Since the glyph renderer is a VFS plugin, it
could be replaced by another implementation in the future without touching any
component.
Modernized API for input-event processing
=========================================
Genode's input-session interface changed very little over the years. Even
though it received evolutionary enhancements from time to time, its design
resembled a traditional C-style interface from the medieval era. We found that
the interface left too much room for interpretation. In particular, the meta
data per event type was defined in a rather ad-hoc way, which raised
uncertainties. For example, is a button-press event accompanied with a
positional value or not? To remove these uncertainties, the current release
replaces the 'Input::Event', with a new implementation that facilitates a safe
way of accessing event meta data. Besides this design change, there is one
noteworthy semantic change as well. With the new interface, symbolic character
information are provided along with their corresponding press events rather
than as distinct events, which - according to our practical findings - greatly
simplifies the consumer side of the 'Input::Event' interface.
Improved keyboard-focus handling
================================
The nitpicker GUI server multiplexes one screen among multiple GUI clients in
a secure way. One aspect remained underdeveloped so far, which is the keyboard
focus handling. Nitpicker's 'Session:focus' call previously triggered a one-off
focus change at call time. This focus change did not pass the same code paths
as a focus change triggered by a "focus" ROM update, which led to
inconsistencies.
The new version changes the implementation of 'Session::focus' such that the
relationship of the caller and the focused session is preserved beyond the
call time. Whenever the calling session is focused in the future, the
specified session will receive the focus instead. So 'Session::focus' no
longer represents a single operation but propagates the information about the
inter-session relationship. This information is taken into account whenever
the focus is evaluated regardless of how the change is triggered. This makes
the focus handling in scenarios like the window manager more robust.
Device drivers
##############
NVMe storage devices
====================
Since NVMe devices have become common in contemporary systems, it is time to
provide a driver for such devices on Genode. With this release, we introduce a
component that is able to drive consumer-grade NVMe storage devices, i.e.,
there is no support for namespace management or other enterprise-grade
features. For now, to keep things simple, the driver uses the device in an
old-fashioned way and uses only one I/O queue with at most 128 entries. That
is to say it does not exploit the parallelism necessary to unlock the full
potential of NVMe storage. Nonetheless, it performs well. The following
snippet illustrates its configuration:
!<start name="nvme_drv">
! <resource name="ram" quantum="8M"/>
! <provides><service name="Block"/></provides>
! <config>
! <report namespace="yes"/>
! <policy label_prefix="client1" writeable="yes"/>
! </config>
!</start>
The component will generate a report, which contains all active namespaces, if
reporting is enabled by setting the 'namespace' attribute of the '<report>'
node to 'yes'. A report may look like the following example:
!<controller model="QEMU NVMe Ctrl" serial="FNRD">
! <namespace id="1" block_count="32768" block_size="512"/>
!</controller>
For an example on how to integrate this component, please have a look at the
_repos/os/run/nvme.run_ script.
While implementing the NVMe driver, a new component for testing block-sessions
was used. In contrast to the already existing 'blk_bench' and 'blk_cli'
components, it features a variety of different test patterns, which can be
selected in its configuration and can be used to test a block component more
thoroughly. For more information please refer to
_repos/os/src/app/block_tester/README_
NXP i.MX SoC
============
We extended the Linux kernel driver port for Ethernet cards found in NXP i.MX
SoC, which was introduced in the previous release. Now does it not only
support i.MX6Q SoC based boards like the Wandboard, but the i.MX53 and i.MX6SX
SoC as well. The new driver was successfully tested with the i.MX53 Quick
Start Board and the Nitrogen6 SOLOX. The latter board even contains two
Ethernet cards. But due to technical limitations of the board design, the same
driver instance has to be used for both cards. Currently, the driver is
tweaked to run on different boards via its configuration ROM. When no
configuration is provided, it appropriates the values for successfully
executing on the Wandboard. The following is an example configuration for the
i.MX53:
! <config>
! <card name="fec0" type="fsl,imx25-fec" mii="rmii" irq="87" mmio="0x63fec000"/>
! </config>
As a side effect of enabling networking on the Nitrogen6 SOLOX, support for
GPIO based signals has been added to the framework too. The existing GPIO
driver for i.MX53 SoC got extended to additionally support the i.MX6 family.
There are some known limitations when using different drivers like Ethernet
and SD-card drivers on the Wandboard right now. At the moment, those drivers
adjust clock parameters and I/O pin configurations independently from each
other, which can lead to inconsistencies. We plan to address those issues with
the implementation of a platform driver for the i.MX6 SoC family.
Improved USB-storage driver
===========================
We improved the stability of the USB-storage driver (usb_block_drv) and
made it compatible with a lot more devices as the driver has become a pivotal
ingredient of the Sculpt scenario. Due to the changes, the way the driver
operates has changed. On the one hand, now it first tries to use 10-byte
Command Descriptor Blocks (CDB) in its SCSI layer and will only switch to
16-byte CDBs when it encounters a device whose blocks cannot be completely
accessed via the former descriptor size. On the other hand, because some
tested devices stopped working after issuing a USB device reset, the reset was
made optional. By setting the 'reset_device' attribute in the '<config>' node
to 'yes', the driver is instructed to perform the USB device reset.
Libraries and applications
##########################
Packaged Qt5 framework
======================
We created package recipes for all previously ported Qt5 libraries and their
dependencies and adapted the run scripts accordingly. Please note that the
host tools needed for building Qt applications (moc, rcc, uic) are not built
automatically anymore, but need to be built and installed manually with the
new 'tool/tool_chain_qt5' script.
Java language support
=====================
Over the course of the past year, we started to look into Java support for
Genode with the ultimate goal of porting an existing Java Virtual Machine
(JVM), which translates and executes Java byte code, to Genode. After
investigating possible JVM candidates, it became obvious that
[http://openjdk.java.net - OpenJDK] is the only viable option when looking for
a functional, maintained, feature complete, and open-source Java SDK.
Therefore, we decided upon OpenJDK version 9 and started to port OpenJDK's
HotSpot virtual machine.
In the first step, we followed the approach to enable HotSpot's internal
Just-in Time (JIT) compiler, which translates byte code into machine code and
is the option with the most to offer performance wise. But we also wanted
support for ARM platforms and soon realized, there was almost no JIT compiler
support for ARM other than for Linux. The Linux version is deeply integrated
into the Linux system libraries (e.g., glibc), which makes it very hard to
bring the compiler onto Genode. For example, Genode uses FreeBSD's libc and
that would now have to offer glibc semantics.
After additional research, we found the so-called interpreter version of the
HotSpot VM. This version does not compile byte code, but interprets and
emulates the code at runtime. It is of course slower than the JIT compiler
version, but also machine-architecture independent, so the same HotSpot VM can
be compiled for x86 and ARM platforms. With the JVM running on Genode, we
added networking and file-system access support via Genode's VFS layer. Note,
there is no graphical toolkit support as of now, but most standard library
classes should work. Also, the byte code has to be compiled on a different
host system (e.g., Linux, *BSD) as of now, since we did not bring the Java
compiler to Genode.
To give Java a spin, a run script can be found under _ports/run/java.run_.
Ada language support
====================
Support for components and libraries written in the Ada/SPARK programming
language experienced a rework with the final goal of seamless integration with
the base framework. We added a new _ada_ library, which contains a (currently
minimal) runtime taken from the sources of our GCC port and thus is always
consistent with the tool chain in use. It is built as a shared library
_ada.lib.so_ that needs to be added to the list of boot modules.
The example in _libports/src/test/ada_ showcases the implementation of an Ada
component using a custom library _test-ada_, which is also implemented in Ada.
Seoul VMM on NOVA
=================
The Seoul/Vancouver VMM - introduced to Genode with release 11.11 - received
some renovations to be able to run recent Linux VMs. Namely the output of the
guest during early boot is now visible and the network models got revised.
Additionally, the Seoul VMM has been packaged and can be used in Sculpt.
Ported software
===============
The [https://dnsprivacy.org/wiki/display/DP/DNS+Privacy+Daemon+-+Stubby - Stubby]
DNS daemon has been ported to begin experimentations with DNS as a native
service. There is a tendency for DNS configuration frameworks to diverge
between operating systems and releases, an inconvenience that is magnified
when maintaining virtual machines. Name-server configuration via DHCP has been
the only constant, so hosting DNS natively and configuring virtual-machines
with the *nic_router* DHCP server presents itself as a viable solution to the
guest resolver quagmire. Expect DNS services in later Sculpt releases.
Platforms
#########
Accessing PCI via ECAM/MMCONF
=============================
The platform driver on x86 is trusted with guarding access to PCI
devices. Up to now, I/O ports have been used to configure the PCI subsystem.
On modern x86 architectures, PCI devices can be configured by using Memory
Mapped I/O (MMIO). This method was introduced with PCI Express and is called
Enhanced Configuration Access Mechanism (ECAM). For Each PCI device a separate
4 KiB MMIO page exists to serves as the configuration interface between OS and
PCI device.
The exact location of all the 4K MMIO pages of the PCI devices is machine
specific and must be determined during the bootstrap phase. The ACPI driver on
Genode is in charge of this procedure and reports the location of the
ECAM/MMCONF region to the platform driver via the 'acpi' ROM.
Besides using a modern PCI interface, switching to ECAM/MMCON served to ease
the execution of Genode/hw on top of the Muen separation kernel.
Kernel-agnostic platform-information handling
=============================================
Up to now, special kernel-specific information was propagated to components
such as Virtualbox, the Seoul VMM, and the timer by reusing the
kernel-provided data structures. For Genode/NOVA, the hypervisor info page
(HIP) was exported as an ordinary Genode ROM. With the rise of Sculpt and the
packaging of components in a - as far as possible - kernel-independent way,
the propagation of kernel-specific information became a stumbling block.
With this release we abandon the 'hypervisor_info_page' ROM of Genode/NOVA and
replace it with a Genode ROM called 'platform_info'. The 'platform_info' ROM
is planned to contain solely information about the host hardware, which may
not be gathered otherwise by Genode components. In the current state it
contains information required by VMMs, namely whether AMD SVM or Intel VMX is
available and usable. Additionally, the ROM contains information about the
frequency of the time stamp counter.
Updated seL4 kernel to version 9.0.1
====================================
Thanks to Hinnerk van Bruinehsen, the seL4 version used by Genode has been
updated to 9.0.1.
Updated Muen separation kernel
==============================
With the addition of memory-mapped access to the PCI config-space in Genode,
base-hw subjects on Muen now only see the effectively assigned physical
devices. This makes it possible to run Genode in parallel with other subjects
and to pass-through different PCI devices for each instance.
The Muen update also brings a much simplified subject info structure plus some
tweaks to the Muen system policy XML format to facilitate easier integration
of new hardware platform specifications.
Build system and tools
######################
Validating 3rd-party code downloads via SHA256
==============================================
This release removes support for verifying source code of third-party ports
with the SHA1 hash algorithm. Last year, SHA1 was banished as a credible
cryptographic hash function after the demonstration of a full collision
attack. Since the
[https://genode.org/documentation/release-notes/14.05 - 14.05 release],
port files have been verified using SHA1, this release replaces all file
digests with SHA256 digests. Any port definitions maintained in external
repositories are required to make these replacements as well. No collisions
have been discovered against source code archives but nonetheless there is an
obligation to widen our margin of safety.
Creating GPT-based disk images by default
=========================================
Up to now Genode's run tool was able to create x86 bootable images in three
flavours:
* Either as ISO bootable by BIOS legacy - 'image/iso', or as
* GPT partitioned disk image only bootable by UEFI - 'image/uefi', or as
* MBR partitioned disk image only bootable by BIOS legacy - 'image/disk'.
With Sculpt came the demand to have a single image type that is in principle
bootable by both UEFI and BIOS legacy. Additionally with Sculpt, we began to
prefer working with GPT partitioned devices.
In the light of the new demands, we changed the 'image/disk' run tool support
to create a GPT partitioned disk image bootable by a legacy BIOS and by UEFI.

File diff suppressed because it is too large Load Diff

View File

@@ -1,681 +0,0 @@
===============================================
Release notes for the Genode OS Framework 19.08
===============================================
Genode Labs
The stated theme of this year's [https://genode.org/about/road-map - road map]
is "bridging worlds", which expresses our ambition to smoothen the practical
use of Genode-based systems such as Sculpt OS. The current release pays
tribute to this ambition by addressing a great number of practical concerns:
How to accommodate the staggering variety of keyboard layouts out there?
(Section [Flexible keyboard layouts])
How can the system gracefully respond when confronted with exotic USB devices?
(Section [Storage-stack improvements])
How to set the system time from within the system? How does SNTP fit in here?
(Section [General system time concept])
How to approach the remote administration of the system?
(Section [Enhanced SSH terminal])
How to copy and paste text securely between mutually distrusting subsystems?
(Section [Clipboard])
Or how to overcome the captive portal of a Hotel WiFi with Sculpt OS?
(Section [Disposable VM for handling captive portals])
By providing answers to those questions, we believe to make Genode - and Sculpt
OS in particular - generally more useful.
As another take on "bridging worlds", we continue our effort to bring the rich
Sculpt OS software stack to the 64-bit ARM world, in particular to our most
loved SoC family, namely NXP i.MX. Section [64-bit ARM and NXP i.MX8] reports
on our progress in this direction.
Under the hood, there are a few exciting developments that will greatly reduce
the effort of running existing software on Genode. In particular, Genode's
(entirely optional) C runtime has gained the ability to emulate the
traditional execve and fork mechanisms.
(Section [Consolidation of the C runtime and Noux]) This will eventually
alleviate the need for our present noux runtime environment to the benefits of
better performance and increased flexibility.
Further highlights of Genode 19.08 are a major update of Qt5 to version 5.13
(Section [Updated Qt5]) and the continuation of our kernel-agnostic
virtualization story (Section [Virtualization]).
Flexible keyboard layouts
#########################
Genode is used worldwide in a multilingual context beyond Germany and common
technical realms of English. Therefore, we had to address localized
keyboard-input handling for quite some time now and introduced the
_input-filter_ component in
[https://genode.org/documentation/release-notes/17.02#Input-event_filter - 17.02].
The component merges input streams and applies several forms of input
transformations, in particular the application of keyboard layouts to
supplement the input-event stream with character events.
But as we are by no means localization experts, our solution, while performing
a solid job for selected layouts, also had some quirks and rough edges when it
came to French or even Swiss German. First, our oversimplified notion of
[https://en.wikipedia.org/wiki/Caps_Lock - Caps Lock] as _just a pressed Shift_
_key_ is plain wrong but part of all our character-generator configurations.
We just missed this drawback because none of our developers uses Caps Lock
regularly. Further, US English and Germany layouts work very well without
[https://en.wikipedia.org/wiki/Dead_key - dead keys], but crossing any German
border (except the Austrian) is impossible without support for key sequences
composing special characters. The French keyboard layout in Genode tried to
alleviate the lack of compose sequences by adding an additional Circumflex
modifier and character mapping, which unfortunately is not standard.
[image keyboard_stack]
Beginning at this state of affairs, we researched common practice in
international keyboard-input handling, sought a quasi-standard source for
layout configurations, and addressed the drawbacks mentioned before. During
our research we found out that no current implementation is void of critique
and, therefore, decided to look more into X11/XKB as our open-source
quasi-standard solution, but always had an eye on the proprietary world.
The handling of key events in X11/XKB happens on three layers.
:Key codes: On the key-code layer, the device driver programs the
keyboard and generates a stream of key-code (i.e., scan-code)
events, which represent the physical location of the actual key on
the keyboard.
:Key symbols: These key codes are mapped to key symbols, which
represent the label imprinted on the key. So, the key code producing
US English _Q_ (QWERTY keyboard) generates _A_ on a French keyboard
(AZERTY). Modifiers like Shift, AltGr, and Caps Lock are included in
the key-symbol mapping. Additionally, some layouts map key codes to
dead key symbols, which start the before-mentioned compose
sequences. Key repeat is also implemented as key-symbol repeat
actually.
:Characters: On top of this stack, the key symbols are mapped to
characters represented as Unicode codepoints or UTF-8 strings.
The procedure obviously includes key symbols that have no character
representation (e.g. Control and Alt). Key symbols forming a valid compose
sequence generate characters on this level (e.g., dead-key circumflex plus
e generates ê).
We limited our research to Western keyboard-input handling and only had a
blink into the direction of Chinese-Japanese-Korean (CJK) and advanced input
methods (IM). This simplification is supported by the fact that CJK can also
be based on the mechanisms mentioned with some limitations only. Nevertheless,
we do not expect to never touch this topic again.
After doing our homework of keyboard-input handling, we worked on squeezing
all available layout information out of X11/XKB, which resulted in a small
tool residing in _tool/xkb2ifcfg_. For those wondering, the name is just a
silly acronym for _XKB to input-filter_ _configuration_ that pays tribute to
the boringness of this task. After building the tool by a run of 'make' in the
tool path, it can be used as follows. Please make sure you have libxkbcommon
development packages installed beforehand.
! xkb2ifcfg generate <layout> <variant> <locale>
!
! xkb2ifcfg generate us euro en_US.UTF-8
! xkb2ifcfg generate de nodeadkeys de_DE.UTF-8
If the parameter combination is available, xkb2ifcfg prints a input-filer
chargen configuration for the selected layout to standard output. Valid
'layout' and 'variant' options can be figured out from the LAYOUTS section in
'man 7 xkeyboard-config', where 'variant' strings are depicted in parentheses
after the layout (e.g., 'us(euro)'). The 'locale' option has the standard
locale syntax (see /usr/share/i18n/locales). The tool needs all three
parameters to gather the correct key-map and compose-sequence information. The
generated chargen configurations include '<map>' and '<key>' nodes
corresponding to significant modifier states and '<sequence>' nodes (described
later). For simplicity of the generator, the '<key>' nodes always use the
'code="..."' attribute, but also have a comment with the UTF-8 character
appended.
! <key name="KEY_MINUS" code="0x00df"/> <!-- ß -->
Last, we addressed the improvement of the input-filter character generator and
the actual chargen configuration files in Genode. Therefore, we specified the
modifier configuration assumed by the standard chargen files as '<mod1>'
corresponds to Shift, '<mod2>' to Control, '<mod3>' to AltGr, and '<mod4>' to
Caps Lock.
! <mod1> <key name="KEY_LEFTSHIFT"/> <key name="KEY_RIGHTSHIFT"/> </mod1>
! <mod2> <key name="KEY_LEFTCTRL"/> <key name="KEY_RIGHTCTRL"/> </mod4>
! <mod3> <key name="KEY_RIGHTALT"/> </mod4> <!-- AltGr -->
! <mod4> <rom name="capslock"/> </mod4>
As outlined above, the '<key>' nodes generated by xkb2ifcfg always use the
'code' attribute for the Unicode codepoint. Because of this and because UTF-8
also refers to codepoints, we deprecated the 'b0/b1/b2/b3' attributes for
character definition with this release.
The chargen is also extended by the '<sequence>' configuration node. A
sequence node permits the definition of dead-key/composing character
sequences. With such sequences, the character is not generated instantly on
key press but only after the sequence is completed. If an unfinished sequence
can't be completed due to an unmatched character, the sequence is aborted and
no character is generated. We support sequences of up to four characters at
the moment.
For example, the French AZERTY
[https://docs.microsoft.com/en-us/globalization/keyboards/kbdfr.html - keyboard layout]
has a dead key for Circumflex Accent _^_ right of the _P_ key (which is
bracket left _[_ on US keyboards). When Circumflex is pressed no visible
character should be generated instantly but the accent must be combined with a
follow-up character (e.g., Circumflex plus _a_ generates _â_).
Dead keys can be defined in the '<key>' nodes of any '<map>' by using
codepoints not used for direct output, for example, Combining Diacritical
Marks beginning at U+0300. The French Circumflex example can be configured
like follows.
! <mod1>
! <key name="KEY_LEFTSHIFT"/> <key name="KEY_RIGHTSHIFT"/>
! </mod1>
! <map>
! <key name="KEY_Q" code="0x0061"/> <!-- a -->
! <key name="KEY_LEFTBRACE" code="0x0302"/> <!-- dead_circumflex -->
! </map>
! <map mod1="true">
! <key name="KEY_Q" code="0x0041"/> <!-- A -->
! </map>
! <sequence first="0x0302" second="0x0061" code="0x00e2"/> <!-- â -->
! <sequence first="0x0302" second="0x0041" code="0x00c2"/> <!-- Â -->
Fortunately, the configuration is automatically generated by xkb2ifcfg, but
admittedly quite extensive. Therefore, we manually amended the chargen
configurations before adding them to Genode, which also gave us the chance to
apply some adjustments like follows for AltGr in Swiss German.
! <map mod1="false" mod2="false" mod3="true" mod4="false">
! <key name="KEY_1" code="0x00a6"/> <!-- ¦ (*) -->
! <key name="KEY_4" code="0x00b0"/> <!-- ° (*) -->
! <key name="KEY_5" code="0x00a7"/> <!-- § (*) -->
! </map>
Beside the advanced input methods mentioned before, there are still loose ends
we are going to address in the upcoming releases. For example, the current key
handling in our Qt5 back end maps localized key symbols incorrectly (think
AZERTY vs. QWERTY) in combination with shortcuts like Ctrl-A.
64-bit ARM and NXP i.MX8
########################
64-bit ARM support in our custom base-hw kernel
-----------------------------------------------
By introducing rudimentary Raspberry Pi 3 support on top of the Fiasco.OC
kernel in the previous release, the first ARM 64-bit support has entered the
Genode OS framework. We continued pursuing the ARM 64-bit path and introduce
support for Raspberry Pi 3 as well as the i.MX8 evaluation kit (EVK), this
time using our own base-hw kernel.
Noteworthy additions in the base-hw kernel are support for the AARCH64 system
level architecture, and the use of the modern GIC v3 interrupt controller on
top of the i.MX8 EVK board. In comparison to the GICv2, GICv3 adds support for
more than eight CPUs, more than 1020 interrupt IDs, and offers fast register
access to the CPU interface, instead of memory-mapped I/O access. Minor
changes had to be made to the page-table implementation of ARMv7 with Large
Physical Address Extension (LPAE) to re-use it for ARMv8. Moreover, the
internal kernel API for TLB maintenance needed to be changed slightly for all
ARM platforms.
We expanded our regular testing infrastructure with two AARCH64 platforms,
namely Raspberry Pi 3 via Qemu and the NXP i.MX8 EVK board as physical
hardware. Both platforms are driven with a single CPU core only at the moment.
Network driver for i.MX7 and i.MX8
----------------------------------
We updated the 'fec' network driver to version 4.16.3, which adds support for
i.MX7 and i.MX8 SoCs. This makes i.MX8 a viable platform for Genode-based
networking scenarios.
Enhanced packaging and test infrastructure for ARMv8
----------------------------------------------------
Besides the improved base-hw kernel, we enabled additional infrastructure for
ARMv8 platforms. For example, noux packages - like _coreutils_, _bash_ - are
now available, the standard C++ library is in place, and support for Genode's
port of the Linux TCP/IP stack is enabled.
Additionally, ARMv8 is now regularly tested within our nightly
_depot_autopilot_ runs.
Base framework and OS-level infrastructure
##########################################
Tracing
=======
Support for fast tracing has been built into Genode for a long time. However,
the stakes to take advantage of this feature remained high because convenience
functions were not in place. With the current release, we added the support
for easy trace setups through a VFS plugin. The plugin is called _vfs_trace_
and can be mounted into a Genode component as follows:
!<config>
! <vfs>
! <trace ram=32MB/>
! </vfs>
!</config>
This configuration will create a trace file system at the root of the VFS. The
_ram_ attribute is mandatory and determines the maximum size of all trace
buffers. The file system forms a recursive directory structure that represents
the parent/child relationship of running components, whereas the leaf
directories represent single threads within a component. Each leaf directory
currently contains three files:
:'enable': Start or stop the tracing of a thread by writing "true" or "false"
into the file.
:'buffer_size': Allows for the configuration of the trace-buffer size for the
thread in the usual Genode format (e.g. 5M, 512K, 1024).
:'trace_buffer': This read-only file contains the current content of the trace
buffer. Each trace entry can only be read once, after that only new entries
appear. "tail -f" can also be used to display continuous output.
As an example, tracing is started by writing _true_ to the _enable_ file:
! echo "true" > enable
The trace buffer can then be displayed using Unix tools like _tail_
! tail -f trace_buffer
which provides a continuous output.
Additionally, we have added the _trace_ function to _base/log.h_ that
facilitates identical functionality as _Genode::log_
! Genode::trace("Tracepoint value: ", value);
In order to enable tracing, the parent must provide the "TRACE" service. For a
real world example on Sculpt OS, please refer to this
[https://genodians.org/ssumpf/2019-06-18-trace_fs - Genodians article].
With the _vfs_trace_ plugin in place, we removed the outdated _trace_fs_.
Consolidation of the C runtime and Noux
=======================================
On our [https://genode.org/about/road-map#August_-_Release_19.08 - road map],
we vaguely hinted at our plan for the "consolidation" of the noux runtime,
which is actually meant as a polite way of announcing that we are going to
remove it. We introduced the
[https://genode.org/documentation/release-notes/11.02#Noux_-_an_execution_environment_for_the_GNU_userland - Noux runtime]
in 2011 as a way to execute command-line-based GNU software directly on
Genode. It has served us well over the years and is - in fact - a crucial
ingredient of Sculpt OS and other system scenarios such as the Genodians.org
web server. Noux supplements Genode with two valuable assets, namely a
flexible and expandable virtual file system (VFS) layer, and the
implementation of the
[https://genode.org/documentation/release-notes/12.02#Noux_support_for_fork_semantics - Unix way]
to spawn applications ('fork' and 'execve').
In the
[https://genode.org/documentation/release-notes/17.02#Enhanced_VFS_infrastructure - meantime],
noux' VFS implementation has become independent from the noux runtime and is
now prominently employed by Genode's C runtime and the VFS server component.
Genode's C runtime became more and more complete, alleviating the use of noux
as POSIX compatibility layer except for programs that depended on a working
implementation of 'fork' and 'execve'.
The current release fills this remaining gap in Genode's C runtime by
providing 'fork', 'execve', and cousins such as 'wait4' and 'getpid' as
regular parts of the libc. This will eventually make noux redundant.
Note that this change does *NOT* make Genode reliant on POSIX. The C runtime
including the Unix features are entirely optional.
As one stepping stone of this undertaking, noux applications, which previously
had to be compiled for noux, have become binary compatible with the regular C
runtime. So one can execute programs like 'bash' directly as a Genode
component without any friction.
There are a few collateral improvements of Genode's dynamic linker and the C
runtime on the account of the new 'fork' and 'execve' implementation. E.g., in
addition to the already supported 'stdin', 'stdout', and 'stderr'
configuration, the libc can be instructed to initialize arbitrary file
descriptors as follows:
! <config>
! ...
! <libc ...>
! <fd id="3" path="/dev/log" writeable="yes" readable="no" seek="10"/>
! ...
! </libc>
! </config>
The libc-based implementation of 'fork' and 'execve' can be tried out via
the new _ports/run/bash.run_ script. Note that there are still a number of
limitations such as the lack of signal and ioctl handling. Pipes are not
supported, and shebangs ('#!') are not interpreted yet. That said, once those
missing pieces come into place, we can fade out the use of noux within Genode.
General system time concept
===========================
Briefly speaking, up to now there has been no notion of an overall concept of
system time in Genode. Components that need to have access to some kind of
real time are either configured locally, e.g., libc-based components access a
configured "device" (/dev/rtc), which just might be an inline file system
containing an artificial timestamp or the VFS RTC plugin, while other
components query some RTC session directly. Most of the time, this session is
provided by the 'rtc_drv' on x86 machines, which is somewhat costly as reading
the RTC via I/O ports takes time and is therefore done scarcely. For example,
the libc will query an RTC source only once and uses this initial value to
interpolate the current time. However, for executing long-running components,
it will be necessary to adjust the clock to compensate for any occurring clock
drift or to correct a misconfigured clock in general. In addition it is
desirable to be able to use a remote time source, e.g., an NTP-server, to
synchronize the system time.
To address this, we came up with the following concept:
[image system_rtc]
The new "System RTC" component, located at
_repos/libports/src/server/system_rtc_, acts as proxy for the RTC service in
front of the actual RTC driver. It uses the driver to get the initial RTC
value and then uses a timer session (via the timeout framework) to locally
interpolate the time. In contrast to querying the RTC driver, querying the
System RTC is fast.
The RTC driver and the System RTC are bundled up together in the new
_drivers-rtc-pc_ package. The runtime of this package requests two ROM modules
used to update the RTC value. The first one, named 'system_set_rtc', is used
to update the proxy component while the second one, called 'hw_set_rtc', is
used by the RTC driver to write the value into the battery-backed RTC. A
separate component, potentially accessing a remote time source, may generate
these ROMs to adjust the time in the package's runtime.
The new native *SNTP* client at _repos/libports/src/app/sntp_client_ is such a
component. It periodically requests the current time from a given SNTP server
and generates a report. The report produced by the component contains the time
as UTC/GMT. Depending on the system policy, it can be used to update the time
of the System RTC and/or instruct the driver to set the RTC value.
To propagate such changes to RTC values, the RTC session was enhanced by the
new 'set' signal. A client of the session can install a signal handler to
adapt its own time when necessary. Based on this, the time back end of the
libc was changed to instantiate a watch handler for the RTC device, which,
when triggered, will cause the libc to re-read the RTC value.
This constellation should, under normal operation, allow for second to
sub-second granularity updates of the overall system time and avoid drifting
away from network time.
Accessing SMBIOS tables
=======================
The System Management BIOS (SMBIOS) is a specification that allows for reading
management information produced by the BIOS of a system as a collection of
data structures in memory. It has the potential to eliminate the need for the
operating system to probe hardware for discovering present devices and their
characteristics. Nowadays, the SMBIOS specification is implemented widely in
PC systems, which includes modern UEFI systems as well. The data structures
are referred to as _tables_ or _records_ by public documentation.
The new native SMBIOS decoder at _os/src/app/smbios_decoder_ can be used on
x86 to parse SMBIOS tables and report gathered information in a human-readable
way. Besides general table information like number and size of structures,
etc., the component supports complete parsing of SMBIOS structures of types
"BIOS", "System", and "Baseboard".
The component is free from any code for acquiring an SMBIOS table through
means like the bootloader or BIOS information. It expects a table to be
present through a regular Genode ROM session with a 'smbios_table' label. This
way, the underlying system is required to find, select, and save the raw table
on startup and create a ROM module out of it. This is currently achieved on
NOVA and base-hw through an interplay of kernel, the core component, and the
ACPI driver and was tested for legacy BIOSes as well as UEFI systems.
Clipboard
=========
Genode introduced a principle copy-and-paste mechanism already
[https://genode.org/documentation/release-notes/15.11#Copy_and_paste - four years ago].
However, originally created as a part of a tech demo, the mechanism remained
unused in our day to day Genode work. This changed now. We took the
integration of copy-and-paste support in Sculpt OS as an opportunity to revive
and refine the existing mechanism and supplement it with the features needed
to make it practical for daily use. We believe that the result aligns ease of
use nicely with security. The concept is described in a
[https://genodians.org/nfeske/2019-07-03-copy-paste - dedicated article]
at Genodians.org.
On a technical level, the existing clipboard component has received a new
option that allows for dynamic information-flow policies based on user
interactivity (keyboard focus, activity). When setting the config attribute
'match_labels="yes"', the clipboard performs plausibility checks for copy and
paste operations against the focus of the Nitpicker GUI server. All aspects of
the clipboard policy - including information-flow policies - have become
reconfigurable.
To make window-manager clients compatible with the clipboard's dynamic policy,
the window manager got enhanced with the ability to proxy the interaction with
the clipboard. GUI clients in turn - in particular the graphical *terminal* -
became able to interact with the clipboard. With the '<config>' attribute
'copy="yes"' specified, the terminal allows the user to select text to be
reported to a "clipboard" report. The selection mode is activated by holding
the left shift key. While the selection mode is active, the text position
under the mouse pointer is highlighted and the user can select text via the
left mouse button. Upon release of the mouse button, the selection is
reported. Vice versa, with the '<config>' attribute 'paste="yes"' specified,
the terminal allows the user to paste the content of a "clipboard" ROM session
to the terminal client by pressing the middle mouse button.
Finally, we integrated those new abilities into Sculpt OS and into several
installable packages, including virtual machines, the noux-system package,
and graphical Qt5-based applications.
Enhanced SSH terminal
=====================
This release paves the way for remotely managing Genode devices over SSH.
Until now, only interactive SSH sessions were supported. It is now possible to
execute commands from a remote SSH client. E.g., 'ssh noux@localhost -p 5555
"ls -hal /bin/"'. For non-interactive sessions, ssh_terminal requires a helper
component. This component is responsible to create the environment for the
command to run in. You can find an example for such a component at
_gems/src/test/exec_terminal_. It starts noux in a sub init and executes the
provided command inside of it. The new _ssh_exec_channel.run_ script gives a
demonstration on how this feature can be used.
This work is a contribution by Sid Hussmann of
[https://gapfruit.com - Gapfruit]. Thanks for this great new feature!
Storage-stack improvements
==========================
The desire of one Genode developer to exchange data via Iomega ZIP drives
between an Atari Falcon and Sculpt OS called for a number of small
improvements across several components of the storage stack.
First, the USB-block driver has been changed to exit on an initialization
failure instead of waiting for another (supported) device. This change enables
the Sculpt manager to detect such conditions and release the USB device
hardware by removing the driver component. Such a failed initialization may
happen with exotic USB-storage devices such as ZIP drives. With the device
released, however, it can be assigned to a virtual machine to access it using
a guest OS with a broader support of devices.
Second, the USB-block driver received new support for issuing the SCSI
START-STOP command at initialization time, thereby overcoming the ZIP-drive
initialization failure.
Third, we enhanced the part-block component with the ability to parse AHDI
partition schemes and detect the GEMDOS variant of FAT as used by Atari TOS.
Fourth, we enabled the Rump VFS plugin to access GEMDOS file systems. The
GEMDOS variant is readily supported by NetBSD's "msdos" file-system driver.
However, it must explicitly be enabled by a mount flag. Hence, we added the
principle ability for passing mount flags to NetBSD file-system drivers and
enabled the MSDOSFSMNT_GEMDOSFS flag based on the VFS plugin's config
attribute 'gemdos="yes"'.
With these changes in place, data can now be exchanged directly between
Atari-formatted disks and Sculpt OS. That said, advanced use cases such as
media changes at runtime are not covered yet.
Updated Ada/SPARK runtime
=========================
Genode's Ada/SPARK runtime is developed and maintained by
[https://componolit.com - Componolit]. Thanks for this excellent
collaboration!
The updated Componolit Ada runtime 1.1.0 increases the proof coverage and
cleans up the source-code structure. SPARK mode is now enabled wherever
possible and unneeded abstractions have been removed. Furthermore, the 64-bit
addition and subtraction have been proven to be free of runtime errors.
As a new feature, the runtime now supports the use of inline assembly in Ada.
The removal of unneeded features such as the incomplete threading support for
the secondary stack has greatly reduced the runtime's complexity while keeping
the current functionality available. Also GNAT.IO has been removed as its
implementation was incomplete and complex. A simpler replacement has been
introduced with 'Componolit.Runtime.Debug'.
Unrelated to Genode, the runtime now supports [https://muen.sk/ - Muen] and
the API/ABI of the runtime has been separated from the GNAT ABI.
Libraries and applications
##########################
Updated Qt5
===========
We updated our Qt5 port to the latest upstream version 5.13.0. Before
preparing the 'qt5' port, please make sure to build and install the updated
Qt5 host tools with the 'tool/tool_chain_qt5' script.
Virtualization
==============
As follow-up of our work on the
[https://genode.org/documentation/release-notes/19.05#Kernel-agnostic_virtual-machine_monitors - kernel agnostic virtual-machine monitor interface]
on x86, we added principle support to run our port of VirtualBox on
Genode/Fiasco.OC. We write _principle_ support, since we managed to get the
VMM running with Fiasco.OC, but unfortunately not all features required by the
VMM are available using the Fiasco.OC kernel, e.g., guest FPU registers, PDPTE
registers, and task-priority support. In practice this means that the VMs with
Windows and Linux come up to a certain point but will fail later whenever the
guest state runs out of synchronization between VMM and hardware. In contrast,
the Seoul VMM runs fine on Fiasco.OC since it does not depend on the mentioned
missing features.
Our main working items have been the completion of transfer of the available
guest registers and control flow synchronization improvements between VMM and
Fiasco.OC kernel. Additionally, the usage of priorities for VirtualBox's
pthreads in the VMM had to be disabled. Finally, some tests for VirtualBox
with Genode/Fiasco.OC are enabled for nightly regular testing now.
As a side topic, we added support for using the VirtualBox
[https://forums.virtualbox.org/viewtopic.php?f=2&t=82299&start=15 - CPU profile]
feature, which allows for presenting a different CPUID to the VM than the one
of the real CPU. This can help when running Windows 7 on a Kaby Lake or newer
CPU, which are considered _unsupported hardware_ and reason enough not to
receive security updates from Microsoft. The feature can be used on Genode by
adding the 'CpuProfile' attribute to the '<CPU>' XML node in the .vbox file,
like:
! <CPU CpuProfile="Intel Core i7-5600U">
Disposable VM for handling captive portals
==========================================
It is common that WiFi networks require the user to interact with a specific
web page before gaining access to full network functionality. Such captive
portal pages are completely individual to the accessed network and not limited
in the use of common web techniques. Therefore, their handling is best be done
using a fully-featured web browser like Mozilla Firefox.
This is where, in a Genode-based desktop system like Sculpt, a disposable VM
for hosting a minimal browser setup becomes desirable. Its goal is to unlock a
network for the native Genode surroundings with as little inconvenience as
possible just to be thrown away afterwards without any side effects on the
system.
Now, one could use the Firefox appliance VM of Sculpt (see the
[https://genode.org/documentation/release-notes/18.05 - release notes] or the
[http://genodians.org/alex-ab/2019-03-06-disposal-browser-vm - Genodians article])
for this. But this VM aims for a long-term browsing experience which, in the
context of mere captive-portal handling, brings some drawbacks like a much
higher RAM consumption or the required sessions for USB detection and shared
folders.
Furthermore, in the captive portal VM, there's no need for managing windows or
browser tabs. The one browser tab needed can always be shown in fullscreen. It
is also unnecessary for the browser to maintain a content cache or remember
user data. This can reduce resource consumption.
[image captive_portal_vm]
The VM we came up with is provided as package for Sculpt by Martin Stein
(depot user 'mstein'). You'll possibly need to manually add Martin's
[https://github.com/genodelabs/genode/tree/master/depot/mstein - depot key and download location]
to your Sculpt depot directory. After enabling this user, the captive portal
VM can be found in the Sculpt menu under "Depot -> mstein -> Virtual
Machines -> vbox5-nova-captive-portal".
The VM is based on a TinyCore 10 Linux with Xserver, i3 WM, and a tailored
Firefox browser. The package runtime doesn't need access to your file system,
it merely loads some ROMs into a RAM FS, so, it will completely forget any
changes made during a session. Therefore, it's also safe to simply remove an
instance via the Leitzentrale component-view once you don't need it anymore.
The guest additions are also included to make the VM window resizable.
Build system and tools
######################
At Genode Labs, we have used _tool/autopilot_ for the steering of tests in our
Continuous Integration workflow for almost a decade now. This implied various
improvements over the years and with the completion of our work on
[https://genode.org/documentation/release-notes/19.05#Unified_build_directories_for_ARM - unified build directories]
it was time to amend this handy tool once again. Unified build directories
support building all components for one CPU architecture in one directory
saving the build server from the redundant work we previously had with
board-specific directories. With the new notion of boards during builds, the
definition of the target platform when integrating Genode system scenarios is
now a triplet of _CPU architecture_, _board_, and _kernel_. This is reflected
in the new '-t <architecture-board-kernel>' command line option, which
instructs autopilot to generate a build directory for _architecture_ and
execute tests for the _board-kernel_ combination.
! autopilot -t x86_64-pc-sel4 -t x86_64-pc-nova -r run/log
The known options for '-k kernel' and '-p platform' are still supported with
the small change that the platform must now be defined as
_architecture-board_.
! autopilot -p x86_64-pc -k sel4 -k nova -r run/log
Autopilot now also documents the hidden feature to propagate custom 'RUN_OPTs'
via the 'RUN_OPT_AUTOPILOT' environment variable to the run tool executed.
Besides that, the tool always appends 'RUN_OPT' with '--autopilot'.
! RUN_OPT_AUTOPILOT="--depot-dir /data/depot" autopilot ...

830
doc/release_notes/08-11.txt Normal file
View File

@@ -0,0 +1,830 @@
==============================================
Release notes for the Genode OS Framework 8.11
==============================================
Genode Labs
Summary
#######
This document presents the new features and major changes introduced
in version 8.11 of the Genode OS Framework. It is geared towards
people interested in closely following the progress of the Genode
project and to developers who want to adopt their software to our
mainline development. The document aggregates important fragments
of the updated documentation such that you won't need to scan existing
documents for the new bits. Furthermore, it attempts to provide our
rationale behind the taken design decisions.
The general theme for the release 8.11 is enabling the use of the
Genode OS framework for real-world applications. Because we regard
the presence of device drivers and a way to reuse existing library
code as fundamental prerequisites for achieving this goal, the major
new additions are an API for device drivers written in C, an API for
handling asynchronous notifications, and a C runtime. Other noteworthy
improvements are the typification of capabilities at the C++-language
level, a way for receiving and handling application faults, the
introduction of managed dataspaces, and a new API for scheduling
timed events.
Base framework
##############
This section documents the new features and changes affecting the
'base' repository, in particular the base API.
New features
============
Connection handling
~~~~~~~~~~~~~~~~~~~
The interaction of a client with a server involves the definition of
session-construction arguments, the request of the session creation via
its parent, the initialization of the matching RPC-client stub code
with the received session capability, the actual use of the session
interface, and the closure of the session. A typical procedure of
using a service looks like this:
!#include <rom_session/client.h>
!...
!
!/* construct session-argument string and create session */
!char *args = "filename=config, ram_quota=4K");
!Capability session_cap = env()->parent()->session("ROM", args);
!
!/* initialize RPC stub code */
!Rom_session_client rsc(session_cap);
!
!/* invoke remote procedures, 'dataspace' is a RPC function */
!Capability ds_csp = rsc.dataspace();
!...
!
!/* call parent to close the session */
!env()->parent()->close(session_cap);
Even though this procedure does not seem to be overly complicated,
is has raised the following questions and criticism:
* The quota-donation argument is specific for each server. Most services
use client-donated RAM quota only for holding little meta data and,
thus, are happy with a donation of 4KB. Other services maintain larger
client-specific state and require higher RAM-quota donations. The
developer of a client has to be aware about the quota requirements for
each service used by his application.
* There exists no formalism for documenting session arguments.
* Because session arguments are passed to the 'session'-call as a plain
string, there are no syntax checks for the assembled string performed
at compile time. For example, a missing comma would go undetected until
a runtime test is performed.
* There are multiple lines of client code needed to open a session to
a service and the session capability must be maintained manually for
closing the session later on.
The new 'Connection' template provides a way to greatly simplify the
handling of session arguments, session creation, and destruction on the
client side. By implementing a service-specific connection class
inherited from 'Connection', session arguments become plain constructor
arguments, session functions can be called directly on the 'Connection'
object, and the session gets properly closed when destructing the
'Connection'. By convention, the 'Connection' class corresponding to a
service resides in a file called 'connection.h' in the directory of the
service's RPC interface. For each service, a corresponding 'Connection'
class becomes the natural place where session arguments and quota
donations are documented. With this new mechanism in place, the example
above becomes as simple as:
!#include <rom_session/connection.h>
!...
!
!/* create connection to the ROM service */
!Rom_connection rom("config");
!
!/* invoke remote procedure */
!Capability ds_csp = rom.dataspace();
[https://genode.org/documentation/api/base_index#Connecting_to_services - See the API documentation for the connection template...]
Typed capabilities
~~~~~~~~~~~~~~~~~~
A plain 'Capability' is an untyped reference to a remote object of any
type. For example, a capability can reference a thread object or a
session to a service. It is loosely similar to a C void pointer, for which
the programmer maintains the knowledge about which data type is actually
referenced. To facilitate the type-safe use of RPC interfaces at the C++
language level, we introduced a template for creating specialized
capability types ('Typed_capability' in 'base/typed_capability.h') and
the convention that each RPC interface declares a dedicated capability
type. Note that type-safety is not maintained across RPC interfaces. As
illustrated in Figure [layered_ipc], typification is done at the
object-framework level on the server side and via in the 'Connection'
classes at the client side.
[image layered_ipc]
From the application-developer's perspective, working with capabilities
has now become type-safe, making the produced code more readable and robust.
[https://genode.org/documentation/api/base_index#Capability_representation - See the updated API documentation for the capability representation...]
Fifo data structure
~~~~~~~~~~~~~~~~~~~
Because the 'List' data type inserts new list elements at the list head,
it cannot be used for implementing wait queues requiring first-in
first-out semantics. For such use cases, we introduced a dedicated
'Fifo' template. The main motivation for introducing 'Fifo' into the
base API is the new semaphore described below.
[https://genode.org/documentation/api/base_index#Structured_data_types - See the new API documentation for the fifo template...]
Semaphore
~~~~~~~~~
Alongside lock-based mutual exclusion of entering critical sections,
organizing threads in a producer-consumer relationship via a semaphore
is a common design pattern for thread synchronization. Prior versions
of Genode provided a preliminary semaphore implementation as part of
the 'os' repository. This implementation, however, supported only one
consumer thread (caller of the semaphore's 'down' function). We have
now enhanced our implementation to support multiple consumer threads
and added the semaphore to Genode's official base API. We have made
the wake-up policy in the presence of multiple consumers configurable
via a template argument. The default policy is first-in-first-out.
[https://genode.org/documentation/api/base_index#Synchronization - See the new API documentation for the semaphore...]
Thanks to Christian Prochaska for his valuable contributions to the new
semaphore design.
Asynchronous notifications
~~~~~~~~~~~~~~~~~~~~~~~~~~
Inter-process communication via remote procedure calls requires both
communication partners to operate in a synchronous fashion. The caller
of an RPC blocks as long as the RPC is not answered by the called
server. In order to receive the call, the server has to explicitly
wait for incoming messages. There are a number of situations where
synchronous communication is not suited.
For example, a GUI server wants to deliver a notification to one of its
clients about new input events being available. It does not want to
block on a RPC to one specific client because it has work to do for
other clients. Instead, the GUI server wants to deliver this
_notification_ with _fire-and-forget_ semantics and continue with
its operation immediately, regardless of whether the client received
the notification or not. The client, in turn, does not want to poll
for new input events at the GUI server but it wants to be _waken_up_
when something interesting happens. Another example is a block-device
driver that accepts many requests for read/write operations at once.
The operations may be processed out of order and may take a long time.
When having only synchronous communication available, the client and
the block device driver would have to employ one distinct thread for
each request, which is complicated and a waste of resources. Instead,
the block device driver just wants to acknowledge the completeness of
an operation _asynchronously_.
Because there are many more use cases for asynchronous inter-process
communication, we introduced a new signalling framework that complements
the existing synchronous RPC mode of communication with an interface for
issuing and receiving asynchronous notifications. It defines interfaces
for signal transmitters and signal receivers. A signal receiver can
receive signals from multiple sources, whereas the sources of incoming
signals are clearly distinguishable. One or multiple threads can either
poll or block for incoming signals. Each signal receiver is addressable
via a capability. The signal transmitter provides fire-and-forget
semantics for submitting signals to exactly one signal receiver. Signals
are communicated in a reliable fashion, which means that the exact number
of signals submitted to a signal transmitter is communicated to the
corresponding signal receiver. If notifications are generated at a higher
rate than as they can be processed at the receiver, the transmitter
counts the notifications and delivers the total amount with the next
signal transmission. This way, the total number of notifications gets
properly communicated to the receiver even if the receiver is not highly
responsive. Notifications do not carry any payload because this payload
would have to be queued at the transmitter.
[image signals]
Image [signals] illustrates the roles of signaller thread,
transmitter, receiver, and signal-handler thread.
[https://genode.org/documentation/api/base_index#Asynchronous_notifications - See the new API documentation for asynchronous notifications...]
The current generic implementation of the signalling API employs one
thread at each transmitter and one thread at each receiver. Because
the used threads are pretty heavy weight with regard to resource usage,
ports of Genode should replace this implementation with platform-
specific variants, for example by using inter-process semaphores or
native kernel support for signals.
Region-manager faults
~~~~~~~~~~~~~~~~~~~~~
In Genode, region-manager (RM) sessions are used to manage the
address-space layout for processes. A RM session is an address-space
layout that can be populated by attaching (portions of) dataspaces to
(regions of) the RM session. Normally, the RM session of a process is
first configured by the parent when decoding the process' ELF binary.
During the lifetime of the process, the process itself may attach
further dataspaces to its RM session to access the dataspace's content.
Core as the provider of the RM service uses this information for
resolving page faults raised by the process. In prior versions of
Genode, core ignored unresolvable page faults, printed a debug message
and halted the page-faulted thread. However, this condition may be of
interest, in particular to the process' parent for reacting on the
condition of a crashed child process. Therefore, we enhanced the RM
interface by a fault-handling mechanism. For each RM session, a fault
handler can be installed by registering a signal receiver capability.
If an unresolvable page fault occurs, core delivers a signal to the
registered fault handler. The fault handler, in turn, can request the
actual state of the RM session (page-fault address) and react upon
the fault. One possible reaction is attaching a new dataspace at the
fault address and thereby implicitly resolving the fault. If core
detects that a fault is resolved this way, it resumes the operation
of the faulted thread.
This mechanism works analogously to how page faults are handled by
CPUs, but on a more abstract level. A (n-level) page table corresponds
to a RM session, a page-table entry corresponds to a dataspace-
attachment, the RM-fault handler corresponds to a page-fault
exception handler, and the resolution of page-faults (RM fault)
follows the same basic scheme:
# Application accesses memory address with no valid page-table-entry
(RM fault)
# CPU generates page-fault exception (core delivers signal to fault
handler)
# Kernel reads exception-stack frame or special register to determine
fault address (RM-fault handler reads RM state)
# Kernel adds a valid page-table entry and returns from exception
(RM-fault handler attaches dataspace to RM session, core resumes
faulted thread)
The RM-fault mechanism is not only useful for detecting crashing child
processes but it enables a straight-forward implementation of growing
stacks and heap transparently for a child process. An example for
using RM-faults is provided at 'base/src/test/rm_fault'.
Note that this mechanism is only available on platforms on which core
resolves page faults. This is the case for kernels of the L4 family.
On Linux however, the Linux kernel resolves page faults and suspends
processes performing unresolvable memory accesses (segmentation fault).
Managed dataspaces (experimental)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The RM-fault mechanism clears the way for an exciting new feature
of Genode 8.11 called managed dataspaces. In prior versions of Genode,
each dataspace referred to a contiguous area of physical memory (or
memory-mapped I/O) obtained by one of core's RAM, ROM, or IO_MEM
services, hence we call them physical dataspaces. We have now added
a second type of dataspaces called managed dataspaces. In contrast
to a physical dataspace, a managed dataspace is backed by the content
described by an RM session. In fact, each RM session can be used as
dataspace and can thereby be attached to other RM sessions.
Combined with the RM fault mechanism described above, managed
dataspaces enable a new realm of applications such as dataspaces
entirely managed by user-level services, copy-on-write dataspaces,
non-contiguous large memory dataspaces that are immune to physical
memory fragmentation, process-local RM fault handlers (e.g., managing
the own thread-stack area as a sub-RM-session), and sparsely populated
dataspaces.
Current limitations
-------------------
Currently, managed dataspaces still have two major limitations. First,
this mechanism allows for creating cycles of RM sessions. Core must
detect such cycles during page-fault resolution. Although, a design for
an appropriate algorithm exists, cycle-detection is not yet implemented.
The missing cycle detection would enable a malicious process to force
core into an infinite loop. Second, RM faults are implemented using the
new signalling framework. With the current generic implementation, RM
sessions are far more resource-demanding than they should be. Once the
signalling framework is optimized for L4, RM sessions and thereby
managed dataspaces will become cheap. Until then, we do not recommend
to put this mechanism to heavy use.
Because of these current limitations, managed dataspaces are marked as
an experimental feature. When building Genode, experimental features are
disabled by default. To enable them, add a file called 'specs.conf'
with the following content to the 'etc/' subdirectory of your build
directory:
! SPECS += experimental
For an example of how to use the new mechanism to manage a part of a
process' own address space by itself, you may take a look at
'base/src/test/rm_nested'.
Changes
=======
Besides the addition of the new features described above, the following
parts of the base framework underwent changes worth describing.
Consistent use of typed capabilities and connection classes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We applied capability typification to all interfaces of Genode including
the base API and the interfaces defined in the 'os' repository. Figure
[base_cap_types] provides an overview about the capability types
provided by the base API.
[image base_cap_types]
Overview about the capability types provided by the base API
Furthermore, we have complemented all session interfaces with
appropriate 'Connection' classes taking service-specific session
arguments into account.
For session-interface classes, we introduced the convention to declare
the service name as part of the session-interface via a static member
function:
! static const char *service_name();
Allocator refinements
~~~~~~~~~~~~~~~~~~~~~
Throughout Genode, allocators are not only used for allocating memory
but also for managing address-space layouts and ranges of physical
resources such as I/O-port ranges or IRQ ranges. In these cases, the
address '0' may be a valid value. Consequently, this value cannot be
used to signal allocation errors as done in prior versions of Genode.
Furthermore, because managed dataspaces use the RM session interface to
define the dataspace layout, the address-'0' problem applies here as
well. We have now refined our allocator interfaces and the RM-session
interface to make them fit better for problems other than managing
virtual memory.
Misc changes
~~~~~~~~~~~~
We revised all interfaces to consistently use _exceptions_ to signal
error conditions rather than delivering error codes as return values.
This way, error codes become exception types that have a meaningful
name and, in contrast to global 'errno' definitions, an error exception
type can be defined local to the interface it applies to. Furthermore,
the use of exceptions allows for creating much cleaner looking interfaces.
Traditionally, we have provided our custom _printf_ implementation as C
symbol to make this function available from both C and C++ code. However,
we observed that we never called this function from C code and that the
'printf' symbol conflicts with the libc. Hence, we turned 'printf'
into a C++ symbol residing in the 'Genode' namespace.
Operating-system services and libraries
#######################################
This section documents the new features and changes affecting
the 'os' repository.
New Features
============
Device-driver framework for C device drivers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Genode's base API features everything needed to create user-level device
drivers. For example, the 'os' repository's PS/2 input driver and the
PCI bus driver are using Genode's C++ base API directly. However, most of
today's device drivers are written in C. To ease the reuse of existing
drivers on Genode, we have introduced a C API for device drivers into
Genode's 'os' repository. The API is called DDE kit (DDE is an acronym
for device-driver environment) and it is located at 'os/include/dde_kit'.
The DDE kit API is the result of long-year experiences with porting device
drivers from Linux and FreeBSD to custom OS environments. The following
references are the most significant contributions to the development of
the API.
;
Christian Helmuth created the initial version of the Linux device-driver
environment for L4. He describes his effort of reusing unmodified sound
drivers on the L4 platform in his thesis
[https://os.inf.tu-dresden.de/papers_ps/helmuth-diplom.pdf - Generische Portierung von Linux-Gerätetreibern auf die DROPS-Architektur].
;
Gerd Griessbach approached the problem of re-using Linux USB drivers
by following the DDE approach in his diploma thesis
[https://os.inf.tu-dresden.de/papers_ps/griessbach-diplom.pdf - USB for DROPS].
;
Marek Menzer adapted Linux DDE to Linux 2.6 and explored the DDE
approach for block-device drivers in his student research project
[https://os.inf.tu-dresden.de/papers_ps/menzer-beleg.pdf - Portierung des DROPS Device Driver Environment (DDE) für Linux 2.6 am Beispiel des IDE-Treibers ]
and his diploma thesis
[https://os.inf.tu-dresden.de/papers_ps/menzer-diplom.pdf - Entwicklung eines Blockgeräte-Frameworks für DROPS].
;
Thomas Friebel generalized the DDE approach and introduced the DDE kit
API to enable the re-use of device driver from other platforms than
Linux. In particular, he experimented with the block-device drivers of
FreeBSD in his diploma thesis
[https://os.inf.tu-dresden.de/papers_ps/friebel-diplom.pdf - Übertragung des Device-Driver-Environment-Ansatzes auf Subsysteme des BSD-Betriebssystemkerns].
;
Dirk Vogt successfully re-approached the port of USB device drivers
from the Linux kernel to L4 in his student research project
[https://os.inf.tu-dresden.de/papers_ps/beleg-vogt.pdf - USB for the L4 Environment].
The current incarnation of the DDE kit API provides the following
features:
* General infrastructure such as init calls, assertions, debug output
* Interrupt handling (attach, detach, disable, enable)
* Locks, semaphores
* Memory management (slabs, malloc)
* PCI access (find device, access device config space)
* Virtual page tables (translation between physical and virtual
addresses)
* Memory-mapped I/O, port I/O
* Multi-threading (create, exit, thread-local storage, sleep)
* Timers, jiffies
For Genode, we have created a complete reimplementation of the DDE kit
API from scratch by fully utilizing the existing Genode infrastructure
such as the available structured data types, core's I/O services,
the synchronization primitives, and the thread API.
[image dde_kit]
Figure [dde_kit] illustrates the role of DDE kit when re-using an
unmodified device driver taken from the Linux kernel. DDE kit translates
Genode's C++ base API to the DDE kit C API. The DDE kit API, in turn, is
used as back end by the Linux driver environment, which translates Linux
kernel interfaces to calls into DDE kit. With this translation in place,
an unmodified Linux device driver can be embedded into the Linux driver
environment. The device API is specific for a class of devices such as
NICs, block devices, or input devices. It can either be used directly as
a function interface by an application that is using the device driver
as a library, or it can be made accessible to external processes via an
RPC interface.
Limitations
-----------
The PCI sub system is not completely implemented, yet.
Alarm API providing a timed event scheduler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The scheduling of timed events is a recurring pattern found in device
drivers, application frameworks such as Qt4 ('qeventdispatcher'), and
applications. Therefore, we have added a timed event scheduler to the
'os' repository. The new alarm API ('os/include/os/alarm.h') allows
for the scheduling of both one-shot alarms and periodic alarms.
Changes
=======
PS/2 input driver
~~~~~~~~~~~~~~~~~
The original PS/2 driver tried to switch the PS/2 keyboard to
scan-code set 2 and assumed that all modern keyboards support this
mode of operation. However, this assumption was wrong. We observed
that the legacy PS/2 support of some USB keyboards covers only the
emulated (xlate) scan-code set 1 mode. This is also case for the PS/2
emulation in VirtualBox. Therefore, we changed our PS/2 driver to
never touch the keyboard mode but to only detect the current mode
of operation. The driver has now to support both, scan-code set 1 and
scan-code set 2. This change comes along with a slightly more complex
state machine in the driver. Hence, we moved the state machine from
the IRQ handler to a distinct class and changed the control flow of
the driver to fetch only one value from the i8042 PS/2 controller
per received interrupt.
PCI bus driver
~~~~~~~~~~~~~~
Until now, Genode's PCI bus driver was only used for experimentation
purposes. With the forthcoming driver framework however, the PCI bus
driver will play a central role in the system. Therefore, we adapted
the interface of the PCI driver to these requirements. Specifically,
the scanning of the PCI bus can now be performed without constraining
the results by a specific vendor ID.
Nitpicker GUI server
~~~~~~~~~~~~~~~~~~~~
We improved the _output_latency_ of the Nitpicker GUI server by flushing
pixels eagerly and deferring the next periodically scheduled flush.
This change has a positive effect on the responsiveness of the GUI to
user input.
Misc changes
~~~~~~~~~~~~
Prior versions of the 'os' repository came with a custom 'os/include/base'
directory with interfaces extending the base API. To avoid confusion
between the 'base' repository and the 'os' repository, 'os'-local API
extensions are now located at 'os/include/os'. This way, the folder
prefix of include statements indicates well from which repository the
included header files comes from.
C runtime
#########
Most of existing libraries rely on the presence of a C library. For
making the reuse of this software on Genode possible, we have now
made a complete C library available for Genode. It comes as a separate
source-code repository called 'libc' and is based on the code of FreeBSD.
The original code is available at the official FreeBSD website.
:FreeBSD website:
[https://www.freebsd.org/developers/cvs.html]
Our libc port comprises the libraries 'gdtoa', 'gen', 'locale', 'stdio',
'stdlib', 'stdtime', 'string', and 'msun'. Currently, it supports the
x86 architecture. Support for other architectures is planned as future
addition. At the current stage, our back end is very basic and most of
its functions are dummy stubs. We used Christian Prochaska's forthcoming
Genode port of Qt4 as test case and successfully used the new libc as
foundation for building graphical Qt4 applications. We will further
extend the back end in correspondence to the growing feature set of the
Genode OS framework.
:Usage:
To use the libc in your application, just add 'libc' to the 'LIBS'
declaration in your build-description file. This declaration will make
the libc headers available for the include path of your target and link
the C library. When building, make sure that the 'libc' repository is
included in your build configuration ('etc/build.conf').
:Limitations:
The current version of the C library is not thread-safe. For most
string and math functions, this is not a problem (as these functions
do not modify global state) but be careful with using more complex
functions such as 'malloc' from multiple threads. Also, 'errno' may
become meaningless when calling libc functions from multiple threads.
We have left out the following files from the Genode port of the
FreeBSD libc: gdtoa 'strtodnrp.c' (gdtoa), 'getosreldate.c' (gen),
'strcoll.c', 'strxfrm.c', 'wcscoll.c', 'wcsxfrm.c' (string),
's_exp2l.c' ('msun').
The current back end is quite simplistic and it may help you to revisit
the current state of the implementation in the 'libc/src/lib/libc'
directory. If one of the functions in 'dummies.c' is called, you will
see the debug message:
! "<function-name> called, not yet implemented!"
However, some of the back-end function implemented in the other files
have dummy semantics but have to remain quiet because they are called
from low-level libc code.
Build infrastructure
####################
Build-directory creation tool
=============================
Because we think that each Genode developer benefits from knowing the
basics about the functioning of the build system, the manual creation of
build directories is described in Genode's getting-started document.
However, for regular developers, creating build directories becomes a
repetitive task. Hence, it should be automated. We have now added a
simple build-directory creation tool that creates pre-configured build
directories for some supported platforms. The tool is located at
'tool/builddir/create_builddir'. To print its usage information, just
execute the tool without arguments.
Improved linking of binary files
================================
For linking binary data, binary file have to be converted to object
files. Over the time, we have used different mechanisms for this
purpose. Originally, we used 'ld -r -b binary'. Unfortunately, these
linker options are not portable. Therefore, the mechanism was changed
to a 'hexdump' and 'sed' magic that generated a C array from binary data.
This solution however, is complicated and slow. Now, we have adopted
an idea of Ludwig Hähne to use the 'incbin' directive of the GNU
assembler, which is a very clean, flexible, and fast solution.
Lib-import mechanism
====================
Libraries often require specific include files to be available at the
default include search location. For example, users of a C library
expect 'stdio.h' to be available at the root of the include search
location. Placing the library's include files in the root of the
default search location would pollute the include name space for
all applications, regardless if they use the library or not. To
keep library-include files well separated from each other, we have
enhanced our build system by a new mechanism called lib-import.
For each library specified in the 'LIBS' declaration of a build
description file, the build system incorporates a corresponding
'import-<libname>.mk' file into the build process. Such as file
defines library-specific compiler options, in particular additional
include-search locations. The build system searches for lib-import
files in the 'lib/import/' subdirectories of all used repositories.
Using 'ar' for creating libraries
=================================
The previous versions of Genode relied on incremental linking ('ld -r')
for building libraries. This approach is convenient because the linker
resolves all cross-dependencies between libraries regardless of the
order of how libraries are specified at the linker's command line.
However, incremental linking prevents the linker from effectively
detecting dead code. In contrast, when linking '.a' files, the linker
detects unneeded object files. Traditionally, we have only linked our
own framework containing no dead code. This changed with the new 'libc'
support. When linking the 'libc', the presence of dead code becomes
the normal case rather than the exception. Consequently, our old
incremental-linking approach produced exceedingly large binaries
including all functions that come with the 'libc'. We have now adopted
the classic 'ar' mechanism for assembling libraries and use the linker's
'start-group' 'end-group' feature to resolve inter-library-dependencies.
This way, dead code gets eliminated at the granularity of object files.
In the future, we will possible look into the '-ffunction-sections' and
'-gc-sections' features of the GNU tool chain to further improve the
granularity to function level.
If your build-description files rely on custom rules referring to
'lib.o' files, these rules must be adapted to refer to 'lib.a' files
instead.
Misc changes
============
* Added sanity check for build-description files overriding 'INC_DIR'
instead of extending it.
* Restrict inclusion of dependency files to those that actually matter
when building libraries within 'var/libcache'. This change significantly
speeds up the build process in the presence of large libraries such as
Qt4 and libc.
* Added rule for building 'cpp' files analogously to the 'cc' rule.
Within Genode, we name all C++ implementation files with the 'cc'
suffix. However, Qt4 uses 'cpp' as file extension so we have to
support both.
* Build-description files do no longer need the declaration
'REQUIRES = genode'. Genode's include search locations are now
incorporated into the build process by default.
Applications
############
This section refers to the example applications contained in Genode's
'demo' repository.
We have enhanced the _Scout_widgets_ as used by the launchpad and the
Scout tutorial browser to perform all graphical output double-buffered,
which effectively eliminates drawing artifacts that could occur when
exposing intermediate drawing states via direct (unbuffered) output.
Furthermore, we have added a way to constrain the maximum size of
windows to perform pixel-buffer allocations on realistic window sizes.
Both launchpad and Scout can now start child applications. In Scout
this functionality is realized by special "execute" links. We have
generalized the underlying application logic for creating and
maintaining child processes between both applications and placed
the unification into a separate 'launchpad' library.
We have replaced the default document presented in Scout with an
_interactive_walk-through_guide_ explaining the basic features of Genode.
The document uses the new "execute" link facility to let the user start
a launchpad instance by clicking on a link.
Platform-specific changes
#########################
Genode used to define _fixed-width_integer_types_ in a file 'stdint.h'
placed in a directory corresponding to bit-width of the platform, for
example 'include/32bit/stdint.h'. When building for a 32bit platform,
the build system included the appropriate directory into the
include-search path and thereby made 'stdint.h' available at the root
of the include location. Unfortunately, this clashes with the 'stdint.h'
file that comes with the C library. To avoid conflict with libc header
files, we moved the definition of fixed-width integer types to
'32bit/base/fixed_stdint.h'.
For the L4/Fiasco version of Genode, there existed some x86-specific
header files that did not specifically depend on L4/Fiasco, for example
atomic operations. Because these files are not L4/Fiasco-specific and
may become handy for other platforms as well, we moved them to the
generic 'base' repository.
Linux 32bit
===========
:Dissolving Genode's dependency from the glibc:
The port of the C runtime to Genode posed an interesting challenge to
the Linux version of Genode. This version used to rely on certain
functions provided by the underlying glibc:
* For creating and destroying threads, we used to rely on POSIX threads
as provided by the 'pthread' library
* The lock implementation was based on the POSIX semaphore functions
'sem_init', 'sem_wait', and 'sem_post'
* Shared memory was realized by using files ('open', 'close',
'ftruncate') and the 'mmap' interface
* Starting and killing processes was implemented using 'fork' and 'kill'
* Inter-process communication used the glibc's socket functions
For our custom C runtime, we want to override the glibc functionality
with our own implementation. For example, we want to provide the 'mmap'
interface to a Genode application by implementing 'mmap' with
functions of our base API. On Linux, however, this base API, in turn,
used to rely on 'mmap'. This is just an example. The problem applies
also for the other categories mentioned above. We realized that we cannot
rely on the glibc on one hand but at the same time replace it by a custom
C runtime (in fact, we believe that such a thing is possible by using
awkward linker magic but we desire a clean solution). Consequently, we
have to remove the dependency of Genode from the glibc on Linux. Step
by step, we replaced the used glibc functions by custom Linux system-call
bindings. Each binding function has a prefix 'lx_' such that the symbol
won't collide with 'libc' symbols. The new bindings are located at the file
'base-linux/src/platform/linux_syscalls.h'. It consist of 20 functions,
most of them resembling the original interface ('socket', 'connect',
'bind', 'getsockname', 'recvfrom', 'write', 'close', 'open', 'fork',
'execve', 'mmap', 'ftruncate', 'unlink', 'tkill', 'nanosleep').
For other functions, we simplified the semantics for our use case
('sigaction', 'sigpending', 'sigsetmask', 'create_thread'). The most
noteworthy changes are the creation and destruction of threads by
directly using the 'clone' and 'tkill' system calls, and the lock
implementation. Because we cannot anymore rely on the convenience of
using futexes indirectly through the POSIX semaphore interface, we
have adopted the simple locking approach that we already use for the
L4/Fiasco version. This lock implementation is a simple sleeping
spinlock.
:Compromises:
The introduction of custom Linux system-call bindings for Genode has
several pros and cons. With this change, The Linux version of Genode is
not anymore easy to port to other POSIX platforms such as the Darwin
kernel. For each POSIX kernel used as Genode platform, a custom
implementation of our system-call bindings must be created. The
original POSIX variant could still be reanimated, but this version
would inherently lack support for Genode's C runtime, and thus would
have limited value. A positive side effect of this solution, however,
is that 'linux_syscalls.h' documents well the subset of the Linux'
kernel interface that we are actually using.
The replacement of POSIX semaphores with sleeping spinlocks decreases
locking performance quite significantly. In the contention case, the
wakeup from sleeping introduces a high latency of up to one millisecond.
Furthermore, fairness is not guaranteed and the spinning produces a bit
of system load. If this approach turns out to become a serious performance
bottleneck, we will consider creating custom bindings for Linux' futexes.
L4/Fiasco
=========
The concepts of _RM_faults_ and _managed_dataspaces_ as described in
Section [Base framework], had been implemented into the L4/Fiasco
version of core. Although the introduction of these concepts involved
only minimal changes at the API level, the required core-internal
changes had been quite invasive, affecting major parts of the pager
and RM-session implementations.
Prior versions of the L4/Fiasco version of core did not implement
the _cancel-blocking_mechanism_ as specified by the CPU-session API.
The missing implementation resulted in lock-ups when destructing a
thread that blocks for lock. With the new implementation based on
L4/Fiasco's inter-task ex-regs system call, such threads can now
be gracefully destructed.

460
doc/release_notes/09-02.txt Normal file
View File

@@ -0,0 +1,460 @@
==============================================
Release notes for the Genode OS Framework 9.02
==============================================
Genode Labs
Summary
#######
Whereas the focus of the previous release 8.11 was the refinement of
Genode's base API and the creation of the infrastructure needed to build
real-world applications, the release 9.02 is focused on functional
enhancements in two directions. The first direction is broadening the
number of possible base platforms for the framework. At present, most
microkernels bring along a custom user land, which is closely tied to the
particular kernel. Our vision is to establish Genode as a common ground for
developing applications, protocol stacks, and device drivers in such a way
that the software becomes easily portable among different kernels. This
release makes Genode available on the L4ka::Pistachio kernel. Hence,
software developed with the Genode API can now run unmodified on
Linux/x86, L4/Fiasco, and L4ka::Pistachio. In the second direction, we
are steadily advancing the functionality available on top of Genode. With
this release, we introduce a basic networking facility and support for
native Qt4 applications as major new features. Thanks to Genode's
portability, these features become automatically available on all
supported base platforms.
Our original plan for the release 9.02 also comprised the support of a
Linux-on-Genode (para-)virtualization solution. Initially, we intended to
make [https://os.inf.tu-dresden.de/L4/LinuxOnL4/ - L4Linux] available on
the L4/Fiasco version of Genode. However, we identified several downsides
with this approach. Apparently, the development of the officially available
version of L4/Fiasco has become slow and long-known issues remain unfixed.
L4Linux, however, is closely tied to L4/Fiasco and the L4 environment. For
us at Genode Labs, maintaining both a custom port of L4Linux for Genode
and L4/Fiasco by ourself in addition to developing Genode is unfeasible.
In contrast, the Pistachio kernel features more advanced options for
virtualization ([http://l4ka.org/projects/virtualization/afterburn/ - Afterburner]
and VT support) that we want to explore. Furthermore, there exists another
version of L4Linux called OKLinux for the OKL4 kernel developed at
[http://ok-labs.com - OK-Labs], which is very interesting as well.
Therefore, we decided against an ad-hoc solution and deferred this feature
to the next release. [https://genode.org/about/road-map - See our updated road map...]
Major new Features
##################
Genode on L4ka::Pistachio
=========================
From the very beginning, the base API of the Genode OS Framework was
designed for portability. We put a lot of effort into finding API
abstractions that are both implementable on a wide range of kernels and as
close to the hardware as possible to keep the abstraction overhead low. For
this reason, we developed the framework in parallel for the Linux kernel and
the L4/Fiasco kernel. To validate our claim that Genode is highly portable,
Julian Stecklina ported the framework to another member of the L4 family,
namely the [http://l4ka.org/projects/pistachio/ - L4ka::Pistachio kernel].
This high-performance kernel implements the latest official L4 API called
L4.x2 and has a number of advanced features such as multi-processor support
and virtualization support.
After Julian successfully created the first Pistachio version of Genode,
we successively refined his work and conducted further unifications among
the platform-dependent code for the different kernels. The result of this
effort is included in this release and comes in the form of the
'base-pistachio' source-code repository.
;Interesting technical notes:
* The IRQ handling on Pistachio is slightly different from L4/Fiasco.
On L4/Fiasco, an IRQ becomes unmasked only when the user-level IRQ
handler thread blocks for an IRQ by issuing an IPC call to the
kernel's corresponding IRQ thread. In contrast, Pistachio unmasks an
IRQ as soon as the user-level IRQ handler associates itself with an
IRQ. Thus, an IRQ message may occur not only when the user-level IRQ
handler blocks for any IRQ but anytime. In particular, IRQ messages
may interfere with the IRQ handler's IPC communication with other
threads. To ensure that IRQ messages do only occur when expecting
them, we lazily associate the IRQ handler thread to the IRQ the
first time we wait for an IRQ and issue an unmasking IPC call
subsequent times.
* Genode provides a mechanism for gracefully destructing threads that
are in a blocking state, for example waiting for an IPC message.
Such a thread may hold locks or other resources that would not
get properly freed when just killing the thread by force. Therefore,
Genode provides a way to issue the cancellation of a blocking
operation by another thread (e.g., the thread calling the destructor).
Once, a blocking operation got canceled, a C++ exception
('Blocking_canceled') is raised such the thread can fall back into
a defined state and then be destructed. On L4ka::Pistachio, we use
Pistachio's pager-exchange-registers feature in combination with
the user-defined UTCB handle for cancelling blocking operations and
detecting cancellations. The interesting code bits can be found in
'src/base/ipc/ipc.cc', 'src/base/lock/lock.cc',
'src/core/platform_thread.cc', and in the Pistachio-specific
timer-service implementation.
* During the refinement of the Pistachio version, we were able to further
generalize code that was previously specific for L4/Fiasco and
L4ka::Pistachio respectively. Now, the platform-specific code comprises
less than 3,000 lines of code (LOC) for L4/Pistachio, circa 2,000 LOC
for L4/Fiasco, and circa 1,000 LOC for Linux. Hence, we expect that
porting the framework to further kernels is possible at reasonable
engineering costs.
:Current limitations:
* The current version does not use superpages (4M mappings) because we
experienced problems with mapping 4K pages out of 4M pages. This is an
issue that we like to investigate further because using 4M mappings
would improve the boot time and reduce the kernel-memory usage.
* Currently, we use a simple sleeping spinlock for synchronization, which
is not optimal for several reasons. There are no fairness guarantees,
the spinning consumes CPU time, and threads that got blocked in the
contention case are woken up at the coarse granularity of the kernel's
timer tick, which is typically one millisecond.
* Nested RM sessions as introduced as an experimental feature in the
Genode release 8.11 are not yet supported.
:Further details:
You can find further technical details and usage instructions at this
dedicated [https://genode.org/documentation/platforms/pistachio - page].
Qt4 on Genode
=============
The minimalism of the Genode OS Framework with regard to its code
complexity raised the question of whether this framework is feasible
for hosting real-world applications and widely used runtime environments.
Christian Prochaska took the challenge to port Trolltech's Qt4 application
framework, which serves as the basis for the popular KDE desktop, to Genode.
Because Christian started his work more than a year ago at a time when no
C library was available on Genode, several intermediate steps were needed.
The first step was the integration of the Qt4 tools such as the meta-object
compiler (moc) and resource compiler properly into the our build systion.
With the tools in place, the Linux version of Genode came to an advantage.
In this environment, a Genode application is able to use glibc functionality.
So the problem of a missing C library could be deferred and Christian was
able to focus on interfacing Qt with the existing Genode services such as
the Nitpicker GUI sever. Next, the glibc dependencies were successively
replaced by custom implementations or simple dummy stubs. Thereby, all
needed functionalities such as timed semaphores and thread-local storage
had to be mapped to existing Genode API calls. Once, all glibc dependencies
had been dissolved, Qt could be compiled for the L4/Fiasco version.
Since a C library has become available in Genode 8.11, we were able to
replace Christian's intermediate stub codes with a real C library. We also
utilize recently added features of Genode such as its alarm framework to
simplify the Qt4 port. Furthermore, we were able to remove all
platform-specific bits such that the Qt4 port has now become completely
generic with regard to the underlying kernel. Qt4 can be executed on Linux,
L4/Fiasco, and L4ka::Pistachio without any changes. Figure [qt4_screenshot]
shows a screenshot of Qt's Tetrix example running side-by-side with native
Genode applications.
[image qt4_screenshot]
:Current state:
* The Qt4 port comes in the form of a source-code repository, which contains
all Qt source codes, and some example programs such as Tetrix. You can
download the Qt4 repository as a separate archive at the download page of
the Genode release 9.2. For the next release, we plan to separate the
Genode-specific parts from Qt original code and make the Genode-specific
parts a regular component of the Genode main line.
* The Qt4 port consists of Qt's Core library, GUI library, Script library,
XML library, and the UI tools library. Other libraries such as Webkit
are not ported yet.
* This first version of Qt4 on Genode is not to be considered as stable.
There are several known issues yet to be addressed. In particular,
the 'QEventDispatcher' is still work in progress and not fully stabilized.
* Because, we use to statically link programs, the binaries of Qt
applications are exceedingly large. For example the Tetrix binary is
100MB including debug information and 11MB in the stripped form. For
employing Qt on Genode at a larger scale, Genode should be enhanced with
shared-library support.
Networking
==========
With Genode 8.11, we introduced the Device-Driver-Environment Kit (DDE Kit)
API, which is a C API specifically designed for implementing and porting
device drivers written in plain C. We have now complemented DDE Kit with an
environment for executing Linux device drivers natively on Genode. This
library is called 'dde_linux26' and contained in our new 'linux_drivers'
source-code repository. The environment consists of several parts, which
correspond to the different sub systems of the Linux kernel 2.6, such as
'arch', 'drivers', 'kernel'.
The first class of device-drivers supported by DDE Linux 2.6 is networking.
At the current stage, the DDE Linux network library comprises general
network-device infrastructure as well as an exemplary driver for the PCnet32
network device.
Based on this library, we have created a basic TCP/IP test utilizing the
uIP stack, which uses the DDE Linux network library as back end. The test
program implements a basic web server displaying uIP packet statistics.
When executed on Qemu, you can use your host's web browser to connect to
the web server running on Genode:
For booting Genode on L4/Fiasco with the web-server demo, use a GRUB
entry in your 'menu.lst' file as follows.
! title Genode: DDE Linux 2.6 NET on L4/Fiasco
! kernel /fiasco/bootstrap -maxmem=64 -modaddr=0x02000000
! module /fiasco/fiasco -nokd -serial -serial_esc
! module /fiasco/sigma0
! module /genode/core
! module /genode/init
! module /config
! module /genode/timer
! module /genode/pci_drv
! module /genode/test-dde_linux26_net
The first four lines are L4/Fiasco specific. When using L4ka::Pistachio,
the 'menu.lst' entry looks like this:
! title Genode: DDE Linux 2.6 NET on L4/Pistachio
! kernel /pistachio/kickstart
! module /pistachio/x86-kernel
! module /pistachio/sigma0
! module /genode/core
! module /genode/init
! module /config
! module /genode/timer
! module /genode/pci_drv
! module /genode/test-dde_linux26_net
The web-server test requires the PCI bus driver and the timer service.
Therefore, the 'config' file for Genode's init should have following
content:
! <config>
! <start>
! <filename>timer</filename>
! <ram_quota>512K</ram_quota>
! </start>
! <start>
! <filename>pci_drv</filename>
! <ram_quota>512K</ram_quota>
! </start>
! <start>
! <filename>test-dde_linux26_net</filename>
! <ram_quota>16M</ram_quota>
! </start>
! </config>
Now, its time to create an ISO image from all files specified in
the GRUB configuration. For this, the new utility 'tool/create_iso'
becomes handy. The ISO image can then be booted on Qemu using the
following arguments:
! qemu -m 64 -serial stdio -no-kqemu -cdrom <iso-image> \
! -net nic,model=pcnet -net user -redir tcp:5555::80
The '-redir' argument tells qemu to redirect TCP connections with
localhost:5555 to the guest OS at port 80. After having booted
up Genode on Qemu, you can use your host's web browser to access
the web server:
! firefox http://localhost:5555
:Notes about using the TAP version:
* Preparations
* You must be permitted to sudo and have installed the tunctl
utility. Under Debian/Ubuntu execute
! sudo apt-get install uml-utilities
* Create TAP device
! TAPDEV=$(sudo tunctl -b -u $USER)
! sudo /sbin/ifconfig $TAPDEV 10.0.0.1
* setup DHCP server on $TAPDEV and 10.0.0.0/8
* Run qemu
! qemu -m 64 -serial stdio -no-kqemu -cdrom dde.iso \
! -net nic,model=pcnet \
! -net tap,ifname=$TAPDEV,script=no,downscript=no
* Ping
* Cleanup
* Stop DHCP server
* Remove TAP device
! sudo tunctl -d $TAPDEV
Operating-system services and libraries
#######################################
C Runtime
=========
We have replaced the 'malloc' implementation of the original FreeBSD C
library with a custom implementation, which relies on Genode's 'Heap' as
allocator. The FreeBSD libc reserves a default memory pool of 1MB, which
is no problem on FreeBSD because virtual memory is backed lazily with
physical pages on demand. On Genode however, we immediately account the
allocated memory, which implicates high quota requirements even for
applications that use little memory. In contrast, Genode's heap allocates
and accounts its backing store in relatively small chunks of a few KB.
Therefore, the quota accounting for applications is much more in line with
the actual memory usage. Furthermore, our custom 'malloc' implementation
has the additional benefit of being thread safe.
* Added i386-specific parts of gen lib, in particular longjmp, setjmp.
Device-Driver-Environment Kit
=============================
* The DDE Kit uses our alarm framework (located in the 'os' repository) now
rather than its own event-scheduler implementation formerly called 'Tick'.
* We refined the DDE Kit API and reduced the number of custom types. For
example, we removed the custom 'dde_kit_lock_t' and using
'struct dde_kit_lock' instead, and replaced 'dde_kit_thread_t' with
'struct dde_kit_thread'.
Because of the apparent stabilization of the DDE Kit API, we have now added
this API to Genode's official API reference.
[https://genode.org/documentation/api/dde_kit_index - See the documentation of the DDE Kit API...]
PS/2 input driver
=================
We improved the PS/2 keyboard driver by adding missing scan-code translations
for the scan code set 1, in particular the cursor keys.
Applications
############
Launchpad configuration
=======================
Launchpad is a graphical application for interactively starting and killing
programs. It is used for the default demonstration of Genode. By default,
launchpad displays a preconfigured list of programs and their respective
default memory quotas. The user can tweak the memory quota for each entry
with mouse and then start a program by clicking on its name. As an
alternative to using the default list, you can now define the list manually
by supplying a configuration to Launchpad. The following example tells
launchpad to display a list of two launcher entries:
!<config>
! <launcher>
! <filename>sdl_pathfind</filename>
! <ram_quota>10M</ram_quota>
! </launcher>
! <launcher>
! <filename>liquid_fb</filename>
! <ram_quota>10M</ram_quota>
! </launcher>
!</config>
To use this configuration for a Launchpad started via init, you can simply
insert the launchpad configuration into the '<start>' node of the launchpad
entry in init's 'config' file.
Platform-specific changes
#########################
L4/Fiasco
=========
* Raise 'Blocking_canceled' exceptions on canceled IPC calls
32-bit Linux
============
* We continued dissolving the dependency of Genode from the glibc by using
a custom 'getenv' implementation used during process creation.
* By default, we compile now with '-nostdinc' and explicitly specify
'/usr/include' as include search directory only when needed. Previously,
a Genode application, which included a host include file by mistake, has
not raised any compilation error when compiled for the Linux version of
Genode. Now, all Genode platforms behave equally with regard to include
search directories.
* We enforce using the actual compiler's C++ support libraries rather than
the default libraries installed on the host.
Tools and build infrastructure
##############################
Official tool chain
===================
At the download section of our website, we used to provide a crosstool-based
tool chain as pre-compiled binaries. Since we got several requests about
how to build such a tool chain from scratch, we created custom utility for
downloading, building, and installing the official Genode tool chain. You
can find the utility at 'tool/tool_chain'. For usage instructions, just
start 'tool_chain' without arguments. Because this utility is a plain script,
you can follow and verify each step that we use for creating the Genode tool
chain. Currently, this official tool chain is based on binutils 2.18 and
gcc 4.2.4.
As an alternative to installing the tool chain from source, we also
provide pre-compiled binaries at the download section of our website.
[https://genode.org/download/tool-chain - Visit our tool-chain download website...]
For the Linux version of Genode, we still use the host's default gcc
as tool chain. This way, we spare the hassle of downloading and installing
a custom tool chain for somebody who wants to give Genode a quick try.
With this is mind, we have fixes several small issues with gcc 4.3.2:
* Fixed dependency generation for gcc-4.3.2. Older version of gcc used to
append a '.o' dependency at the target of '.d'-files. However, gcc-4.3.2
seems to handle the option '-MT' differently, resulting in a rule that
contains only the '.d' as target. Now, we explicitly specify both the
'.o' file and the '.d' file as target. Consequently, on older gcc
versions, the '.o' file appears twice but that is no problem.
* Fixed assembler issue with the 'fnstsw' instruction in the C library.
This instruction does not accept eax but only ax as argument.
Build-directory creation tool
=============================
We added a rule for creating a pre-configured build directory for the
Pistachio version to our build-directory creation tool
('tool/builddir/create_builddir'). Furthermore, we changed the default
build configuration such that the official Genode tool chain is used for
L4/Fiasco and L4ka::Pistachio.
Build system
============
* Improved clean rule - visit each target directory only once
* Stop the build process on the first error by default, for continuing
the build process depite of an error, you can use the '-i' argument
of make.
* Compiler flags can now be set specific for compiling C and C++ sources.
This is needed because both variants allow different sets of warning
options. The new variables are called 'CC_CXX_OPT' and 'CC_C_OPT'.
ISO image creation tool
=======================
We have created a convenient front end for 'genisoimage', which we
use for testing Genode on Qemu. You can find this ISO-image-creation
tool at 'tool/create_iso'. For usage instructions, simply start the
tool without arguments.

585
doc/release_notes/09-05.txt Normal file
View File

@@ -0,0 +1,585 @@
==============================================
Release notes for the Genode OS Framework 9.05
==============================================
Genode Labs
Shortly after including support for the L4ka::Pistachio kernel in the
previous release, the Genode version 9.05 gives a further evidence of
Genode's high portability by making the framework available on top of
the OKL4 kernel. This kernel is a commercial-grade microkernel
developed by [http://ok-labs.com - Open Kernel Labs]. In Section
[Supporting the OKL4 kernel as new base platform], we elaborate on the
new base platform and summarize the experiences made during our porting
work.
The previous Genode release was accompanied by a source-code archive containing
the initial version of Qt4 for Genode. Our approach is to make the Qt4
framework available for building Genode applications running natively on the
microkernel rather than within a virtualization environment. As advertised in
our [https://genode.org/about/road-map - road map], we have now seamlessly
integrated the Qt4 framework into our mainline source tree. Furthermore, we
have adapted our port to the Qt4 version 4.5.1. Section [Integration of Qt4
into the mainline repository] gives a rough overview of the changes and an
introduction on how to use the Qt4 framework with Genode.
The third major feature of the release is the addition of preliminary USB
support. We have been able to port major parts of Linux' USB infrastructure
to Genode using the DDE Kit introduced in autumn 2008. Section [USB support]
presents an overview about the pursued design and the current state of
implementation.
Section [OKLinux on Genode] outlines our ongoing efforts of running Linux
as a node in Genode's process tree.
Supporting the OKL4 kernel as new base platform
###############################################
The OKL4 kernel developed by Open Kernel Labs started as a fork of the
L4ka::Pistachio kernel. Whereas L4ka::Pistachio remained true to the L4
x.2 specification, OKL4 was subject of major API changes geared towards high
performance on the ARM architecture. OKL4 earned much fame for executing a
user-level variant of Linux (OKLinux) on top the microkernel, which turned out
to be faster than executing Linux natively on the ARM9 architecture. Even
though OKL4 is primary targeted at the ARM architecture, we wanted to go for
the x86 variant because of two reasons. First, there exists the just mentioned
user-level port of Linux for OKL4, which looks like an attractive way to execute
Linux on Genode once Genode runs on OKL4. Second, we think that distributing
Genode in the form of ISO images bootable on plain PC hardware is the best
way to reach the OS community. Therefore, we decided to use OKL4 version 2.1 as
the base for our work. In contrast to later releases, this version supports
both x86 and ARM. The following section reviews the unique features of the
OKL4 kernel from our perspective.
OKL4 viewed from the angle of a Genode developer
================================================
On the kernel-API level, OKL4 has several interesting properties that had been
both welcome and challenging. We want to highlight the following points:
In contrast to prior L4 kernels, OKL4 has *removed wall-clock timeouts* from
the kernel interface. On L4, timeouts were used as arguments for for blocking
IPC operations serving two purposes. First, specifying IPC timeouts allowed the
IPC caller for regaining control over the blocking thread after the specified
time elapsed. This is considered as important in the case that the called
thread misbehaves and never answers the call. However, the problem of choosing
an appropriate timeout was never properly resolved. When dimensioning the
timeout too small, the called thread may miss the timeout just because it had
no chance to be selected by the scheduler in time. Such timeouts rely on the
presumption that there is low load on the system. On the other hand, when
dimensioning the timeout too high, the system will become sluggish when the
called thread misbehaves. For example, a simple GUI server may want to send
input events to its clients with a timeout to be robust against misbehaving
clients that never wait for events. When choosing a timeout too small, chances
are high that an event will occur at a time when the receiver is handling a
previous event. The timeout would trigger and the event would get lost. When
choosing the timeout too large, say 1 second, any misbehaving client could make
the GUI server freeze for 1 second. Therefore, timeouts for regaining control
over a blocked thread seem to be a bad idea. So we welcome their absence in
OKL4. The second use of timeouts is their use as user-level time source. On L4,
sleep is typically implemented as a blocking IPC with a timeout set to the
sleep value. For this purpose, a system built on top of OKL4 has to employ a
user level device driver accessing a timer device. In Genode, we already have a
timer service for this purpose. So we won't miss timeouts at all.
Classical L4 kernels provide two variants of *synchronous IPC*. So called long
IPC could copy any amount of memory from the sending to the receiving address
space. This is complicated operation because either communication partner may
specify communication buffers that contain unmapped pages. Hence, page faults
may occur during long-IPC operations. On L4, page faults, in turn, are handled
by the user land. Not until a user-level pager thread resolves the page fault
by establishing a mapping at the faulting address, the kernel can proceed the
IPC operation. This sounds pretty complicated, and it is. The second IPC
variant is called short IPC. It constrains the transferable payload to CPU
registers. Hence, these IPC operations should only be used for messages with a
payload of a maximum of 2 machine words. Because short IPCs are never touching
user-level memory pages, no page faults can occur.
On OKL4, there is only one IPC operation, which copies payload from the
sender's user-level thread-control block (UTCB) to the receiver's UTCB. An
UTCB is an always-mapped memory region. Hence no page faults can occur during
IPC operations. On Genode, the UTCB size of 256 bytes may become a limitation
when RPC messages get large. For example, session requests may include large
session-argument strings specifying session-constructor arguments. Current
services rely only on a few arguments so the size limitation is not an
apparent problem. But that may change for future services. Furthermore, in
contrast to L4 x.2, OKL4 does not allow for transferring payload other than
plain data. In particular, OKL4 does not support the transfer of memory
mappings via IPC. Removing memory mappings from the IPC operation is a very
good idea. On Genode, only roottask (core) establishes mappings and shared
memory is implemented as a user-level protocol (data spaces). There is no need
to allow arbitrary processes to establish memory mapping via IPC.
The *boot procedure* of OKL4 largely differs from other L4 kernels. This is
attributed to Open Kernel Labs' focus on embedded systems, which mostly rely on
single-image boot loading. OKL4 employs a tool (elfweaver) for creating a
bootable image from a bunch of files and an XML configuration file. Among the
declarations about which processes to be loaded and which policies to enforce,
the configuration file contains platform parameters such as the amount of
physical memory of the machine. This static approach to configure a system is
certainly useful for embedded systems but PC hardware uses to vary a lot. In
this case, evaluating boot-time memory descriptors would be the preferred
solution.
OKL4 introduces kernel support for *user-level synchronization*. Prior L4
kernels facilitated user-level synchronization through a combination of
synchronous IPC operations with either priorities or delayed preemption.
OKL4's mutexes can make the life in the user land much easier. However, we have
not looked into OKL4 mutexes yet.
There does not exist a recursive *map operation* as the source operand of the
map operation is a physical memory descriptor rather than a virtual address in
the mapper's address space. Consequently, this design eliminates the need for
having a recursive unmap operation and thereby, the need to maintain a mapping
data base in the kernel. This is cool because Genode keeps track of the
mappings at the user level anyway (within core). From our perspective, there is
no need to maintain mapping relationships in the kernel. Removing the mapping
database effectively discards a lot of much-discussed problems about how to
manage the mapping database in a clever way.
There exists *no root memory manager* (sigma0). Because the map operation
takes a physical memory descriptor as argument instead of a virtual address
in the mapper's address space. The mapper does not need to have the mapped
page locally mapped within its own address space. In fact, core (as the only
mapper in a Genode system) does only have very little memory mapped locally.
This design accelerates the boot time because there is no need to map each
physical page in core at startup as performed when running core on the other
L4 kernels.
These differences of OKL4 compared with the microkernels already supported
by Genode posed a number of interesting challenges and opportunities. We have
thoroughly documented the process in
[https://genode.org/documentation/articles/genode-on-okl4 - Bringing Genode to OKL4].
Usage
=====
For using Genode with OKL4, please refer to the following dedicated page:
:[https://genode.org/documentation/platforms/okl4 - Genode on the OKL4 microkernel]:
Site about building and using Genode with the OKL4 kernel.
Limitations of the current implementation
=========================================
The current implementation is able to execute the complete Genode demonstration
scenario on OKL4. This means, we can build and destroy arbitrary trees of
processes, have all the needed infrastructure in place to execute user-level
device drivers such as VESA and PS/2, perform inter-process communication
via RPC and shared memory, and have all basic framework API functions available.
We regard the current state as the first functional version. However, there are
the following points that need improvement and are subject to our future work.
:Incomplete timer driver:
On x86, the timer driver should program the PIT to dispatch sleep requests.
However, the I/O ports of the PIT can only by made available to one party in
the system (which naturally would be the timer driver). Unfortunately, there
are some VESA BIOSes around, which try using the PIT directly. The current
version of our VESA driver does not virtualize these accesses. It rather
tries to gain direct access to the I/O ports from core. This would not work
if the timer already uses this device resource. Our plan is to supplement
our VESA driver with a virtual PIT that uses the timer service as back end.
Then we can safely use the PIT by the timer driver.
:Signalling framework not yet implemented:
We have not yet implemented Genode's API for asynchronous notifications
in the OKL4 version. In fact, the goal of the initial version of the
OKL4 support was running the default demonstration scenario, which does
not rely on signals. The second and more technical reason is that we
consider exploiting OKL4's event mechanism for implementing the signalling
API but have not finalized the design. The generic implementation as used
on the other platforms cannot be used on OKL4 because this implementation
utilizes one helper thread per signal transmitter. Within core, each RM
session is a potential signal transmitter, which means that we need to
create a helper thread per process. Unfortunately, by default, OKL4
limits the number of threads within roottask (core) to only 8 threads,
which would impose a severe limit on the number of processes we could
run on OKL4.
:OKL4's kernel mutexes yet to be used:
We have not yet explored the use of mutexes provided by the OKL4 kernel
for implementing Genode synchronization APIs but we rather rely on a
yielding spin lock for now. This has a number of drawbacks such as high
wake-up latencies in the contention case (depending on the scheduling
time slice), no support for priorities, and no fairness. Although it
is a simple and robust solution to start with, we plan to facilitate
the OKL4 kernel feature with our upcoming work.
:Overly simplistic UTCB allocation:
Right now, we allocate a fixed amount of 32 UTCBs per address space and
thereby limit the maximum number of threads per process. In the future,
this limit should be made configurable.
:Managed dataspaces not yet supported:
The support of managed dataspaces relies on the signal API, which is
not yet available for OKL4.
:Message buffers are limited to 256 bytes:
Because OKL4 performs message-based inter-process communication by
copying data between the UTCBs of the communicating threads, the
UTCB size constaints the maximum message size. Therefore, message
must not exceed 256 bytes. This is not a huge problem for the currently
available Genode programs but we can imagine session argument-lists
to become larger in the future.
:Advanced thread functions are incomplete:
Thread functions such as querying registers of remote threads are not yet
implemented.
Integration of Qt4 into the mainline repository
###############################################
Qt4 is a tool kit for developing platform-independent applications. It
comprises a complete platform-abstraction layer and a rich GUI tool kit
widely used for commercial and open-source applications. It is particularly
known as the technical foundation of the KDE project. The previous Genode
release was accompanied by a snapshot of our initial port of Qt4 to Genode. For
the current release, we have turned this proof-of-concept implementation into a
properly integrated part of the Genode mainline development. This enables Qt4
applications to be executed natively on the full range of kernels supported by
Genode.
Usage
=====
We complemented Genode's source tree with the new 'qt4' source-code repository,
which contains the Genode-specific parts of the Qt4 framework. The most
portions for the Qt4 framework are used unmodified and thereby have not been
made part of the Genode source tree. Instead, we fetch the original Qt4 source
code from Trolltech's FTP server. This way, our source tree remains tidy and
neat.
For using Qt4 for your Genode applications, you first need to download and
prepare the original Qt4 source codes and build a few Qt4 tools such as the
meta-object compiler and the resource compiler. The makefile found in the
top-level directory of the 'qt4' repository automates this task:
! make prepare
To include the 'qt4' repository into the Genode build process, just add the
'qt4' directory to the 'REPOSITORIES' declaration of the 'etc/build.conf' file
within your build directory. Make sure that the repositories 'demo' and 'libc'
are included as well. The 'qt4' repository comes with a couple of demo applications.
The 'qt_launchpad' is especially interesting because it makes use of both the
Qt4 framework and the Genode framework in one application.
Features and limitations
========================
The Qt4 port comprises Qt's Core library, GUI library, Script library, XML
library, and the UI tools library.
For using Qt4 on the Linux version of Genode, we recommend using the Genode
tool chain rather than your host's tool chain. Qt4 makes use of a lot of libc
functionality, supplied by Genode's 'libc' repository. However, on Linux we
still link against your host's libc. This becomes a problem if your host
compiler's C++ support code references libc functionality that is not part of
Genode's libc. Thereby the linker will silently create references to glibc
symbols, making both libraries collide. So if using Qt4, we recommend using the
Genode tool chain:
:[https://genode.org/download/tool-chain]:
Information about downloading and using the Genode tool chain
USB support
###########
This release introduces the first fragments of USB support to Genode, taking
the USB human-interface device (HID) class as starting point. With this work,
we follow our approach of reusing unmodified Linux device drivers executed
within a device-driver environment called DDE Linux. In the previous release,
we already utilized this approach for realizing basic networking on Genode.
With this release, we complement DDE Linux with support required by USB
drivers. We are grateful for being able to base our implementation on the
excellent foundation laid by Dirk Vogt. He described his work in
[https://os.inf.tu-dresden.de/papers_ps/beleg-vogt.pdf - USB for the L4 environment].
For USB HID support, we added the Linux USB and input subsystems to the DDE
Linux 2.6 framework. Besides the 'dde_linux26/net.h' API for network drivers
added in Genode 9.02, the current version also includes APIs for input
('dde_linux26/input.h') and USB ('dde_linux26/usb.h'). We intend these
interfaces to mature towards generic driver-library APIs in the future. For
example, BSD-based drivers shall transparently provide the same functionality
as the current Linux drivers, which permits the simple reuse of driver server
implementations.
[image usb_current]
Image [usb_current] illustrates the current implementation of the USB-based
human-interface device (HID) driver. In this monolithic setup, all parts of the
USB stack and the device API are executed within one address space. These parts
are
* Input server glue code
* HID driver and input subsystem
* Core functions for management of USB request buffers (URBs),
attached devices, and registered drivers
* Host controller drivers for UHCI, OHCI, and EHCI
[image usb_aspired]
We regard this as an intermediate step towards our goal to decompose the USB
stack. Image [usb_aspired] shows our aspired design. In this design, the
USB server and one or more USB gadget drivers run in dedicated address spaces.
The USB server provides two interfaces called USB session interface and USB
device interface. A USB session interface corresponds to a virtual root hub,
from which USB devices can be queried. The client of the USB session interface
is usually an USB gadget driver that uses the USB device interface. Because
this interface is used for transferring the actual payload at a potentially
high bandwidth, it is based on shared memory and signals. The USB server
consists of the following components:
* USB server glue code
* Virtual USB device driver managing all attached devices
* Core functions including hardware hub management
* Host controller drivers
The USB server presents a virtual USB hub to each USB gadget driver. Such
a driver consists of:
* Device interface, e.g., input server glue code
* Gadget driver, e.g., HID driver and input subsystem
* Core functions
* Virtual host controller
* USB client glue code
The HID driver uses the USB session API to monitor ports of its virtual root
hub and submit URBs to attached devices. The session interface facilitates the
signalling framework for event notification and a shared-memory dataspace for
URB transmission.
The 'os' repository already contains the USB session and USB device interfaces.
However, the decomposition is not yet in a functional state.
:Current limitations:
The current monolithic implementation of the USB HID service can already be
used as a replacement of the PS/2 driver. However, both drivers cannot be used
at the same time, yet. To enable the use of both USB HID and PS/2, we plan to
create a further component that merges multiple streams of input events and
passes the result to the GUI server.
OKLinux on Genode
#################
According to our road map, we pursued the goal to run Linux as a node in
Genode's process tree. We explored two approaches:
:Reanimating the Afterburner project conducted by the [http://l4ka.org - L4Ka group]:
This approach is the result of the L4Ka groups's long-year experience with
manually supporting L4Linux on top of the L4ka::Pistachio kernel. Because of
the high costs of maintaining the paravirtualized Linux kernel, a
semiautomatic paravirtualization technique was created. According to the
impressive results presented in
[http://www.l4ka.org/l4ka/publ_2006_levasseur-ua_soft-layering.pdf - Pre-Virtualization: Soft Layering for Virtual Machines],
this approach is able to drastically reduce maintenance costs while retaining
good performance. Furthermore, the approach was applied not only to Linux
running on the L4 kernel but also for using Xen or Linux as underlying
host operating systems.
:Porting the OKL4-specific version of L4Linux to Genode:
Open Kernel Labs maintain a custom version of L4Linux that runs on OKL4. This
version is mostly referred to as OKLinux aka Wombat. Since Genode can now use OKL4
as base platform, the reuse of OKLinux in combination with Genode has become
a feasible option.
Both approaches have pros and cons. Whereas Afterburner is a intriguing
approach, this project seems to be stalled. It relies on a rather old tool
chain, and recent Linux features such as thread-local storage support are not
considered, yet. To pick up this solution for Genode will require us to fully
understand the mechanisms and the code. So we consider this as a mid-term
solution. In short term, running OKLinux on Genode is more feasible. We were
already able to create a prototype version of OKLinux running on Genode. This
version starts up the kernel including all Linux kernel threads, mounts the
boot partition supplied as memory image, and starts the init process. The
engineering costs had been rather low. We replaced the Iguana user land
libraries as originally used by Wombat by a Genode-specific reimplementation to
keep our manual adaptions of the Linux kernel code as small as possible.
Our custom reimplementation of the needed Iguana APIs consists of less than
1,000 lines of code (SLOC). The diff for our changes to the OKLinux kernel code
comprises less than 1,000 lines. We plan to make a snapshot of this prototype
publicly available soon.
Operating-system services and libraries
#######################################
Nitpicker GUI server
====================
We optimized the performance of the 'refresh' call, which updates all views of
a session, which display a given buffer portion. The new implementation restricts
the redraw operations to the fragment of each view that displays the specified
buffer portion. The performance improvement becomes most visible when updating
only small parts of a buffer.
USB session interface
=====================
Genode's emerging USB support introduces two new interfaces to the 'os' repository,
which are called USB session and USB device.
An _USB_session_ is a virtual USB bus with just one root hub with 'MAX_PORTS'
downstream ports. The client of such as session submits USB request blocks
(URBs) and is, in turn, informed about port changes on the root hub as well as
request completion. Connected USB devices can be referenced by USB device
capabilities and are associated with one port at the virtual root hub on
server side.
An _USB_device_ references a hardware device connected to a virtual USB bus's
root hub. The device capability enables the client to send USB request
blocks to the hardware device.
Input interface
===============
We updated the key codes of the input interface in response to recent changes
of Linux' 'dev/event' definitions.
VESA driver
===========
Until now, there existed different processes that tried to access the PCI bus
via I/O ports, in particular the VESA framebuffer driver and the PCI bus
driver.
Since core enforces that each I/O port can only be assigned exclusively to one
component in the system, multiple processes that need access to the same I/O
ports cannot run at the same time. For our default demonstration scenario, we
had been able to allow the VESA driver to use the PCI I/O ports because nobody
else needed them. However, our growing base of device drivers relies on the
PCI bus driver. To be able to use the VESA driver together with other drivers,
we virtualized the access to the PCI bus from within the VESA driver.
Our current PCI virtualization code is pretty limited. The VESA driver sees a
virtual PCI bus with only the VGA card attached. For now, we only allow reading
the PCI configuration space of this device, but not writing to it. Apparently,
this simple approach is sufficient to run the VESA BIOS of Qemu. However, other
VESA BIOS implementations may need further access to the PCI device's
configuration space. For example, for querying the size of a PCI resource,
write access to base address registers is required. In such an event, the VESA
driver will print a message about the missing virtualization feature:
! writing data register not supported
If you see such a message, we are very interested to see your log output such
that we can enhance our PCI virtualization code as needed. Please contact us!
Base framework
##############
In the process of bringing Genode to the OKL4 kernel, we have generalized much
of former platform-specific code:
* The initialization of C++ exception handling has now become part of the
generic 'cxx' library in the 'base' repository. All platforms except
Linux are using this generic library now.
* The 'server' library used to contain a platform-specific part that
implemented the 'manage' function of a 'Server_entrypoint'. The
generalized version of this library is now being used on all platforms
other than Linux.
* We unified core-internal interfaces and their implementations such as
'Dataspace_component', 'Cap_session_component', 'Rm_session_component',
and 'Irq_session_component'. The result has become part of the 'base'
repository.
* On OKL4, threads need to execute small startup code for querying their
own thread IDs. Therefore, we have extended the 'Thread_base' interface
with a platform-specific hook function called '_thread_bootstrap'.
* The types defined in 'base/native_types.h' had been complemented by a
new 'Native_thread_id' type. This type is exclusively used by core and the
framework libraries. For using the Genode API, this type is meaningless.
* For the 64bit support, we slightly refined the interfaces of some utility
template functions in 'util/misc_math.h'. Furthermore, parts of the generic
marshalling code of the IPC framework needed refinement, but no API changes
were needed.
Linux-specific changes
######################
Adaptation to 64 bit
====================
Because most Genode developers tend to work with the Linux version of Genode,
supporting 64-bit Linux becomes increasingly important. With the current release,
we start to officially support 64-bit Linux as base platform. This comes
along with the following changes:
* We replaced the 'spec-x86.mk' file with new 'spec-x86_32.mk' and 'spec-x86_64.mk'
files. The default version of 'base-linux/etc/specs.conf' automatically
chooses the right spec file according to the output of 'uname -m'. Therefore,
output of the build processes matches your host architecture. This behaviour
can be changed by placing a customized 'spec.conf' file in your build directory's
'etc/' subdirectory.
* We added type definitions for 64-bit-specific fixed-size integers in the form
of a 64-bit-specific 'fixed_stdint.h' file.
* Because using 64 bit instead of 32 bit changes the payload size of RPC
messages, we had to adjust several message buffers such as 'Ram_session_client'
and 'Input::Session_client', and adapted the used stack sizes.
* Towards the goal of completely dissolving Genode's dependency on the Linux' glibc,
we implemented custom system-call bindings. Apparently, Linux' syscall interface
differs between 32 bit and 64 bit. For example, the 32-bit version handles
all socket-related calls via a compound 'socketcall' whereas the 64-bit
version uses distinct syscalls. Another difference is the handling of the
'mmap' syscall and different behaviour of 'tkill'. The latter problem was
resolved by replacing 'tkill' with 'tgkill' and setting the thread-group
argument of the corresponding PID. Therefore, a 'Native_thread_id' on Linux
now comprises both the TID and the PID.
* The 'Platform_env' on Linux contains a local implementation of the 'Rm_session'
interface, which uses 'mmap' to attach dataspaces to the process' address
space and maintains the region list in the form of a static array. This array
was dimensioned to 256 entries, which constrained the maximum amount of
usable memory when allocating a lot of small blocks via Genode's heap. Since
the heap allocates backing store at the granularity of only 16KB, the worst
case for reaching this limit was about 4MB. This was OK for our simple test
applications. But for using Qt4, in particular on 64 bit, this has become a
serious limitation. For now, we increased the region limit to 4096 and plan
to replace the static array with a dynamically growing data structure.
Furthermore, we made the heap granularity depend on the actual machine-word
size. Therefore, the heap allocates its backing store in 32KB blocks when
running on 64 bit.
Debugging hooks
===============
On Linux, we use gdb for debugging Genode. This is feasible as long as the
targeted process is running. However, during low-level debugging, we had the
recurring problem of a thread dying shortly after starting up. So we added a hook
for halting a thread at the startup in order to be able to attach gdb to the
thread before it dies. This simple hook lets the thread wait for a key press by
directly calling the 'read' syscall. We also added a simple debug facility for
printing debug messages bypassing Genode's LOG service by calling the 'write'
syscall directly. Both hooks are now part of the Linux version of the 'env'
library (see 'base-linux/src/base/env/debug.cc'). Note that these hooks are not
part of the Genode API. There exists no header file.

1016
doc/release_notes/09-11.txt Normal file

File diff suppressed because it is too large Load Diff

1224
doc/release_notes/10-02.txt Normal file

File diff suppressed because it is too large Load Diff

1211
doc/release_notes/10-05.txt Normal file

File diff suppressed because it is too large Load Diff

871
doc/release_notes/10-11.txt Normal file
View File

@@ -0,0 +1,871 @@
===============================================
Release notes for the Genode OS Framework 10.11
===============================================
Genode Labs
During the past three months, the Genode project was primarily driven by our
desire to create a bigger picture out of the rich set of components that we
introduced over time, in particular over the last year. Looking back at the
progress made since mid 2009, there were many functional additions to the
framework, waiting to get combined. To name a few, we added support for
networking, audio output, real-time priorities, mandatory access control,
USB, ATAPI block devices, Python, hardware-accelerated 3D graphics, Qt4,
the WebKit-based Arora browser, and the paravirtualized OKLinux kernel.
So many wonderful toys waiting to get played with. This is how the idea of
creating [https://genode.org/download/live-cds - the new Genode Live CD] was
born. In the past, Genode was mostly used in settings with a relatively static
configuration consisting of several components orchestrated to fulfill
a few special-purpose functions. Now, the time has come for the next step,
creating one dynamic setup that allows for the selection of different subsystems
at runtime rather than at boot time.
This step is challenging in several ways. First, the processes that form
the base system have to run during the entire time of all demo setups. If
any of those processes contained stability problems or leaked memory, it would
subvert the complete system. Second, the components of all subsystems combined
are far too complex to be loaded into memory at boot time. This would not
only take too long but would consume a lot of RAM. Instead, those components
and their data had to be fetched from disk (CDROM) on demand. Third, because
multiple demo subsystems can be active at a time, low-level resources such as
networking and audio output must be multiplexed to prevent different
subsystems from interfering with each other. Finally, we had to create a
single boot and configuration concept that is able to align the needs of all
demos, yet staying manageable.
Alongside these challenges, we came up with a lot of ideas about how Genode's
components could be composed in new creative ways. Some of these ideas such
as the browser-plugin concept and the http-based block server made it onto
the Live CD. So for producing the Live CD, we not only faced the said
technical challenges but also invested substantial development effort in new
components, which contributed to our overall goal. Two weeks ago, we released
the Live CD. This release-notes document is the story about how we got there.
To keep ourself focused on the mission described above, we deferred the
original roadmap goal for this release, which was the creation of a Unix-like
runtime environment to enable compiling Genode on Genode. This will be the
primary goal for the next release.
Execution environment for gPXE drivers
######################################
Up to now, DDE Linux provided Genode with drivers for hardware devices
ranging from USB HID to WLAN. In preparation of the live CD, we
noticed the demand for support of a broader selection of ethernet
devices. Intel's e1000 PCI and PCIe cards seemed to mark the bottom
line of what we had to support. The major advantage of NIC drivers
from Linux is their optimization for maximum performance. This emerges
a major downside if DDE Linux comes into play: We have to provide all
the nifty interfaces used by the driver in our emulation framework. To
achieve our short-term goal of a great live CD experience, we had to
walk a different path.
[https://gpxe.org/ - gPXE] is a lovely network boot loader / open-source
PXE ROM project and the successor of the famous Etherboot
implementation. Besides support for DNS, HTTP, iSCSI and AoE, gPXE
includes dozens of NIC drivers and applies a plain driver framework.
As we were also itching to evaluate DDE kit and the DDE approach at
large with this special _donator OS_, we went for implementing the
device-driver environment for gPXE (DDE gPXE).
The current version provides drivers for e1000, e1000e, and pcnet
devices. The emulation framework comprises just about 600 lines of
code compared to more than 22,000 LOC reused unmodified from gPXE.
Benchmarks with the PCNet32 driver showed that DDE gPXE's performance
is comparable to DDE Linux.
The gPXE driver environment comes in the form of the new 'dde_gpxe'
repository. For building DDE gPXE, you first need to download and patch
the original sources. The top-level makefile of this repository automates
this task. Just issue:
! make prepare
Now, you need to include the DDE gPXE repository into your Genode
build process. Just add the path to this directory to the
'REPOSITORIES' declaration of the 'etc/build.conf' file within your
build directory, for example
! REPOSITORIES += $(GENODE_DIR)/dde_gpxe
After successful build the DDE gPXE based ethernet driver is located
at 'bin/gpxe_nic_drv'.
On-demand paging
################
In the [https://genode.org/documentation/release-notes/8.11#section-8 - release 8.11],
we laid the foundation for implementing user-level dataspace managers.
But so far, the facility remained largely unused except for managing thread
contexts. This changed with this release.
So what is a user-level dataspace manager and who needs it? In short,
Genode's memory management is based on dataspaces. A dataspace is a
container for memory. Normally, it is created via core's RAM or ROM
services. The RAM service hands out dataspaces containing contiguous
physical memory. After allocating such a RAM dataspace, the creator can
attach the dataspace to its own address space to access the dataspace
content. In addition, it can pass a dataspace reference (called dataspace
capability) to other processes, which, in turn, can than attach the same
dataspace to their local address space, thereby establishing shared memory.
Similarly, core's ROM service hands out boot-time binary data as dataspaces.
For the most use cases of Genode so far, these two core services were the
only dataspace providers needed. However, there are use cases that require
more sophisticated memory management. For example, to implement swapping,
the content of a dataspace must be transferred to disk in a way that
is transparent to the users of the dataspace. In monolithic kernels, such
functionality is implemented in the kernel. But on a multi-server OS
such as Genode, this is no option. Implementing such a feature into
core would increase the trusted computing base of all applications
including those who do not need swapping. Core would need a hard-disk
driver, effectively subverting the Genode concept. Other examples for
advanced memory-management facilities are copy-on-write memory and
non-contiguous memory - complexity we wish to avoid at the root of the
process tree. Instead of implementing such memory management facilities
by itself, core provides a mechanism to let any process manage dataspaces.
This technique is also called user-level page-fault handling.
For the Live CD, we decided to give Genode's user-level page-fault handling
facility a go. The incentive was accessing files stored on CDROM in an
elegant way. We wanted to make the CDROM access completely transparent to
the applications. An application should be able to use a ROM session as
if the file was stored at core's ROM service. But instead of being
provided by core, the session request would be delegated to an
alternative ROM service implementation that reads the data from disk
as needed. Some of the files stored in the CDROM are large. For example,
the disk image that we use for the Linux demo is 160MB. So reading
this file at once and keeping it in memory is not an option. Instead, only
those parts of the file should be read from disk, which are actually
needed. To uphold the illusion of dealing with plain ROM files for
the client, we need to employ on-demand-paging in the CDROM server.
Here is how it works.
# The dataspace manager creates an empty managed dataspace. Core
already provides a tool for managing address spaces called
region manager (RM service). A RM session is an address space,
to which dataspaces can be attached. This is exactly what is
needed for a managed dataspace. So a dataspace manager uses the
same core service to define the layout of a managed dataspace
as is used to manage the address space of a process. In fact,
any RM session can be converted into a managed dataspace.
! enum { MANAGED_DS_SIZE = 64*1024*1024 };
! Rm_connection rm(0, MANAGED_DS_SIZE);
This code creates a RM session with the size of 64MB. This is an empty
address space. A dataspace capability that corresponds to this address
space can then be requested via
! Dataspace_capability ds = rm.dataspace();
# The dataspace capability can be passed to a client, which may
attach the dataspace to its local address space. Because the
managed dataspace is not populated by any backing store, however,
an access would trigger a page fault, halting the execution of
the client. Here, the page-fault protocol comes into play.
# The dataspace manager registers itself for receiving a signal each time
a fault occurs:
! Signal_receiver rec;
! Signal_context client;
! Signal_context_capability sig_cap = rec.manage(client);
! rm.fault_handler(sig_cap);
When an empty part of the managed dataspace is accessed by any
process, a signal is delivered. The dataspace manager can then
retrieve the fault information (access type, fault address) and
dispatch the page fault by attaching a real dataspace at the
fault address of the managed dataspace. In a simple case, the code
looks as follows:
! while (true) {
! Signal signal = rec.wait_for_signal();
! for (int i = 0; i < signal.num(); i++) {
! Rm_session::State state = rm.state();
! ds = alloc_backing_store_dataspace(PAGE_SIZE);
! rm.attach_at(ds, state.addr & PAGE_MASK);
! }
! }
This simple page-fault handler would lazily allocate a page of
backing store memory each time a fault occurs. When the backing
store is attached to the managed dataspace, core will automatically
wake up the faulted client.
# The example above has the problem that the dataspace manager has
to pay for the backing store that is indirectly used by the client.
To prevent the client from exhausting the dataspace manager's memory,
the dataspace manager may choose to use a limited pool of backing
store only. If this pool is exceeded, the dataspace manager can reuse
an already used backing-store block by first revoking it from its
current managed dataspace:
! rm.detach(addr);
This will flush all mappings referring to the specified address
from all users of the managed dataspace. The next time, this
address region is accessed, a new signal will be delivered.
This page-fault protocol has the following unique properties. First,
because core is used as a broker between client and dataspace manager, the
dataspace manager remains completely unaware of the identity of its client.
It does not even need to possess the communication right to the client. In
contrast, all other user-level page-fault protocols that we are aware of
require direct communication between client and dataspace manager. Second,
because dataspaces are used as first-level objects to resolve page faults,
page faults can be handed at an arbitrary granularity (of course, a multiple
of the physical page size). For example, a dataspace manager may decide to
attach backing-store dataspaces of 64K to the managed dataspace. So the
overhead produced by user-level page-fault handler can be traded for the
page-fault granularity. But most importantly, the API is the same across
all kernels that support user-level page fault handling. Thus the low-level
page-fault handling code becomes inherently portable.
Having said that, we have completed the implementation of the described
core mechanisms, in particular the 'detach' facility, for OKL4. The ISO9660
driver as featured on the Live CD implements the 'ROM' interface and
reads the contents of those files from CDROM on demand. It uses a
fixed pool of backing store, operates at a page-fault granularity of
64KB, and implements a simple fifo replacement strategy.
Base framework
##############
There had been only a few changes to the base framework described as
follows.
We unified the core-specific console implementation among all
base platforms and added synchronization of 'vprintf' calls.
The kernel-specific code resides now in the respective
'base-<platform>/src/base/console/core_console.h' files.
We removed the argument-less constructor from 'Allocator_avl_tpl'.
This constructor created an allocator that uses itself for
meta-data allocation, which is the usual case when creating
local memory allocators. However, on Genode, this code is typically
used to build non-memory allocators such as address-space regions.
For these use cases, the default policy is dangerous. Hence, we
decided to remove the default policy.
The 'printf' helper macros have been unified and simplified. The
available macros are 'PINF' for status information, 'PWRN' for warnings,
'PLOG' for log messages, and 'PERR' for errors. By default, the message
types are colored differently to make them easily distinguishable.
In addition to normal messages, there is the 'PDBG' for debugging
purposes. It remains to be the only macro that prints the function name
as message prefix and is meant for temporary messages, to be removed
before finalizing the code.
Genode's on-demand-paging mechanism relies on the signalling framework.
Each managed dataspace is assigned to a distinct signal context.
Hence, signal contexts need to be created and disposed alongside
with managed dataspaces. We complemented the signalling framework
with a 'dissolve' function to enable the destruction of signal
contexts.
Operating-system services and libraries
#######################################
Finished transition to new init concept
=======================================
With the release 10.05, we introduced the
[https://genode.org/documentation/release-notes/10.05#section-0 - current configuration concept of init].
This concept supports mandatory access control and provides flexible
ways for defining client-server relationships. Until now, we maintained
the old init concept. With the current release, the transition to the
new concept is finished and we removed the traditional init.
We retained the support for loading configurations for individual subsystems
from different files but adopted the syntax to the use of attributes.
Instead of
! <configfile>subsystem.config</configfile>
the new syntax is
! <configfile name="subsystem.config"/>
Virtual network bridge (Proxy ARP)
==================================
Since we originally added networking support to Genode, only one program could
use the networking facilities at a time. In the simplest form, such a program
included the network driver, protocol stack, and the actual application. For
example, the uIP stack featured with release 9.02 followed this approach.
In release 9.11 we added the 'Nic_session' interface to decouple the network
driver from the TCP/IP protocol stack. But the 1-to-1 relation between
application and network interface remained. With the current release, we
introduce the 'nic_bridge' server, which is able to multiplex the 'Nic_session'
interface.
The implementation is roughly based on the proxy ARP RFC 1027. At startup, the
'nic_bridge' creates a 'Nic_session' to the real network driver and, in turn,
announces a 'Nic' service at its parent. But in contrast to a network driver
implementing this interface, 'nic_bridge' supports an arbitrary number of
'Nic_sessions' to be opened. From the client's perspective, such a session
looks like a real network adaptor.
This way, it has become possible to run multiple TCP/IP stacks in
parallel, each obtaining a distinct IP address via DHCP. For example,
is has become possible to run multiple paravirtualized Linux kernels
alongside an lwIP-based web browser, each accessing the network via a
distinct IP address.
As a side effect for developing the 'nic_bridge', we created a set
of utilities for implementing network protocols. The utilities are
located at 'os/include/net' and comprise protocol definitions for
ethernet, IPv4, UDP, ARP, and DHCP.
Nitpicker GUI server
====================
Our work on the Live CD motivated several improvements of the Nitpicker
GUI server.
Alpha blending
~~~~~~~~~~~~~~
In addition to nitpicker's plain pixel buffer interface that is compatible
with a normal framebuffer session, each nitpicker session can now have
an optional alpha channel as well as an corresponding input-mask channel
associated. Both the alpha channel and the input mask are contained in the
same dataspace as the pixel buffer. The pixel buffer is followed by
the 8-bit alpha values, which are then followed by the input-mask values.
This way, the presence of an alpha channel does not interfere with the
actual pixel format. Each 8-bit input mask value specifies the user-input
policy for the respective pixel. If the value is zero, user input
referring to the pixel is not handled by the client but "falls through"
the view that is visible in the background of the pixel. This is typically
the case for drop shadows. If the input-mask value is '1', the input
is handled by the client.
With the input-mask mechanism in place, we no longer have a definitive
assignment of each pixel to a single client anymore. In principle, an
invisible client is able to track mouse movements by creating a full-screen
view with all alpha values set to '0' and all input-mask values set to '1'.
Once, the user clicks on this invisible view, the user input gets routed
to the invisible client instead of the actually visible view. This
security risk can be addressed at two levels:
* In X-Ray mode, nitpicker completely disables alpha blending
and the input-mask mechanism such that the user can identify the
client that is responsible for each pixel on screen.
* The use of the alpha channel is a session argument, which is specified
by nitpicker clients at session-creation time. Consequently, this
session argument is subjected to the policy of all processes involved
with routing the session request to nitpicker. Such a policy may permit
the use of an alpha channel only for trusted applications.
_Caution:_ The use of alpha channels implies read operations from
the frame buffer. On typical PC graphics hardware, such operations are
extremely slow. For this reason, the VESA driver should operate in
buffered mode when using alpha blending in Nitpicker.
Tinted views in X-Ray mode
~~~~~~~~~~~~~~~~~~~~~~~~~~
We added support for tinting individual clients or groups of clients
with different colors based on their label as reported at session-creation
time. By using session colors, nitpicker assists the user to tell apart
different security domains without reading textual information. In
addition to the tinting effect, the title bar presents the session
color of the currently focused session.
The following nitpicker configuration tints all views of the launchpad
subsystem in blue except for those views that belong to the testnit
child of launchpad. Those are tinted red.
! <config>
! <policy label="launchpad" color="#0000ff"/>
! <policy label="launchpad -> testnit" color="#ff0000"/>
! </config>
Misc Nitpicker changes
~~~~~~~~~~~~~~~~~~~~~~
We introduced a so-called 'stay-top' session argument, which declares
that views created via this session should stay on top of other views.
This function is useful for menus that should always remain accessible
or banner images as used for Live CD.
Nitpicker's reserved region at the top of the screen used to cover up
the screen area as seen by the clients. We have now excluded this area
from the coordinate system of the clients.
We implemented the 'kill' mode that can be activated by the 'kill' key.
(typically this is the 'Print Screen' key) This feature allows the user
to select a client to be removed from the GUI. The client is not
actually killed but only locked out. The 'kill' mode is meant as an
emergency brake if an application behaves in ways not wanted by the
user.
ISO9660 server
==============
As outlined in Section [On-demand paging], we revisited the ISO9660 server
to implement on-demand-paged dataspaces. It is the first real-world
use case for Genode's user-level page-fault protocol. The memory pool
to be used as backing store for managed dataspaces is dimensioned according
to the RAM assigned to the iso9660 server. The server divides this backing
store into blocks of 64KB and assigns those blocks to the managed dataspaces
in a fifo fashion. We found that using a granularity of 64KB improved the
performance over smaller block sizes because this way, we profit from reading
data ahead for each block request. This is particularly beneficial for
CDROM drives because of their extremely long seek times.
Audio mixer
===========
We added a new *channel synchronization* facility to the 'Audio_out_session'
interface. An 'Audio_out_session' refers to a single channel. For stereo
playback, two sessions must be created. At session-creation time, the
client can provide a hint about the channel type such as "front-left" as
session-construction argument. This design principally allows for supporting
setups with an arbitrary amount of channels. However, those channels must
be synchronized. For this reason, we introduced the 'sync_session' function
to the 'Audio_out_session' interface. It takes the session capability of
another 'Audio_out_session' as argument. The specified session is then
used as synchronization reference.
To reduce the latency when stopping audio replay, we introduced a new *flush*
function to the 'Audio_out_session' interface. By calling this function,
a client can express that it is willing to discard all audio data already
submitted to the mixer.
Furthermore, we improved the audio mixer to support both long-running
streams of audio and sporadic sounds. For the latter use case, low latency
is particularly critical. In this regard, the current implementation is a
vast improvement over the initial version. However, orchestrating the
mixer with audio drivers as well as with different clients (in particular
ALSA programs running on a paravirtualized Linux) is not trivial. In the
process, we learned a lot, which will eventually prompt us to further
optimize the current solution.
Nitpicker-based virtual Framebuffer
===================================
To support the browser-plugin demo, we introduced 'nit_fb', which is a
framebuffer service that uses the nitpicker GUI server as back end. It
is similar to the liquid framebuffer as featured in the 'demo' repository
but in contrast to liquid framebuffer, 'nit_fb' is non-interactive.
It has a fixed screen position and size. Furthermore, it does not
virtualize the framebuffer but passes through the framebuffer portion of
the nitpicker session, yielding better performance and lower latency.
If instantiated multiple times, 'nit_fb' can be used to statically arrange
multiple virtual frame buffers on one physical screen. The size and screen
position of each 'nit_fb' instance can be defined via Genode's configuration
mechanism using the following attributes of the 'nit_fb' config node:
! <config xpos="100" ypos="150"
! width="300" height="200"
! refresh_rate="25"/>
If 'refresh_rate' isn't set, the server will not trigger any refresh
operations by itself.
On the Live CD, each browser plugin instantiates a separate instance of
'nit_fb' to present the plugin's content on screen. In this case, the
view position is not fixed because the view is further virtualized by the
loader, which imposes its policy onto 'nit_fb' - Genode's nested
policies at work!
TAR ROM service
===============
For large setups, listing individual files as boot modules in single-image
creation tools (e.g., elfweaver) or multiboot boot loaders can be
cumbersome, especially when many data files or shared libraries are
involved. To facilitate the grouping of files, 'tar_rom' is an
implementation of the 'ROM' interface that operates on a 'tar' file.
The name of the TAR archive must be specified via the 'name' attribute of
an 'archive' tag, for example:
! <config>
! <archive name="archive.tar"/>
! </config>
The backing store for the dataspaces exported via ROM sessions is accounted
on the 'rom_tar' service (not on its clients) to make the use of 'rom_tar'
transparent to the regular users of core's ROM service. Hence, this service
must not be used by multiple clients that do not trust each other.
Typically, 'tar_rom' is instantiated per client.
The Live CD uses the 'tar_rom' service for the browser demo. Each plugin
is fetched from the web as a tar file containing the config file of the
plugin subsystem as well as supplemental binary files that are provided
to the plugin subsystem as ROM files. This way, a plugin can carry along
multiple components and data that form a complete Genode subsystem.
DDE Kit
=======
The DDE kit underwent slight modifications since the previous release.
It now provides 64-bit integer types and a revised virtual PCI bus
implementation.
Device drivers
##############
PCI bus
=======
Genode was tested on several hardware platforms in preparation of the
current release. This revealed some deficiencies with the PCI bus
driver implementation. The revised driver now efficiently supports
platforms with many PCI busses (as PCIe demands) and correctly handles
multi-function devices.
VESA framebuffer
================
We updated the configuration syntax of the VESA driver to better match
the style of new init syntax, preferring the use of attributes rather than
XML sub nodes. Please refer to the updated documentation at
'os/src/drivers/framebuffer/vesa/README'.
:Buffered output:
To accommodate framebuffer clients that need to read from the frame buffer,
in particular the nitpicker GUI server operating with alpha channels, we
introduced a buffered mode to the VESA driver. If enabled, the VESA driver
will hand out a plain memory dataspace to the client rather than the
physical framebuffer. Each time, the client issues as 'refresh' operation
on the framebuffer-session interface, the VESA driver copies the corresponding
screen region from the client-side virtual framebuffer to the physical
framebuffer. Note that the VESA driver will require additional RAM quota
to allocate the client buffer. If the quota is insufficient, the driver will
fall back to non-buffered output.
:Preinitialized video modes:
As an alternative to letting the VESA driver set up a screen mode, the
driver has become able to reuse an already initialized mode, which is useful
if the VESA mode is already initialized by the boot loader. If the screen
is initialized that way, the 'preinit' attribute of the 'config' node can
be set to '"yes"' to prevent the driver from changing the mode. This way,
the driver will just query the current mode and make the already
initialized framebuffer available to its client.
Audio
=====
We observed certain hardware platforms (in particular VirtualBox) to
behave strangely after ALSA buffer-underrun conditions. It seems that the
VirtualBox audio driver plays actually more frames than requested by
ALSA's 'writei' function, resulting in recurring replay of data that
was in the buffer at underrun time. As a work-around for this problem,
we zero-out the sound-hardware buffer in the condition of an ALSA buffer
underrun. This way, the recurring replay is still there, but it is
replaying silence.
To improve the support for sporadic audio output, we added a check for the PCM
state for buffer underruns prior issuing the actual playback. In the event of
an underrun, we re-prepare the sound card before starting the playback.
Furthermore, we implemented the new flush and channel-synchronization
abilities of the 'Audio_out_session' interface for the DDE Linux driver.
Paravirtualized Linux
#####################
To support the demo scenarios that showcase the paravirtualized Linux kernel,
we enhanced our custom stub drivers of the OKLinux kernel. Thereby, we have
reached a high level of integration of OKLinux with native Genode services,
including audio output, block devices, framebuffer output, seamless integration
with the Nitpicker GUI, and networking. All stub drivers are compiled in by
default and are ready to use by specifying a device configuration in the config
node for the Linux kernel. This way, one Linux kernel image can be easily used
in different scenarios.
:Integration with the Nitpicker GUI:
We enhanced our fbdev stub driver with a mechanism to merge view reposition
events. If a X11 window is moved, a lot of subsequent events of this type are
generated. Using the new optimization, only the most recent state gets
reported to Nitpicker, making the X11 GUI more responsive.
:UnionFS:
As we noticed that unionfs is required by all our Linux scenarios, we decided
to include and enable the patch by default.
:Network support:
With the introduction of the 'nic_bridge', multiple networking stacks can run
on Genode at the same time, which paves the way for new use cases. We have now
added a stub driver using Genode's 'Nic_session' interface to make the new
facility available to Linux.
:Audio output:
We adapted the ALSA stub driver to the changes of the 'Audio_out_session'
interface, using the new channel synchronization and flush functions.
Thereby, we optimized the stub driver to keep latency and seek times of
Linux userland applications reasonably low.
:Removed ROM file driver:
With the addition of the 'Block_session' stub driver, the original ROM file
driver is no longer required. So we removed the stub. For using ROM files as
disk images for Linux, there is the 'rom_loopdev' server, which provides a
block session that operates on a ROM file.
:Asynchronous block interface:
To improve performance, we changed the block stub driver to facilitate the
asynchronous mode of operation as provided by the 'Block_session' interface.
This way, multiple block requests can be issued at once, thereby shadowing
the round trip times for individual requests.
Protocol stacks and libraries
#############################
Gallium3D / Intel GEM
=====================
We improved the cache handling of our DRM emulation code (implementing
'drm_clflush_pages') and our EGL driver, thereby fixing caching
artifacts on i945 GPUs. Furthermore, we added a temporary work-around
for the currently dysfunctional sequence-number tracking with i945 GPUs.
On this chipset, issuing the 'MI_STORE_DWORD_INDEX' GPU command used
for tracking sequence numbers apparently halts the processing the command
stream. This condition is normally handled by an interrupt. However,
we have not enabled interrupts yet.
To prepare the future support for more Gallium drivers than i915, we
implemented a driver-selection facility in the EGL driver. The code
scans the PCI bus for a supported GPU and returns the name of the
corresponding driver library. If no driver library could be found,
the EGL driver falls back to softpipe rendering.
lwIP
====
We revised our port of the lwIP TCP/IP stack, and thereby improved its
stability and performance.
* The lwIP library is now built as shared object, following the convention
for libraries contained in the 'libports' repository.
* By default (when using the 'libc_lwip_nic_dhcp' library), lwIP will
issue a DHCP request at startup. If this request times out, the loopback
device is set as default.
* If there is no 'Nic' service available, the lwIP stack will fall back to
the loopback device.
* We increased the default number of PCBs in lwIP to 64.
* We removed a corner case of the timed semaphore that could occur
when a timeout was triggered at the same time ,'up' was called.
In this case, the semaphore was unblocked but the timeout condition
was not reflected at the caller of 'down'. However, the lwIP code
relies on detecting those timeouts.
Qt4
====
We implemented a custom *nitpicker plugin widget*, which allows for the
seamless integration of arbitrary nitpicker clients into a Qt4 application.
The primary use case is the browser plugin mechanism presented at
the Live CD. In principle, the 'QNitpickerViewWidget' allows for creating
mash-up allocations consisting of multiple native Genode programs. As shown
by the browser plugin demo, a Qt4 application can even integrate other
programs that run isolated from the Qt4 application, and thereby depend on
on a significantly less complex trusted computing base than the Qt4
application itself.
[image nitpicker_plugin]
The image above illustrates the use of the 'QNitpickerViewWidget' in the
scenario presented on the Live CD. The browser obtains the Nitpicker view to be
embedded into the website from the loader service, which virtualizes the
Nitpicker session interface for the loaded plugin subsystem. The browser then
tells the loader about where to present the plugin view on screen. But it has
neither control over the plugin's execution nor can it observe any user
interaction with the plugin.
New Gems repository with HTTP-based block server
################################################
To give the web-browser demo of our Live CD a special twist, and to show off
the possibilities of a real multi-server OS, we decided to implement the
somewhat crazy idea of letting a Linux OS run on a disk image fetched at
runtime from a web server. This way, the Linux OS would start right away and
disk blocks would be streamed over the network as needed. Implementing this
idea was especially attractive because such a feature would be extremely hard
to implement on a classical OS but is a breeze to realize on Genode where all
device drivers and protocol stacks are running as distinct user-level
components. The following figure illustrates the idea:
[image http_block]
The block stub driver of the Linux kernel gets connected to a special block
driver called 'http_block', which does not access a real block device but
rather uses TCP/IP and HTTP to fetch disk blocks from a web server.
Because the 'http_block' server is both user of high-level functionality (the
lwIP stack) and provider of a low-level interface ('Block_session'), the
program does not fit well into one of the existing source-code repositories.
The 'os' repository, which is normally hosting servers for low-level interfaces
is the wrong place for 'http_block' because this program would make the 'os'
repository depend on the higher-level 'libports' repository where the 'lwip'
stack is located. On the other hand, placing 'http_block' into the 'libports'
repository is also wrong because the program is not a ported library. It merely
uses libraries provided by 'libports'. In the future, we expect that native
Genode components that use both low-level and high-level repositories will
become rather the norm than an exception. Therefore, we introduced a new
repository called 'gems' for hosting such programs.
Tools
#####
Automated coding-style checker
==============================
As Genode's code base grows and new developers start to get involved,
we noticed recurring questions regarding coding style. There is a
[https://genode.org/documentation/developer-resources/coding_style - document]
describing our coding style but for people just starting to get involved,
adhering all the rules can become tedious. However, we stress the importance
of a consistent coding style for the project. Not only does a consistent style
make the framework more approachable for users, but it also eases the work
of all regular developers, who can feel right at home at any part of
the code.
To avoid wasting precious developer time with coding-style fixes, we
have created a tool for the automated checking and (if possible) fixing
the adherence of source code to Genode's coding style. The tool is
located at 'tool/beautify'. It takes a source file as argument and
reports coding-style violations. The checks are fairly elaborative:
* Placement of braces and parenthesis
* Indentation and alignment, trailing spaces
* Vertical spacing (e.g., between member functions, above comments)
* Naming of member variables and functions (e.g., private members start with '_')
* Use of upper and lower case
* Presence of a file header with the mandatory fields
* Policy for function-header comments (comment at declaration, not
at implementation)
* Style of single-line comments, function-header comments, multi-line comments
The user of 'beautify' may opt to let the tool fix most of the violations
automatically by specifying the command line arguments '-fix' and '-write'.
With only the '-fix' argument, the tool will output the fixed version of
the code via stdout. By specifying the '-write' argument, the changes will
be written back to the original file. In any case, we strongly recommend
to manually inspect all changes made by the tool.
Under the hood, the tool consists of two parts. A custom C++ parser called
'parse_cxx' reads the source code and converts it to a syntax tree. In the
syntax tree, all formating information such as whitespaces are preserved.
The C++ parser is a separate command-line tool, which we also use for
other purposes (e.g., generating the API documentation at the website).
The actual 'beautify' tool calls 'parse_cxx', and applies its checks and
fixes to the output of 'parse_cxx'. For this reason, both tools have to
reside in the same directory.
Platform-specific changes
#########################
OKL4
====
:Added support for shared interrupts:
The Genode Live CD operates on a large number of devices that trigger
interrupts (USB, keyboard, mouse, ATAPI, timer, network). On most
platforms, the chances are extremely high that some of them use
the same IRQ line. Therefore, we enhanced core's IRQ service to
allow multiple clients to request the same IRQ. If the interrupt occurs,
all clients referring to this interrupt are notified. The interrupt
gets cleared after all of those clients responded. Even though, we regard
PIC interrupts as a legacy, the support of shared interrupts enables
us to use OKL4 with such complex usage scenarios.
:Revised page-fault handling:
If a page fault occurs, the OKL4 kernel delivers a message to the page-fault
handler. The message contains the page-fault address and type as well as the
space ID where the fault happened. However, the identity of the faulting
thread is not delivered. Instead, the sender ID of the page fault message
contains the KTCB index of the faulting thread, which is only meaningful
within the kernel. This KTCB index is used as a reply token for answering the
page fault message. We wondered about why OKL4 choose to deliver the KTCB
index rather then the global thread ID as done for plain IPC messages. The
only reasonable answer is that by using the KTCB index directly in OKL4's
page-fault protocol, one lookup from the userland-defined thread ID to the
KTCB index can be avoided. However, this comes at the cost of losing the
identity of the faulting thread. We used to take the space ID as a key for
the fault context within core. However, with Genode's user-level page-fault
mechanism, this simplification does not suffice anymore. We have to know the
faulting thread as a page fault may not be answered immediately but at a
later time. During that time, the page-fault state has to be stored at core's
representation of the faulting thread. Our solution is reverting OKL4's
page-fault protocol to operate with global thread IDs only and to never make
kernel-internal KTCB indices visible at the user land. You can find the patch
for the OKL4 kernel at 'base-okl4/patches/reply_tid.patch'.
:Reboot via kernel debugger:
We fixed the reboot code of OKL4's kernel debugger to improve our work
flow. The patch can be found at 'base-okl4/patches/kdb_reboot.patch'.
:Relieved conflict with libc 'limits.h':
For some reason, the OKL4 kernel bindings provide definitions
normally found in libc headers. This circumstance ultimately leads
to trouble when combining OKL4 with a real C runtime. We have
relieved the problem with the patch 'base-okl4/patches/char_bit.patch'.
:Exception handling:
We added a diagnostic message to core that reports about exceptions
such as division by zero.
Pistachio
=========
Our revised syscall bindings for supporting position-independent code
on L4ka::Pistachio have been integrated into the mainline development
of the kernel. Therefore, the patch is not needed anymore when using
a kernel revision newer than 'r791:0d25c1f65a3a'.
Linux
=====
On Linux, we let the kernel manage all virtual address spaces for us,
except for the thread-context area. Because the kernel does not know
about the special meaning of the thread-context area, it may choose to
use this part of the virtual address space as target for 'mmap'. This
may lead to memory corruption. Fortunately, there is a way to tell the
kernel about virtual address regions that should be reserved. The
trick is to pre-populate the said region with anonymous memory using
the 'mmap' arguments 'MAP_PRIVATE', 'MAP_FIXED', 'MAP_ANONYMOUS', and
'PROT_NONE'. The kernel will still accept a fixed-address mapping
within such a reserved region (overmap) but won't consider using the
region by itself. The reservation must be done at the startup of each
process and each time when detaching a dataspace from the thread
context area. For the process startup, we use the hook function
'main_thread_bootstrap' in 'src/platform/_main_helper.h'. For reverting
detached dataspaces to a reserved region within the context area, we
added as special case to 'src/base/env/rm_session_mmap.cc'.
For hybrid programs (Genode processes that link against native
shared libraries of the Linux system), which are loaded by the dynamic
linker of Linux, we must further prevent the dynamic linker from
populating the thread-context area. This is achieved by adding a
special program segment at the linking stage of all elf binaries.

876
doc/release_notes/11-02.txt Normal file
View File

@@ -0,0 +1,876 @@
===============================================
Release notes for the Genode OS Framework 11.02
===============================================
Genode Labs
One year ago, the release 10.02 was our break-through with regard to the support
of multiple kernels as base platform for Genode. With the added support for
the NOVA hypervisor and the Codezero kernel, Genode applications could be executed
on 6 different kernels. With the current release, we take our commitment to
kernel platform support even further. With the added support for the Fiasco.OC
kernel, we make Genode available on one of the most feature-rich modern microkernels.
Additionally, we entered the realms of kernel design with our new platform support
for the Xilinx MicroBlaze architecture. This platform support comes in the shape
of a custom kernel specifically targeted to the MicroBlaze CPU architecture.
Furthermore, we updated our support for the NOVA Hypervisor to the bleeding-edge
version 0.3, which has been released earlier this month.
With the current support for 8 different kernel platforms (L4/Fiasco, Linux,
L4ka::Pistachio, OKL4, NOVA, Codezero, Fiasco.OC, and native MicroBlaze), testing
and integrating application scenarios across all platforms becomes increasingly
challenging. Therefore, we introduce a new framework for automating such tasks.
Thanks to the tight integration of the automation tool with Genode's build system,
going back and forth between different kernels becomes an almost seamless
experience.
Functionality-wise, the release carries on our vision to create a highly secure
yet easy to use general-purpose operating system. Because the Genode framework
is developed on Linux using the wonderful GNU tools, we consider the
availability of the GNU user land on Genode as crucial for using the system by
ourself. This motivation drives the creation of a custom execution environment
for GNU software on top of Genode. With the current release, we are proud to
present the first pieces of this execution environment. Even though not fully
functional yet, it clearly shows the direction of where we are heading.
Support for Fiasco.OC
#####################
The OC in the name of the Fiasco.OC kernel stands for "object capability", hinting
at the most significant feature that sets current-generation microkernels such as
NOVA, seL4, and Fiasco.OC apart from their predecessors. Whereas previous L4 kernels
succeeded in protecting subsystems from each other, the new generation of kernels
is geared towards strict security policies. Traditionally, two protection domains
were able to communicate with each other if they both agreed. Communication partners
were typically globally known via their respective thread/task IDs. Obviously, this
policy is not able to guarantee the separation of subsystems. If two subsystems
conspire, they could always share information. Object-capability-based kernels
are taking the separation much further by prohibiting any communication between
protection domains by default. Two protection domains can communicate only if
a common acquaintance of both agrees. This default-deny policy facilitates the
creation of least-privilege security policies. From the ground up, Genode has
been designed as a capability-based system which is naturally capable of leveraging
kernel-based object-capability support if present. After NOVA, Fiasc.OC is the
second of Genode's base platforms that provides this feature.
Apart from being a capability-based kernel, Fiasco.OC has a number of compelling
features such as thorough support for ARM platforms and the x86 32/64 bit
architectures. It supports SMP, hardware virtualization, and provides special
optimizations for running paravirtualized operating systems.
Technically, Fiasco.OC is the successor of the L4/Fiasco kernel developed by
the OS group of the TU-Dresden. However, the kernel interface of Fiasco.OC has
not much in common with L4/Fiasco. Some heritages are still there (e.g., IPC
timeouts) but the kernel API has evolved to a fully object-oriented model.
:Thanks:
We are indebted to the main developer of Fiasco.OC Alexander Warg for being
very reponsive to our inquiries while doing the porting work. Thanks to his
support, the adaptation of Genode to this kernel has been an almost smooth
ride.
Prerequisites
=============
You need GNU C & C++ Compilers, GNU Binutils, GNU Make, and Perl to use the
Fiasco.OC build system. On Debian/Ubuntu systems, you have to install the
following packages:
! apt-get install make gawk g++ binutils pkg-config subversion
Moreover, you need to download and install the tool-chain used by Genode. Have
a look at this page:
:[https://genode.org/download/tool-chain]:
Genode tool-chain
Downloading and building Fiasco.OC
==================================
Checkout the Fiasco.OC sources and tool-chain to an appropriated directory:
! export REPOMGR_SVN_REV=27
! svn cat https://svn.tudos.org/repos/oc/tudos/trunk/repomgr |\
! perl - init https://svn.tudos.org/repos/oc/tudos fiasco l4re
Building the kernel
~~~~~~~~~~~~~~~~~~~
Create the build directory for the kernel:
! cd <path_to_fiasco_src_dir>/src/kernel/fiasco
! make BUILDDIR=<path_to_kernel_build_dir>
Go to the build directory, configure the kernel:
! cd mybuild
! make config
This will launch the configuration menu. Here you can configure your kernel.
The default config is just fine to test the Genode port. It will build a
uniprocessor IA32 kernel with debugging features enabled. You can exit the menu and
save the configuration by simply typing 'x'.
Now, build Fiasco.OC by invoking:
! make
Building necessary tools
~~~~~~~~~~~~~~~~~~~~~~~~
To practically use Fiasco.OC, you need in addition to the kernel a tool to
bootstrap it, and the initial pager of the system, namely 'sigma0'. Both tools
can be found in the L4 runtime environment's base directory. Outgoing from
the directory where you checked out the sources, you have to change to the
following directory:
! cd <path_to_fiasco_src_dir>/src/l4
Create another build directory:
! make B=<path_to_l4re_build_dir>
Again, you might want to tweak the configuration:
! make O=<path_to_l4re_build_dir> config
Finally, build the tools:
! make O=<path_to_l4re_build_dir>
Building the Fiasco.OC version of Genode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Fiasco.OC version of Genode is available at the Genode public subversion repository:
:https://genode.org/download/subversion-repository:
Information about accessing the Genode public subversion repository
Go to a directory where you want the Genode/Fiasco.OC build directory to remain. Use
the helper script in the 'tool/builddir' directory of the Genode source tree to
create the initial build environment. You need to state the absolute path to the
build directory of the L4 runtime environment as 'L4_DIR', as it contains the kernel
bindings needed by the Genode port.
! <path_to_genode_src_dir>/tool/builddir/create_builddir foc_x86_32 \
! L4_DIR=<path_to_l4re_build_dir> \
! GENODE_DIR=<path_to_genode_src_dir> \
! BUILD_DIR=<path_to_genode_build_dir>
Now, go to the newly created build directory and type make.
! cd <path_to_genode_build_dir>
! make
Booting Genode on top of Fiasco.OC
==================================
Example GRUB configuration entry:
! timeout 0
! default 0
!
! title Genode on Fiasco.OC
! kernel /bootstrap -modaddr=0x01100000
! module /fiasco -serial_esc
! module /sigma0
! module /core
! module /init
! module /config
! module /pci_drv
! module /vesa_drv
! module /ps2_drv
! module /timer
! module /nitpicker
! module /launchpad
! module /liquid_fb
! module /scout
! module /testnit
! module /nitlog
For an example of a matching Genode 'config' file, please take a look
at 'os/config/demo'.
The Genode binaries are located in '<path_to_genode_build_dir>/bin',
the 'fiasco' kernel in '<path_to_kernel_build_dir>'. Assuming you compiled
for x86/586 (the default), you can find the 'bootstrap' binary in
'bin/x86_586' and 'sigma0' in 'bin/x86_586/l4f' within the
'<path_to_l4re_build_dir>' directory.
Current state
=============
The adaptation of Genode to Fiasco.OC covers most parts of the Genode API
including advanced semantics such as cancelable locks and support for
real-time priorities. So far, it has been tested on the x86 architecture.
Because 'base-foc' does not contain x86-specific code, we expect no major
roadblocks for running Genode on Fiasco.OC on ARM. However, we have not
exercised tests in this regard.
As of today, there exist the following limitations of the Fiasco.OC support:
* The dynamic linker is not yet adapted to Fiasco.OC. Special care must
be taken for handling the parent capability for dynamically loaded
programs. We have already covered this issue for the NOVA version but
the adaptation to Fiasco.OC remains yet to be done.
* The destruction of sub systems is not yet fully stable. Because Genode
forms a more dynamic workload than the original userland accompanied with
the kernel, the usage pattern of the kernel API triggers different
effects. We are working with the Fiasco.OC developers to remedy this
issue.
* The signalling framework is not yet supported. A design exist but it is
not implemented yet.
We believe however that none of these limitations are a significant hurdle for
starting to use Genode with this kernel. Please expect this issues to be
resolved with the upcoming Genode release.
Technical details about 'base-foc'
==================================
The following technical bits are worth noting when exploring the use of
Genode with the 'base-foc' platform.
* The timer implementation uses a one thread-per-client mode of operation.
We use IPC timeouts as time source. Hence, the timer driver is hardware
independent and should work out of the box on all hardware platforms
supported by Fiasco.OC.
* Each 'Server_object' of Genode corresponds to a so-called IPC gate,
which is the Fiasco.OC kernel object used for capability invocation.
Therefore, protection and object integrity is provided at the fine
granularity of single 'Server_objects'. This is in line with our
support for NOVA's implementation of capability-based security.
* In contrast to the lock implementation that we used with the original
L4/Fiasco kernel, the 'base-foc' lock is a fully-featured Genode lock
with support for lock cancellation and blocking. For blocking and
waking up lock applicants, we use Fiasco.OC's IRQ objects.
* The allocator used for managing process-local capability selectors
does not yet support the reuse of capability selectors.
Further Information
===================
:genode/tool/builddir/README:
Reference manual for the 'create_builddir' script
:[https://os.inf.tu-dresden.de/fiasco]:
Official website for the Fiasco.OC microkernel.
Noux - an execution environment for the GNU userland
####################################################
Even though Genode is currently mainly geared to the classical special-purpose
application domains for microkernel-based systems, the main property that sets
Genode apart from traditional systems is the thorough support for dynamic
workloads and the powerful mechanisms for handling hardware resources and
security policies in highly dynamic setting. We are convinced that Genode's
architecture scales far beyond static special-purpose domains and believe in
the feasibility of Genode as a solid foundation for a fully-fledged general
purpose operating system. Internally at Genode Labs, we set up the ultimate
goal to switch from Linux to Genode for our day-to-day work. We identified
several functionalities that we could not live without and systematically try
to bring those features to Genode. Of course, the most fundamental programs
are the tools needed to develop and build Genode. Currently we are developing
on Linux and enjoy using the GNU userland.
Consequently, we require a solution for using this rich tool set on Genode.
The straight-forward way for making these tools available on Genode would be
running them within a virtualized Linux instance (e.g., using OKLinux on OKL4).
However, this approach would defeat our actual goal to create a highly secure
yet easy to use working environment because adding Linux to the picture would
involve administering the virtualized Linux system. We would prefer a native
solution that makes the overall system less, not more, complicated. This way
the idea for a native execution environment for the GNU userland on Genode
was born. The implementation is called Noux and the first bits of code are
featured in the 'ports' repository. Noux consists of two parts, a build
environment for compiling GNU programs such that they can be run as Genode
processes and an execution environment that provides the classical UNIX
functionality to these programs.
Noux build environment
======================
From our experience, porting existing UNIX applications to a non-UNIX system
tends to be a task of manual and time-consuming labour. One has to loosely
understand the build system and the relationship of the involved source codes,
implement dummy functions for unresolved references, and develop custom glue
code that interfaces the ported application to the actual system. Taking the
shortcut of changing the original code has to be avoided at any cost because
this produces recurring costs in the future when updating the application. In
short, this long-winding process does not scale. For porting a tool set such as
the GNU userland consisting of far more than a three-digit number of individual
programs, this manual approach becomes unfeasible. Therefore, we have created
a build environment that facilitates the use of the original procedure of
invoking './configure && make'. The challenge is to supply configure with
the right arguments and environment variables ('CFLAGS' and the like) such that
the package is configured against the Genode environment. The following
considerations must be taken:
* Configure must not detect any global headers (e.g., '/usr/include/')
or libraries (e.g., '/usr/lib/'). This can be achieved by the '-nostdinc' and
'-nostdlib' options
* Configure has to use the same include-search paths as used for compiling
normal libc-using Genode programs
* Configure must use the Genode tool chain
* The final linking stage must use the Genode linker script, the Genode
base libraries, and other Genode-specific linker arguments.
Thanks to the power of the GNU build system, all this can be achieved by
supplying arguments to './configure' and indirectly to the 'make' process via
environment variables. The new Noux build environment takes care of these
precautions. It comes in the form of the 'ports/mk/noux.mk' file which enables
the seamless integration of GNU packages with the Genode build system. To
compile a GNU package, the manual steps needed are reduced to the creation of a
'target.mk' file representing the package. This 'target.mk' defines the name
of the package (by default, the basename of the 'target.mk' enclosing directory
is assumed) and the location of the source package. With this approach, we
managed to build 'coreutils' (over 100 small UNIX utilities such as 'ls', 'cp',
'sort'), 'binutils' (GNU linker, assembler, object-file tools), 'findutils'
('find', 'xargs'), 'bash', 'dash', GNU make, and finally the GNU compiler
collection including 'g++'. The resulting binaries are ready to be executed as
native Genode processes. However, without the right environment that presents
the program the needed UNIX functionality, those programs won't do much.
This leads us to the Noux execution environment.
Noux execution environment
==========================
The Noux execution environment plays the role of a UNIX kernel for programs
built via the Noux build environment. In contrast to a real kernel, the Noux
environment is a plain Genode user-level process that plays the role of being
the parent of one or multiple Noux processes. In addition of providing the
'Genode::Parent' interface, Noux also provides a locally implemented service called
'Noux::Session' that offers UNIX-like system-calls via an RPC interface. Each
hosted program is linked against a special Noux libc plugin that catches all
libc calls that would normally result in a system call. It then transparently
forwards this function call to the 'Noux::Session' interface.
Currently the Noux execution environment implements the following
system calls: 'getcwd', 'write', 'stat', 'fstat', 'fcntl', 'open',
'close', 'dirent', 'fchdir', 'read', and 'execve'.
The execution environment submits arguments (argc, argv, environment) to the
hosted program, manages its current working directory and receives its exit
code. File operations are targeted to a custom VFS infrastructure, which
principally allows a flexible configuration of the virtual file system visible
to the hosted programs. At the current stage, Noux supports mounting plain tar
archives obtained from core's ROM service as read-only file system. On startup,
the Noux environment starts one process (the init process) and connects the
file descriptor 1 (stdout) to Genode's LOG service.
State of the implementation
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The infrastructure implemented so far already allows the execution of many simple
UNIX tools such as 'ls -lRa', 'echo', 'seq', 'find'. The 'execve' system call
is implemented such that a new process is started that inherits the file
descriptors and the PID of the calling process. This allows using the exec
functionality of the 'bash' shell. However, because 'fork' is not implemented
yet, there is currently no way to start multiple programs hosted in a single
Noux execution environment.
As of today, the Noux environment is not considered to be usable for practical
purposes. However, it clearly shows the feasibility of the path we are walking.
With the foundation laid, we are looking forward to expanding Noux to a capable
solution for running our beloved GNU userland tools on Genode.
Vision
~~~~~~
The most significant intermediate result of pursuing the development of Noux is
the realization that such an environment is not exceedingly complex. Because of
the combination with Genode, we only need to provide a comfortable runtime as
expected by user processes but we can leave much of intricate parts of UNIX out
of the picture. For example, because we handle device drivers on Genode, we do
not need to consider device-user interaction in Noux. As another example,
because the problem of bootstrapping the OS is already solved by Genode, there
is no need to run an 'init' process within Noux. Our vision foresees that Noux
runtimes are to be created on demand for individual tasks such as editing a
file (starting a custom Noux instance containing only the file to edit and the
text editor), compiling source code (starting a custom Noux instance with only
the source code and the build tools). Because Noux is so simple, we expect the
runtime overhead of starting a Noux instance to be not more than the time
needed to spawn a shell in a normal UNIX-like system.
Test drive
~~~~~~~~~~
To give Noux a spin, we recommend using Linux as base platform as this is
the platform we use for developing it. First, you will need to download the
source code of the GNU packages. From within the 'ports' repository,
use the following command:
! make prepare PKG=coreutils
This command will download the source code of the GNU coreutils. You may
also like to give the other packages a try. To see what is available,
just call 'make' without any argument.
Create a build directory (e.g., using tool/builddir/create_builddir).
Change to the build directory and issue the command
! make run/noux
This command will execute the run script provided at 'ports/run/noux.run'.
First it builds core, init, and coreutils. Then it creates a tar archive
containing the installed coreutils. Finally, it starts the Noux environment on
Genode. Noux then mounts the TAR archive as file system and executes 'ls -laR',
showing the directory tree.
Approaching platform support for Xilinx MicroBlaze
##################################################
With the release 11.02, we are excited to include the first version of our
custom platform support for the Xilinx MicroBlaze CPU architecture. MicroBlaze
is a so-called softcore CPU, which is commonly used as part of FPGA-based
System-on-Chip designs. At Genode Labs, we are regularly using this IP core,
in particular for our Genode FPGA Graphics Project, which is a GUI software stack
and a set of IP cores for implementing fully-fledged windowed GUIs on FPGAs:
:Website of the Genode FPGA Graphics Project:
[https://genode-labs.com/products/fpga-graphics]
Ever since we first released the Genode FPGA project, we envisioned to combine
it with the Genode OS Framework. In Spring 2010, Martin Stein joined our team
at Genode Labs and accepted the challenge to bring the Genode OS Framework to
the realms of FPGA-based SoCs. Technically, this implies porting the framework
to the MicroBlaze CPU architecture. In contrast to most softcore CPUs such as
the popular Lattice Mico32, the MicroBlaze features a MMU, which is a fundamental
requirement for implementing a microkernel-based system. Architecturally-wise
MicroBlaze is a RISC CPU similar to MIPS. Many system parameters of the CPU
(caches, certain arithmetic and shift instructions) can be parametrized at
synthesizing time of the SoC. We found that the relatively simple architecture
of this CPU provides a perfect playground for pursuing some of our ideas about
kernel design that go beyond the scope of current microkernels. So instead of
adding MicroBlaze support into one of the existing microkernels already
supported by Genode, we went for a new kernel design. Deviating from the typical
microkernel, which is a self-sufficient program running in kernel mode that
executes user-level processes on top, our design regards the kernel as a part of
Genode's core. It is not a separate program but a library that implements the
glue between user-level core and the raw CPU. Specifically, it provides the
entrypoint for hardware exceptions, a thread scheduler, an IPC mechanism, and
functions to manipulate virtual address spaces (loading and flushing entries
from the CPU's software-loaded TLB). It does not manage any physical memory
resources or the relationship between processes. This is the job of core.
From the kernel-developer's point of view, the kernel part can be summarized as
follows:
* The kernel provides user-level threads that are scheduled in a round-robin
fashion.
* Threads can communicate via synchronous IPC.
* There is a mechanism for blocking and waking up threads. This mechanism
can be used by Genode to implement locking as well as asynchronous
inter-process communication.
* There is a single kernel thread, which never blocks in the kernel code paths.
So the kernel acts as a state machine. Naturally, there is no concurrency in the
execution paths traversed in kernel mode, vastly simplifying these code parts.
However, all code paths are extremely short and bounded with regard to
execution time. Hence, we expect the interference with interrupt latencies
to be low.
* The IPC operation transfers payload between UTCBs only. Each thread has a
so-called user-level thread control block which is mapped transparently by
the kernel. Because of this mapping, user-level page faults cannot occur
during IPC transfers.
* There is no mapping database. Virtual address spaces are manipulated by
loading and flushing physical TLB entries. There is no caching of mappings
done in the kernel. All higher-level information about the interrelationship
of memory and processes is managed by the user-level core.
* Core runs in user mode, mapped 1-to-1 from the physical address space
except for its virtual thread-context area.
* The kernel paths are executed in physical address space (MicroBlaze).
Because both kernel code and user-level core code are observing the same
address-space layout, both worlds appear to run within a single address
space.
* User processes can use the entire virtual address space (4G) except for a
helper page for invoking syscalls and a page containing atomic operations.
There is no reservation used for the kernel.
* The MicroBlaze architecture lacks an atomic compare-and-swap instruction. On
user-level, this functionality is emulated via delayed preemption. A kernel-
provided page holds the sequence of operations to be executed atomically and
prevents (actually delays) the preemption of a thread that is currently
executing instructions at that page.
* The MicroBlaze MMU supports several different page sizes (1K up to 16MB).
Genode fully supports this feature for page sizes >= 4K. This way, the TLB
footprint can be minimized by choosing sensible alignments of memory
objects.
Current state
=============
The MicroBlaze platform support resides in the 'base-mb' repository. At the
current stage, core is able to successfully start multiple nested instances of
the init process. Most of the critical kernel functionality is working. This
includes inter-process communication, address-space creation, multi-threading,
thread synchronization, page-fault handling, and TLB eviction.
This simple scenario already illustrates the vast advantage of
using different page sizes supported by the MicroBlaze CPU. If using
4KB pages only, a scenario with three nested init processes produces more than
300.000 page faults. There is an extremely high pressure on the TLB, which
only contains 64 entries. Those entries are constantly evicted so that
threshing effects are likely to occur. By making use of flexible page
sizes (4K, 16K, 64K, 256K, 1M, 4M, 16M), the number of page faults gets
slashed to only 1.800, speeding up the boot time by factor 10.
Currently, there is no restriction of IPC communication rights. Threads are
addressed using their global thread IDs (in fact, using their respective
indices in the KTCB array). For the future, we are planning to add
capabilty-based delegation of communication rights.
Building and using Genode on MicroBlaze
=======================================
For building Genode for the MicroBlaze platform, you need the MicroBlaze
tool chain as it comes with the Xilinx EDK. The tool chain is typically
prefixed with 'mb-'. Please make sure that the tool chain's 'bin/' directory
is included in your 'PATH' environment variable.
For building and starting Genode on MicroBlaze, you first need to create
a build directory using the build-directory creation tool:
! tool/builddir/create_builddir microblaze \
! BUILD_DIR=</path/to/build/dir> \
! GENODE_DIR=</path/to/genode/dir>
The 'base-mb' repository comes with support for Genode's run tool. In order to
use it, you will first need to declare the location of your qemu binary using
the 'QEMU=/path/to/qemu' variable in the '<build-dir>/etc/microblaze.conf'
file. Then you will be able to start an example scenario by issuing the
following command from within your build directory:
! make run/nested_init
Thereby, the 'run' tool will attempt to start core using the microblaze version
of qemu.
You can also find a simple hello-world example at 'base-mb/src/test/hello'.
The corresponding run script is located at 'base-mb/run/hello.run'. You can
execute it via 'make run/hello' from the build directory.
Note that currently, all boot modules are linked against the core binary.
To change the boot modules, the file 'base-mb/src/core/boot_modules.s' must
be modified.
For reference, we are using the following tools:
* mb-g++ (GCC) 4.1.1 20060524 (Xilinx 11.2 Build EDK_LS2.2
20 Apr 2009 Xilinx 11.2 Build EDK_LS2.2 23 Apr 2009)
* GNU ld version 2.16 Xilinx 11.2 Build EDK_LS2.2 23 Apr 2009
* GNU assembler 2.16 Xilinx 11.2 Build EDK_LS2.2 23 Apr 2009
* QEMU emulator version 0.14.50, Copyright (c) 2003-2008 Fabrice Bellard
Petalogix linux reference design targeting Xilinx Spartan 3ADSP-1800 boards.
Supporting the NOVA hypervisor version 0.3
##########################################
NOVA is a so called microhypervisor - a modern capability-based microkernel
with special support for hardware-based virtualization and IOMMUs. Since we
incorporated the initial support for the NOVA hypervisor in Genode one year
ago, this kernel underwent multiple revisions. The latest version was released
earlier this month. To our delight, much of the features that we missed from
the initial release had been implemented during the course of the last year. We
are especially happy about the fully functional 'revoke' system call and the
support for remote kernel-object creation.
With the Genode release 11.02, we officially support the latest NOVA version.
The update of Genode to the new version required two steps. First, because many
details of the kernel interface were changed between version 0.1 and version
0.3, we had to revisit our syscall bindings and adapting our code to changed
kernel semantics. Second, we filled our 'base-nova' code related to object
destruction and unmapping with life to benefit from NOVA's 'revoke' system
call. Consequently, we are now able to run the complete Genode software stack
including the dynamic linker on NOVA.
Note that for using Genode on NOVA, you will need to apply a small patch to the
NOVA source code. This patch enables the re-use of user-level thread control
blocks in the kernel. The patch can be found at 'base-nova/patches/utcb.patch'.
When executing NOVA on qemu, please specify the '-cpu coreduo' argument to the
qemu command line. When using Genode 'run' tool, you may assign this argument
to the 'QEMU_OPT' variable in '<build-dir>/etc/build.conf'.
:Thanks:
We are grateful for the ongoing very pleasant collaboration with Udo Steinberg
who is the driving force behind NOVA. Thanks for the ultra-fast responses to our
questions and for considering our suggestions regarding the feature set of
NOVA's kernel interface!
Base framework
##############
Upgrading existing sessions
===========================
Genode enables a client of a service to lend parts of its own resources to
the service when opening a session. This way, servers do not need to allocate
own resources on behalf of their clients and become inherently robust against
resource-exhaustion-based denial-of-service attacks.
However, there are cases when the client can not decide about the amount of
resources to lend at session-creation time. In such cases, we used to devise an
overly generous client policy. Now, we have added a new 'upgrade' function to
the 'Parent' and 'Root' interfaces that enables a client to upgrade the
resources of an existing session.
For the 'env()->rm_session()' and 'env()->ram_session()' of processes using
the Genode 'env' library, we implemented a transparent quota upgrade that kicks in
in the event of an exceeded metadata backing store.
Comprehensive accounting of core resources
==========================================
We changed all services of core to limit their respective resource usage
specifically for each individual session. For example, the number of dataspaces
that can be handled by a particular region-manager (RM) session depends on the
resource donation attached to the session. To implement this accounting scheme
throughout core, we added a generic 'Allocator_guard' utility to
'base/include/'. We recommend using this utility when implementing resource
multiplexers, in particular multi-level services. Thanks to this change in
core, the need for a slack memory reservation in core has vanished.
Various changes
===============
The remaining parts of the base API underwent no fundamental revision. The
changes are summarized as follows.
:C++ Support:
We removed 'libgcc' from our C++ support library ('cxx') and link
it to each individual final target and shared library instead. This change alleviates
the need to abuse the 'KEEP_SYMBOLS' mechanism that we used in 'cxx' to
keep libc-dependencies of GCC's support libraries local to the 'cxx'
library. Besides the benefit of reducing heuristics, this change improves
the compatibility with recent cross-compiling tool chains.
Furthermore, we added 'realloc' to the local libc support of the 'cxx'
library because recent ARM tool chains tend to use this function.
:Argument handling for 'main()':
We added a hook to the startup code to enable the implementation of
custom facilities for passing arguments to the main function. The
hook uses the global variables 'genode_argc' and 'genode_argv'.
:Child-exit policy hook:
We enhanced the 'Child_policy' with a new policy interface that allows
a simplified implementation of policies related to program termination.
:Changed API of 'Range_allocator':
We changed the return value of 'alloc_addr' to distinguish different error
conditions. Note that the boolean meaning of the return value is inverted.
Please check your uses of 'alloc_addr'!
Operating-system services and libraries
#######################################
C Runtime
=========
In conjunction with our work on Noux, we improved Genode's C runtime at many
places. First, we added libstdtime and some previously missing bits of libgdtoa
to the libc. These additions largely alleviate the need for dummy stubs, in
particular time-related functions. Second, we added the following functions to
our libc plugin interface: 'dup2', 'fchdir', 'fcntl', 'fstat', 'stat', and
'write'. This enables the creation of advanced libc plugins simulating a whole
file system as done with Noux. Still, there are a number of dummy stubs found
at 'libc/src/lib/libc/dummy.cc'. However, those stubs are now all defined as
weak symbols such that they can be overridden by libc plugins. Finally, we have
replaced the original 'exit' implementation that comes with the libc with a
Genode-specific version. The new version reports the exit code of the
application to the parent process via an 'Parent::exit()' RPC call.
Until now, Genode's libc magically handled output to stdout and stderr by
printing messages via Genode's LOG interface. We have now replaced this
hard-wired interface by an optional libc plugin called 'libc_log'. If present, write
operations to stdout are caught at the libc plugin interface and delegated to
the plugin, which implements the output to the LOG interface. If you have an
application using Genode's libc, you might consider adding the 'libc_log'
library to your 'target.mk' file.
Support for big numbers by the means of libgmp and libmpfr
==========================================================
We have now include both the GNU Multiple Precision Arithmetic Library and
(GMP) and MPFR to the 'ports' repository. This work was specifically motivated
by our port of GCC to Genode as GCC version 4.4.5 requires both libraries.
Because we intend to use those libraries primarily on x86_32, the current port
covers only this architecture. However, expanding the port to
further CPU architectures should be straight-forward if needed.
Furthermore, you can now also find GCC's 'longlong.h' header at
'libports/include/gcc'.
Qt4 updated to version 4.7.1
############################
The current release bumps the supported Qt4 version from 4.6.2 to 4.7.1 and the
Arora web browser (located at the ports repository) from version 0.10.2 to
version 0.11. Of course, we updated our custom additions such as our custom
Nitpicker plugin widget that enables the seamless integration of native
Nitpicker GUI clients into Qt4 applications to work with the new Qt4 version.
Tools
#####
Tool chain update to GCC 4.4.5 and Binutils 2.21
================================================
We upgraded the official Genode tool chain from gcc 4.2.4 to gcc 4.4.5. Please
update your tool chain by downloading the new binary archive (available for x86_32)
or building the tool chain from source using our 'tool/tool_chain' utility.
New support for automated integration and testing
=================================================
With the growing number of supported base platforms, the integration and testing
of Genode application scenarios across all kernels becomes
increasingly challenging. Each kernel has a different boot mechanism and
specific requirements such as the module order of multiboot modules (Fiasco's
bootstrap, Pistachio's sigma0 and kickstart), kernel parameters, or the
invocation of a single-image creation tool (OKL4's elfweaver). To make our
life supporting all those platforms easier, we have created a tool called
'run', which is tightly integrated within Genode's build system. In short 'run'
gathers the intrinsics in the form of a 'run/env' file specific for the
platform used by the current build directory from the respective
'base-<platform>' repository. It then executes a so-called run script, which
contains all steps needed to configure, build, and integrate an application
scenario. For example, a typical run script for building and running a test
case resides in a file called '<any-repository>/run/<run-script-name>.run' and
looks as follows:
! build "core init test/exception"
! create_boot_directory
! install_config {
! <config>
! <parent-provides>
! <!--<service name="ROM"/>-->
! <service name="LOG"/>
! </parent-provides>
! <default-route>
! <any-service> <parent/> </any-service>
! </default-route>
! <start name="test-exception">
! <resource name="RAM" quantum="1M"/>
! </start>
! </config>
! }
! build_boot_image "core init test-exception"
! append qemu_args "-nographic -m 64"
! run_genode_until {.*Exception \(label 0xffb0\) occured.*} 10
First, the build system is instructed to create the targets specified as argument
for the 'build' function. Next, for the integration part, a new boot directory is
created. On most kernel platform, the respective location of the boot directory
is '<build-dir>/var/run/<run-script-name>'. Initially, this directory is empty.
It gets populated with a 'config' file specified as argument of the 'install_config'
command, and by the boot modules specified at the 'build_boot_image' command.
Now that the integration is complete, the scenario is executed via the
'run_genode_until' command. This command takes a regular expression as
argument, which determines the successful termination of the test case. The
second argument is a timeout (is seconds). In the example, the test case will
fail if its output does not match the regular expression within the execution
time of 10 seconds.
The command 'append qemu_args' specifies run-script-specific qemu arguments in
the case that qemu is used to execute the scenario. This is the case for most
kernel platforms (except for Linux where core gets executed directly on the host).
Additional build-directory-specific qemu arguments can be specified in the
'etc/build.conf' file by defining the 'QEMU_OPT' variable. For example, to
prevent KVM being used on Ubuntu Linux, specify:
! QEMU_OPT = -no-kvm
To execute the run script from with build directory, you need to have Expect
installed. Typically, the Linux package is called 'expect'. Simply issue
the following command from within your build directory:
! make run/<run-script>
Note that you will need to have a GRUB 'stage2_eltorito' binary available
at '<genode-dir>/tool/grub' on base platforms that use an ISO image as boot
stategy.
Because the whole chain of actions, building, integrating, executing, and
validating an application scenario is now at the fingertips of issuing a
single command with no kernel-specific considerations needed, it has never
been easier to run the same scenario on a wide range of different kernels.
Please find further instructive examples at 'os/run/'. The 'ldso' run
script executes the test of the dynamic linker. It is completely generic.
The 'demo' run script starts Genode's default demo scenario and shows how
platform-specific considerations (e.g., which device drivers to use) can be
taken into account.
We found that the 'run' tool significantly boosted our productivity not
only for testing purposes but also for accelerating the development-test
cycle during our day-to-day work.
:Technical notes:
The 'run' tool uses Expect as automation tool. Expect is a Tcl interpreter,
which is accompanied by special functionality for automating interactive
command-line applications. Technically, a run script is an Expect script
which gets included by the 'tool/run' script. For the reference of
run-specific functions, please revise the documentation in the 'tool/run'
script. Because each run script is actual Expect source code, it is possible
to use all Tcl and Expect scripting features in a run script.
In particular, a run script may issue shell commands using Tcl's 'exec'
function. This way, even complex integration tasks can be accomplished.
For example, the integration of the Genode Live CD was done via a single
run script.
Build system
============
To facilitate the integration of 3rd-party build systems into the Genode build
process, we added support for pseudo targets that do not require any 'SRC'
declaration. Such 'target.mk' may contain custom rules that will be executed
when the target is revisited by the build system. The bindings are as follows:
! build_3rd_party:
! ...custom commands...
!
! $(TARGET): build_3rd_party
!
! clean_3rd_party:
! ...custom commands...
!
! clean_prg_objects: clean_3rd_party:

1289
doc/release_notes/11-05.txt Normal file

File diff suppressed because it is too large Load Diff

703
doc/release_notes/11-08.txt Normal file
View File

@@ -0,0 +1,703 @@
===============================================
Release notes for the Genode OS Framework 11.08
===============================================
Genode Labs
One of Genode's most distinctive properties is its support for various
different kernels as base platforms. Each of the 8 currently supported kernels
differs with regard to features, security, hardware support, complexity, and
resource management. Even though different applications call for different
kernel properties, through Genode, those properties can be leveraged using a
unified API. The growing number of supported base platforms, however, poses two
challenges, which are the comprehension of the large diversity of tools and
boot concepts, and capturing of the semantic differences of all the kernels.
With the version 11.08, the framework mitigates the former challenge by
introducing a unified way to download, build, and use each of the
kernels with Genode's user-level infrastructure. The new tools empower users of
the framework to instantly change the underlying kernel without the need to know
the peculiarities of the respective kernels. Using microkernels has never been
easier.
The second challenge of translating each kernel's specific behaviour to the
framework's unified API longs for an automated testing infrastructure that
systematically exercises all the various facets of the API on all base
platforms. The new version introduces the tooling support especially designed
for conducting such quality-assurance measures. These tools largely remove the
burden of manual testing while helping us to uphold the stability and quality
of the framework as it grows in terms of functional complexity and number of
base platforms.
Speaking of functional enhancements, the work on version 11.08 was focused
on our block-device infrastructure and ARM support. The block-device-related
work is primarily motivated by our fundamental goal to scale Genode to a
general-purpose computing platform. The additions comprise new drivers for
SD-cards, IDE, SATA, USB storage as well as a new partition server. All those
components provide Genode's generic block interface, which is meant to be used
as back end for file systems. On file-system level, a new libc plugin utilizes
libffat to enable the straight-forward use of VFAT partitions by libc-using
programs.
The current release comes with far-reaching improvements with respect to
ARM-based platforms. The paravirtualized L4Linux kernel has been updated to
Linux version 2.6.39 running on both x86_32 and ARM. Also, Qt4 including Webkit
has become functional on ARMv6-based platforms.
Among the further improvements are many new examples in the form of
ready-to-use run scripts as well as a comprehensive documentation update.
Originally, we had planned to complement the Noux runtime environment to
support interactive command-line applications by the time of the current
release. However, we realized that the current users of the framework would
value the new streamlined tooling support, the enhanced documentation, and the
new quality-assurance infrastructure over such a functional addition. Hence, we
prioritized the topics accordingly. Even though you will find the first bits of
interactive GNU application support in this release, we deferred working on
this topic in full steam to the upcoming version 11.11.
Blurring the boundaries between different kernels
#################################################
Before the Genode project was born, each microkernel carried along its own
userland. For example, the L4/Fiasco kernel came with the L4 environment, the
OKL4 kernel came with Iguana, or the L4ka::Pistachio kernel came with a small
set of example components. Those user-level counterparts of the kernel
complemented their respective kernels with a runtime for user-level
applications and components while exposing significant parts of the kernel
interface at API level. Consequently, most if not all applications developed
against these APIs were tied to a particular kernel. On the one hand, this
approach enabled developers to fine-tune their programs using kernel-specific
features. On the other hand, much effort was wasted by duplicating other
people's work. Eventually, all of the mentioned userlands stayed limited to
special purposes - for the most part the purposes of operating-systems
researchers. Consequently, none of the microkernels gained much attention in
general-purpose computing. Another consequence of the highly fragmented
microkernel community was the lack of a common ground to compare different
kernels in an unbiased way because each userland provided a different set of
components and libraries.
Different application areas call for different kernel features such as
security mechanisms, scheduling, resource management, and hardware support.
Naturally, each kernel exhibits a specific profile of these parameters
depending on its primary purpose. If one microkernel attempted to accommodate
too many features, it would certainly sacrifice the fundamental idea of being
minimally complex. Consequently, kernels happen to be vastly different. During
the past three years, however, Genode has demonstrated that one carefully
crafted API can target highly diverse kernels, and thereby enables users of
the framework to select the kernel that fits best with the requirements
dictated by each application scenario individually. For us Genode developers,
it was extremely gratifying to see that kernels as different as Linux and NOVA
can be reconciled at the programming-interface level. Still, each kernel comes
with different tools, configuration mechanisms, and boot concepts. Even though
Genode programs can be developed in a kernel-independent way, the deployment of
such programs still required profound insights into the peculiarities of the
respective kernel.
With the current release, we introduce a fundamentally new way of using
different microkernels by unifying the procedures of downloading and building
kernels as well as integrating and running Genode programs with each of them.
Existing Genode application scenarios can be ported between kernels in an
instant without the need for deep insights into the kernel's technicalities. As
a teaser, consider the following commands for building and running Genode's
graphical demo scenario on the OKL4 microkernel:
! # check out Genode
! svn co https://genode.svn.sourceforge.net/svnroot/genode/trunk genode
!
! # download the kernel, e.g., OKL4
! make -C genode/base-okl4 prepare
!
! # create Genode build directory
! genode/tool/create_builddir \
! okl4_x86 BUILD_DIR=build
!
! # build everything and execute the interactive demo
! make -C build run/demo
The same principle steps can be used for any of the OKL4, NOVA,
L4/Fiasco, Fiasco.OC, L4ka::Pistachio, or Codezero kernels. You should
nevertheless consult the documentation at 'base-<platform>/doc/' before
starting to use a specific kernel because some base platforms require
the installation of additional tools.
Under the hood, this seamless way of dealing with different kernels is made
possible by the following considerations:
:Repository preparation:
Each kernel comes from a different source such as a Git/SVN/Mercurial
repository or a packaged archive. Some kernels require additional patches. For
example, OKL4 needs to be patched to overcome problems with modern tool chains.
Now, each 'base-<platform>' repository hosts a 'Makefile' that automates the
download and patch procedure. To download the source code of a kernel,
issue 'make prepare' from within the kernel's 'base-<platform>' directory. The
3rd-party source code will be located at 'base-<platform>/contrib/'.
:Building the kernel:
Each kernel has a different approach when it comes to configuration and
compilation. For example, NOVA comes with a simple 'Makefile', OKL4 relies on a
complex SCons-based build system, L4ka::Pistachio uses CML2 and autoconf (for
the userland tools). Furthermore, some kernels require the setting of specific
configuration values. We have streamlined all these procedures into the Genode
build process by the means of a 'kernel' pseudo target and a 'platform' pseudo
library. The kernel can be compiled directly from the Genode build directory by
issuing 'make kernel'. The 'platform' pseudo library takes care of making the
kernel headers available to Genode. For some kernels such as OKL4 and NOVA, we
replaced the original build mechanism with a Genode target. For other kernels
such as L4ka::Pistachio or Fiasco.OC, we invoke the kernel's build system.
:Genode build directory:
Genode build directories are created via the 'tool/create_builddir' tool.
This tool used to require certain kernel-specific arguments such as the
location of the kernel source tree. Thanks to the unified way of preparing
kernels, the need for such arguments has vanished. Now, the only remaining
arguments to 'create_builddir' are the actual platform and the location
of the build directory to create.
:System integration and booting:
As diverse the build systems of the kernels are, so are the boot concepts. Some
kernels rely on a multiboot-compliant boot loader whereas others have special
tools for creating boot images. Thankfully, Genode's run concept allows us to
hide the peculiarities of booting behind a neat and easy-to-use facade. For
each platform we have crafted a dedicated run environment located at
'base-<platform>/run/env', which contains the rules for system integration and
booting. Therefore, one and the same run script can be used to build and
execute one application scenario across various different kernels. For an
illustrative example, the 'os/src/run/demo.run' script can be executed on all
base platforms (except for base-mb) by issuing 'make run/demo' from within the
build directory.
Emerging block-device infrastructure
####################################
Since version 10.08, Genode is equipped with a block-session interface. Its
primary use cases so far were the supply of the paravirtualized OKLinux kernel
with backing store, and the access of the content of a bootable Live CD.
However, for our mission to use Genode as general-purpose computing platform,
disk device access is crucial. Therefore, we dedicated our attention to
various aspects of Genode's block-device infrastructure, reaching from
programming APIs for block drivers, over partition handling, to file-system
access.
:Block session interface:
The glue that holds all block-device-related components together is the generic
block interface 'os/include/block_session'. It is based on the framework's
packet-stream facility, which allows the communication of bulk data via shared
memory and a data-flow protocol using asynchronous notifications. The interface
supports arbitrary allocation schemes and the use of multiple outstanding
requests. Hence, it is generally suited for scatter-gather DMA and the use of
command queuing as offered by the firmware of modern block-device controllers.
(albeit the current drivers do not exploit this potential yet)
:Block component framework:
Our observation that components implementing the block session interface share
similar code patterns prompted us to design a framework API for implementing
this family of components. The set of classes located at 'os/include/block'
facilitate the separation of device-specific code from application logic.
Whereas 'component.h' provides the application logic needed to implement the
block service, the 'driver.h' is an abstract interface to be implemented by the
actual device driver. This new infrastructure significantly reduces code
duplication among new block-device drivers.
:Device-driver implementations:
The new block-device drivers introduced with the current release address
common types of block devices:
* By adding ATA read/write support to the ATAPI driver ('os/src/drivers/atapi'),
this driver can be used to access IDE disks now.
* The new fully-functional SD-card driver ('os/src/drivers/sdcard') enables the
use of SD-cards connected via the PL180 controller.
* The USB storage driver ('linux_drivers/src/drivers/usb') has been adapted
to the block-session interface and can be used on PC hardware.
* The new AHCI driver ('os/src/drivers/ahci') enables the access of disks
connected via SATA on PC hardware.
Because all drivers are providing the generic block-session interfaces, they
can be arbitrarily combined with components that use this interface as back
end, for example, the partition server and file systems.
:Partition manager as resource multiplexer:
The new partition manager ('os/src/server/part_blk') multiplexes one back-end
block session to multiple block sessions, each accessing a different partition.
Its natural role is being "plugged" between a block-device driver and a file
system.
:File-system access:
Even though a session interface for file systems does not exist yet, we
enabled the use of VFAT partitions through a libc plugin. This libc plugin uses
the ffat library to access files stored on a block device. An
application using this plugin can be directly connected to a block session.
New documentation
#################
The new way of dealing with different kernels motivated us to revisit and
complement our exiting documentation. The following documents are new or
have received considerable attention:
:[https://genode.org/documentation/developer-resources/getting_started - Getting started]:
The revised guide of how to explore Genode provides a quick way to
test drive Genode's graphical demo scenario with a kernel of your
choice and gives pointers to documents needed to proceed your
exploration.
:[https://genode.org/documentation/developer-resources/build_system - Build system manual]:
The new build-system manual explains the concepts behind Genode's
build system, provides guidance with creating custom programs and
libraries, and covers the tool support for the automated integration
and testing of application scenarios.
:[https://genode.org/documentation/components - Components overview]:
The new components-overview document explains the categorization of
Genode's components and lists all components that come with the framework.
:[https://genode.org/documentation/developer-resources/init - Configuration of the init process]:
The document describes Genode's configuration concept, the routing of
service requests, and the expression of mandatory access-control policies.
:[https://genode.org/community/wiki - Wiki]:
The platform-specific Wiki pages for L4/Fiasco, L4ka::Pistachio, NOVA,
Codezero, Fiasco.OC, and OKL4 have been updated to reflect the new flows of
working with the respective base platforms.
Base framework
##############
The RPC API for performing procedure calls across process boundaries
introduced with the version 11.05 was the most significant API change
in Genode's history. To make the transition from the old client-server
API to the new RPC API as smooth as possible, we temporarily upheld
compatibility to the old API. Now, the time has come to put the old
API at rest. The changes that are visible at API level are as follows:
* The old client-server API in the form of 'base/server.h' is no more.
The functionality of the original classes 'Server_entrypoint' and
'Server_activation' is contained in the 'Rpc_entrypoint' class provided
via 'base/rpc_server.h'.
* When introducing the RPC API, we intentionally left the actual session
interfaces as unmodified as possible to proof the versatility of the new
facility. However, it became apparent that some of the original interfaces
could profit from using a less C-ish style. For example, some interfaces used
to pass null-terminated strings as 'char const *' rather than via a dedicated
type. The methodology of using the new RPC API while leaving the original
interfaces intact was to implement such old-style functions as wrappers
around new-style RPC functions. These wrappers were contained in
'rpc_object.h' files, e.g. for 'linux_dataspace', 'parent', 'root',
'signal_session', 'cpu_session'. Now, we have taken the chance to modernise
the API by disposing said wrappers. Thereby, the need for 'rpc_object.h'
files has (almost) vanished.
* The remaining users of the old client-server API have been adapted to the
new RPC API, most prominently, the packet-stream-related interfaces such as
'block_session', 'nic_session', and 'audio_session'.
* We removed 'Typed_capability' and the second argument of the 'Capability'
template. The latter was an artifact that was only used to support the
transition from the old to the new API.
* The 'ipc_client' has no longer an 'operator int'. The result of an IPC can
be requested via the 'result' function.
* We refined the accessors of 'Rpc_in_buffer' in 'base/rpc_args.h'. The
'addr()' has been renamed to 'base()', 'is_valid_string()' considers the
buffer's capacity, and the new 'string()' function is guaranteed to return a
null-terminated string.
* We introduced a new 'Rm_session::Local_addr' class, which serves two
purposes. It allows the transfer of the bit representation of pointers across
RPC calls and effectively removes the need for casting the return type of
'Rm_session::attach' to the type needed at the caller side.
* The 'Connection' class template has been simplified, taking the session
interface as template argument (rather than the capability type). This change
simplified the 'Connection' classes of most session interfaces.
* The never-used return value of 'Parent::announce' has been removed. From the
child's perspective, an announcement always succeeds. The way of how the
announcement is treated is entirely up to the parent. The client should never
act differently depending on the parent's policy anyway.
* The new 'Thread_base::cap()' accessor function allows obtaining the thread's
capability as used for the argument to CPU-session operations.
Operating-system services and libraries
#######################################
Dynamic linker
==============
As a follow-up to the major revision of the dynamic linker that was featured
with the previous release, we addressed several corner cases related to
exception handling and improved the handling of global symbols.
The dynamic linker used to resolve requests for global symbols by handing out
its own symbols if present. However, in some cases, this behaviour is
undesired. For example, the dynamic linker contains a small set of libc
emulation functions specifically for the ported linker code. In the presence of
the real libc, however, these symbols should never be considered at all. To
avoid such ambiguities during symbol resolution, the set of symbols to be
exported is now explicitly declared by the white-list contained in the
'os/src/lib/ldso/symbol.map' file.
We changed the linkage of the C++ support library ('cxx') against dynamic
binaries to be consistent with the other base libraries. Originally, the 'cxx'
library was linked to both the dynamic linker and the dynamic binary, which
resulted in subtle problems caused by the duplication of cxx-internal data
structures. By linking 'cxx' only to the dynamic linker and exporting the
'__cxa' ABI as global symbols, these issues have been resolved. As a positive
side effect, this change reduces the size of dynamic binaries.
C++ exception handling in the presence of shared libraries turned out to be
more challenging than we originally anticipated. For example, the
'_Unwind_Resume' symbol is exported by the compiler's 'libsupc++' as a hidden
global symbol, which can only be resolved when linking this library to the
binary but is not seen by the dynamic linker. This was the actual reason of why
we used to link 'cxx' against both dynamic binaries and shared libraries
causing the problem mentioned in the previous paragraph. Normally, this problem
is addressed by a shared library called 'libgcc_s.so' that comes with the
compiler. However, this library depends on glibc, which prevents us from using
it on Genode. Our solution is renaming the hidden global symbol using a
'_cxx__' prefix and introducing a non-hidden global wrapper function
('__cxx__Unwind_Resume' in 'unwind.cc'), which is resolved at runtime by the
dynamic linker.
Another corner case we identified is throwing exceptions from within the
dynamic linker. In contrast to the original FreeBSD version of the dynamic
linker, which is a plain C program that can never throw a C++ exception,
Genode's version relies on C++ code that makes use of exceptions. To support
C++ exceptions from within the dynamic linker, we have to relocate the
linkers's global symbols again after having loaded the dynamic binary. This
way, type information that is also present within the dynamic binary becomes
relocated to the correct positions.
Block partition server
======================
The new block-partition server uses Genode's block-session interfaces as both
front and back end, leading to the most common use case where this server will
reside between a block driver and a higher level component like a file-system
server.
At startup, the partition server will try to parse the master boot record (MBR)
of its back-end block session. If no partition table is found, the whole block
device is exported as partition '0'. In the other case, the MBR and possible
extended boot records (EBRs) are parsed and offered as separate block sessions
to the front-end clients. The four primary partitions will receive partition
numbers '1' to '4' whereas the first logical partition will be assigned to '5'.
The policy of which partition is exposed to which client can be expressed
in the config supplied to the 'part_blk' server. Please refer to the
documentation at 'os/src/server/part_blk/README' for further details. As an
illustration of the practical use of the 'part_blk' server, you can find a run
script at 'os/run/part_blk.run'.
Skeleton of text terminal
=========================
As part of the ongoing work towards using interactive text-based GNU software
on Genode, we created the first bits of the infrastructure required for
pursuing this quest:
The new terminal-session interface at 'os/include/terminal_session/' is the
designated interface to be implemented by terminal programs.
After investigating the pros and cons of various terminal protocols and
terminal emulators, we settled for implementing a custom terminal emulator
implementing the Linux termcap. This termcap offers a reasonable small set of
commands while providing all essential features such as function-key support
and mouse support. Thanks to Peter Persson for pointing us to the right
direction! The preliminary code for parsing the escape sequences for the Linux
termcap is located at 'gems/include/terminal/'.
We have created a simplistic terminal service that implements the
terminal-session interface using a built-in font. Please note that the
implementation at 'gems/src/server/terminal/' is at an early stage. It is
accompanied by a simple echo program located at 'gems/src/test/terminal_echo'.
Device drivers
##############
USB HID and USB storage
=======================
We replaced the former DDE-Linux-based USB-related driver libraries (at the
'linux_drivers/' repository) by a single USB driver server that offers the
'Input' and 'Block' services. This enables us to use both USB HID and USB
storage at the same time. The new USB driver is located at
'linux_drivers/src/drivers/usb/'.
For using the USB driver as input service (supporting USB HID), add the
'<hid/>' tag to the 'usb_drv' configuration. Analogously, for using the driver
as block service, add the '<storage/>' tag. Both tags can be combined.
For testing the USB stack, the 'linux_drivers' repository comes with the run
scripts 'usb_hid.run' and 'usb_storage.run'.
ATA read/write support
======================
The ATAPI driver has been extended to support IDE block devices for both
read and write transactions. To use the new facility, supply 'ata="yes"'
as XML attribute to the config node of 'atapi_drv'. Please note that this
driver was primarily tested on Qemu. Use it with caution.
SATA driver
===========
The new SATA driver at 'os/src/drivers/ahci/' implements the block-driver
API ('os/include/block'), thus exposing the block-session interface as
front-end. AHCI depends on Genode's PCI driver as well as the timer server. For
a usage example see: 'os/run/ahci.run'.
Limitations and known issues
----------------------------
Currently, the server scans the PCI bus at startup and retrieves the first available
AHCI controller, scans the controller ports and uses the first non-ATAPI port
where a device is present.
On real hardware and on kernels taking advantage of I/O APICs (namely NOVA and
Fiasco.OC) we still lack support for ACPI parsing and thus for interrupts,
leading to a non-working driver.
SD-card driver
==============
The first fragments of our SD-card driver that we introduced with the previous
release have been complemented. The new SD-card driver located at
'os/src/drivers/sd_card/' implements the block-session interface by using
MMC/SD-cards and the PL180 controller as back end. Currently the driver
supports single-capacity SD cards. Therefore, the block file for Qemu should
not exceed 512 MB. Because the driver provides the generic block-session
interface, it can be combined with the new 'libc_ffat' plugin in a
straight-forward way. To give the driver a quick spin, you may give the
'libports/run/libc_ffat.run' script on the 'foc_pbxa9' platform a try.
ARM Realview PL011 UART driver
==============================
The new PL011 UART driver at 'os/src/drivers/uart/' implements the LOG session
interface using the PL011 device. Up to 4 UARTs are supported. The assignment
of UARTs to clients can be defined via a policy supplied to the driver's config
node. For further information, please refer to the README file within the
'uart' directory.
Libraries and applications
##########################
Hello tutorial
==============
The 'hello_tutorial/' repository contains a step-by-step guide for building
a simple client-server scenario. The tutorial has been rewritten for the new
RPC API and is now complemented by a run script for testing the final scenario
on various base platforms.
C and C++ runtimes
==================
:Support for standard C++ headers:
Triggered by public demand for using standard C++ headers for Genode applications,
we introduced a generally usable solution in the form of the 'stdcxx' library
to the 'libc' repository. The new 'stdcxx' library is not a real library. (you
will find the corresponding 'lib/mk/stdcxx.mk' file empty) However, it comes
with a 'lib/import/import-stdcxx.mk' file that adds the compiler's C++ includes
to the default include-search path for any target that has 'stdcxx' listed in
its 'LIBS' declaration.
:Libc back end for accessing VFAT partitions:
The new 'libc_ffat' libc plugin uses a block session via the ffat library. It
can be used by a Genode application to access a VFAT file system via the libc
file API. The file-system access is performed via the 'ffat' library. To
download this library and integrate it with Genode, change to the 'libports'
repository and issue the following command:
! make prepare PKG=ffat
For an example of how to use the libc-ffat plugin, please refer to the run
script 'libports/run/libc_ffat.run'. The source code of the test program can be
found at 'libports/src/test/libc_ffat/'.
Qt4
===
Qt4 version 4.7.1 has been enabled on ARMv6-based platforms, i.e., PBX-A9 on
Fiasco.OC. The support comprises the entire Qt4 framework including qt_webcore
(Webkit).
L4Linux
=======
L4Linux enables the use of one or multiple instances of Linux-based operating
systems as subsystems running on the Fiasco.OC kernel. The Genode version of
L4Linux has seen the following improvements:
:Kernel version: has been updated to Linux 2.6.39.
:ARM support: The L4Linux kernel can be used on ARM-based platforms now.
The PBX-A9 platform is supported via the 'l4linux.run' script as found
at 'ports-foc/run/'. Please find more information at 'ports-foc/README'.
:Genode-specific stub drivers outside the kernel tree:
The stub drivers that enable the use of Genode's services as virtual
devices for L4Linux have been moved outside the kernel patch, which
makes them much easier to maintain. These stub drivers are located
under 'ports-foc/src/drivers/'.
Platform support
################
All base platforms are now handled in a unified fashion. Downloading 3rd-party
source code is performed using the 'prepare' rule of the 'Makefile' provided by
the respective kernel's 'base-<platform>' repository. Once, the platform's base
repository is prepared, the kernel can be built directly from the Genode
build directory using 'make kernel'. All base platforms are now supported by
Genode's run mechanism that automates the tasks of system integration and
testing. For more details about each specific kernel, please revisit the
updated documentation within the respective 'base-<platform>/doc/' directory.
:L4/Fiasco:
The kernel has been updated to revision 472, enabling the use of recent
GNU tool chains.
:Fiasco.OC:
The kernel as been updated to revision 36, which remedies stability problems
related to interaction of the IPC path with thread destruction. The new version
improves the stability of highly dynamic workloads that involve the frequent
creation and destruction of subsystems. However, we experienced the new kernel
version to behave instable on the x86_64 architecture. If you depend on x86_64,
we recommend to temporarily stick with Genode 11.05 and Fiasco.OC revision 31.
:L4ka::Pistachio:
The kernel has been updated to revision 803, enabling the use of recent
versions of binutils.
:OKL4:
OKL4v2 is showing its age. Apparently, the use of the original distribution
requires tools (i.e., python 2.4) that do not ship with current Linux
distributions anymore. This makes it increasingly difficult to use this kernel.
Still, we find ourselves frequently using it for our day-to-day development. To
streamline the use of OKL4v2, we have now incorporated the kernel compilation
into the Genode build system and thereby weakened the kernel's dependency on
ancient tools. However, we decided to drop support for OKL4/ARM for now. We
figured that the supported GTA01 platform is hardly used anymore and hard to
test because it is unsupported by Qemu. Newer ARM platforms are supported by
other kernels anyway.
:Codezero:
Even though B-Labs apparently abandoned the idea of developing the Codezero
kernel in the open, we adapted Genode to the kernel's most recent Open-Source
version that is still available at the official Git repository. Furthermore,
the kernel is now fully supported by Genode's new 'make prepare' procedure and
run environment. Therefore, run scripts such as 'run/demo' can now easily be
executed on Codezero without the need to manually configure the kernel.
Note that, for now, we have disabled Codezero's capabilities because they do
not allow the assignment of device resources. Consequently, 'sys_map' fails for
MMIO regions when performing the capability check (calling 'cap_map_check').
Furthermore, the current version of the kernel requires a workaround for a
current limitation regarding the definition of a thread's pager. At some point,
Codezero abandoned the facility to define the pager for a given thread via the
exregs system call. Instead, the kernel hard-wires the creator of the thread as
the thread's pager. This is conflicting with Genode's way of creating and
paging threads. In the current version of Genode for this kernel, all threads
are paged by one thread (thread 3 happens to be the global pager) within core.
As a workaround to Codezero's current limitation, we define thread 3 to be the
pager of all threads. The patch of the upstream code is automatically being
applied by the 'make prepare' mechanism.
Build system and tools
######################
In addition to the major change with respect to the integration of the various
base platforms, Genode's tool support received the following incremental
improvements:
Build system
============
:Simplification of 'create_builddir' tool:
The 'create_builddir' tool has been relocated from
'tool/builddir/create_builddir' to 'tool/create_builddir' to make it more
readily accessible. Furthermore, we simplified the usage of the tool by
removing the mandatory 'GENODE_DIR' argument. If not explicitly specified, the
tool deduces 'GENODE_DIR' from the its known location within the Genode source
tree.
:Booting from USB sticks:
For most x86-based base platforms, their respective run environments execute
Genode from an ISO image via Qemu. Naturally, such an ISO image can be burned
onto a CD-ROM to be used to boot a real machine. However, booting from CD-ROM
is slow and optical drives are becoming scarce. Therefore we changed the
procedure of creating ISO images to support writing the resulting images to a
USB stick. Under the hood, the boot mechanism chain-loads GRUB via ISOLinux.
The files to implement the boot concept are located at 'tool/boot/'.
:Support for source files in target sub directories:
Until now, the 'SRC_*' declarations in target description files contained
a list of plain file names. The location of the files within the directory
tree had to be defined via 'vpath'. This led to inconveniences when building
3rd-party code that contains files with the same name at different subdirectories.
To resolve such an ambiguity, the target had to be decomposed into multiple
libraries each building a different set of subdirectories. To make the
build system more convenient to use, we have now added support for specifying
source codes with a relative pathname. For example, instead of using
! SRC_CC = main.cc addon.cc
! vpath addon.cc $(PRG_DIR)/contrib
we can now use
! SRC_CC = main.cc contrib/addon.cc
Automated testing across multiple kernels
=========================================
To execute one or multiple test cases on more than one base platform, we
introduced a dedicated tool located at 'tool/autopilot'. Its primary purpose is
the nightly execution of test cases. The tool takes a list of platforms and a
list of run scripts as arguments and executes each run script on each platform.
The build directory for each platform is created at
'/tmp/autopilot.<username>/<platform>' and the output of each run script is
written to a file called '<platform>.<run-script>.log'. On stderr, autopilot
prints the statistics about whether or not each run script executed
successfully on each platform. If at least one run script failed, autopilot
returns a non-zero exit code, which makes it straight forward to include
autopilot into an automated build-and-test environment.

1008
doc/release_notes/11-11.txt Normal file

File diff suppressed because it is too large Load Diff

862
doc/release_notes/12-02.txt Normal file
View File

@@ -0,0 +1,862 @@
===============================================
Release notes for the Genode OS Framework 12.02
===============================================
Genode Labs
The release of Genode 12.02 marks an exciting point in the history of the
project as it is the first version developed in the open rather than within the
chambers of Genode Labs. Thereby, we have embraced GitHub as central facility
for discussion and source-code management. This change has benefits for users
and developers of the framework alike. For users, it has become possible to get
hold of the latest developments using the official 'genodelabs/master' branch and
get involved with discussing the current activities. For regular Genode
developers, the public Git repository replaces a former mix of public
Subversion and company-internal Mercurial repositories, making life much
easier. In Section [Liberation of the development process], we outline the
motivation behind this change and give pointers to the new resources.
The major new additions to the base system are a new framework API for accessing
memory-mapped I/O resources, special support for using Genode as user-level
component framework on Linux, and API support for the reuse of existing
components in the form of sandboxed libraries. These changes are accompanied
with new device-driver infrastructure such as the first version of a device
driver manager and a new ACPI parser.
Feature-wise, the current release takes the first steps towards the goal of the
[https://genode.org/about/road-map - Roadmap for 2012], turning Genode into a
general-purpose OS ready for everyday use by its developers. According to the
roadmap, we enhanced the Noux runtime with fork semantics so that we can run
command-line based GNU programs such as the bash shell and coreutils unmodified
and natively on various microkernels. Furthermore, the library infrastructure
has been enhanced by porting and updating libraries such as Qt 4.7.4 and the
MuPDF PDF rendering engine.
Liberation of the development process
#####################################
In summer 2011, we started a discussion within Genode Labs about changing the
mode of how Genode is developed. Until then, most design discussions and the
actual development work took place locally at the company. At quarterly
intervals, we used to publish our work in the form of official Genode
releases. This way of development seemed to work quite well for us, we were
satisfied about the pace of development, and with each release, our project got
more recognition.
However, the excellent book [https://producingoss.com/ - Producing Open Source Software]
made us realize that even though we released our work under an Open-Source
license, our development process was actually far from being open and may have
discouraged participation of people outside the inner circle of developers.
Because we believe that the framework has reached a state where it becomes
interesting for a wider audience of users and developers, the idea was born
to liberate the project from its closed fashion of development.
In the beginning of December, the vague idea has become a plan. So we finally
brought the topic to our mailing list
([https://genode.org/news/steps-towards-an-open-development-process - Steps towards an open development process]).
We decided to take the release cycle for Genode 12.02 as the opportunity to put
our plan to practice. The central element of this endeavour was moving the
project over to GitHub and adapt our workflows and tooling support accordingly.
First, we started to embrace GitHub's issue tracker for the management of
working topics:
:[https://github.com/genodelabs/genode/issues]: Issue Tracker
The most significant step was leaving our Genode-Labs-internal code
repositories behind and starting a completely public Git repository instead:
:[https://github.com/genodelabs]: Genode Labs at GitHub
With the code repository going public, the way was cleared to opening up design
discussions as well. Instead of having such discussions internally at Genode
Labs, we try to increasingly take them to our mailing list and issue tracker.
With this new way of development, we hope to make the project much more
approachable for people who want to get involved and let Genode reach far out
beyond the reach of our little company.
The changes mentioned above are actually just the tip of the iceberg. For
example, the transition phase required us to rethink the way the project
website is maintained. From now on, almost all of the content of genode.org
comes directly from the project's Git repository. So maintaining website
content is done in the same coherent and transparent way as working on Genode's
code base. So we could finally put the old Wiki to rest. In the process, we
largely revisited the existing content. For example, we rewrote the
[https://genode.org/community/contributions - contributions] document in a
tutorial-like style and incorporated several practical hints, in particular
related to the recommended use of Git.
Although it is probably too early to judge the outcome of our transition, we
are excited how smooth this massive change went. We attribute this pleasant
experience mostly to the excellent GitHub hosting platform, which instantly
ignited a spirit of open collaboration among us. We are excited to see new
people approaching us and showing their interest for teaming up, and we are
curious about where this new model of development will take Genode in the
future.
Base framework, low-level OS infrastructure
###########################################
RPC framework refinements
=========================
Until now, the RPC framework did not support const RPC functions. Rather than
being a limitation inherent to the concept, const RPC functions plainly did not
exist. So supporting them was not deemed too important. However, there are uses
of RPC interfaces that would benefit from a way to declare an RPC function as
const. Candidates are functions like 'Framebuffer::Session::mode()' and
'Input::Session::is_pending()'.
With the current version, we clear the way towards declaring such functions as
const. Even though the change is pretty straight-forward, the thorough support
for const-qualified RPC functions would double the number of overloads for the
'call_member' function template (in 'base/include/util/meta.h'). For this
reason, as of now, the support of const functions is limited to typical getter
functions with no arguments. This appears to be the most common use of such
functions.
API support for enslaving services
==================================
While evolving and using the framework, we always keep an eye on recurring
patterns of how its API is used. Once such a pattern becomes obvious, we try
to take a step back, generalize the observed pattern, and come up with a new
building block that unifies the former repetitive code fragments.
One of those patterns that was far from obvious when we designed Genode years
ago is the use of a service running as child of its own client. At the first
glance, this idea seems counter-intuitive because normally, services are
understood as components that operate independently and protected from their
(untrusted) clients. But there is a class of problems where this approach
becomes extremely useful: The reuse of protocol implementations as a
library-like building block. Most services are actually protocol stacks that
translate a low-level protocol to a more abstract API. For example, a block
device driver translates a specific device API to the generic 'Block_session'
interface. Or the 'iso9660' service translates the 'Block_session' interface to
the 'Rom_session' interface by parsing the ISO9660 file system. Or similarly,
the 'tar_rom' service parses the tar file format to make its content available
via the 'Rom_session' interface.
If a particular functionality is needed by multiple programs, it is common
practice to move this functionality into a dedicated library to avoid the
duplication of the same code at many places. For example, if a program would
need to parse a tar archive, it might be tempting to move the tar-parsing code
from the 'tar_rom' service into a dedicated library, which can then be used by
both the 'tar_rom' service and the new program. An alternative approach is to
just re-use the 'tar_rom' service as a black box and treat it like it was a
library. That is, start the 'tar_rom' service as a child process, supply the
resources the component needs to operate and, in turn, use its API (now in the
form of an RPC interface) to get work done. Because the service is started as a
mere tool at the discretion of its client, we call it *slave*. It turns out
that this idea works exceedingly well in many cases. In a way, it resembles the
Unix philosophy to solve complex problems by combining many small tools each
with a specific purpose. In contrast to the use of libraries, the reuse of
entire components has benefits with regard to fault isolation. Because the
reused functionality is sandboxed within a distinct process, the environment
exposed to this code can be tailored to a rigid subset of the host program's
environment. In the event of a fault within the reused component, the reach of
problem is therefore limited.
On the other hand, we observed that even though this idea works as intended,
implementing the idea for a particular use case involved a good deal of
boiler-plate code where most of this code is needed to define the slave's
environment and resources. Hence, we reviewed the existing occurrences of the
slave pattern and condensed their common concerns into the 'Slave_policy' and
'Slave' classes residing in 'os/include/os/slave.h'. The 'Slave' class is meant
to be used as is. It is merely a convenience wrapper for a child process and
its basic resources. The 'Slave_policy' is meant as a hook for service-specific
customizations. The best showcase is the new 'd3m' component located at
'gems/src/server/d3m'. D3m extensively uses the slave pattern by instantiating
and destroying drivers and file-system instances on-the-fly. A further instance
of this pattern can be found in the new ACPI driver introduced with the current
release.
Support for resizable framebuffers
==================================
The framebuffer-session interface has remained largely untouched since the
original release of Genode in 2008. Back then, we were used to rely on C-style
out parameters in RPC functions. The current RPC framework, however, promotes
the use of a more object-oriented style. So the time has come to revisit the
framebuffer session interface. Instead of using C-style out parameters, the new
'mode()' RPC call returns the mode information as an object of type 'Mode'.
Consequently, mode-specific functions such as 'bytes_per_pixel()' have been
moved to the new 'Framebuffer::Mode' class. The former 'info()' function is
gone.
In addition to the overhaul of the RPC interface, we introduced basic support
for resizable framebuffers. The new 'mode_sigh()' function enables a client to
register a signal handler at the framebuffer session. This signal handler gets
notified in the event of server-side mode changes. Via the new 'release()'
function, the client is able to acknowledge a mode change. By calling it, the
client tells the framebuffer service that it no longer uses the original
framebuffer dataspace. So the server can replace it by a new one. After having
called 'release()', the client can obtain the dataspace for the new mode by
calling 'dataspace()' again.
MMIO access framework
=====================
As the arsenal of native device drivers for Genode grows, we are observing
an increased demand to formalize the style of how drivers are written to
foster code consistency. One particular cause of inconsistency used to be
the way of how memory-mapped I/O registers are accessed. C++ has poor support
for defining bit-accurate register layouts in memory. Therefore, driver code
usually carries along a custom set of convenience functions for reading and
writing registers of different widths as well as a list of bit definitions in
the form of enum values or '#define' statements. To access parts of a register,
the usual pattern is similar to the following example (taken from the pl011
UART driver:
! enum {
! UARTCR = 0x030, /* control register */
! UARTCR_UARTEN = 0x0001, /* enable bit in control register */
! ...
! }
! ...
!
! /* enable UART */
! _write_reg(UARTCR, _read_reg(UARTCR) | UARTCR_UARTEN);
This example showcases two inconveniences: The way the register layout is
expressed and the manual labour needed to access parts of registers. In the
general case, a driver needs to also consider 'MASK' and 'SHIFT' values to
implement access to partial registers properly. This is not just inconvenient
but also error prone. For lazy programmers as ourselves, it's just too easy to
overwrite "undefined" bits in a register instead of explicitly masking the
access to the actually targeted bits. Consequently, the driver may work fine
with the current generation of devices but break with the next generation.
So the idea was born to introduce an easy-to-use formalism for this problem. We
had two goals: First, we wanted to cleanly separate the declaration of register
layouts from the program logic of the driver. The actual driver program should
be free from any intrinsics in the form of bit-masking operations. Second, we
wanted to promote uncluttered driver code that uses names (i.e., in the form of
type names) rather than values to express its operations. The latter goal is
actually achieved by the example above by the use of enum values, but this is
only achieved through discipline. We would prefer to have an API that
facilitates the use of proper names as the most convenient way to express an
operation.
The resulting MMIO API comes in the form of two new header files located at
'base/include/util/register.h' and 'base/include/util/mmio.h'.
Register declarations
~~~~~~~~~~~~~~~~~~~~~
The class templates found in 'util/register.h' provide a means to express
register layouts using C++ types. In a way, these templates make up for
C++'s missing facility to define accurate bitfields. Let's take a look at
a simple example of the 'Register' class template that can be used to define
a register as well as a bitfield within this register:
! struct Vaporizer : Register<16>
! {
! struct Enable : Bitfield<2,1> { };
! struct State : Bitfield<3,3> {
! enum{ SOLID = 1, LIQUID = 2, GASSY = 3 };
! };
!
! static void write (access_t value);
! static access_t read ();
! };
In the example, 'Vaporizer' is a 16-bit register, which is expressed via the
'Register' template argument. The 'Register' class template allows for
accessing register content at a finer granularity than the whole register
width. To give a specific part of the register a name, the 'Register::Bitfield'
class template is used. It describes a bit region within the range of the
compound register. The bit 2 corresponds to true if the device is enabled and
bits 3 to 5 encode the 'State'. To access the actual register, the methods
'read()' and 'write()' must be provided as backend, which performs the access
of the whole register. Once defined, the 'Vaporizer' offers a handy way to
access the individual parts of the register, for example:
! /* read the whole register content */
! Vaporizer::access_t r = Vaporizer::read();
!
! /* clear a bit field */
! Vaporizer::Enable::clear(r);
!
! /* read a bit field value */
! unsigned old_state = Vaporizer::State::get(r);
!
! /* assign new bit field value */
! Vaporizer::State::set(r, Vaporizer::State::LIQUID);
!
! /* write whole register */
! Vaporizer::write(r);
Memory-mapped I/O
~~~~~~~~~~~~~~~~~
The utilities provided by 'util/mmio.h' use the 'Register' template class as
a building block to provide easy-to-use access to memory-mapped I/O registers.
The 'Mmio' class represents a memory-mapped I/O region taking its local base
address as constructor argument. Let's take a simple example to see how it is
supposed to be used:
! class Timer : Mmio
! {
! struct Value : Register<0x0, 32> { };
! struct Control : Register<0x4, 8> {
! struct Enable : Bitfield<0,1> { };
! struct Irq : Bitfield<3,1> { };
! struct Method : Bitfield<1,2>
! {
! enum { ONCE = 1, RELOAD = 2, CYCLE = 3 };
! };
! };
!
! public:
!
! Timer(addr_t base) : Mmio(base) { }
!
! void enable();
! void set_timeout(Value::access_t duration);
! bool irq_raised();
! };
The memory-mapped timer device consists of two registers: The 32-bit 'Value'
register and the 8-bit 'Control' register. They are located at the MMIO offsets
0x0 and 0x4, respectively. Some parts of the 'Control' register have specific
meanings as expressed by the 'Bitfield' definitions within the 'Control'
struct.
Using these declarations, accessing the individual bits becomes almost a
verbatim description of how the device is used. For example:
! void enable()
! {
! /* access an individual bitfield */
! write<Control::Enable>(true);
! }
!
! void set_timeout(Value::access_t duration)
! {
! /* write complete content of a register */
! write<Value>(duration);
!
! /* write all bitfields as one transaction */
! write<Control>(Control::Enable::bits(1) |
! Control::Method::bits(Control::Method::ONCE) |
! Control::Irq::bits(0));
! }
!
! bool irq_raised()
! {
! return read<Control::Irq>();
! }
In addition to those basic facilities, further noteworthy features of the new
API are the support for register arrays and the graceful overflow handling
with respect to register and bitfield boundaries.
C Runtime
=========
We extended our FreeBSD-based C runtime to accommodate the needs of the Noux
runtime environment and our port of the MuPDF application.
* The dummy implementation of '_ioctl()' has been removed. This function is
called internally within the libc, i.e., by 'tcgetattr()'. For running
libreadline in Noux, we need to hook into those ioctl operations via the
libc plugin interface.
* The 'libc/regex' and 'libc/compat' modules have been added to the libc.
These libraries are needed by the forthcoming port of Slashem to Noux.
* We added a default implementation of 'chdir()'. It relies on the sequence of
'open()', 'fchdir()', 'close()'.
* The new libc plugin 'libc_rom' enables the use of libc file I/O functions
to access ROM files as provided by Genode ROM session.
* We changed the libc dummy implementations to always return ENOSYS. Prior
this change, 'errno' used to remain untouched by those functions causing
indeterministic behaviour of code that calls those functions, observes the
error return value (as returned by most dummies), and evaluates the error
condition reported by errno.
* If using the libc for Noux programs, the default implementations of
time-related functions such as 'gettimeofday()' cannot be used because they
rely on a dedicated timeout-scheduler thread. Noux programs, however, are
expected to contain only the main thread. By turning the functions into weak
symbols, we enabled the noux libc-plugin to provide custom implementations.
DDE Kit
=======
Linux DDE used to implement Linux spin locks based on 'dde_kit_lock'. This
works fine if a spin lock is initialized only once and used from then on. But
if spin locks are initialized on-the-fly at a high rate, each initialization
causes the allocation of a new 'dde_kit_lock'. Because in contrast to normal
locks, spinlocks cannot be explicitly destroyed, the spin-lock emulating locks
are never freed. To solve the leakage of locks, we complemented DDE Kit with
the new 'os/include/dde_kit/spin_lock.h' API providing the semantics as
expected by Linux drivers.
Libraries and applications
##########################
New and updated libraries
=========================
:Qt4 updated to version 4.7.4:
We updated Qt4 from version 4.7.1 to version 4.7.4. For the most part, the
update contains bug fixes as detailed in the release notes for the versions
[https://qt.nokia.com/products/changes/changes-4.7.2 - 4.7.2],
[https://qt.nokia.com/products/changes/changes-4.7.3 - 4.7.3], and
[https://labs.qt.nokia.com/2011/09/01/qt-4-7-4-released - 4.7.4].
:Update of zlib to version 1.2.6:
Because zlib 1.2.5 is no more available at zlib.net, we bumped the zlib
version to 1.2.6.
:New ports of openjpeg, jbig2dec, and mupdf:
MuPDF is a fast and versatile PDF rendering library with only a few
dependencies. It depends on openjpeg (JPEG2000 codec) and jbig2dec (b/w image
compression library). With the current version, we integrated those libraries
alongside the MuPDF library to the 'libports' repository.
GDB monitor refinements and automated test
==========================================
We improved the support for GDB-based user-level debugging as introduced with
the previous release.
For the x86 architecture, we fixed a corner-case problem with using the
two-byte 'INT 0' instruction for breakpoints. The fix changes the breakpoint
instruction to the single-byte 'HLT'. 'HLT' is a privileged instruction and
triggers an exception when executed in user mode.
The new 'gdb_monitor_interactive.run' script extends the original
'gdb_monitor.run' script with a startup sequence that automates the
initial break-in at the 'main()' function of a dynamically linked binary.
The revised 'gdb_monitor.run' script has been improved to become a full
automated test case for GDB functionalities. It exercises the following
features (currently on Fiasco.OC only):
* Breakpoint in 'main()'
* Breakpoint in a shared-library function
* Stack trace when not in a syscall
* Thread info
* Single stepping
* Handling of segmentation-fault exception
* Stack trace when in a syscall
PDF viewer
==========
According to our road map for 2012, we pursued the port of an existing PDF
viewer as native application to Genode.
We first looked at the [https://poppler.freedesktop.org - libpoppler],
which seems to be the most popular PDF rendering engine in the world of
freedesktop.org. To get a grasp on what the porting effort of this engine may
be, we looked at projects using this library as well as the library source
code. By examining applications such as the light-weight epdfview
application, we observed that libpoppler's primary design goal is to integrate
well with existing freedesktop.org infrastructure rather than to reimplement
functionality that is provided by another library. For example, fontconfig is
used to obtain font information and Cairo is used as rendering backend. In the
context of freedesktop.org, this makes perfect sense. But in our context,
porting libpoppler would require us to port all this infrastructure to Genode
as well. To illustrate the order of magnitude of the effort needed, epdfview
depends on 65 shared libraries. Of course, at some point in the future, we will
be faced to carry out this porting work. But for the immediate goal to have a
PDF rendering engine available on Genode, it seems overly involved. Another
criterion to evaluate the feasibility of integrating libpoppler with Genode is
its API. By glancing at the API, it seems to be extremely feature rich and
complex - certainly not a thing to conquer in one evening with a glass of wine.
The Qt4 backend of the library comprises circa 8000 lines of code. This value
can be taken as a vague hint at the amount of work needed to create a custom
backend, i.e., for Genode's framebuffer-session interface.
Fortunately for us, there exists an alternative PDF rendering engine named
MuPDF. The concept of MuPDF is quite the opposite of that of libpoppler.
MuPDF tries to be as self-sufficient as possible in order to be suitable
for embedded systems without comprehensive OS infrastructure. It comes with a
custom vector-graphics library (instead of using an existing library such as
Cairo) and it even has statically linked-in all font information needed to
display PDF files that come with no embedded fonts. That said, it does not
try to reinvent the wheel in every regard. For example, it relies on
common libraries such as zlib, libpng, jpeg, freetype, and openjpeg. Most
of them are already available on Genode. And the remaining libraries are rather
free-standing and easy to port. To illustrate the low degree of dependencies,
the MuPDF application on GNU/Linux depends on only 15 shared libraries. The
best thing about MuPDF from our perspective however, is its lean and clean API,
and the wonderfully simple example application. Thanks to this example, it was
a breeze to integrate the MuPDF engine with Genode's native framebuffer-session
and input-session interfaces. The effort needed for this integration work lies
in the order of less than 300 lines of code.
At the current stage, the MuPDF rendering engine successfully runs on Genode
in the form of a simple interactive test program, which can be started
via the 'libports/run/mupdf' run script. The program supports the basic key
handling required to browse through a multi-page PDF document
(page-up or enter -> next page, page-down or backspace -> previous page).
Improved terminal performance
=============================
The terminal component used to make all intermediate states visible to the
framebuffer in a fully synchronous fashion. This is an unfortunate behaviour
when scrolling through large text outputs. By decoupling the conversion of the
terminal state to pixels from the 'Terminal::write()' RPC function,
intermediate terminal states produced by sub sequential write operations do not
end up on screen one by one but only the final state becomes visible. This
improvement drastically improves the speed in situations with a lot of
intermediate states.
Noux support for fork semantics
===============================
Genode proclaims to be a framework out of which operating systems can be built.
There is no better way of putting this claim to the test than to use the
framework for building a Unix-like OS. This is the role of the Noux runtime
environment.
During the past releases, Noux evolved into a runtime environment that is able
to execute complex command-line-based GNU software such as VIM with no
modification. However, we cannot talk of Unix without talking about its
fundamental concept embodied in the form of the 'fork()' system call. We did
not entirely dismiss the idea of implementing 'fork()' into Noux but up to now,
it was something that we willingly overlooked. However, the primary goal of
Noux is to run the GNU userland natively on Genode. This includes a good deal
of programs that rely on fork semantics. We could either try to change all the
programs to use a Genode-specific way of starting programs or bite in the
bullet and implement fork. With the current release, we did the latter.
The biggest challenge of implementing fork was to find a solution that is not
tied to one kernel but one that works across all the different base platforms.
The principle problem of starting a new process in a platform-independent
manner is already solved by Genode in the form of the 'Process' API. But this
startup procedure is entirely different from the semantics of fork. The key to
the solution was Genode's natural ability to virtualize the access to low-level
platform resources. To implement fork semantics, all Noux has to do is to
provide local implementations of core's RAM, RM, and CPU session interfaces.
The custom implementation of the CPU session interface is used to tweak the
startup procedure as performed by the 'Process' class. Normally, processes
start execution immediately at creation time at the ELF entry point. For
implementing fork semantics, however, this default behavior does not work.
Instead, we need to defer the start of the main thread until we have finished
copying the address space of the forking process. Furthermore, we need to start
the main thread at a custom trampoline function rather than at the ELF entry
point. Those customizations are possible by wrapping core's CPU service.
The custom implementation of the RAM session interface provides a pool of RAM
shared by Noux and all Noux processes. The use of a shared pool alleviates the
need to assign RAM quota to individual Noux processes. Furthermore, the custom
implementation is needed to get hold of the RAM dataspaces allocated by each
Noux process. When forking a process, the acquired information is used to
create a shadow copy of the forking address space.
Finally, a custom RM service implementation is used for recording all RM
regions attached to the region-manager session of a Noux process. Using the
recorded information, the address-space layout can then be replayed onto a new
process created via fork.
With the virtualized platform resources in place, the only puzzle piece that
is missing is the bootstrapping of the new process. When its main thread is
started, it has an identical address-space content as the forking process but
it has to talk to a different parent entrypoint and a different Noux session.
The procedure of re-establishing the relationship of the new process to its
parent is achieved via a small trampoline function that re-initializes the
process environment and then branches to the original forking point via
setjmp/longjmp. This mechanism is implemented in the libc_noux plugin.
As the immediate result of this work, a simple fork test can be executed across
all base platforms except for Linux (Linux is not supported yet). The test
program is located at 'ports/src/test/noux_fork' and can be started with the
'ports/run/noux_fork.run' script.
Furthermore, as a slightly more exciting example, there is a run script for
running a bash shell on a tar file system that contains coreutils. By starting
the 'ports/run/noux_bash.run' script, you get presented an interactive bash
shell. The shell is displayed via the terminal service and accepts user input.
It allows you to start one of the coreutils programs such as ls or cat. Please
note that the current state is still largely untested, incomplete, and flaky.
But considering that Noux is comprised of less than 2500 lines of code, we are
quite surprised of how far one can get with such little effort.
Device drivers
##############
Driver improvements to accommodate dynamic (re-)loading
=======================================================
To support the dynamic probing of devices as performed by the new d3m
component, the ATAPI and USB device drivers have been enhanced to support the
subsequent closing and re-opening of sessions.
First bits of the d3m device-driver manager
===========================================
The abbreviation d3m stands for demo device-driver manager. It is our current
solution for the automated loading of suitable drivers as needed for running
Genode from a Live CD or USB stick. Because of the current narrow focus of d3m,
it is not a generic driver-management solution but a first step in this
direction. We hope that in the long run, d3m will evolve to become a generic
driver-management facility so that we can remove one of the "D"s from its name.
In the current form d3m solves the problems of merging input-event streams,
selecting the boot device, and dealing with failing network drivers.
When using the live CD, we expect user input to come from USB HID devices or
from a PS/2 mouse and keyboard. The live system should be operational if at
least one of those sources of input is available. In the presence of multiple
sources, we want to accumulate the events of all of them.
The live CD should come in the form of a single ISO image that can be burned onto a CDROM or
alternatively copied to an USB stick. The live system should boot fine in both
cases. The first boot stage is accommodated by syslinux and the GRUB boot
loader using BIOS functions. But once Genode takes over control, it needs to
figure out on its own from where to fetch data. A priori, there is no way to
guess whether the ATAPI driver or the USB storage driver should be used.
[image d3m_what_next]
Therefore, d3m implements a probing mechanism that starts each of the drivers,
probes for the presence of a particular file on an iso9660 file system.
[image d3m_probing]
Once d3m observes a drivers that is able to successfully access the magic file,
it keeps the driver and announces the driver's service to its own parent. For
the system outside of d3m, the probing procedure is completely transparent. D3m
appears to be just a service that always provides the valid block session for
the boot medium.
[image d3m_ready]
The network device drivers that we ported from the iPXE project cover the
range of most common wired network adaptors, in particular the E1000 family.
But we cannot presume that a computer running the live system comes equipped
with one of the supported devices. If no supported network card could be
detected the driver would simply fail. Applications requesting a NIC session
would block until a NIC service becomes available, which won't happen. To
prevent this situation, d3m wraps the NIC driver and provides a dummy NIC
service in the event the drivers fails. This way, the client application won't
block infinitely but receive an error on the first attempt to use the NIC.
ACPI support
============
To accommodate kernels like Fiasco.OC or NOVA that take advantage of x86's
APIC, we have introduced a simple ACPI parser located at 'os/src/drivers/acpi'.
The server traverses the ACPI tables and sets the interrupt line of devices
within the PCI config space to the GSIs found in the ACPI tables. Internally it
uses Genode's existing PCI driver as a child process for performing PCI access
and, in turn, announces a PCI service itself.
For obtaining the IRQ routing information from the ACPI tables without
employing a full-blown ACPI interpreter, the ACPI driver uses an ingenious
technique invented by Bernhard Kauer, which is described in the following
paper:
:[https://os.inf.tu-dresden.de/papers_ps/tr-atare-2009.pdf - ATARE - ACPI Tables and Regular Expressions]:
_TU Dresden technical report TUD-FI09-09, Dresden, Germany, August 2009_
:Usage:
Start the 'acpi_drv' in your Genode environment. Do not start the 'pci_drv'
since this will be used as a slave of the 'acpi_drv'. You still must load the
'pci_drv' in your boot loader. To integrate the ACPI driver into your boot
configuration, you may take the following snippet as reference:
!<start name="acpi">
! <resource name="RAM" quantum="2M"/>
! <binary name="acpi_drv"/>
! <provides><service name="PCI"/></provides>
! <route>
! <service name="ROM"> <parent/> </service>
! <any-service> <any-child/> <parent/> </any-service>
! </route>
!</start>
:Limitations and known issues:
Currently there is no interface to set the interrupt mode for core's IRQ
sessions (e.g., level or edge triggered). This is required by Fiasco.OCs kernel
interface. We regard this as future work.
Platform support
################
Fiasco.OC microkernel
=====================
The support for the Fiasco.OC base platform is still lacking proper handling
for releasing resources such as kernel capabilities. Although this is a known
issue, we underestimated the reach of the problem when Genode's signal API is
used. Each emitted signal happens to consume one kernel capability within core,
ultimately leading to a resource outage when executing signal-intensive code
such as the packet-stream interface. The current release comes with an interim
solution. To remedy the acute problem, we extended the 'Capability_allocator'
class with the ability to register the global ID of a Genode capability so
that the ID gets associated with a process-local kernel capability. Whenever
a Genode capability gets unmarshalled from an IPC message, the
capability-allocator is asked, with the global ID as key, whether the
kernel-cap already exists. This significantly reduces the waste of
kernel-capability slots.
To circumvent problems of having one and the same ID for different kernel
objects, the following problems had to be solved:
* Replace pseudo IDs with unique ones from core's badge allocator
* When freeing a session object, free the global ID _after_ unmapping
the kernel object, otherwise the global ID might get re-used in some
process and the registry will find a valid but wrong capability
for the ID
Because core aggregates all capabilities of all different processes, its
capability registry needs much more memory compared to a regular process.
By parametrizing capability allocators differently for core and non-core
processes, the global memory overhead for capability registries is kept
at a reasonable level.
Please note that this solution is meant as an interim fix until we have
resolved the root of the problem, which is the proper tracking and releasing
of capability selectors.
Linux
=====
Linux is one of the two original base platforms of Genode. The original
intension behind supporting Linux besides a microkernel was to facilitate
portability of the API design and to have a convenient testing environment for
platform-independent code. Running Genode in the form of a bunch of plain Linux
processes has become an invaluable feature for our fast-paced development.
To our delight, we lately discovered that the use of running Genode on Linux
can actually go far beyond this original incentive. Apparently, on Linux, the
framework represents an equally powerful component framework as on the other
platforms. Hence, Genode has the potential to become an attractive option for
creating complex component-based user-level software on Linux.
For this intended use, however, the framework has to fulfill the following
additional requirements:
* Developers on Linux expect that their components integrate seamlessly with
their existing library infrastructure including all shared libraries
installed on Linux.
* The use of a custom tool chain is hard to justify to developers who regard
Genode merely as an application framework. Hence, a way to use the normal
tool chain as installed on the Linux host system is desired.
* Application developers are accustomed with using GDB for debugging and expect
that GDB can be attached to an arbitrary Genode program in an intuitive way.
Genode's original support for Linux as base platform did not meet those
expectations. Because Genode's libc would ultimately collide with the Linux
glibc, Genode is built with no glibc dependency at all. It talks to the kernel
directly using custom kernel bindings. In particular, Genode threads are created
directly via the 'clone()' system call and thread-local storage (TLS) is managed
in the same way as for the other base platforms. This has two implications.
First, because Genode's TLS mechanism is different than the Linux TLS
mechanism, Genode cannot be built with the normal host tool chain. This
compiler would generate code that would simply break on the first attempt to
use TLS. We solved this problem with our custom tool chain, which is configured
for Genode's needs. The second implication is that GDB is not able to handle
threads created differently than those created via the pthread library. Even
though GDB can be attached to each thread individually, the debugger would not
correctly handle a multi-threaded Genode process as a multi-threaded Linux
program. With regard to the use of Linux shared libraries, Genode used to
support a few special programs that used both the Genode API and Linux
libraries. Those programs (called hybrid Linux/Genode programs) were typically
pseudo device drivers that translate a Linux API to a Genode service. For
example, there exists a framebuffer service that uses libSDL as back end.
Because those programs were a rarity, the support by the build system for such
hybrid targets was rather poor.
Fortunately, all the problems outlined above could be remedied pretty easily.
It turns out that our custom libc is simply not relevant when Genode is
used as plain application framework on Linux. For this intended use, we always
want to use the host's normal libc. This way, the sole reason for using plain
system calls instead of the pthread library vanishes, which, in turn,
alleviates the need for a custom tool chain. Genode threads are then simply
pthreads compatible with the TLS code as emitted by the host compiler and
perfectly recognised by GDB. With the surprisingly little effort of creating a
new implementation of Genode's thread API to target pthreads instead of using
syscalls, we managed to provide a decent level of support for using Genode as
user-level component framework on Linux.
These technical changes alone, however, are not sufficient to make Genode
practical for real-world use. As stated above, the few hybrid Linux/Genode
programs used to be regarded as some leprous artifacts. When using Genode as
Linux application framework, however, this kind of programs are becoming the
norm rather than an exception. For this reason, we introduced new support for
such hybrid programs into the build system. By listing the 'lx_hybrid'
library in the 'LIBS' declaration of a target, this target magically becomes a
hybrid Linux/Genode program. It gets linked to the glibc and uses pthreads
instead of direct syscalls. Furthermore, host libraries can be linked to the
program by stating their respective names in the 'LX_LIBS' variable. For an
example, please refer to the libSDL-based framebuffer at
'os/src/drivers/framebuffer/sdl/target.mk'.
To enforce the build of all targets as hybrid Linux/Genode programs, the build
system features the 'alyways_hybrid' 'SPEC' value. To make it easy to create a
build directory with all targets forced to be hybrid, we have added the new
'lx_hybrid_x86' platform to the 'create_builddir' tool.
OKL4
====
:Sending an invalid-opcode exception IPC on OKL4:
When an invalid opcode gets executed, OKL4 switches to the kernel debugger
console instead of sending an exception IPC to the userland. We fixed this
problem by removing the code that invokes the debugger console from the kernel.
:Hard-wire OKL4 elfweaver to Python 2:
Recent Linux distributions use Python version 3 by default. But OKL4's
elfweaver is not compatible with this version of Python. For this reason, we
introduced a patch for pinning the Python version used by elfweaver to
version 2.
Both patches get automatically applied when preparing the 'base-okl4'
repository via 'make prepare'.
Build system and tools
######################
:Facility for explicitly building all libraries:
During its normal operation, the build system creates libraries as mere side
effects of building targets. There is no way to explicitly trigger the build of
libraries only. However, in some circumstances (for example for testing the
thorough build of all libraries), a mechanism for explicitly building libraries
would be convenient. Hence we introduced this feature in the form of the pseudo
target located at 'base/src/lib/target.mk'. By issuing 'make lib' in a build
directory, this target triggers the build of all libraries available for the
given platform.

1029
doc/release_notes/12-05.txt Normal file

File diff suppressed because it is too large Load Diff

665
doc/release_notes/12-08.txt Normal file
View File

@@ -0,0 +1,665 @@
===============================================
Release notes for the Genode OS Framework 12.08
===============================================
Genode Labs
With Genode 12.08, the project focused on platform support. It enters the world
of OMAP4-based ARM platforms, revived and vastly enhanced the support for the
NOVA hypervisor, and becomes able to run directly on ARM platforms without the
need for an underlying kernel.
The new 'base-hw' platform is a deviation from Genode's traditional approach to
complement existing kernels with user-land infrastructure. It completely leaves
the separate kernel out of the picture and thereby dwarfs the base line of the
trusted computing base of Genode-based systems to approximately the half. The
new base platform is described in Section [Genode on naked ARM hardware].
Speaking of base platforms, we are happy to have promoted the NOVA hypervisor
to a first-class citizen among the base platforms. During the last months, this
kernel underwent fundamental changes regarding its mode of development and its
feature set. This prompted us to vastly improve Genode's support for this
platform and leverage its unique features. If considering the use of Genode on
x86-based hardware, NOVA has become a very attractive foundation. Section
[Embracing the NOVA Hypervisor] describes the NOVA-specific changes.
The improvement of platform support with the current release does not entail
the base platforms only but extends to profound additions of device drivers, in
particular for the ARM-based OMAP4 SoC as used on the popular Pandaboard. We
are proud to announce the availability of device drivers for HDMI output,
SD-card, USB HID, and networking for this platform.
Beyond the low-level platform improvements, the new version comes with several
new services, optimizations of existing components, and new ported libraries.
In particular, the Noux runtime has reached a point where we can principally
execute serious networking applications such as the Lynx web browser natively
on Genode. Another example is the new FFAT-based file-system service, which
makes persistent storage available via Genode's file-system interface. By
combining this new service with existing components such as the partition
service, Noux, or the file-system plugin of the libc, a lot of new application
scenarios become available. Thanks to these new components, the framework has
become able to perform on-target debugging via GDB running in Noux, or host
the genode.org website via the lighttpd web server,
:What about the road map?:
Those of you who track the milestones laid out in our [https://genode.org/about/road-map - road map]
may wonder how Genode 12.08 relates to the stated goals. In fact, several
points of the road map haven't received the attention as originally planned.
As an explanation, let us quote the paragraph right atop of the road-map page:
"The road map is not fixed. If there is commercial interest of pushing the
Genode technology to a certain direction, we are willing to revisit our plans."
Well, this is what happened. So we traded the work on the tiled window manager,
the Intel wireless driver, and SMP support for the work on the platform topics
outlined above. Nevertheless, we stick to our overall plan to turn Genode into
a general-purpose OS that is fit for use by its developers by the end of the
year. If looking closely at the additions that come with the current release,
it will become apparent how well they fit into the big picture.
Genode on naked ARM hardware
############################
One of Genode's most distinguishing properties is the ability to use the framework
on top of a range of different kernels. This way, users of the framework
benefit from the wide variety of features provided by those kernels while
only dealing with a single API and configuration concept. For example, we
frequently find ourselves using the Linux kernel as base platform while
developing services, interfaces, and protocol stacks. By being able to start
Genode as a regular program, we effectively eliminate the reboot-time for each
test run and enjoy using commodity debugging and profiling tools. On the other
hand, if high security is a concern, NOVA and Fiasco.OC provide
capability-based security at kernel-level. So the use of one of those kernels
is desirable. Genode allows for switching between those vastly different
kernels almost seamlessly.
In general, a Genode system consists of a kernel, Genode's core, and the
largely generic components on top of core. Core abstracts away the
peculiarities of the respective kernel and provides a unified API to the
components on top. From the application's point of view both kernel and core
are always at the root of the process tree and thereby are a inherent part of
the application's trusted computing base (TCB). The distinction of both
programs is almost superficial.
Since both the kernel and core must be ultimately trusted, the complexity of
both programs is critical for each Genode-based system. On our quest for
minimizing the TCB complexity so far, however, we did not question the role of
the kernel as an inherent part of the TCB and focused our attention to the
software stack on top. However, with more and more kernels entering the
picture, we identified that there is typically a considerable overlap in
functionality between kernel and core. For example, both need to know about
address spaces and their relationship to physical memory objects. Most kernels
keep track of memory mappings in an in-kernel database. Core also needs to keep
track of this information. Consequently, we found several information
replicated without a clear benefit. With this comes a seemingly significant
redundancy of code for data structures, allocators, and utility functions.
Furthermore, there exists a class of problems that must be solved by the kernel
and core alike. In particular the resource management of dynamically allocated
in-kernel objects respectively in-core objects. Whereas core uses Genode's
resource-trading concept to solve this problem, most kernels lack a good
solution for the management of in-kernel resources and are consequently prone
to resource exhaustion problems.
Out of these observations, the idea was born to explore the opportunities of
merging both programs into one and thereby eliminating the redundancies. Our
first attempt to go into this direction was the 'base-mb' platform, which
enabled us to run Genode on the Xilinx MicroBlaze softcore CPU. With this
experiment, we gained confidence that the approach is generally feasible. So we
took on the challenge to implement the idea of a hybrid kernel/core on a more
complex architecture namely ARM Cortex-A9.
The 'base-hw' platform introduced with the current release is the intermediate
result of our experiment. With this base platform, core plays the role of core
and the kernel within one program. A few code paths that require execution in
privileged mode are executed in kernel mode whereas most code paths are
executed in user mode. Both user mode code and kernel mode code run in the same
address space. The kernel portion merely provides a few basic mechanisms
without performing complex operations such as dynamic memory allocations. For
example, if core is requested to create a new thread via core's CPU session
interface, the user-level code within core allocates a KTCB (kernel thread
control block) and UTCB (user-level thread-control block) from the physical
memory allocator and passes both physical addresses to the kernel function that
spawns the actual thread. This way, we can employ Genode's resource-trading
concept for managing typical kernel resources.
The experiment turned out to be a great success. Traditionally, we would account
at least 10,000 lines of code (LOC) for the kernel. Most kernels are actually
much larger than that. Core comes at a complexity of another 10,000 LOC. So
both kernel and core make up a base line of TCB complexity of more than 20,000
LOC. By co-locating core with the kernel, we end up with a program of just
about 13,000 LOC. The vast reduction of TCB complexity compared to having
kernel and core as separate programs strikes us.
The 'base-hw' version of core supports the complete Genode API covering support
for user-level device drivers, synchronous RPCs, asynchronous notifications,
shared memory, and managed dataspaces. It is thereby able to execute the
sophisticated Genode scenarios on top including the GUI, the dynamic linker,
and user-level device drivers. That said, we regard the current version still
as work in progress. We successfully use it as an experimentation platform for
ongoing research activities (i.e., for exploring ARM TrustZone) but some
important features such as capability-based security are not yet implemented.
:Using the base-hw platform:
The new base platform is fully integrated with Genode's build system.
When listing the supported base platforms via the 'tool/create_builddir' tool,
you will see the new 'hw_panda_a2', 'hw_vea9x4', 'hw_pbxa9' choices of
build-directory templates. The latter platform enables you to run a
'base-hw' Genode system on Qemu.
[https://genode.org/documentation/platforms/hw - Learn more about using the new base-hw platform...]
For running Genode directly on the Pandaboard, please refer to the
[https://genode.org/documentation/platforms/hw_panda_a2 - Pandaboard-specific documentation...]
Embracing the NOVA Hypervisor
#############################
NOVA is a so-called microhypervisor for the x86 architecture. It combines the
principles of microkernels with capability-based security and hardware-assisted
virtualization. Among the various base platforms supported by Genode, NOVA's
kernel interface stands out for being extremely minimalistic and orthogonal,
even by microkernel standards.
Genode has supported NOVA as base platform since 2010. But because we used NOVA
solely for sporadic research activities and NOVA's lack of a regular release
schedule, the framework's platform support received only little attention. This
has changed now. NOVA's main developer Udo Steinberg moved from TU Dresden to
Intel Labs where he leads the development of NOVA as a true Open-Source
project. In fact, the code is now being hosted at GitHub:
:[https://github.com/IntelLabs/NOVA]:
NOVA hypervisor at GitHub
Since its move to GitHub, the hypervisor has already seen significant
improvements. The repository is continuously updated, which enables us to stay
in a close feedback loop with the NOVA developers. This change of how NOVA's
development is conducted ignited our renewed interest in promoting this
platform to a first-level citizen of our framework. The first noteworthy
improvement is the recently added 64-bit support of NOVA. We enabled Genode to
work with both variants of the kernel - 32 bit and 64 bit.
But this was just the first step. The second major change addresses the
allocation of kernel resources. Early versions of the hypervisor allowed each
process to create kernel objects and thereby indirectly consume the limited
memory resources of the kernel. This is perfectly fine for a research project
but it becomes a potential denial-of-service problem in real-world use cases.
For this reason, newer versions introduced the ability to retain the allocation
of kernel objects within a trusted component only. In the Genode world, this
component is naturally core. Even though NOVA still lacks a flexible concept for
kernel-resource management as of now, Genode has become able to use NOVA
without suffering the inherent resource management limitation. This is achieved
because core is able to arbitrate the allocation of kernel resources.
The third fundamental change is the abolishment of the last traces of global
names in a NOVA-based Genode system. There are no thread IDs, object IDs, or
any other kind of globally meaningful names. Each process has a local view on
(a small part of) the system only. If a process interacts with another process,
the kernel translates the references to remote objects from one namespace to
the other. The security implications are eminent. First, a process can only
interact with or refer to objects for which it has a name, which vastly reduces
problems of ambient authority. Second, because the kernel translates names, it
becomes impossible to forge object identities. If a process tried to pass a
forged object reference to another process, the translation would simply fail,
rendering the attack ineffective.
The described changes do not come without issues, though. To make the NOVA
kernel fit with Genode's requirements, minor patches of the hypervisor are
needed. The patches are located at 'base-nova/patches/'. However, those patches
are meant as interim solutions until we find mechanisms that fit well with the
design of the hypervisor and also fulfil our requirements.
So far, we greatly enjoyed the revived collaboration with the NOVA developers
and congratulate Udo Steinberg for the new mode of development of the
hypervisor.
Base framework
##############
In the following, we describe changes of the base API that may affect users of
the framework.
:Allocation of DMA buffers:
We extended the RAM session interface with the ability to allocate DMA buffers.
The client specifies the type of RAM dataspace to allocate via the new 'cached'
argument of the 'Ram_session::alloc()' function. By default, 'cached' is true,
which corresponds to the common case and the original behavior. When setting
'cached' to 'false', core takes the precautions needed to register the memory
as uncached in the page table of each process that has the dataspace attached.
Currently, the support for allocating DMA buffers is implemented for Fiasco.OC
only. On x86 platforms, it is generally not needed. But on platforms with more
relaxed cache coherence (such as ARM), user-level device drivers should always
use uncacheable memory for DMA transactions.
:MMIO framework improvements:
As we find ourselves increasingly using the 'Register' and 'Mmio' templates
provided by 'util/register.h' and 'util/mmio.h' for dealing with memory-mapped
devices, we extended the utilities with support for 64-bit registers and a new
interface for polling bit states. The latter functionality is provided by the
new 'wait_for' function template. To decouple the MMIO-related utility code
from an actual timer facility, the function takes a so-called 'delayer' functor
as argument. This way the user of the MMIO framework is able to pick a timer
facility that fits best with the device.
:New 'memcpy' implementation:
The memory-copy functions provided by 'util/string.h' are extremely simple
and arguably slow, particularly on platforms where byte-wise copy operations
are not supported by the CPU (i.e., ARM). Hence, we have added a CPU-specific
memcpy function ('memcpy_cpu') to 'cpu/string.h', which enables us to
provide optimized implementations. So far, we did so for the ARM architecture.
Low-level OS infrastructure
###########################
FFat-based file-system service
==============================
With the previous release, we introduced Genode's file-system interface
accompanied with a simple in-memory file-system service. With the addition of
'ffat_fs', the current release adds the first persistent file system to the
framework. The service is located at 'libports/src/server/ffat_fs'. It uses
Genode's 'Block::Session' interface as back end. Therefore, it can be combined
with any of Genode's block-device drivers and the partition service called
'part_blk'. To see the new 'ffat_fs' service in action, please refer to the new
'libports/run/libc_ffat_fs.run' script.
On the course of our work on the 'ffat_fs' service, we enabled support for long
file names in libffat and added 'lseek' support to the 'libc_ffat' plugin.
TAR-based file-system service
=============================
The new 'tar_fs' service located at 'os/src/server/tar_fs' provides a read-only
file-system session interface by reading data from a TAR archive, which, in
turn, is fetched from a ROM service. By combining 'tar_fs' with the 'libc_fs'
plugin, it becomes easy to provide customized pseudo file systems to individual
Genode programs. For example, one instance of 'tar_fs' containing a static
website and a web-server configuration can be provided as file system to a web
server. The configuration is similar to the patterns known from the 'tar_rom'
and 'ram_fs' servers:
! <config>
! <archive name="tar_archive.tar" />
! <policy label="label_of_client" root="/rootdir/for/client" />
! </config>
The policy node allows for assigning different parts of one TAR archive to
different clients. For a practical usage example of 'tar_fs', please refer to
the 'libports/run/libc_fs_tar_fs.run' script.
Terminal improvements
=====================
Our work on running a growing number of command-line-based Unix programs via
Noux prompted us to improve our terminal implementation as needed. To ease
debugging for terminal colors, we changed the previous default color scheme to
fully saturated combinations of red, green, and blue. Albeit this looks quite
painful on the eyes, it is easier to spot wrong colors when using a program
that uses ncurses, for example Lynx. Furthermore, we added the handling of
sgr0 and sgr escape sequences and thereby enabled Lynx to become almost
usable when running within Noux.
Terminal cross-link service
===========================
The 'Terminal::Session' interface gets increasingly popular within Genode.
It is used by the UART drivers, the graphical terminal, GDB monitor, the TCP
terminal, and Noux. For most of these programs, their respective client or
server role is quite clear but we find ourselves tempted to combine components
in unusual ways. For example, to let Noux run an instance of GDB, which operates
on a terminal via a virtual character device. For remote debugging, GDB plays
the role of a terminal client and the UART driver plays the role of the server.
But when running GDB monitor on the same machine, GDB monitor will also
expect to play the role of the client. In order to connect GDB monitor
to a local instance of GDB, both of them being terminal clients, we need an
adapter component. This is where the new terminal cross-link service enters
the picture. It plays the role of a terminal server between exactly two
clients. The output of one client ends up as input to the other and vice
versa. Data sent to the server gets stored in a buffer of 4096 bytes (one
buffer per client). As long as the data to be written fits into the buffer, the
'write()' call returns immediately. If no more data fits into the buffer, the
'write()' call blocks until the other client has consumed some of the data from
the buffer via the 'read()' call. The 'read()' call never blocks. A signal
receiver can be used to block until new data is ready for reading.
The new terminal crosslink can be tested via the 'os/run/terminal_crosslink.run'
script. It is also used for the just mentioned on-target debugging scenario
demonstrated by the 'ports/run/noux_gdb.run' script.
DMA-aware and optimized packet streams
======================================
Motivated by our work on OMAP4 platform support, we introduced API extensions
for handling of DMA buffers to the following interfaces:
:'Attached_ram_dataspace':
The convenience utility for allocating and locally mapping a RAM dataspace
has been enhanced with the 'cached' constructor argument, which is true
by default. When using 'Attached_ram_dataspace' for allocating DMA buffers,
this argument should be set to false.
:Block and network packet stream:
The 'Block::Session' and 'Nic::Session' interfaces use Genode's packet stream
facility for transferring bulk payload between processes. A packet stream
combines shared memory with asynchronous notifications and thereby facilitates
the use of batched packet processing. To principally enable zero-copy semantics
for device drivers, the packet-stream buffer is now explicitly allocated as DMA
buffer. This clears the way to let the SD-card driver direct DMA transactions
right into the packet stream buffer. Consequently, when attaching the SD-card
driver directly to a file system, there is no copy of payload needed.
The 'Nic::Session' interface has further been improved by using a fast
bitmap allocator for allocations within the packet-stream buffer. This is
possible because networking packets have the MTU size as an upper limit.
In contrast to the 'Block::Session' interface where requests are relatively
large, 'Nic::Session' packets are tiny, and thus, greatly benefit from the
optimized allocator.
Libraries and applications
##########################
C runtime
=========
:File I/O:
We complemented our C runtime with support for the 'pread', 'pwrite', 'readv',
and 'writev' functions. The 'pread' and 'pwrite' functions are shortcuts for
randomly accessing different parts of a file. Under the hood, the functions are
implemented via 'lseek' and 'read/write'. To provide the atomicity of the
functions, a lock guard prevents the parallel execution of either or both
functions if called concurrently by multiple threads. The 'readv' and 'writev'
functions principally enable the chaining of multiple I/O requests.
Furthermore, we added 'ftruncate', 'poll', and basic support for (read-only)
mmapped files to the C runtime.
:Libc RPC framework headers:
Certain RPC headers of the libc are needed for compiling 'getaddrinfo.c'.
Unfortunately that means we have to generate a few header files, which we do
when we prepare the libc.
New and updated 3rd-party libraries
===================================
:Expat:
[https://expat.sourceforge.net - Expat] is an XML parsing library. The port of
this library was motivated by our goal to use the GNU debugger for on-target
debugging. GDB depends on this library.
:MPC and GMP:
We complemented our existing port of the
[https://gmplib.org - GNU multiple precision arithmetic library (libgmp)] with
support for the x86_64 and ARM architectures. This change combined with the
port of the [http://www.multiprecision.org/index.php?prog=mpc - MPC library]
enables us to build the Genode tool chain for these architectures.
:OpenSSL:
Our port of OpenSSL has been updated to version 1.0.1c. Because libcrypto
provides certain optimized assembler functions, which unfortunately are not
expressed with position-independent code, we removed this assembler code and
build libcrypto with '-DOPENSSL_NO_ASM'. Because the assembler code is not
needed anymore, its generation is also removed from 'openssl.mk'.
:Light-weight IP stack (lwIP):
We enabled the lwIP TCP/IP stack for 64-bit machines and updated the library to
version 1.4.1-rc1. With the new version, the call of 'lwip_loopback_init' is
not needed anymore because lwIP always creates a loopback device. Hence, we
will be able to remove the 'libc_lwip_loopback' in the future. For now, we keep
it around so we currently do not need to update the other targets that depend
on it.
:PCRE:
[https://www.pcre.org/ - PCRE] is a library for parsing regular rexpressions. We
require this library for our ongoing work on porting the lighttpd webserver.
Lighttpd web server
===================
The [https://www.lighttpd.net/ - Lighttpd] web server has been added to the
'ports' repository. The port runs as a native Genode application and ultimately
clears the way to hosting the genode.org website on Genode. To test drive this
scenario, please give the 'ports/run/genode_org.run' script a try.
At the current stage, the port is still quite limited. For example, it does not
make use of non-blocking sockets yet. But the 'genode_org.run' run script
already showcases very well how simple a Genode-based web-server appliance can
look like.
Device drivers
##############
OMAP4 platform drivers
======================
:HDMI output:
The new HDMI driver at 'os/src/drivers/framebuffer/omap4' implements Genode's
'Framebuffer::Session' interface by using the HDMI output of OMAP4. The current
version sets up a fixed XGA screen mode of 1024x768 with the RGB565 pixel
format.
:SD-card:
The new SD card driver at 'os/src/drivers/sd_card/omap4' allows the use of a
HDSD card with the Pandaboard as block service. The driver can be tested using
the 'os/run/sd_card.run' script. Because it implements the generic
'Block::Session' interface, it can be combined with a variety of other
components such as 'part_blk' (for accessing individual partitions) or
'ffat_fs' for accessing a VFAT file system on the SD card.
The driver uses the master DMA facility of the OMAP4 SD-card controller, which
yields to good performance at low CPU utilization. The throughput matches (and
in some cases outperforms) the Linux kernel driver. In the current version,
both modes of operation PIO and DMA are functional. However, PIO mode is
retained for benchmarking purposes only and will possibly be removed to further
simplify the driver.
:USB HID:
The OMAP4-based Pandaboard relies on USB for attaching input devices.
Therefore, we need a complete USB stack to enable the interactive use of the
board. Instead of implementing a USB driver from scratch, we built upon the USB
driver introduced with the Genode release 12.05. This driver was ported from the
Linux kernel.
:Networking:
The Pandaboard realizes network connectivity via the SMSC95xx chip attached to
the USB controller. Therefore, we enhanced our USB driver with support for USB
net and the smsc95xx driver. In addition to enabling the actual device-driver
functionality, the USB stack has received much attention concerning performance
optimizations. To speed up the allocation of SKBs, we replaced the former
AVL-tree based allocator with a fast bitmap allocator. For anonymous
allocations, we introduced a slab-based allocator. Furthermore, we introduced
the distinction between memory objects that are subjected to DMA operations
from non-DMA memory objects. The most profound conceptual optimization is the
use of transmit bursts by the driver. The Linux kernel, which our driver
originates from, does not provide an API for transmitting multiple packets as a
burst. For our driver, however, this optimization opportunity opened up thanks
to Genode's packet stream interface, which naturally facilitates the batching
of networking packets. So the driver has all the information needed to create
burst transactions.
USB driver
==========
By testing our new USB driver on a variety of real PC hardware, we discovered
several shortcomings, which we resolved. In particular, we added support for
more than one UHCI controller, make sure that the 'PIRQ' bit in the legacy
support register (PCI config space) of the UHCI controller is enabled and that
the 'Trap on IRQ' bit is disabled.
With those modifications in place, the USB driver works reliably on the tested
platforms.
Runtime environments
####################
Noux
====
Noux enables the easy reuse of unmodified GNU software on Genode by providing
a Unix-like kernel interface as user-level service. Because Noux is pivotal for
our plan to use Genode for productive work, we significantly enhanced and
complemented its feature set.
:Noux on ARM and x86_64:
For keeping the scope of the development manageable, the initial version of
Noux was tied to the x86_32 platform. This was not a principal limitation of
the approach but rather an artificial restriction to keep us focused on
functionality first. Now that Noux reaches a usable state, we desire to use it
on platforms other than x86_32. The current release enables Noux for the 64-bit
x86 and ARM architectures.
The level of support is pretty far-reaching and even includes the building and
execution of the Genode tool chain on those platforms. In the process of
enabling these platforms, we updated the Noux package for GCC to version 4.6.1,
which matches the version of the current Genode tool chain.
:Terminal file system:
Noux supports the concept of stacked file systems. The virtual file system
is defined at the start of a Noux instance driven by the static Noux
configuration. This way, arbitrary directory structures can be composed out
of file-system sessions and TAR archives. The VFS concept allows for the
easy addition of new file system types. To allow programs running in a Noux
instance to communicate over a dedicated terminal session, we added a new
file-system type that corresponds to a virtual character device node attached
to a terminal session.
:GDB running in the Noux environment:
With the terminal file system in place, we are ready to execute GDB within
Noux and let it talk to a GDB monitor instance over the terminal session
interface. From GDB's point of view, the setup looks like a remote debugging
session. But in reality both the debugging target and GDB reside in different
subtrees of the same Genode system.
:Executing shell scripts:
By inspecting the program specified to the execve system call, Noux has become
able to spawn scripts that use the '#!' syntax. If such a file is detected, it
executes the specified interpreter instead and passes the arguments specified
after the '#!' marker, followed by command-line arguments.
:Networking support:
Our work on porting various networking tools to Noux triggers us to steadily
improve the networking support introduced with Genode 12.05. In particular, we
added proper support for DNS resolving, which enables us to execute the
command-line based Lynx web browser within Noux.
:User information:
Because there are certain programs, which need the information that is stored
in 'struct passwd', we introduced configurable user information support to
Noux. One can set the user information via the '<user>' node in the Noux
config:
! <config>
! <user name="baron" uid="1" gid="1">
! <shell name="/bin/bash" />
! <home name="/home" />
! </user>
! ...
! </config>
When '<user>' is not specified, default values are used. Currently these
are 'root', 0, 0, '/bin/bash', '/'. Note that this is just a single user
implementation because each Noux instance has only one user or rather one
identity and there will be no complete multi-user support in Noux. If you need
different users, just start new Noux instances for each of them.
:New '/dev/null' and '/dev/zero' pseudo devices:
These device are mandatory for most programs (well, at least null is required
to be present for a POSIX compliant OS, which Noux is actually not). But for
proper shell-script support we will need them anyway. Under the hood, both
pseudo devices are implemented as individual file-systems and facilitate Noux's
support for stacked file systems. The following example configuration snippet
creates the pseudo devices under the '/dev' directory.
! <config>
! <fstab>
! <dir name="dev" >
! <null /> <zero />
! </dir>
! ...
! <fstab>
! ...
! </config>
Vancouver
=========
The comprehensive rework of the NOVA base platform affected the Genode version
of the Vancouver virtual machine monitor as this program used to speak directly
to the NOVA kernel. Since no kernel objects can be created outside of core
anymore, the Vancouver port had to be adjusted to solely use Genode interfaces.
L4Linux
=======
To improve the stability and performance of L4Linux on OMAP4 platforms, we
reworked parts of the Genode-specific stub drivers, in particular the
networking code. Among the improvements are the use of a high-performance
allocator for networking packets, improved IRQ safety of IPC calls (to
the Genode world), and tweaks of the TCP rmem and wmem buffer sizes to
achieve good TCP performance when running Linux with little memory.
Furthermore, we added two ready-to-use run scripts residing within
'ports-foc/run' as examples for executing L4Linux on the OMAP4-based
Pandaboard. The 'linux_panda.run' script is meant as a blue print for
experimentation. It integrates one instance of L4Linux with the native SD-card
driver, the HDMI driver, and the USB HID input driver. The
'two_linux_panda.run' script is a more elaborative example that executes two
instances of L4Linux, a block-device test, and a simple web server. Each of
the L4Linux instances accesses a different SD-card partition whereas the
block-device test operates on a third partition.

735
doc/release_notes/12-11.txt Normal file
View File

@@ -0,0 +1,735 @@
===============================================
Release notes for the Genode OS Framework 12.11
===============================================
Genode Labs
The central theme of version 12.11 of the Genode OS Framework is
self-hosting Genode on Genode. With self-hosting, we understand the execution of the
entire Genode build system within the Genode environment. There are two motivations
for pursing this line of work. First, it is a fundamental prerequisite for the
Genode developers to move towards using Genode as a day-to-day OS. Of course,
this prerequisite could be realized using one of the available virtualization
solutions. For example, we could run L4Linux on top of Genode on the Fiasco.OC
kernel and use the Genode build system from within an L4Linux instance.
However, this defeats the primary incentive behind Genode to reduce system
complexity. By having both Genode and L4Linux in the picture, we would indeed
increase the overall complexity in configuring, maintaining, and using the
system. Therefore, we would largely prefer to remove the complex Linux user
land from the picture. The second motivation is to prove that the framework and
underlying base platforms are suited and stable enough for real-world use.
If the system is not able to handle a workload like the build system,
there is little point in arguing about the added value of having a
microkernel-based system over current commodity OSes such as GNU/Linux.
We are happy to have reached the state where we can execute the unmodified
Genode build system directly on Genode running on a microkernel. As the
build system is based on GNU utilities and the GNU compiler collection,
significant effort went into the glue between those tools and the Genode API.
Section [Building Genode on Genode] provides insights into the way we achieved
the goal and the current state of affairs.
Along with the work on bringing the build system to Genode came numerous
stability improvements and optimizations all over the place, reaching from the
respective kernels, over the C runtime, the file-system implementations, memory
allocators, up to the actual programs the tool chain is composed of. Speaking
of the tool chain, the official Genode tool chain has been updated from GCC
version 4.6.1 to version 4.7.2. Thereby, all 3rd-party code packages were
subjected to testing and fixing activities.
For running the build system, the project currently focuses on NOVA and
Fiasco.OC as base platforms. However, our custom kernel platform for the ARM
architecture has also received significant improvements. With added support for
Freescale i.MX and Texas Instruments OMAP4, this platform proved to be very
well adaptable to new SoCs whereas new cache handling brings welcome
performance improvements. Furthermore, we have added experimental support for
ARM TrustZone technology, which principally enables the execution of Genode in
the so-called secure world of TrustZone while executing Linux in the so-called
normal world.
As we discovered the increasing interest in using Genode as a middleware
solution on Linux, we largely revisited the support for this kernel platform
and discovered amazing new ways to align the concept of Genode with the
mechanisms provided by the Linux kernel. Section [Linux] provides a summary
of the new approaches taken for supporting this platform.
Functionality-wise, the new version introduces support for audio drivers of
the Open Sound System, a new OMAP4 GPIO driver, improvements of the graphical
terminal, and the initial port of an SSH client.
Building Genode on Genode
#########################
On the Genode developer's way towards using Genode as a day-to-day OS, the
ability to execute the Genode build system within the Genode environment is a
pivotal step - a step that is highly challenging because the build system is
based on the tight interplay of many GNU programs. Among those
programs are GNU make, coreutils, findutils, binutils, gcc, and bash. Even
though there is a large track record of individual programs and libraries ported
to the environment, those programs used to be self-sustaining applications that
require only little interaction with other programs. In contrast, the build
system relies on many utilities working together using mechanisms such as
files, pipes, output redirection, and execve. The Genode base system does not
come with any of those mechanisms let alone the subtle semantics of the POSIX
interface as expected by those utilities. Being true to microkernel principles,
Genode's API has a far lower abstraction level and is much more rigid in scope.
To fill the gap between the requirements of the build system and the bare
Genode mechanisms, the Noux runtime environment was created. Noux is a Genode
process that acts like a Unix kernel. When started, it creates a child process,
which plays a similar role as the init process of Unix. This process communicates
via RPC messages to Noux. Using those messages, the process can perform all the
operations normally provided by a classical Unix kernel. When executed under
Noux, a process can even invoke functionalities such as fork and execve, which
would normally contradict with Genode's principles of resource management.
Over the course of the past year, more and more programs have been ported to
the Noux environment. Thereby, the semantics provided by Noux have been
successively refined so that those program behave as expected. This was an
iterative process. For example, at the beginning, Noux did not consider the
differences between 'lstat' and 'stat' as they did not matter for the first
batch of GNU programs ported to Noux. As soon as the programs got more
sophisticated, such shortcuts had to be replaced by the correct semantics. The
Genode build system is by far the most complex scenario exposed to Noux so far.
It revealed many shortcomings by both functionality implemented in Noux or the
C runtime as well as the underlying base platforms. So it proved to be a great
testing ground for analysing and improving those platform details. Therefore,
the secondary effects of self-hosting Genode on Genode in terms of stability
turned out to be extremely valuable.
The release comes with two ready-to-use run scripts for building bootable
system images that are able to execute the Genode tool chain, one for targeting
NOVA and one for targeting Fiasco.OC. Those run scripts are located at
'ports/run/' and called 'noux_tool_chain_nova.run' and 'noux_tool_chain_foc.run'
respectively. Each of those run scripts can be executed on either of those base
platforms. For example, by executing 'noux_tool_chain_nova' on Fiasco.OC, the
image will run Genode on Fiasco.OC and the tool chain will build binaries for
NOVA. When started, a build directory will be created at '/home/build'.
The Genode source code is located at '/genode'. In the '/bin' directory,
there are all the GNU programs needed to execute the tool chain. For
taking a look into the source code, 'vim' is available. To build core,
change to the build directory '/home/build' and issue 'make core'.
On Fiasco.OC, the complete Genode demo scenario can be compiled. On NOVA, the
incomplete life-time management of kernel objects will still result in an
out-of-memory error of the kernel. This kernel issue is currently being worked
on. Executing the tool chain on either of those platforms is still relatively
slow as extensive trace output is being generated and no actions have been taken to
optimize the performance so far. There are many opportunities for such
optimizations, which will be taken on as the next step.
Base framework
##############
Genode's base framework has received new support for extending session
interfaces and gained improvements with regard to interrupt handling on the x86
platform. At the API level, there are minor changes related to the CPU session
and 'Range_allocator' interfaces.
Support for specializing session interfaces
===========================================
With increasingly sophisticated application scenarios comes the desire to
extend Genode's existing session interface with new functionality. For example,
the 'Terminal::Session' interface covers plain read and write operations. It is
implemented by services such as a graphical terminal, the telnet-like TCP
terminal, or UART drivers. However, for the latter category, the breadth of the
interface is severely limited as UART drivers tend to supplement the read / write
interface with additional control functions, e.g., for setting the baud rate.
One way to go would be to extend the existing 'Terminal::Session' interface
with those control functions. However, these functions would be meaningless for
most implementations. Some of those other implementations may even desire their
own share of additions. In the longer term, this approach might successively
broaden the interface and each implementation will cover a subset only.
Because Genode aspires to keep interfaces as low-complex as possible while, at
the same time, it wants to accommodate the growing sophistication of usage
scenarios, we need a solution that scales. The solution turns out to be
strikingly simple. The RPC framework already supports the inheritance of RPC
interfaces. So it is possible to model the problem such that a new
'Uart::Session' interface derived from the existing 'Terminal::Session' will
be the host of UART-specific functionality. The only piece missing is the
propagation of both 'Uart' and 'Terminal' through the parent interface while
announcing the service. To spare the work of manually announcing the chain of
inherited interfaces from the implementor, the 'Parent::announce()' function has
been enhanced to automatically announce all service types implemented by the
announced interface. This way, a UART driver will always announce a "Uart"
and a "Terminal" service.
Improved interrupt handling
===========================
To accommodate modern x86 platforms, the session arguments of core's IRQ
service have been supplemented with the IRQ mode. There are two degrees of
freedom, namely the trigger (level / edge) and polarity (high / low). Thanks to
this addition, device drivers have become able to supply their knowledge of
devices to core.
In system scenarios with many peripherals, in particular when using the USB
driver, IRQ lines are shared between devices. Until now, Genode supported
shared interrupts for the OKL4 base platform only. To also cover the other
x86 kernels, we have generalized the interrupt sharing code and enabled this
feature on Fiasco.OC and NOVA.
Revised CPU session interface
=============================
We revisited the CPU session interface, removed no-longer used functions and
added support for assigning threads to CPUs.
The original CPU session interface contained functions for iterating through
the threads of a session. This interface was originally motivated by an
experimental statistical profiling tool that was developed at an early stage of
Genode. In the meanwhile, we discovered that the virtualization of the CPU
session interface is much more elegant to cover this use case than the
thread-iterator interface. Because the iteration has no transactional
semantics, it was unsafe to use it anyway.
To enable the use of multiple CPUs on multi-processor systems, the CPU
session interface has been enhanced with two functions, namely 'affinity'
and 'num_cpus'. The interface extension principally allows the assignment of
individual threads to CPUs. It is currently implemented on Fiasco.OC only.
On all other base platforms, 'num_cpus' returns one CPU. Note that on
the Linux platform, multiple CPUs will be used transparently.
The 'Cpu_session::state' function has been split into two functions, one
for retrieving information and one for propagating state information. The
prior interface was less explicit about the semantics of the 'state' function
as it took a non-const pointer to a 'Thread_state' object as argument.
Platform-tailored protection domains
====================================
Genode tries to provide a uniform API across all the different base platforms.
Yet, it also strives to make genuine platform features available to the
users of the framework. Examples for such features are the virtualization
support of the NOVA hypervisor or the special support for paravirtualizing
Linux on Fiasco.OC. Another example is the security model as found on the Linux
platform. Even though the security mechanisms of plain Linux are not as strong
as Genode's capability concept on a conceptual level, we still want to leverage
the available facilities such as user IDs and chroot as far as possible.
Consequently, we need a way to assign platform-specific properties to PD
sessions. With the new 'Native_pd_args' type introduced into
'base/native_types.h', there is now a way to express those platform-specific
concerns. This type is now used at all the places that deal with the creation
of protection domains such as 'Process', 'Child', and the loader.
Revised 'Range_allocator' interface
===================================
The handling of allocation errors has been refined in order to distinguish
different error conditions, in particular out-of-metadata and out-of-memory
conditions. The user of the allocator might want to handle both cases
differently. Hence we return an 'Alloc_return' value as result. In prior
versions, this type was just an enum value. With the new version, the type has
been changed to a class. This makes the differentiation of error conditions at
the caller side more robust because, in contrast to enum values, typed objects
don't get implicitly converted to bool values.
Low-level OS infrastructure
###########################
New UART session interface
==========================
To accommodate UART specific extensions of the 'Terminal::Session' interface,
in particular setting the baud rate, we introduced the new 'Uart::Session'
interface and changed the existing UART drivers to implement this
interface instead of the 'Terminal::Session' interface. Because 'Uart::Session'
inherits the 'Terminal::Session' interface, 'Uart' services announce both
"Uart" and "Terminal" at their parent.
New GPIO session interface
==========================
Embedded SoCs such as OMAP4 provide many general-purpose I/O pins, which can be
used for different purposes depending on the board where they are soldered on.
For example, the Pandaboard uses such GPIO pins to detect the presence of a
HDMI plug or control the power supply for the USB. If only one driver deals
with GPIO pins, the GPIO programming can reside in the driver. However, if
multiple drivers are used, the GPIO device resources cannot be handed out to
more than one driver. This scenario calls for the creation of a GPIO driver as
a separate component, which intermediates (and potentially multiplexes) the
access to the physical GPIO pins. The new 'Gpio::Session' interface allows one
or multiple clients to configure I/O pins, request states, as well as to
register for events happening on the pins.
Terminal
========
The graphical terminal has been enhanced with support for different built-in
font sizes and background-color handling.
In addition to those functional changes, the implementation has been decomposed
into several parts that thereby became reusable. Those parts comprise the
handling of key mappings, decoding the VT character stream, and the handling of
the character array. These functionalities are now available at
'gems/include/terminal'.
Libraries and applications
##########################
C runtime
=========
:Allocator optimized for small-object allocations:
To optimize the performance of workloads that depend on a large number of small
dynamic memory allocations, in particular the lwIP TCP/IP stack, we replaced
the memory allocator of the libc with a more sophisticated strategy. Until now,
the libc used 'Genode::Heap' as allocator. This implementation is an
AVL-tree-based best-fit allocator that is optimized for low code complexity
rather than performance for small allocations. The observation of the allocator
usage pattern of lwIP prompted us to replace the original libc malloc/free with
a version that uses slab allocators for small objects and relies on the
'Genode::Heap' for large objects only.
:Symbolic links:
Because part of our ongoing refinements of the Noux runtime is the provision of
symbolic links, support for symbolic links was added in the libc, libc plugins,
and file system servers.
lwIP
====
We updated the light-weight IP stack to version STABLE-1.4.1. Additionally,
the following optimizations were conducted to improve its performance and
robustness.
We reduced the maximum segment lifetime from one minute to one second to avoid
queuing up PCBs in TIME-WAIT state. This is the state, PCBs end up after
closing a TCP connection socket at the server side. The number of PCBs in this
state is apparently not limited by the value of 'MEMP_NUM_TCP_PCB'. One
allocation costs around 160 bytes. If clients connect to the server at a high
rate, those allocations accumulate quickly and thereby may exhaust the memory
of the server. By reducing the segment lifetime, PCBs in TIME-WAIT state are
cleaned up from the 'tcp_tw_pcbs' queue in a more timely fashion (by
'tcp_slowtmr()').
To prevent the TCP/IP stack from artificially throttling TCP throughput,
we adjusted lwIP's TCP_SND_BUF size.
From our work on optimizing the NIC stub-code performance of L4Linux as
described [https://genode.org/documentation/articles/pandaboard - here],
we learned that the use of a NIC-specific packet allocator for the
packet-stream interface is beneficial. At the lwIP back end, we still relied on
the original general-purpose allocator. Hence, we improved the lwIP back-end
code by using the bitmap-based 'Nic::Packet_allocator' allocator instead.
Standard C++ library
====================
Genode used to rely on the standard C++ library that comes with the tool chain.
However, this mechanism was prone to inconsistencies of the types defined in
the header files used at compile time of the tool chain and the types provided
by our libc. By building the C++ standard library as part of the Genode build
process, such inconsistencies cannot happen anymore. The current version of the
C++ standard library corresponds to GCC 4.7.2.
Note that the patch changes the meaning of the 'stdcxx' library for users that
happened to rely on 'stdcxx' for hybrid Linux/Genode applications. For such
uses, the original mechanism is still available, in the renamed form of
'toolchain_stdcxx'.
Device drivers
##############
Open Sound System
=================
Genode tries to re-use existing device drivers as much as possible using an
approach called device-driver environment (DDE). A DDE is a library that
emulates the environment of the original driver by translating device accesses
to the Genode API. There are many success stories of drivers successfully ported
to the framework this way. For example, using DDE-Linux, we are able to use the
Linux USB stack. Using DDE-ipxe, we are able to use iPXE networking drivers.
With Genode 12.11 we extend our arsenal of DDEs with DDE-OSS, which is a
device-driver environment for the audio drivers of the Open Sound System (OSS).
:Website of the Open Sound System:
[http://www.4front-tech.com]
The new 'dde_oss' contains all the pieces needed to use Intel HDA, AC97, and
ES1370 audio cards on Genode. On first use, the 3rd-party code can be
downloaded by issuing 'make prepare' from within the 'dde_oss' source-code
repository. Also, you need to make sure to add the 'dde_oss' repository to your
'REPOSITORIES' variable in 'etc/build.conf'.
An OSS demo configuration can be found under 'run/oss.run' and can be started
via 'make run/oss' from a Genode build directory. Be sure to adjust the
'filename' tag of the 'audio0' program. The file has to reside under
'<build-dir>/bin/'. The file format is header-less two-channel float-32 at
44100 Hz. You may use the 'sox' utility to create these audio files:
! sox -c 2 -r 44100 foo.mp3 foo.f32
OMAP4 GPIO driver
=================
The new OMAP4 GPIO driver is the first implementation of the just introduced
'Gpio::Session' interface. The driver supports two ways of interacting
with GPIO pins, by providing a static configuration, or by interacting with a
session interface at runtime. An example for a static configuration looks as
follows:
! <config>
! <gpio num="121" mode="I"/>
! <gpio num="7" mode="O" value="0"/>
! <gpio num="8" mode="O" value="0"/>
! </config>
The driver is located at 'os/src/drivers/gpio/omap4'. As reference for using
the driver, please refer to the 'os/run/gpio_drv.run' script.
Thanks to Ivan Loskutov of Ksys-Labs for contributing the session interface
and the driver!
iPXE networking drivers
=======================
We updated our device-driver environment for iPXE networking drivers to a
recent git revision and enabled support for the x86_64 architecture.
Currently, the driver covers Intel gigabit ethernet (e1000, e1000e, igb),
Intel eepro100, and Realtek 8139/8169.
Runtime environments
####################
Noux
====
The Noux runtime environment has received plenty of love thanks to the
aspiration to execute the Genode build system.
:Time:
The build system uses GNU make, which depends on time stamps of files. We do
not necessarily need a real clock. A monotonic increasing virtual time is
enough. To provide such a virtual time, the libc was enhanced with basic
support for functions like 'gettimeofday', 'clock_gettime', and 'utimes'. As
there is currently no interface to obtain the real-world time in Genode, Noux
simulates a pseudo real-time clock using a jiffies-counting thread. This
limited degree of support for time is apparently sufficient to trick tools like
ping, find, and make into working as desired.
:Improved networking support:
The Noux/net version of Noux extends the Noux runtime with the BSD-socket
interface by using the lwIP stack. This version of Noux multiplexes the
BSD-socket interface of lwIP to multiple Noux programs, each having a different
socket-descriptor name space and the principal ability to use blocking calls
such as 'select'. The code for multiplexing the lwIP stack among multiple Noux
processes has been improved to cover corner cases exposed by sophisticated
network clients, i.e., openssh.
:Directory cache for the TAR file system:
The original version of the TAR file system required a search in all TAR
records for each file lookup. This takes a long time when composing a large
directory tree out of multiple TAR archives stacked together. This is the case
for the Genode build-system scenario where we have all the files of the GNU
tools as well as the Genode source tree. Searching through thousands of records
for each call of 'stat' quickly becomes a scalability issue. Therefore, we
introduced a TAR indexing mechanism that scans each TAR file only once at the
startup of Noux and generates a tree structure representing the directory
layout. Looking up files using this index is quick.
:New packages:
With Genode-12.11, new 3rd-party packages have become available, namely
OpenSSH, the 'which' command, and all tool-chain components in their current
version. OpenSSH is still at an experimental stage. The run script at
'ports/run/noux_net_openssh_interactive.run' demonstrates how SSH can be used
to login into a remote machine.
:New pseudo file systems:
The new 'stdio' and 'random' file systems are intended to represent the pseudo
devices '/dev/random' and '/dev/tty' on Noux. Both are needed to run OpenSSH.
Note that the 'Arc4random' class, on which the random file system is based on,
currently _does not collect enough_ random bytes! It should not be used for
security-critical applications.
L4Linux
=======
The paravirtualized L4Linux kernel for the Fiasco.OC platform was updated to
SVN revision 25, which matches the Fiasco.OC SVN revision 40. We further
improved the integration of L4Linux with Genode by optimizing the stub drivers
for block devices and networking, and added principal support for running
L4Linux on SMP platforms.
Platforms
#########
NOVA
====
Genode follows the steady development of the NOVA microhypervisor very closely.
The kernel used by the framework corresponds to the current state of the master
branch of IntelLabs/NOVA.
:Improvements towards GDB support:
The NOVA-specific implementation of the CPU session interface has been improved
to accommodate the requirements posed by GDB. In particular, the 'pause',
'resume', 'state', and 'single_step' functions have been implemented. Those
functions can be used to manipulate the execution and register state of
threads. Under the hood, NOVA's 'recall' feature is used to implement these
mechanisms. By issuing a 'recall' for a given thread, the targeted thread is
forced into an exception. In the exception, the current state of the thread can
be obtained and its execution can be halted/paused.
:Maximizing contiguous virtual space:
To enable the Vancouver virtual machine monitor to hand out large amounts of
guest memory, we optimized core's virtual address space to retain large and
naturally aligned contiguous memory regions. For non-core processes, the
thread-context area that contains the stacks of Genode threads has been moved
to the end of the available virtual address space.
:Life-time management of kernel resources:
We improved the life-time management of kernel resources, in particular
capabilities, within Genode. Still the management of such kernel resources
is not on par with the Fiasco.OC version, partially because of missing
kernel functionality. This is an ongoing topic that is being worked on.
:Using the BIOS data area (BDA) to get serial I/O ports on x86:
If the I/O ports for the comport are non default (default is 0x3f8), we had to
specify manually the correct I/O ports in the source code. To avoid the need
for source-code modifications when changing test machines, we changed the core
console to read the BDA and use the first serial interface that is available.
If no serial interface is available, no device configuration will be
undertaken. The BDA can be populated via a multi-boot chain loader. Bender is
such a chain loader that can detect serial ports accessible via PCI and writes
the I/O ports to the Bios Data area (BDA). These values get then picked up by
core.
Fiasco.OC
=========
The Fiasco.OC kernel has been updated to the SVN revision 40. The update improves
SMP support and comes with various bug fixes. There is no noteworthy change
with regard to the kernel interface. We extended the number of supported
Fiasco.OC-based platforms for Genode by including the Freescale i.MX53.
To enable the use of multiple CPUs by Genode processes, the CPU session
interface has been enhanced to support configuring the affinity of threads with
CPUs. We changed the default kernel configuration for x86 and ARM to
enable SMP support and adapted L4Linux to use the new interface.
Execution on bare hardware (base-hw)
====================================
The development of our custom platform for executing Genode directly on bare
hardware with no kernel underneath went full steam ahead during the release
cycle.
:Pandaboard:
The in-kernel drivers needed to accommodate the Pandaboard, more specifically
the timer and interrupt controller, are now supported. So the Pandaboard can be
used with both 'base-hw' and 'base-foc'. Also, the higher-level platform
drivers for USB, HDMI, and SD-card that were introduced with the previous
release, are equally functional on both platforms.
:Freescale i.MX31:
We added principal support for the Freescale i.MX line of SoCs taking the
ARMv6-based i.MX31 as starting point. As of now, the degree of support is
limited to the devices needed by the kernel to operate. Pure software-based
scenarios are able to work, i.e., the nested init run script executes
successfully.
:TrustZone support:
The new VM session interface of core provides a way to execute software
in the normal world of a TrustZone system whereas Genode runs in the secure
world. From Genode's point of view, the normal world looks like a virtual
machine. Each time, the normal world produces a fault or issues a secure
monitor call, control gets transferred to the virtual machine monitor, which is
a normal user-level Genode process. The base-hw kernel has been enhanced to
perform world switches between the secure and normal world and with the ability
to handle fast interrupts (FIQs) in addition to normal interrupts. The latter
extension is needed to assign a subset of devices to either of both worlds.
Currently, the only TrustZone capable platform is the ARM CoreTile Express
CA9x4 for the Versatile Express board. For a virtual machine working properly
on top, some platform resources must be reserved. Therefore, there exist two
flavours of this platform now, one with the 'trustzone' spec-variable enabled
and one without. If 'trustzone' is specified, most platform resources (DDR-RAM,
and most IRQs) are reserved for the normal world and not available to the
secure Genode world.
:Memory attributes and caching:
We successively activated various levels of caching and improved the handling
of caching attributes propagated into the page tables. These changes resulted
in a significant boost in performance on non-emulated platforms.
Linux
=====
The Linux version of Genode was originally meant as a vehicle for rapid
development. It allows the framework components including core to be executed
as plain Linux processes. But in contrast to normal Linux programs, which
use the glibc, Genode's components interact with the kernel directly without
any C runtime other than what comes with Genode. We use the Linux version on a
regular basis to implement platform-agnostic functionality and protocols. Most
of Genode's code (except for device drivers) falls in this category. Because
the Linux version was meant as a mere tool, however, we haven't put much
thought into the principle way to implementing Genode's security concept on
this platform. Threads used to communicate over globally accessible Unix-domain
sockets and memory objects were represented as globally accessible files within
'/tmp'.
That said, even though Linux was not meant as a primary platform for Genode in
the first place, Genode can bring additional value to Linux. When considering
the implementation of a component-based system on Linux, there are several
possible approaches to take. For example, components may use DBus to
communicate, or components could pick from the manifold Unix mechanisms such as
named pipes, files, sysv-shared memory, signals, and others. Unfortunately
those mechanisms are not orthogonal and most of them live in the global name
space of the virtual file system. Whereas those mechanisms are principally able
to let processes communicate, questions about how processes get to know each
other, access-control policy, synchronization of the startup of processes are
left to the developer.
Genode, on the other hand, does provide an API for letting components
communicate but also answers those tricky questions concerning the composition
of components. This makes Genode an interesting option to build component based
applications, even on Linux. However, when used in such a context, the
limitations of the original Linux support need resolutions. Therefore, the
current release comes with a largely revised platform support for the Linux
base platform.
The changes can be summarized as follows:
:Using file descriptors as communication addresses:
Genode's synchronous RPC framework was using Unix domain sockets. Each RPC
entrypoint was represented by a pair of named files, one for sending and one
for receiving messages. In the new version, inter-process communication is
performed via file descriptors only.
:Transfer of communication rights via RPC only:
Capabilities used to be represented as a pair of the destination thread ID and
a global object ID. The thread ID has been replaced by a file descriptor that
points to the corresponding RPC entrypoint. When capabilities are transferred
as RPC arguments, those file descriptors are transferred via SCM rights
messages. This is in line with Genode's way of capability-based delegation of
access rights.
:Core-only creation of communication channels:
Communication channels used to be created locally by each process. The naming
of those channels was a mere convention. In contrast, now, communication
channels are created by core only and do not reside on the Linux virtual file
system. When creating an RPC entrypoint, core creates a socket pair and hands
out both ends to the creator of the entrypoint.
:Restricted access to memory objects:
Access to dataspace content was performed by mmap'ing a file. For a given
dataspace, the file name could be requested at core via a Linux-specific RPC
call. Now, core holds the file descriptors of all dataspaces, which are
actually unlinked files. A process that is in possession of a dataspace
capability can request the file descriptor for the content from core and mmap
the file locally. This way, access to memory objects is subjected to the
delegation of dataspace capabilities.
:Core-local process creation:
Genode used to create new processes by directly forking from the respective
Genode parent using the process library. The forking process created a PD
session at core merely for propagating the PID of the new process into core
(for later destruction). This traditional mechanism has the following
disadvantages:
First, the PID reported by the creating process to core cannot easily be
validated by core. Therefore core has to trust the PD client to not specify a
PID of an existing process, which would happen to be killed once the PD session
gets destructed. Second, there is no way for a Genode process to detect the
failure of any of its grandchildren. The immediate parent of a faulting process
could use the SIGCHLD-and-waitpid mechanism to observe its children but this
mechanism does not work transitively.
By performing the process creation exclusively within core, all Genode
processes become immediate child processes of core. Hence, core can respond to
failures of any of those processes and reflect such conditions via core's
session interfaces. Furthermore, the PID associated to a PD session is locally
known within core and cannot be forged anymore. In fact, there is actually no
need at all to make processes aware of any PIDs of other processes.
:Handling of chroot, user IDs, and group IDs:
With the move of the process creation into core, the original chroot trampoline
mechanism implemented in 'os/src/app/chroot' does not work anymore. A process
could simply escape the chroot environment by spawning a new process via core's
PD service. Therefore, chroot support has been integrated into core and the
chroot policy becomes a mandatory part of the process creation. For each process
created by core, core checks for a 'root' argument of the PD session. If a path
is present, core takes the precautions needed to execute the new process in the
specified chroot environment.
This conceptual change implies minor changes with respect to the Genode API and
the configuration of the init process. The API changes are the enhancement of
the 'Genode::Child' and 'Genode::Process' constructors to take the root path as
argument. Init supports the specification of a chroot per process by specifying
the new 'root' attribute to the '<start>' node of the process. In line with
these changes, the 'Loader::Session::start' function has been enhanced with the
additional (optional) PD argument.
In line with how the chroot path can be propagated into core, core has become
able to assign customized UIDs and GIDs to individual Genode processes or whole
Genode subsystems. The new 'base-linux/run/lx_uid.run' script contains an
example of how to use the feature.
Build system and tools
######################
The current release comes with a new tool chain based on GCC 4.7.2 and binutils
2.22. The tool-chain upgrade involved adapting the Genode code base and fixing
various issues in 3rd-party software. To obtain the new tool chain, please
refer to the tool-chain website:
:Genode tool chain:
[https://genode.org/download/tool-chain]

941
doc/release_notes/13-02.txt Normal file
View File

@@ -0,0 +1,941 @@
===============================================
Release notes for the Genode OS Framework 13.02
===============================================
Genode Labs
Traditionally, the February release of Genode is focused on platform support.
The version 13.02 follows this tradition by vastly improving Genode for the
NOVA base platform and the extending the range of ARM SoCs supported by
both our custom kernel platform and the Fiasco.OC kernel.
The NOVA-specific improvements concern three major topics, namely the added
support for running dynamic workloads on this kernel, the use of IOMMUs, and
the profound integration of the Vancouver virtual machine monitor with the
Genode environment. The latter point is particularly exciting to us because
this substantial work is the first contribution by Intel Labs to the Genode
code base. Thanks to Udo Steinberg and Markus Partheymüller for making that
possible.
Beyond the x86 architecture, the new version comes with principal support for
the ARM Cortex-A15-based Exynos 5250 SoC and the Freescale i.MX53 SoC. The
Exynos 5250 SoC has been enabled for our custom kernel as well as for the
Fiasco.OC kernel. The most significant functional improvements are a new
facility to detect faulting processes and a new mechanism for file-system
notifications.
Besides those added functionalities, the release cycle was taken as an
opportunity to revisit several aspects under the hood of the framework. A few
examples are the reworked synchronization primitives, the simplified base
library structure, the completely redesigned audio-output interface, and a
modernized timer interface.
DMA protection via IOMMU
########################
Direct memory access (DMA) of devices is universally considered as the Achilles
heel of microkernel-based operating systems. The most compelling argument in
favour of using microkernels is that by encapsulating each system component
within a dedicated user-level address space, the system as a whole becomes more
robust and secure compared to a monolithic operating-system kernel. In the
event that one component fails due to a bug or an attack, other components
remain unaffected. The prime example for such buggy components are device
drivers. By empirical evidence, those remain the most prominent trouble makers
in today's operating systems. Unfortunately however, most commodity hardware
used to render this nice argumentation moot because it left one giant loophole
open, namely bus-master DMA.
Via bus-master DMA, a device attached to the system bus is able to directly
access the RAM without involving the CPU. This mechanism is crucial for all
devices that process large amounts of data such as network adapters, disk
controllers, or USB controllers. Because those devices can issue bus requests
targeting the RAM directly and not involving the CPU altogether, such requests
are naturally not subjected by the virtual-memory mechanism implemented in the
CPU in the form of an MMU. From the device's point of view there is just
physical memory. Hence, if a driver sets up a DMA transaction, let's say a disk
driver wants to read a block from the disk, the driver tells the device about
the address and size of a physical-memory buffer where the it wants to receive
the data. If the driver lives in a user-level process, as is the case for a
microkernel-based system, it still needs to know the physical address to
program the device correctly. Unfortunately, there is nothing to prevent the
driver from specifying any physical address to the device. Consequently, a
malicious driver could misuse the device to read and manipulate all parts of
the memory, including the kernel.
[image no_iommu]
Traditional machine without IOMMU. Direct memory accesses issued by the
disk controller are not subjected to the MMU. The disk controller can
access the entity of memory present in the system.
So - does this loop hole render the micro-kernel approach useless? Of course not.
Putting each driver in a dedicated address space is still beneficial in two
ways. First, classes of bugs that are unrelated to DMA remain confined in the
driver's address space. In practice most driver issues arise from issues like
memory leaks, synchronization problems, deadlocks, flawed driver logic, wrong
state machines, or incorrect device-initialization sequences. For those classes
of problems, the microkernel argument still applies. Second, executing a driver
largely isolated from other operating-system code minimizes the attack surface
of the driver. If the driver interface is rigidly small and well-defined, it is
hard to compromise the driver by exploiting its interface.
Still the DMA issue remains to be addressed. Fortunately, modern PC hardware
has closed the bus-master-DMA loophole by incorporating a so-called IOMMU into
the system. As depicted in the following figure, the IOMMU sits between the RAM
and the system bus where the devices are attached to. So each DMA request has
to pass the IOMMU, which is not only able to arbitrate the access of DMA
requests to the RAM but also able to virtualize the address space per device.
Similar to how a MMU confines each process running on the CPU within a distinct
virtual address space, the IOMMU is able to confine each device within a
dedicated virtual address space. To tell the different devices apart, the IOMMU
uses the PCI device's bus-device-function triplet as unique identification.
[image iommu]
An IOMMU arbitrates and virtualizes DMA accesses issued by a device to the
RAM. Only if a valid IOMMU mapping exists for a given DMA access, the memory
access is performed.
Of the microkernels supported by Genode, NOVA is the first kernel that supports
the IOMMU. NOVAs interface to the IOMMU is quite elegant. The kernel simply
applies a subset of the (MMU) address space of a process (aka protection domain
in NOVA speak) to the (IOMMU) address space of a device. So the device's
address space can be managed in the same way as we normally manage the address
space of a process. The only missing link is the assignment of device address
spaces to process address spaces. This link is provided by the dedicated system
call "assign_pci" that takes a process identifier and a device identifier as
arguments. Of course, both arguments must be subjected to a security policy.
Otherwise, any process could assign any device to any other process. To enforce
security, the process identifier is a capability to the respective protection
domain and the device identifier is a virtual address where the extended PCI
configuration space of the device is mapped in the specified protection domain.
Only if a user-level device driver got access to the extended PCI configuration
space of the device, it is able to get the assignment in place.
To make NOVA's IOMMU support available to Genode programs, we enhanced the
ACPI/PCI driver with the ability to hand out the extended PCI configuration
space of a device and added a NOVA-specific extension to the PD session
interface. The new 'assign_pci' function allows the assignment of a PCI device
to the protection domain.
[image iommu_aware]
NOVAs management of the IOMMU address spaces facilities the use of
driver-local virtual addresses as DMA addresses.
Even though these mechanisms combined principally
suffice to let drivers operate with the IOMMU enabled, in practice, the
situation is a bit more complicated. Because NOVA uses the same
virtual-to-physical mappings for the device as it uses for the process, the DMA
addresses the driver needs to supply to the device must be virtual addresses
rather than physical addresses. Consequently, to be able to make a device
driver usable on systems without IOMMU as well as on systems with IOMMU, the
driver needs to be IOMMU-aware and distinguish both cases. This is an
unfortunate consequence of the otherwise elegant mechanism provided by NOVA. To
relieve the device drivers from caring about both cases, we came up with a
solution that preserves the original device interface, which expects physical
addresses. The solution comes in the form of so called device PDs. A device PD
represents the address space of a device as a Genode process. Its sole purpose
is to hold mappings of DMA buffers that are accessible by the associated
device. By using one-to-one physical-to-virtual mappings for those buffers
within the device PD, each device PD contains a subset of the physical address
space. The ACPI/PCI server performs the assignment of device PDs to PCI
devices. If a device driver intends to use DMA, it asks the ACPI/PCI driver for
a new DMA buffer. The ACPI/PCI driver allocates a RAM dataspace at core,
attaches it to the device PD using the dataspace's physical address as virtual
address, and hands out the dataspace capability to the driver. If the driver
requests the physical address of the dataspace, the returned address will be a
valid virtual address in the associated device PD. From this design follows
that a device driver must allocate DMA buffers at the ACPI/PCI server (while
specifying the PCI device the buffer is intended for) instead of using core's
RAM service to allocate buffers anonymously. The current implementation of the
ACPI/PCI server assigns all PCI devices to only one device PD. However, the
design devises a natural way to partition devices into different device PDs.
[image iommu_agnostic]
By modelling a device address space as a dedicated process (device PD),
the traditional way of programming DMA transactions can be maintained,
even with the IOMMU enabled.
Because the changed way of how DMA buffers are allocated, our existing drivers
such as the AHCI disk driver, the OSS sound driver, the iPXE network driver,
and the USB driver had to be slightly modified. We also extended DDE Kit with
the new 'dde_kit_pci_alloc_dma_buffer' function for allocating DMA buffers.
With those changes, the complete Genode user land can be used on systems with
IOMMU enabled. Hence, we switched on the IOMMU on NOVA by default.
Full virtualization on NOVA/x86
###############################
Vancouver is a x86 virtual machine monitor that is designed to run as
user-level process on top of the NOVA hypervisor. In
[https://genode.org/documentation/release-notes/11.11#Faithful_x86_PC_Virtualization_enabled_by_the_Vancouver_VMM - Genode version 11.11],
we introduced the preliminary adaptation of Vancouver to Genode. This version
was meant as a mere proof of concept, which allowed the bootup of small Guest
OSes (such as Fiasco.OC or Pistachio) inside the VMM. However, it did not
support any glue code to Genode's session interface, which limited the
usefulness of this virtualization solution at that point. We had planned to
continue the integration of Vancouver with Genode once we observed public
demand.
The move of NOVA's development to Intel Labs apparently created this demand.
It is undeniable that combining the rich user land provided by Genode with the
capabilities of the Vancouver VMM poses an attractive work load for NOVA. So
the stalled line of the integration work of Vancouver with Genode was picked up
within Intel Labs, more specifically by Markus Partheymüller. We are delighted
to be able to merge the outcome of this undertaking into the mainline Genode
development. Thanks to Intel Labs and Markus in particular for this substantial
contribution!
The features added to the new version of Vancouver for Genode are as follows:
:VMX support:
Our initial version supported AMD's SVM technology only because this was
readily supported by Qemu. With the added support for Intel VMX, Vancouver
has become able to operate on both Intel and AMD processors with hardware
virtualization support.
:Timer support:
With added support for timer interrupts, the VMM has become able to
boot a complete Linux system.
:Console support:
With this addition, the guest VM can be provided with a frame buffer and
keyboard input.
For the frame-buffer size in Vancouver, the configuration value in the
machine XML node is used. It is possible to map the corresponding memory
area directly to the guest regardless if it comes from nitpicker, a virtual
frame buffer, or the VESA driver. The guest is provided with two modes (text
mode 3 and graphics mode 0x114 (0x314 in Linux).
Pressing LWIN+END while a VM has focus resets the virtual machine. Also,
RESET and DEBUG key presses will not be forwarded to the VM anymore.
It is possible to dump a VM's state by pressing LWIN+INS keys.
The text console is able to detect idle mode, unmaps the buffer from the
guest and stops interpreting. Upon the next page fault in this area, it
resumes operation again. The code uses a simple checksum mechanism instead
of a large buffer and 'memcmp' to detect an idle text console. False
positives don't matter very much.
:Network support:
The VMM has become able to use the Intel 82576 device model from the NUL
user land to give VMs access to the network via Genode's NIC bridge service
or a NIC driver.
:Disk support:
The VMM can now assign block devices to guests using Genode's block-session
interface. The machine has to be configured to use a specified drive, which
could be theoretically routed to different partitions or services via policy
definitions. Currently the USB driver only supports one device. Genode's AHCI
driver is untested.
:Real-time clock:
By using the new RTC session interface, Vancouver is able to provide the
wall-clock time to guest OSes.
To explore the new version of the Vancouver VMM, there exists a ready-to-use
run script at 'ports/run/vancouver.run'. Only the guest OS binaries such as a
Linux kernel image and a RAM disk must be manually supplied in the
'<build-dir>/bin' directory. The run script is able to start one or multiple
instances of the VMM using the graphical launchpad.
Low-latency audio output
########################
In version 10.05, we introduced an interface for the playback of audio data
along with an audio mixer component and ALSA-based sound drivers ported from
the Linux kernel. The original 'Audio_out' session interface was based on
Genode's packet stream facility, which allows the communication of bulk data
across address spaces via a combination of shared memory and signals. Whereas
shared memory is used to transfer the payload in an efficient manner without
the need to copy data via the kernel, signals are used to manage the data flow
between the information source and sink.
[image packet_stream]
Figure [packet_stream] displays the life cycle of a packet of information
transferred from the source to the sink. The original intent behind the
packet-stream facility was the transmission of networking packets and blocks
of block devices. At the time when we first introduced the 'Audio_out'
interface, the packet stream seemed like a good fit for audio, too. However, in
the meanwhile, we came to the conclusion that this is not the case when trying
to accommodate streamed audio data and sporadic audio output at the same time.
For the output of streamed audio data, a codec typically decodes a relatively
large portion of an audio stream and submits the sample data to the mixer. The
mixer, in turn, mixes the samples of multiple sources and forwards the result
to the audio driver. Each of those components the codec, the mixer, and the
audio driver live in a separate process. By using large buffer sizes between
them, the context-switching overhead is hardly a concern. Also, the driver can
submit large buffers of sample data to the sound device without any further
intervention needed.
In contrast, sporadic sounds are used to inform the user about an immediate
event. It is ultimately expected that such sounds are played back without much
latency. Otherwise the interactive experience (e.g., of games) would suffer.
Hence, using large buffers between the audio source, the mixer, and the driver
is not an option. By using the packet stream concept, we have to settle on a
specific buffer size. A too small buffer increases CPU load caused by many
context switches and the driver, which has to feed small chunks of sample data
to the sound device. A too large buffer, however, makes sporadic sounds at low
latencies impossible. We figured out that the necessity to find a sweet spot
for picking a buffer size is a severe drawback. This observation triggered us
to replace the packet-stream-based communication mechanism of the 'Audio_out'
session interface by a new solution that we specifically designed to
accommodate both corner cases of audio output.
[image audio_out]
Similarly to the packet-stream mechanism, the new interface is based on a
combination of shared memory and signals. However, we dropped the notion of
ownership of packets. When using the packet-stream protocol depicted as above,
either the source or the sink is in charge of handling a given packet at a
given time, not both. At the points 1, 2, and 4, the packet is owned by the
source. At the points 3 and 4, the packet is owned by the sink. By putting a
packet descriptor in the submit queue or acknowledgement queue, there is a
handover of responsibility. The new interface weakens this notion of ownership
by letting the source update once submitted audio frames even after submitting
them. If there are solely continuous streams of audio arriving at the mixer,
the mixer can mix those large batches of audio samples at once and pass the
result to the driver.
[image mixer_streaming]
The mixer processes incoming data from multiple streaming sources as batches.
Now, if a sporadic sound comes in, the mixer checks the
current output position reported by the audio driver, and re-mixes those
portions that haven't been played back yet by incorporating the sporadic sound.
So the buffer consumed by the driver gets updated with new data.
[image mixer_sporadic]
A sporadic occuring sound prompts the mixer to remix packets that are
already submitted in the output queue.
Besides changing the way of how packets are populated with data, the second
major change is turning the interface into a time-triggered concept. The
driver produces periodic signals that indicate the completeness of a
played-back audio packet. This signal triggers the mixer to become active,
which in turn serves as a time base for its clients. The current playback
position is denoted alongside the sample data as a field in the memory buffer
shared between source and sink.
The new 'Audio_out' interface has the potential to align the requirements of
both streamed audio with those of sporadic sounds. As a side benefit, the now
domain-specific interface has become simpler than the original packet-stream
based solution. This becomes nowhere as evident as in the implementation of the
mixer, which has become much simpler (30% less code). The interface change
is accompanied with updates of components related to audio output, in
particular the OSS sound drivers contained in 'dde_oss', the ALSA audio driver
for Linux, the avplay media player, and the libSDL audio back-end.
Base framework
##############
Signalling API improvements
===========================
The signalling API provided by 'base/signal.h' is fairly low level. For
employing the provided mechanism by application software, we used to craft
additional glue code that translates incoming signals to C++ method
invocations. Because the pattern turned out to be not only useful but a good
practice, we added the so called 'Signal_dispatcher' class template to the
signalling API.
In addition to being a 'Signal_context', a 'Signal_dispatcher' associates a
member function with the signal context. It is intended to be used as a member
variable of the class that handles incoming signals of a certain type. The
constructor takes a pointer-to-member to the signal handling function as
argument. If a signal is received at the common signal reception code, this
function will be invoked by calling 'Signal_dispatcher_base::dispatch'. This
pattern can be observed in the implementation of RAM file system
('os/src/server/ram_fs').
Under the hood, the signalling implementation received a major improvement with
regard to the life-time management of signal contexts. Based on the observation
that 'Signal' objects are often referring to non-trivial objects derived from
'Signal_context', it is important to defer the destruction of such objects to a
point when no signal referring to the context is in flight anymore. We solved
this problem by modelling 'Signal' type as a shared pointer that operates on a
reference counter embedded in the corresponding 'Signal_context'. Based on
reference counter, the 'Signal_receiver::dissolve()' function does not return
as long as the signal context to be dissolved is still referenced by one or
more 'Signal' objects.
Trimmed and unified framework API
=================================
A though-provoking
[https://sourceforge.net/mailarchive/forum.php?thread_name=CAGQ-%3Dq27%2B_UooBiJmz9RdTE1gDmVcg9v0w-8TNgEH5fzHYiA%2BQ%40mail.gmail.com&forum_name=genode-main - posting]
on our mailing list prompted us to explore the idea to make shared libraries
and dynamically linked executables binary compatible among different kernels.
This sounds a bit crazy at first but it is not downright infeasible.
As a baby step into this direction, we unified several public headers of the
Genode API and tried to make headers private to the framework where possible.
The latter is the case for the 'base/platform_env.h' header, which is actually
not part of the generic Genode API. Hence, it was moved to the
framework-internal 'src/base/env'. Another step was the removal of
platform-specific types that are not necessarily platform-dependent. We could
remove the 'Native_lock' type without any problems. Also, we were able to unify
the IPC API, which was formerly split into the two parts 'base/ipc_generic.h'
and 'base/ipc.h' respectively. Whereas 'base/ipc_generic.h' was shared among
all platforms, the 'base/ipc.h' header used to contain platform-specific IPC
marshalling and unmarshalling code. But by moving this code from the header to
the corresponding (platform-specific) IPC library, we were able to discard the
content of 'base/ipc.h' altogether. Consequently, the former
'base/ipc_generic.h' could be renamed to 'base/ipc.h'. These changes imply no
changes at the API level.
Simplified structure of base libraries
======================================
The Genode base API used to come in the form of many small libraries, each
covering a dedicated topic. Those libraries were 'allocator_avl', 'avl_tree',
'console', 'env', 'cxx', 'elf', 'env', 'heap', 'server', 'signal', 'slab',
'thread', 'ipc', and 'lock'. The term "library" for those bits of code was
hardly justified as most of the libraries consisted of only a few .cc files.
Still the build system had to check for their inter-dependencies on each run of
the build process. Furthermore, for Genode developers, specifying the list of
base libraries in their 'target.mk' files tended to be an inconvenience. Also,
the number of libraries and their roles (core only, non-core only, shared by
both core and non-core) were not easy to capture. Hence, we simplified the way
of how those base libraries are organized. They have been reduced to the
following few libraries:
* 'cxx.mk' contains the C++ support library
* 'startup.mk' contains the startup code for normal Genode processes
On some platform, core is able to use the library as well.
* 'base-common.mk' contains the parts of the base library that are
identical by core and non-core processes.
* 'base.mk' contains the complete base API implementation for non-core
processes
Consequently, the 'LIBS' declaration in 'target.mk' files becomes simpler as
well. In the normal case, only the 'base' library must be mentioned.
New fault-detection mechanism
=============================
Until now, it was hardly possible for a parent process to respond to crashes of
child processes in a meaningful way. If a child process crashed, the parent
would normally just not take notice. Even though some special use cases such as
GDB monitor could be accommodated by the existing
'Cpu_session::exception_handler' facility, this mechanism requires the
virtualization of the 'Cpu_session interface' because an exception handler used
to refer to an individual thread rather than the whole process. For ordinary
parents, this mechanism is too cumbersome to use. However, there are several
situations where a parent process would like to actively respond to crashing
children. For example, the parent might like to restart a crashed component
automatically, or enter a special failsafe mode.
To ease the implementation of such scenarios, we enhanced the existing
'Cpu_session::exception_handler' mechanism with the provision of a
default signal handler that is used if no thread-specific handler is installed.
The default signal handler can be set by specifying an invalid thread
capability and a valid signal-context capability. So for registering a signal
handler to all threads of a process, no virtualization of the 'Cpu_session'
interface is needed anymore. The new mechanism is best illustrated by the
'os/run/failsafe.run' script, which creates a system that repeatedly spawns a
crashing child process.
Reworked synchronization primitives
===================================
We reworked the framework-internal lock interface in order to be able to use
the 'futex' syscall on the Linux base platform. Previously, the lock
implementation on Linux was based on Unix signals. In the contention case, the
applicant for a contended lock would issue a blocking system call, which gets
canceled by the occurrence of a signal. We used 'nanosleep' for this purpose.
Once the current owner of the lock releases the lock, it sends a signal to the
next applicant of the lock. Because signals are buffered by the kernel, they
are guaranteed to be received by the targeted thread. However, in situations
with much lock contention, we observed the case where the signal was delivered
just before the to-be-blocked thread could enter the 'nanosleep' syscall. In
this case, the signal was not delivered at the next entrance into the kernel
(when entering 'nanosleep') but earlier. Even though the signal handler was
invoked, we found no elegant way to handle the signal such that the subsequent
'nanosleep' call would get skipped. So we decided to leave our signal-based
solution behind and went for the mainstream 'futex' mechanism instead.
Using this mechanism required us to re-design the internal lock API, which was
originally designed with the notion of thread IDs. The 'Native_thread_id' type,
which was previously used in the lock-internal 'Applicant' class to identify a
thread to be woken up, was not suitable anymore for implementing this change.
Hence, we replaced it with the 'Thread_base*' type, which also has the positive
effect of making the public 'base/cancelable_lock.h' header file
platform-independent.
In addition to reworking the basic locking primitives, we changed the
'Object_pool' data structure to become safer to use. The former 'obj_by_*'
functions have been replaced by 'lookup_and_lock' that looks up an object and
locks it in one atomic operation. Additionally, the case that an object may
already be in destruction is handled gracefully. In this case, the lookup will
return that the object is not available anymore.
Low-level OS infrastructure
###########################
Notification mechanism for the file-system interface
====================================================
To support dynamic system scenarios, we extended Genode's file-system interface
with the ability to monitor changes of files or directories, similar to the
inotify mechanism on Linux but simpler. The new 'File_system::sigh' function
can be used to install a signal handler for an open file node. When a node is
closed after a write operation, a prior registered signal handler for this file
gets notified. Signal handlers can also be installed for directories. In this
case, the signal handler gets informed about changes of immediate nodes hosted
in the directory, i.e., the addition, renaming, or removal of nodes.
The 'ram_fs' server has been enhanced to support the new interface. So any file
or directory change can now be observed by 'ram_fs' clients.
New adapter from file-system to ROM session interface
=====================================================
The new 'fs_rom' server translates the 'File_system' session interface to the
'ROM' session' interface. Each request for a ROM file is handled by looking
up an equally named file on the file system. If no such file can be found,
then the server will monitor the file system for the creation of the
corresponding file. Furthermore, the server reflects file changes as signals
to the ROM session.
There currently exist two limitations: First, symbolic links are not handled.
Second, the server needs to allocate RAM for each requested file. The RAM is
always allocated from the RAM session of the server. Thereby, the RAM quota
consumed by the server depends on the client requests and the size of the
requested files. Therefore, one instance of the server should not be used by
untrusted clients and trusted clients at the same time. In such situations,
multiple instances of the server could be used.
The most interesting feature of the 'fs_rom' server is the propagation of
file-system changes as ROM module changes. This clears the way to use this
service to supply dynamic configurations to Genode programs.
Dynamic re-configuration of the init process
============================================
The init process has become able to respond to configuration changes by
restarting the scenario using the new configuration. To make this feature
useful in practice, init must not fail under any circumstances. Even on
conditions that were considered previously as fatal and led to the abort of
init (such as ambiguous names of the children or misconfiguration in general),
init must stay alive and responsive to configuration changes.
With this change, the init process is one of the first use cases of the dynamic
configuration feature enabled via the 'fs_rom' service and the new file-system
notifications. By supplying the configuration of an init instance via the
'fs_rom' and 'ram_fs' services, the configuration of this instance gets fetched
from a file of the 'ram_fs' service. Each time, this file is changed, for
example via VIM running within a Noux runtime environment, the init process
re-evaluates its configuration.
In addition to the support for dynamic re-configurations, we simplified the use
of conditional session routing, namely the '<if-args>' mechanism. When matching
the 'label' session argument using '<if-args>' in a routing table, we can omit
the child name prefix because it is always the same for all sessions
originating from the child anyway. By handling the matching of session labels
as a special case, the expression of label-specific routing
becomes more intuitive.
Timer interface turned into asynchronous mode of operation
==========================================================
The 'msleep' function of 'Timer::Session' interface is one of the last relics
of blocking RPC interfaces present in Genode. As we try to part away from
blocking RPC calls inside servers and as a means to unify the timer
implementation across the many different platforms supported by Genode, we
changed the interface to an asynchronous mode of operation.
Synchronous blocking RPC interfaces turned out to be constant sources of
trouble and code complexity. E.g., a timer client that also wants to respond to
non-timer events was forced to be a multi-threaded process. Now, the blocking
'msleep' call has been replaced by a mechanism for programming timeouts and
receiving wakeup signals in an asynchronous fashion. Thereby signals
originating from the timer can be handled, along with signals from other signal
sources, by a single thread. Once a timer client has registered a signal
handler using the 'Timer::sigh' function, it can program timeouts using the
functions 'trigger_once' and 'trigger_periodic', which take an amount of
microseconds as argument. For maintaining compatibility and convenience, the
interface still contains the virtual 'msleep' function. However, it is not an
RPC function anymore but a mere client-side wrapper around the 'sigh' and
'trigger_once' functions. For use cases where sleeping at the granularity of
milliseconds is too coarse (such as udelay calls by device drivers), we added
a new 'usleep' call, which takes a number of microseconds as argument.
As a nice side effect of the interface changes, the platform-specific
implementations could be vastly unified. On NOVA and Fiasco.OC, the need to use
one thread per client has vanished. As a further simplification, we changed the
timer to use the build system's library-selection mechanism instead of
providing many timer targets with different 'REQUIRES' declarations. This
reduces the noise of the build system. For all platforms, the target at
'os/src/drivers/timer' is built. The target, in turn, depends on a 'timer'
library, which is platform-specific. The various library description files are
located under 'os/lib/mk/<platform>'. The common bits are contained in
'os/lib/mk/timer.inc'.
Since the 'msleep' call is still available from the client's perspective,
the change of the timer interface does not imply an API incompatibility.
However, it provides the opportunity to simplify clients in cases that required
the maintenance of a separate thread for the sole purpose of
periodic signal generation.
Loader
======
The loader is a service that enables its clients to dynamically create Genode
subsystems. Leveraging the new fault-detection support described in section
[New fault-detection mechanism], we enabled loader clients to respond to
failures that occur inside the spawned subsystem. This is useful for scenarios
where subsystems should be automatically restarted or in situations where the
system should enter a designated failsafe mode once an unexpected fault
happens.
The loader provides this feature by installing an optional client-provided
fault handler as default CPU exception handler and a RM fault handler for all
CPU and RM sessions of the loaded subsystem. This way, the failure of any
process within the subsystem gets reflected to the loader client as a signal.
The new 'os/run/failsafe.run' test illustrate this mechanism. It covers two
cases related to the loader, which are faults produced by the immediate child
of the loader and faults produced by indirect children.
Focus events for the nitpicker GUI server
=========================================
To enable a way for applications to provide visual feedback to changed keyboard
focus, we added a new 'FOCUS' event type to the 'Input::Event' structure. To
encode whether the focus was entered or left, the former 'keycode' member is
used (value 0 for leaving, value 1 for entering). Because 'keycode' is
misleading in this context, the former 'Input::Event::keycode' function was
renamed to 'Input::Event::code'. The nitpicker GUI server has been adapted to
deliver focus events to its clients.
NIC bridge with support for static IP configuration
===================================================
NIC bridge is a service that presents one physical network adaptor as many
virtual network adaptors to its clients. Up to now, it required each client
to obtain an IP address from a DHCP server at the physical network. However,
there are situations where the use of static IPs for virtual NICs is useful.
For example, when using the NIC bridge to create a virtual network between
the lighttpd web server and the Arora web browser, both running as Genode
processes without real network connectivity.
The static IP can be configured per client of the NIC bridge using a '<policy>'
node of the configuration. For example, the following policy assigns a static
address to a client with the session label "lighttpd".
!<start name="nic_bridge">
! ...
! <config>
! <policy label="lighttpd" ip_addr="10.0.2.55"/>
! </config>
!</start>
Of course, the client needs to configure its TCP/IP stack to use the assigned
IP address. This can be done via configuration arguments examined by the
'lwip_nic_dhcp' libc plugin. For the given example, the configuration for the
lighttpd process would look as follows.
!<start name="lighttpd">
! <config>
! <interface ip_addr="10.0.2.55"
! netmask="255.255.255.0"
! gateway="10.0.2.1"/>
! </config>
!</start>
Libraries and applications
##########################
New terminal multiplexer
========================
The new 'terminal_mux' server located at 'gems/src/server/terminal_mux' is able
to provide multiple terminal sessions over one terminal-client session. The
user can switch between the different sessions using a keyboard shortcut, which
brings up an ncurses-based menu.
The terminal sessions provided by terminal_mux implement (a subset of) the
Linux terminal capabilities. By implementing those capabilities, the server
is interchangeable with the graphical terminal ('gems/src/server/terminal').
The terminal session used by the server is expected to by VT102 compliant.
This way, terminal_mux can be connected via an UART driver with terminal
programs such as minicom, which typically implement VT102 rather than the Linux
terminal capabilities.
When started, terminal_mux displays a menu with a list of currently present
terminal sessions. The first line presents status information, in particular
the label of the currently visible session. A terminal session can be selected
by using the cursor keys and pressing return. Once selected, the user is able
to interact with the corresponding terminal session. Returning to the menu is
possible at any time by pressing control-x.
For trying out the new terminal_mux component, the 'gems/run/termina_mux.run'
script sets up a system with three terminal sessions, two instances of Noux
executing VIM and a terminal_log service that shows the log output of both Noux
instances.
New ported 3rd-party libraries
==============================
To support our forthcoming port of Git to the Noux runtime environment, we
have made the following libraries available via the libports repository:
* libssh-0.5.4
* curl-7.29.0 (for now the port is x86_* only because it depends on libcrypto,
which is currently not tested on ARM)
* iconv-1.14
Device drivers
##############
Besides the changes concerning the use of IOMMUs, the following device driver
have received improvements:
:UART drivers:
The OMAP4 platform support has been extended by a new UART driver, which
enables the use of up to 4 UART interfaces. The new driver is located at
'os/src/drivers/uart/omap4'.
All UART drivers implement the 'Terminal::Session' interface, which
provides read/write functionality accompanied by a function to determine
the terminal size. The generic UART driver code shared among the various
implementations has been enhanced to support the detection of the terminal
size using a protocol of escape sequences. This feature can be enabled by
including the attribute 'detect_size="yes"' in the policy of a UART client.
This is useful for combining UART drivers with the new 'terminal_mux'
server.
:ACPI support for 64-bit machines:
In addition to IOMMU-related modifications, the ACPI driver has been enhanced
to support 64-bit machines and MCFG table parsing has been added.
:PCI support for IOMMUs:
With the added support of IOMMUs, the 'Pci::Session' interface has been
complemented with a way to obtain the extended PCI configuration space in the
form of a 'Genode::Dataspace'. Also, the interface provides a way to allocate
DMA buffers for a given PCI device. Device drivers that are meant to be used
on system with and without IOMMUs should use this interface rather than
core's RAM session interface to allocate DMA buffers.
:Real-time clock on x86:
Up to now, the x86 real-time clock driver served as a mere example for
accessing I/O ports on x86 machines but the driver did not expose any service
interface. With the newly added 'os/include/rtc_session' interface and the
added support of this interface in the RTC driver, Genode programs have now
become able to read the real-time clock. Currently, the interface is used by
the Vancouver VMM.
:USB driver restructured, support for Arndale board added:
While adding support for the Exynos-5-based Arndale board, we took the
chance to restructure the driver to improve portability to new
platforms. The most part of the driver has become a library, which is
built in a platform-specific way. The build system automatically selects
the library that fits for the platform as set up for the build directory.
Platforms
#########
NOVA
====
The NOVA base platform received major improvements that address the kernel
as well as Genode's NOVA-specific code. We pursued two goals with this line
of work. The first goal was the use of NOVA in highly dynamic settings, which
was not possible before, mainly due to lacking kernel features. The second
goal was the use of IOMMUs.
NOVA is ultimately designed for accommodating dynamic workloads on top of the
kernel. But we found that the implementation of crucial functionality was
missing. In particular, the kernel lacked the ability to destroy all kinds of
kernel objects and to reuse memory of kernel objects that had been destroyed.
Consequently, when successively creating and destroying kernel objects such as
threads and protection domains, the kernel would eventually run out of memory.
This issue became a show stopper for running the Genode tool chain on NOVA
because this scenario spawns and destroys hundreds of processes. For this
reason, we complemented the kernel with the missing functionality. This step
involved substantial changes in the kernel code. So our approach of using the
upstream kernel and applying a hand full of custom patches started to show its
limitations.
To streamline our work flow and to track the upstream kernel in a structured
way, we decided to fork NOVA's Git repository and maintain our patches in our
fork. For each upstream kernel revision that involves kernel ABI changes, we
create a separate branch called "r<number>". This branch corresponds to the
upstream kernel with our series of custom patches applied (actually rebased) on
top. This way, our additions to the upstream kernel are well documented. The
'make prepare' mechanism in the base-nova repository automates the task of
checking out the right branch. So from the Genode user's point of view, this
change is transparent.
The highly dynamic application scenarios executed on NOVA triggered several
synchronization issues in Genode's core process that had not been present on
other base platforms. The reason for those issues to occur specifically on NOVA
lies in the concurrent page fault handling as employed on this base platform.
For all classical L4-like kernels and Fiasco.OC, we use one global pager thread
to resolve all page faults that occur in the whole Genode system. In contrast,
on NOVA we use one pager thread per user thread. Consequently, proper
fine-grained synchronization between those pager threads and the other parts of
core is mandated. Even though the immediate beneficiary of these changes is the
NOVA platform, many of the improvements refer to generic code. This paves the
ground for scaling the page-fault handling on other base platforms (such as
Fiasco.OC) to multiple threads. With these improvements in place, we are able
to successfully execute the 'noux_tool_chain_nova' scenario on the NOVA kernel
and build Genode's core on NOVA. That said, however, not all issues are covered
yet. So there is still a way left to go to turn base-nova into a base platform
that is suitable for highly dynamic scenarios.
The second goal was the use of NOVA's IOMMU support on Genode. This topic is
covered in detail in section [DMA protection via IOMMU].
To be able to use and debug Genode on NOVA on modern machines that lack legacy
comports, we either use UART PCI cards or the Intel's Active Management
Technology (AMT) mechanism. In both cases, the I/O ports to access the serial
interfaces differ from the legacy comports. To avoid the need for adjusting the
I/O port base addresses per platform, we started using the chain-boot-loader
called "bender" developed by the Operating Systems Group of TU Dresden,
Germany. This boot loader is started prior the kernel, searches the PCI bus for
the first suitable device and registers the corresponding I/O port base address
at the bios data area (BDA). Genode's core, in turn, picks the I/O port base
address up from the BDA and uses the registered i8250 serial controller for its
LOG service.
Execution on bare hardware (base-hw)
====================================
The base-hw platform enables the use of Genode on ARM-based hardware without
the need for a 3rd-party kernel.
With the new release, the range of supported ARM-based hardware has been
extended to cover the following additional platforms. With the previous
release, we introduced the support for Freescale i.MX family of SoC, starting
with i.MX31. The current release adds support for the i.MX53 SoC and adds
a user-level timer driver for this platform. With the Samsung Exynos 5, the
first Cortex-A15-based SoC has entered the list of supported SoCs. Thanks to
this addition, Genode has become able to run on the
[http://www.arndaleboard.org - Howchip Arndale board]. At the current state,
core and multiple instances of init can be executed but drivers for peripherals
are largely missing. Those will be covered by our ongoing work with this SoC.
The added platforms are readily available via the 'create_builddir' tool.
To make base-hw practically usable on real hardware (i.e., the Pandaboard),
support for caches has been implemented. Furthermore, the implementation of the
signalling API underwent a redesign, which leverage the opportunities that
arise with tailoring a kernel specifically to the Genode API. As a side-benefit
of this endeavour, we could unify the 'base/signal.h' header with the generic
version and thereby took another step towards the unification of the Genode
headers across different kernels.
Microblaze platform removed
===========================
The 'base-mb' platform has been removed because it is no longer maintained.
This platform enabled Genode to run directly on the Xilinx Microblaze softcore
CPU. For supporting the Microblaze CPU architecture in the future, we might
consider integrating support for this architecture into base-hw. Currently
though, there does not seem to be any demand for it.
Fiasco.OC forked, support for Exynos 5 SoC added
================================================
In the last release cycle, we went beyond just using the Fiasco.OC kernel and
started to engage with the kernel code more intensively. To avoid that the
management of a growing number of kernel patches goes out of hand, we forked
the Fiasco.OC kernel and conduct our development in our Fiasco.OC Git
repository. When using the 'make prepare' mechanism in the 'base-foc'
repository, the new Git repository will be used automatically. There exists a
dedicated branch for each upstream SVN revision that we use. We started with
updating Fiasco.OC to the current revision 47. Hence, the current branch used
by Genode is named "r47". The branch contains the unmodified state of the
upstream SVN repository with our modifications appearing as individual commits
on top. This makes it easy to keep track of the Genode-specific modifications.
Please note that the update to Fiasco.OC requires minor adaptations inside
the 'ports-foc' repository. So for using L4Linux, "make prepare" must be
issued in both repositories 'base-foc' and 'ports-foc'.
Speaking of engaging with the kernel code, the most profound improvement is
the support for the Samsung Exynos-5-based Arndale board that we added to the
kernel. This goes hand in hand with the addition of this platform to Genode.
For creating a build directory targeting the Arndale board, just specify
"foc_arndale" to the 'create_builddir' tool. At the time of the release,
several basic scenarios including the timer driver and the USB driver are
working. Also, both Cortex-A15 CPUs of the Exynos 5 SoC are operational.
However, drivers for most of the peripherals of the Exynos-5 SoC are missing,
which limits the current scope of Genode on this platform.
Linux
=====
Since the base-linux platform became used for more than a mere development
vehicle, we are revisiting several aspects of this base platform. In the last
release, we changed the synchronous inter-process-communication mechanism to
the use of SCM rights. For the current release, it was time to have a closer
look at the memory management within core. The Linux version of core used a
part of the BSS to simulate access to physical memory. All dataspaces would
refer to a portion of 'some_mem'. So each time when core would access the
dataspace contents, it would access its local BSS. For all processes outside of
core, dataspaces were represented as files. We have now removed the distinction
between core and non-core processes. Now, core uses the same 'Rm_session_mmap'
implementation as regular processes. This way, the 'some_mem' could be
abandoned. We still use a BSS variable for allocating core-local meta data
though. The major benefit of this change is the removal of the artificial
quota restriction that was imposed by the predefined size of the 'some_mem'
array. Now, the Linux base platform can use as much memory as it likes. Because
the Linux kernel implements virtual memory, we are not bound by the physical
memory. Hence, the available quota assigned to the init process is almost
without bounds.
To implement the fault-detection mechanism described in section
[New fault-detection mechanism] on Linux, we let core catch SIGCHLD signals of
all Genode processes. If such a signal occurs, core determines the process that
produced the signal by using 'wait_pid', looks up the CPU session that belongs
to the process and delivers an exception signal to the registered exception
handler. This way, abnormal terminations of Genode processes are reflected to
the Genode API in a clean way and Genode processes become able to respond to
terminating Genode child processes.
OKL4
====
The audio stub driver has been removed from OKLinux. Because of the changed
'Audio_out::Session' interface, we needed to decide on whether to adapt the
OKLinux stub driver to the changed interface or to remove the stub driver.
Given the fact that OKLinux is not actively used, we decided for the latter.

943
doc/release_notes/13-05.txt Normal file
View File

@@ -0,0 +1,943 @@
===============================================
Release notes for the Genode OS Framework 13.05
===============================================
Genode Labs
With Genode 13.05, we have diverged quite a bit from the feature-laden plans
laid out in our [https://genode.org/about/road-map road map] as we realized
that consolidating and optimizing the current feature set will have a more
sustainable effect than functional enhancements at this point. In particular,
we addressed the problem that the ever growing diversity of platforms imposes
on the quality and coverage of testing. We also desired to extend our
systematic testing efforts to real hardware platforms, and to have a mechanism
for detecting performance regressions. Section
[Automated quality-assurance testing] details how we approached these
challenges, and how we went on analyzing Genode's network performance in
particular.
That said, we haven't completely restrained ourself from implementing new
features. Closely related to test automation but very useful in other
situations, we improved the terminal infrastructure in order to enable the
interactive use of dynamic system scenarios in headless situations. Section
[Terminal infrastructure] introduces a new command-line interface for managing
Genode subsystems.
With regard to platform support, the current release follows up on the
hardware support added in the previous releases. For Samsung Exynos-5-based
platforms, drivers for USB-3, fast-ethernet networking, gigabit networking,
eMMC, and SATA have been added. For Freescale i.MX53-based devices, new
drivers for display, touchscreen, and GPIO have become available. The
OMAP4 display driver has been enhanced to cover both LCD displays and HDMI.
Our custom base-hw kernel has been enabled on the Raspberry Pi
board. Finally, Linux/ARM was added to accompany Linux/x86 as a fully usable
Genode base platform.
Automated quality-assurance testing
###################################
One of the greatest challenges of the Genode OS Framework is preventing
regressions in the face of the growing number of supported platforms.
The challenge stems from the fact that the space of Genode scenarios grow
two-dimensional. On one axis, the software stack on top of Genode gets more
and more complex, which calls for contiguous testing. On the other axis, there
is a growing number of kernel and hardware platforms to support.
In principle, there are even more dimensions, for example the diversity
of tool chains or the diversity of the OS used on the development machine.
Luckily, the problem of tool-chain diversity could be mitigated with the
introduction of the Genode tool chain since version 11.11, which was a huge
relief. However, the mentioned two dimensions cannot be avoided. Because
manual testing of manifold scenarios of component compositions on top of many
different kernels became infeasible, we automated the task of building and
testing years ago.
The automated builder checks out the staging branch of Genode, prepares
the repositories that integrate 3rd-party code, and builds the software
for 12 different kernel/platform combinations. Not all 3rd-party software
packages are built for each combination though. But we make sure that each
piece of software is exposed to different combinations of CPU architectures
and kernels.
The build test is accompanied with automated runtime tests of various
run scripts on Qemu. Each run script listed in 'tool/autopilot.lst' is
executed on each kernel using the autopilot tool. The tests range from
stimulating low-level mechanisms (such as signal, timer, and ldso) to complex
scenarios (such as testing networking with L4Linux, or running Noux).
Both build and runtime tests are executed daily. If any of the
tests fail, the Genode developers receive a notification email.
Once all tests are passed, the staging branch can be merged into the master
branch. This way, we spare the users of Genode to deal with intermediate
problems introduced in the staging branch.
The build and runtime tests have become a fundamental tool for our
development work. With the growing variety of real hardware
(as opposed to hardware emulated via Qemu), however, our existing solution
was falling short. Even though our tests confirm that Genode is running
happily on Qemu, they won't help us to detect regressions in our device
drivers for non-Qemu hardware such as Pandaboard, Arndale, or modern PC
hardware. Furthermore, we are increasingly focussing on performance
considerations. In order to be a viable OS platform, Genode does not only need
to be able to do networking, but networking performance must be on par with
mainstream OSes. This raises the new challenge to extend our
continuous-testing tools to become continuous-benchmarking tools. The ultimate
goal is to monitor the performance of Genode on real hardware over long
periods of development.
In this release cycle, we attacked this problem in two steps. First, we
enabled Genode's run tool to target not only Qemu but real hardware, with the
premise that existing run scripts must not be changed. The second step is the
creation of new run scripts that perform benchmarks in an automated fashion.
By aggregating the results of this automatically executed benchmarks, we can
correlate performance effects with commits in our code repository.
Targeting real hardware via the run tool
========================================
In the following, we briefly describe the procedure to execute run scripts
on native hardware, for both Intel-based x86 machines and ARM-based platforms.
TFTP boot x86
~~~~~~~~~~~~~
The following description uses NOVA as an example to illustrate the usage.
Other base platforms are supported as well and can be configured analogously.
[https://os.inf.tu-dresden.de/~us15/pulsar/ - Pulsar] is a tiny boot loader
that uses PXE to fetch boot images via TFTP over the network. On the x86
architecture, Genode supports the automatic generation of Pulsar configuration
files, which can be placed directly onto a TFTP server. Genode can be booted
via Pulsar using the following steps:
* On the x86 test machine, enable "PXE boot feature" in the BIOS.
* When booting, the machine will look for a DHCP server announcing a TFTP server.
So you need to make sure to have both the DHCP server and the TFTP server
configured such that the 'pulsar' binary will be loaded as PXE binary.
* After the PXE BIOS of the test machine has loaded and started the pulsar
binary, Pulsar will look on the TFTP server for a file called
'config-XX-XX-XX-XX-XX-XX', where the sequence of 'XX' corresponds to the
MAC address of the test machine.
For example, if the MAC of the network card is 01:02:03:04:05:06, Pulsar
would request a file called 'config-01-02-03-04-05-06'.
* Using this configuration file, we direct Pulsar to the configuration
generated by the run tool. I.e., it should look as follows
! root /tftpboot/nova
! config config-00-00-00-00-00-00
The lines above tell pulsar to load another config file, which contains the
actual configuration. To instruct the run script to actually generate the
'config-00-00-00-00-00-00' file, set the following environment variables in
your shell prior executing the run script:
! export PXE_TFTP_DIR_BASE=/tftpboot
! export PXE_TFTP_DIR_OFFSET=/nova
The two-staged configuration of Pulsar may look overly complicated at first
sight but has the benefit that the run tool does not need to know the MAC
address of the test machine in order to generate the Pulsar configuration
file.
* Create a symbolic link '/tftpboot/nova' pointing to the corresponding
Genode build directory.
* The next time 'make run/printf' is invoked,
the run script will generate the 'config-00-00-00-00-00-00' in
'/tftpboot/nova'.
* When rebooting the test machine, it will load and start the printf test.
TFTP boot using U-Boot
~~~~~~~~~~~~~~~~~~~~~~
Configure your U-Boot boot loader to load the images via TFTP.
The remainder of the procedure is similar to the description for x86 above.
On ARM platforms, the run tool automatically generates the uBoot image and
creates a symbolic link into the TFTP directory.
* Pandaboard:
! export PXE_TFTP_DIR_BASE=/tftpboot
! export PXE_TFTP_DIR_OFFSET=/panda
! ln -s <genode-build-dir> /tftpboot/panda
! RUN_OPT="--target uboot" make run/printf
* Arndale board:
! export PXE_TFTP_DIR_BASE=/tftpboot
! export PXE_TFTP_DIR_OFFSET=/arndale
! ln -s <genode-build-dir> /tftpboot/panda
! RUN_OPT="--target uboot" make run/printf
Output and reset with Intel's AMT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Most modern x86-based machines lack a COM port, which is normally used for
kernel debug messages as well as LOG messages printed by Genode's core.
However, Intel's Advanced Management Technology (AMT) can be used to obtain
the serial output of the test machine and to reset the test machine. To use
AMT with Genode's run tool, install the 'amtterm' package (version 1.3 is
known to work well) and set the following environment variables, specifying
the IP address of the test machine and the AMT password.
! export AMT_TEST_MACHINE_IP=XXX.XXX.XXX.XXX
! export AMT_TEST_MACHINE_PWD=XXXXXXXXX
Via setting the RUN_OPT environment variable, we instruct the run tool to use
AMT instead of Qemu. The following command will reset the test machine, the test
machine will load the binaries of the printf run script via PXE, and we will be
able to see the serial output of the test machine through Intel's AMT Serial
Over Line (SOL),
! RUN_OPT="--target amt" make run/printf
Output via a COM port (UART)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the x86 test machine, Pandaboard or Arndale test board is connected
via UART, the run tool can use a specified command to interact with it.
For example, if the UART interface of the test machine is connected directly
to the host machine at /dev/ttyUSB3, and the picocom tool is available,
the following command can be used to establish a connection:
! RUN_OPT="--target serial --serial-cmd \"picocom -b 115200 /dev/ttyUSB3\"" make run/printf
Alternatively, if the board is connected to some remote machine, which exports
the corresponding serial line via TCP/IP, the socat tool can be used for
communicating with the remote test machine:
! RUN_OPT="--target serial --serial-cmd \"socat - tcp:10.0.0.1:2000\"" make run/printf
Reset via a IP power plug NETIO-230B from Koukaam
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At Genode Labs, we use a NETIO-230B power plug to automate power-cycling ARM
boards. This power plug can be controlled over the network. For example, if
the Pandaboard is connected to power port 3, the following command will
automatically turn on the board when the run script is started:
! RUN_OPT="--target uboot --target reset --reset-port 2 --reset-ip 10.0.0.1 --reset-user admin --reset-passwd secret" make run/printf
The '--target reset' option can be combined with '--target uboot' to
instruct the run tool to boot via TFTP (as described above) and take care
of power cycling. When the run script has finished, the specified port
will be automatically switched off by the run tool.
Of course, the IP address settings, as well as the actual user name and
password, to access the NETIO-230B power plug, have to be adjusted accordingly.
Automated benchmarking
======================
With the '--target' features added to the run tool, the road is paved to
obtain benchmark results in an automated fashion. Currently, we are most
interested in exploring the network-performance characteristics of Genode.
Network performance can be explored at different levels. We started with
looking at raw driver performance, then looked at the overhead of separating
the network application from the device driver (and thereby introducing
inter-process communication overhead), and finally explored the effects
of the TCP/IP stack.
For pursuing the packet-level performance measurements, we crafted a library
called 'net-stat', which contains the application logic of a low-level
benchmark operating at network-packet level. This library has been
successively incorporated into the 'dde_ipxe' NIC driver and the 'usb_drv'
(NIC driver via ethernet-over-USB) to measure the raw driver performance
without any microkernel overhead or TCP/IP protocol overhead.
To see the influence of the inter-process communication, namely the
packet-stream interface employed by Genode's NIC-session interface,
we implanted the same net-stat library into a NIC-session client. This
experiment enables us to compare the operation of the NIC driver
with the operation of a NIC driver separated from the NIC
application.
The raw networking tests can be executed automatically using the set
of 'network_test_nic*.run' scripts located at 'os/run'.
The scenario sends raw ethernet packets from the host machine to the
target machine. Three tests are provided:
The 'network_test_nic_raw.run' test measures the net-stat-instrumented driver
(of usb_drv and net_drv respectively) to observe the raw receive performance.
The 'network_test_nic_raw_client.run' test implements the benchmark in a
NIC-session client connected to the NIC driver running as a separate
component whereas the NIC driver is not instrumented.
The 'network_test_nic_raw_bridge_client.run' test further adds a NIC bridge
in-between the driver and the NIC-session client.
In addition to analyzing the performance on a low level, we investigated
the effects of TCP/IP for the application performance. This topic is
covered in more detail in Section [TCP/IP performance].
Terminal infrastructure
#######################
Closely related to the quality-assurance measures detailed in the previous
section, there is the arising need to interact with increasingly complex system
scenarios in headless settings. In particular when executing tests remotely on a
development board, manual user-interaction via a GUI
becomes impractical. We vastly prefer a low-bandwidth textual interface
in such situations. But how should a textual user interface for dynamic
systems comprised of many components look like? This is particularly difficult
because most development boards are equipped with merely a single UART
connector.
On a normal Genode system, the UART connector is typically used
by the kernel debugger to print debugging output, or for the interactive
use of a debugger. This leaves no interface for interacting with Genode
components. So how can we expose complex scenarios, such as concurrently
running several instances of Genode subsystems, to the user?
Our solution consists of three parts: A pseudo UART driver for Genode
that uses the kernel debugger as back end, a terminal-multiplexing
facility running on the reference platform, and a command-line based
tool for interacting with Genode. By combining those, the user
can interact with the kernel debugger, a Genode command line, and the
consoles of executed Linux instances over a single serial connection.
The pseudo UART driver called kdb_uart_drv is a Genode service that
implements the 'Uart::Session' interface. Therefore, it can be combined
with all components that use the 'Uart::Session' or the 'Terminal::Session'
interfaces, for example the Noux runtime environment, the terminal_log
service (for displaying LOG messages via the terminal interface), L4Linux, or
programs linked against the 'libc_terminal' plugin. The kdb_uart_drv component
is located at 'os/src/drivers/uart/kdb'. It does not access a real UART device
but rather uses the user-level bindings of the kernel debugger to indirectly
read and write data over the UART interface.
[image kdb_uart_drv 65%]
The kdb_uart_drv driver used for sharing one UART among the kernel
debugger, core's LOG service, and a terminal client application
running on Genode.
Figure [kdb_uart_drv] illustrates the relationship between the kernel
debugger, core's LOG service, and kdb_uart_drv. Because write operations
target the kernel debugger directly, core's LOG service gets bypassed. Output
written to the kdb_uart_drv will directly appear at the terminal program of
the host system. Because kdb_uart_drv has
direct access to the host terminal, it can leverage all facilities of the host
terminal, in particular various escape sequences for terminal manipulations.
For reading from the kernel debugger, there is no way to block for UART input.
Hence, the kdb_uart_drv periodically polls for new input with a period of 20
milliseconds. If new input is available, the driver reads as many characters as
available at once. So the runtime overhead of polling is negligible. To test
kdb_uart_drv as individual component, there is a run script provided at
'os/run/kdb_uart_drv.run'.
Thanks to kdb_uart_drv, both the kernel debugger and Genode can
share one single UART connection. So we have a principal way to let the user
interact with a Genode component that uses the 'Terminal::Session' interface.
However, typical system scenarios should accommodate not just a single program
but multiple Linux instances and native Genode applications simultaneously,
each requiring a dedicated 'Terminal::Session'. Hence, we need a way to
multiplex the 'Terminal::Session' interface between those clients. Our
multiplexing solution comes in the form of a component called terminal_mux,
which we just introduced in the
[https://genode.org/documentation/release-notes/13.02#New_terminal_multiplexer - previous release].
It uses a single terminal connection to implement a text-based user interface
to multiple virtual terminal consoles.
[image terminal_mux 40%]
Operation of the terminal_mux service.
Figure [terminal_mux] depicts the basic functioning of this component. For
terminal_mux clients, the service implements the Linux terminal capabilities.
For doing that, it shares large parts of the implementation of the existing
Genode terminal program. For each client, terminal_mux renders the client
output into a client-specific text-screen buffer. So any number of clients can
perform output on terminal_mux concurrently. According to the selection by
the user, terminal_mux periodically translates one client buffer (the
foreground buffer) to escape sequences as understood by the host terminal. This
translation is performed using the ncurses library. The user can pick the
foreground buffer using an interactive menu that can be activated via the
keyboard shortcut _Control-x_.
By combining kdb_uart_drv with terminal_mux, we created a flexible way
to let the user interact with many Genode applications. The last part
missing for a real dynamic system is a text-based command interface to
start and stop Genode subsystems. This functionality is provided by the
new cli_monitor component located at 'os/src/app/cli_monitor'.
It uses the 'Terminal::Session' interface to present a simple interactive
command line with commands for starting and stopping Genode subsystems,
entering the kernel debugger, and showing status information. It provides
tab completion and inline help to make it easily explorable. The cli_monitor
component is integrated in the scenario of the 'terminal_mux.run' script
mentioned above. Because cli_command is a 'Terminal::Session' client, it can
be interfaced with terminal_mux. This composition is illustrated by Figure
[uart_overview].
[image uart_overview 100%]
Overview of the terminal infrastructure as employed in the
demonstration scenario.
Note that in some situations, e.g., when killing subsystems, the kernel, core,
or the init process may print LOG messages. Because those messages are
naturally not routed through terminal_log, they will interfere with the
operation of terminal_mux and thereby result in visible inconsistencies.
Pressing _Control-x_ will clear such artifacts. This will bring up the
terminal_mux menu, which implicitly triggers the redraw of the entire terminal.
Base framework
##############
The current release comes with incremental improvements of the MMIO framework
API and a new utility to ease the synchronized accesses to otherwise
unsynchronized class interfaces.
:MMIO framework improvements:
For native Genode device drivers, we consistently use our
[https://genode.org/documentation/release-notes/12.02#MMIO_access_framework - MMIO framework API].
These utilities help us to safeguard the access to individual bit fields of
memory-mapped device registers and cleanly separate the declaration of device
registers from the driver logic. During the increased use of the API, we
observe that the 'Genode::Mmio' class template operates mostly on addresses
that belong to dataspaces provided by core's IO_MEM service. Those dataspaces
are typically obtained via the 'Attached_io_mem_dataspace' convenience class,
which requests the dataspace and attaches it to the local address
space at once. To further reduce repetitive code, we introduced the new
'Attached_mmio' class (located at 'os/attached_mmio.h'), which handles the
common case of making the content of a IO_MEM dataspace available through
register definitions using the 'Mmio' utility. Furthermore, the MMIO framework
API has been enhanced with a variant of the 'Mmio::wait_for()' function that
waits for whole register values rather than bits.
:Synchronized interfaces:
Most Genode programs are multi-threaded, which makes the proper use of locks
inevitable. For most data structures, Genode does not implicitly manage the
locking but expects the user of the data structures to know what he is doing.
This way, we can avoid the locking overhead if a data structure is known to be
accessed by a single thread only. If accessed by multiple threads, we usually
wrap such data structures within an accessor interface that takes care of the
locking. For example, for the 'Allocator' interface, there exists a
corresponding 'Synchronized_allocator' interface wrapper. This technique works
well as long as the number of interfaces is low -- as is the case for Genode's
base API. However, as the wrapper code is for the most part pretty dumb, we'd
like to avoid it. Also, when using the Genode API to implement programs on
top, we do not anticipate manually creating such accessor wrappers. To ease
the creation of synchronized interfaces, we introduced the new
'Synced_interface' class template. It takes a pointer to an existing interface
and a lock as arguments. An instance of a 'Synced_interface' provides
synchronized access to the wrapped interface functions via the 'operator ()'.
Because the 'Synced_interface' does not provide any means to obtain the
unsynchronized version of the interface, once wrapped, the interface cannot be
misused by subsystems that get handed over a reference to a
'Synced_interface'. To see how to employ this utility, please have a look of
how we realize the synchronization within the Vancouver VMM (in particular,
the access to the motherboard).
Low-level OS infrastructure
###########################
TCP/IP performance
==================
On the course of the automated benchmarking described in Section
[Automated quality-assurance testing], we conducted the following steps
to enable benchmarks and to improve performance at the TCP/IP level.
At application level, we desire to compare our network performance with the
performance on GNU/Linux using commodity benchmarks. For this reason, netperf
has been ported to run as native Genode using the lwIP stack. This benchmark
allows us to systematically compare our results with those achieved by Linux.
The port of netperf is available in the ports repository.
In addition to running a commodity benchmark, we pursue synthetic benchmarks
that model the behaviour of typical application scenarios, for example, a
web server that receive many small requests. This is where the added
'test-ping_client' and 'test-ping_server' tests come into play. The test
is located at 'libports/src/test/lwip/pingpong'. It is used by the
series of 'network_test_*.run' scripts located at 'libports/run'. The
run scripts exercise the test in various scenarios and thereby allow us to
systematically explore the impact of the libc and NIC bridge on the
application performance.
# Using raw lwIP without the libc
# Like the first test, but with an instance of the NIC bridge in between the
test program and the driver.
# Using lwIP with the libc socket bindings
# Like the third test, but with NIC bridge added
To keep track of the lwIP development more closely, we switched to the
Git version of lwIP instead of using a source snapshot.
Furthermore, we incorporated "window scaling" support (RFC 1323) into our
version of lwIP as we identify the TCP window size as a limiting factor
of the TCP throughput achieved via lwIP.
C runtime
=========
We added support for "resolv" functionality to the libc_lwip_nic_dhcp plugin.
Normally, a file called 'resolv.conf' is expected to be located at '/etc'.
On Genode, however, we don't have a global file system, which makes this
way of configuration cumbersome. To ease the provision of a simple default
'resolv.conf' configuration, the plugin hands out the file as a virtual file.
The configuration automatically provides the DNS server address acquired by
lwIP via DHCP. If, for some reason, this policy is not desired, the feature
can be disabled via:
! <libc resolv="no" />
*Note that the configuration of the C runtime has changed*
To foster consistency of the libc configuration, we moved the static
network "interface" attributes into the 'libc' XML node. A new configuration
of static networking would look as follows:
! <libc ip_addr="..." netmask="..." gateway="..." />
Terminal
========
Genode's custom terminal implementation has been improved to better handle
widely used escape sequences.
The new version is able to handle two-argument SGR commands with
attribute/color arguments in any order, and supports the ED, EL0, and
CUB commands.
Because the terminal classes do not rely on any 3rd-party code, they
have been moved to the os repository at 'os/include/terminal'. This way,
we can use those classes by other components of the os repository such
as the new CLI monitor.
FS-LOG service
==============
Using the new FS-LOG service residing at 'libports/os/src/server/fs_log', log
messages of different processes can be redirected to files on a file-system
service. The assignment of processes to files can be expressed in the
configuration as follows:
! <start name="fs_log">
! <resource name="RAM" quantum="2M"/>
! <provides><service name="LOG"/></provides>
! <config>
! <policy label="noux" file="/noux.log" />
! <policy label="noux ->" file="/noux_process.log" />
! </config>
! </start>
In this example, all messages originating from the noux process are directed
to the file '/noux.log'. All messages originating from children of the noux
process end up in the file '/noux_process.log'.
Liquid FB
=========
Liquid FB is a virtual framebuffer service that uses the nitpicker GUI
server as back end. The virtual framebuffer is presented as a movable
window with a title bar. Until now, we used it primarily for demonstration
purposes, i.e., it is part of Genode's default demo scenario.
Thanks to our forthcoming adaptation of Qt5 to Genode, which requires a
very similar solution to interface Qt5's platform-abstraction layer (QPA) to
Genode, liquid FB got in the spotlight of this release.
First, we took the chance to update its configuration parameters to
become more consistent with similar services such as nit_fb. As liquid_fb was
originally conceived at a time when Genode's XML parser did not support
XML attributes, its configuration syntax used to be a bit arcane. This
has changed now. Apart from this cosmetic refinement, there are two prominent
new features: Support for resizing the framebuffer window with the
mouse and support for dynamic reconfiguration of the virtual framebuffer
via Genode's configuration mechanism.
When the liquid FB window gets resized by the user, the virtual framebuffer
emits a mode-changed signal to its client, which, in turn can handle the
event by re-acquiring the frame-buffer dataspace.
The added support for dynamic reconfiguration allows for changing the
properties of a liquid FB instance via Genode's configuration mechanism.
For example, the window position and size can be manipulated this way.
Furthermore, two new configuration options have been added. The
'resize_handle' option shows or hides the resize handle widget at the
lower-right window corner (by default, it is hidden). The 'decoration' option
defines whether window decorations should be visible (default is yes). Both
options can have the values "on" or "off".
3rd-party libraries
###################
The following 3rd-party libraries have been added or updated:
* To complement libSDL, we have added ports of SDL_ttf, SDL_image,
SDL_image, SDL_mixer, and SDL_loadso. Those additions to libSDL
are used by popular libSDL-based applications such as Tuxpaint.
They are now available at the libports repository.
* GNU FriBidi 0.19.5 added to the libports repository
* Qt4 updated to version 4.8.4
* zlib updated to version 1.2.8
Device drivers
##############
Unified driver names
====================
The growing diversity of supported hardware platforms calls for improved
conventions of how to name device drivers. Otherwise, run scripts that are
meant to support a wide range of platforms will eventually become more
and more complicated due to platform-dependent conditional configuration
snippets. For example, the default framebuffer drivers of the respective
platforms used to be called "vesa_drv" (for x86), "omap4_fb_drv", or "pl11x_drv".
In order to support the different platforms, run scripts that were otherwise
platform-agnostic had to explicitly deal with those differences.
To solve this issue, we introduced a generic SPEC values for device types, for
which a default driver is expected to exist. If a platform features a
framebuffer driver, it includes the SPEC value "framebuffer". On each
platform, the default driver for the respective device has the same name. So
each of "vesa_drv", "pl11x_drv", and "omap4_fb_drv" had been renamed to
"fb_drv". This is possible because the use of those drivers is mutually
exclusive.
The same convention has been applied to GPIO drivers as well. The
corresponding SPEC value is called "gpio". The driver binaries are called
"gpio_drv".
ATAPI
=====
LBA48 support has been added to the ATAPI driver. Thanks to Ivan Loskutov!
KDB UART driver for L4/Fiasco and Fiasco.OC
===========================================
The new KDB UART driver at 'os/src/drivera/uart/kdb' uses the kernel debugger
console as backend for input and output. This is useful in the case that only
one UART is available as described in Section [Terminal infrastructure].
Examples for using the kdb_uart_drv are available in the form of the run scripts
'ports-foc/run/l4linux.run' and 'os/run/kdb_uart_drv.run'.
Revised GPIO session interface
==============================
The original design of the GPIO session interface enabled the client of a
single session to interact with any number GPIO pins. Each function of the
interface took a GPIO number as first argument, which addressed the GPIO pin.
To simplify the interface and to enable fine-grained GPIO-assignment policies,
the interface has been changed to provide access to a single GPIO pin per
session only. At session creation time, the client specifies a single GPIO
pin, to which the session refers. This information can be evaluated for the
session routing. So access-control policies can be easily implemented per GPIO
pin. The server stores the pin as part of the session context and implicitly
uses the pin for operations on the session interface.
Furthermore, a generic driver interface for GPIO-class-device drivers
has been introduced. The new interface at 'os/include/gpio' alleviates the
need to implement the boilerplate code to interface the driver with Genode.
The existing GPIO drivers for OMAP4 and i.MX53 are the first beneficiaries of
these changes.
Exynos 5 SoC
============
After principally enabling the Exynos 5 SoC platform in the previous
release, we moved on with extending the device-driver coverage of this SoC. In
particular, we addressed USB networking, XHCI (USB-3), Gigabit networking over
USB-3, eMMC, and SATA.
The development of those device drivers follows our rationale that guided our
[https://genode.org/documentation/articles/pandaboard - previous work on the OMAP4 platform].
For the USB driver, we employed the device-driver-environment (DDE) approach
for reusing the Linux USB stack and the host controller drivers. In contrast,
the eMMC and SATA drivers are built as genuine Genode drivers with no
3rd-party code used.
Technically, the addition of Exynos-5 support to our USB driver was
an evolutionary step. It required us to add the corresponding EHCI
controller and to supply a few additions to the device-driver
environment. To simplify the driver, we decided to let the driver
rely on the platform initialization as performed by the U-Boot boot
loader. Since the initialization is performed during the boot process
already, there is no need to do this work twice. Because the platforms
supported by the USB driver become more and more diverse, we re-organized the
internal structure of the 'dde_linux' repository to keep those platforms well
separated. Furthermore, we reworked the memory management of the USB driver to
improve the utilization of the available RAM. The new solution employs Genode's
concept of managed dataspaces to manage a part of the local address-space
layout manually. This helps us to implement a fast translation of driver-local
virtual addresses to physical addresses as needed for issuing DMA requests.
The eMMC driver builds upon our protocol implementation for the SD-card
protocol, which was originally developed for the OMAP4 SD-card driver.
Because we kept the SD-card protocol implementation well separated
from the host-controller driver, it was possible to leverage parts of our
existing work for the eMMC driver. Because the eMMC protocol is an extension
of the SD-card protocol, however, we needed to enhance the protocol
implementation accordingly. The extension comprises support for the
MMC_SEND_EXT_CSD, MMC_SEND_OP_COND, and STOP_TRANSMISSION commands as well as
the MMC detection. The host controller driver was implemented from scratch
with the help of I/O access traces gathered from instrumenting the U-Boot boot
loader and the Linux kernel. The driver operates the eMMC in high-speed, 8-bit
mode at 52 MHz using DMA. The implementation can be found at
'os/src/drivers/sd_card/exynos5'.
The initial version of our new SATA driver for Exynos 5 has been implemented
from the ground up. Even though it is at an early stage, it has been
successfully tested with a UDMA-133 disk, e.g., our generic block test
is passed and the disk can be attached as a block device to an instance of
L4Linux.
Freescale i.MX SoC
==================
The support for the Freescale i.MX53 SoC has been extended by a number of
devices. All drivers reside in the os repository under the 'os/src/drivers'
subdirectory.
The general-purpose I/O (GPIO) driver located at 'gpio/imx53' implements the
revised GPIO-session interface.
The i.MX53 input driver provides support for the input devices featured on the
i.MX53 SABRE tablet. The tablet uses an Egalaxy touchscreen and Freescale's
MPR121 capacitative touch buttons. Both are supported by the new driver. The
driver is located at 'input/imx53'.
The new framebuffer driver for the i.MX53 quick-start board (QSB) as well as
the SABRE tablet comes with special support for using the
hardware overlay feature provided by the i.MX53 image processing unit (IPU)
Access to the overlay is implemented via an IPU-specific extension
of the framebuffer-session interface. To combine the driver well with
nitpicker using alpha-channels, optional support for double-buffering
is provided. The driver is located at 'framebuffer/imx53'.
As an abstraction of platform features that need to be accessed by
multiple drivers, a so-called platform driver has been introduced.
The platform driver safeguards the access to global resources such
as clocks and system-configuration bits. It can be found at 'platform/imx53'.
OMAP4 SoC
=========
The OMAP4 framebuffer driver used to support HDMI only, which was used
for connecting a display to the Pandaboard. To make the driver usable on
phones and tablets, the driver has been enhanced to support LCD output. Thanks
to Alexander Tarasikov for the patch and the insightful story about
[https://allsoftwaresucks.blogspot.com/2013/05/porting-genode-to-commercial-hardware.html - porting Genode to the B&N Nook HD+ tablet]!
USB
===
The USB driver of the 'dde_linux' repository has received substantial
improvements both feature-wise and under the hood.
First and foremost, the Linux device-driver environment, on which the
driver is based on, has been updated from kernel version 3.2 to version
3.9 as the latter version includes drivers for recent host controllers
such as DWC3 out of the box.
DWC3 is the host controller employed on the Exynos-5-based
Arndale platform for USB 3. We added the support needed to operate this
controller in XHCI mode and added support for Gigabit networking through
the ASIX AX88179 Gigabit-Ethernet Adapter as well as USB storage support.
Apart from extending the device-driver coverage, we revised the driver
internally. The back-end allocators for DMA buffers and normal memory have been
rewritten to allocate RAM more sparingly. Furthermore, we enabled the USB
driver for 64-bit x86 machines and improved the support for HID keyboards,
including the application of quirks to cherry keyboards.
*Note the change of the USB configuration*
With the addition of XHCI, the USB driver supports a growing number
of host controllers. In some situations, it is desirable to constrain the
driver to a subset of controllers only. For example, on the Arndale platform,
we desire to use a dedicated USB stack for XHCI, which operates completely
independent from the USB stack accessing USB-2. This way, gigabit networking
over USB-3 won't interfere with the operation of USB-2. To make this
possible, we added new configuration options to the USB driver.
With the new scheme, host controllers must be explicitly enabled in the
configuration. Supported config attributes are: 'uhci', 'ehci', and 'xhci'.
For example, a configuration snippet to enable UHCI and EHCI looks as
follows:
! <config uhci="yes" ehci="yes">
Updated iPXE device-driver environment
======================================
The iPXE device-driver environment was update to the most recent
iPXE upstream Git version in order to benefit from upstream improvements
of the Intel E1000 NIC driver.
Runtime environments
####################
Vancouver VMM on NOVA
=====================
Vancouver is the user-level virtual-machine monitor that accompanies the
NOVA hypervisor for hosting unmodified guest operating systems.
The most active line of development is led by Julian Stecklina at TU Dresden
via a fork called Seoul. In contrast to the original version of Vancouver,
this fork is open for outside contributions. Hence, it represents an ideal
platform for those parties with a stake in Vancouver to collaborate, i.e.,
the NUL userland, the NOVA runtime environment of TUD, and Genode.
In the current state of the transition, the Hip structure from Genode
is reused. String functions, which were formerly taken from NUL are now
provided by a stripped-down version of the C library called
'seoul_libc_support'. The nul/config.h is replaced by just using a constant
value in the one place where the file was needed.
The Genode-specific back ends of Vancouver, as largely introduced with the
previous Genode release, have been improved in several respects:
* CPUID 0x40000000: This instruction is issued by Linux when the KVM
guest support is compiled in. We have to return deterministic values to let
the Linux kernel survive.
* Replaced busy thread startup synchronization by proper locking.
* New locking scheme: We replaced the error-prone manual locking with the
use of the freshly introduced 'Synced_interface' for the motherboard and the
VCPU dispatcher. Also, all globally visible locks have been removed. They are
explicitly passed to subsystems only when needed.
* Improved PS/2 mouse back-end:
The previous version of the PS/2 mouse back end managed mouse-motion
events in a strange way, effectively throwing away most information
about the motion vector. Furthermore, the tracking of the mouse-button
states were missing. So drag-and-drop in a guest OS won't work. The new
version fixes those issues. For the transformation of input events to
PS/2 packets, the 'Genode::Register' facility is used, which greatly
simplifies the code.
L4Linux on Fiasco.OC
====================
We improved the memory management of L4Linux on Genode in two ways.
The first improvement is concerned about the upper limit of memory per Linux
instance. The corresponding discussion can be found at
[https://github.com/genodelabs/genode/issues/414 - issue #414].
We changed our L4Re emulation library to match the semantics of the original
L4Re more closely. Furthermore, we removed a heuristic in the L4Linux kernel,
which assumed that all kernel-local addresses above 0x8000000 refer to device
resources. In our version of L4Linux, there exist no MMIO resources. In
contrary, the virtual addresses above this addresses are used for normal
memory. By removing this artificial restriction with regard to the virtual
memory layout of the L4Linux kernel, we can host a larger kernel memory area.
The second improvement is concerned with the allocation of L4Linux
memory at Genode's core. Until now, L4Linux used to allocate its memory
as one contiguous RAM dataspace at core's RAM service. Core tries to
naturally align the allocation to improve the likelihood for large-page
mappings. So a dataspace is likely to be physically located at a
power-of-two boundary larger or equal than the dataspace size. For example,
the allocation of a 100 MiB RAM dataspace for a Linux instance will
be located at a 128 MiB boundary. If multiple of such allocations happen
sub-sequentially, this allocation strategy results in 28 MiB gaps between
100 MiB dataspaces. This memory cannot be used for large contiguous
allocations anymore. So even if the available memory capacity is far
larger than 100 MiB, an allocation of a 100 MiB block may fail.
To relieve this problem, we weakened the requirement for contiguous memory
by assembling L4Linux memory from multiple chunks of small dataspaces.
For example, by using a chunk size of 16 MiB, core's best-fit allocator
will have a better chance to find a more suited position for allocation
when aligning the block to a 16 MiB boundary compared to the allocation
of a larger block. Furthermore, slack memory can be used more efficiently
because smaller gaps (such as a 20 MiB gap) remain to be usable for L4Linux.
The discussion of this topic and the individual patch can be found at
[https://github.com/genodelabs/genode/issues/695 - issue #695].
Furthermore, the L4Linux block driver has been improved to support large
partitions.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Raspberry Pi
~~~~~~~~~~~~
Principal support for the Raspberry Pi platform has been added to the base-hw
kernel. The popular Raspberry Pi board is based on an ARMv6 Broadcom BCM2835
SoC. The current scope of the platform support comprises:
* IRQ controller driver: Because the interrupt controller uses a cascade of
registers, we settled on the following IRQ enumeration scheme.
IRQ numbers 0..7 refer to the basic IRQs.
IRQ numbers 8..39 refer to GPU IRQs 0..31.
IRQ numbers 40..71 refer to GPU IRQs 32..63.
* The kernel employs the so-called system timer for the preemptive scheduling.
* Core's LOG messages are printed over the PL011-based UART.
* The user-level timer driver uses the so-called ARM timer, which is a
slightly modified SP804 timer device.
Up to this point, a few device driver are missing to use Genode on the
Raspberry Pi in practice, most notably USB.
To build and run Genode on the Raspberry Pi, create a new build directory
via the 'create_builddir' tool, specifying 'hw_rpi' as platform.
User-level timer driver for Arndale platform
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By adding our new Exynos 5250 PWM timer driver, the base-hw kernel can now
be used for executing meaningful scenarios on the Arndale board including
the USB stack and networking.
Linux
=====
Until now, Genode on Linux supported x86-based platforms only.
The newly added 'linux_arm' platform clears the way to run Genode directly on
Linux-based ARM platforms. Genode's entire software stack is supported,
including the dynamic linker, graphical applications, and Qt4.
As a known limitations, the libc 'setjmp()'/'longjmp()' doesn't currently
save/restore floating point registers.
Build system and tools
######################
The run tool has been enhanced as detailed in Section
[Automated quality-assurance testing].

995
doc/release_notes/13-08.txt Normal file
View File

@@ -0,0 +1,995 @@
===============================================
Release notes for the Genode OS Framework 13.08
===============================================
Genode Labs
The release of version 13.08 marks the 5th anniversary of the Genode OS
framework. We celebrate this anniversary with the addition of three major
features that we have much longed for, namely the port of Qt5 to Genode,
profound multi-processor support, and a light-weight event tracing
framework. Additionally, the new version comes with new device drivers for
SATA 3.0 and power management for the Exynos-5 SoC, improved virtualization
support on NOVA on x86, updated kernels, and integrity checks for
downloaded 3rd-party source code.
Over the course of the past five years, Genode's development was primarily
motivated by adding and cultivating features to make the framework fit for as
many application areas as possible. Now that we have a critical mass of
features, the focus on mere functionality does not suffice anymore. The
question of what Genode can do ultimately turns into the question of how well
Genode can do something: How stable is a certain workload? How does networking
perform? How does it scale to multi-processor systems? Because we are lacking
concise answers to these kind of questions, we have to investigate.
When talking about stability, our recently introduced automated testing
infrastructure makes us more confident than ever. Each night, over 200
automated tests are performed, covering various kernels and several hardware
platforms. All those tests are publicly available in the form of so-called run
scripts and are under continues development.
Regarding performance investigations, recently we have begun to benchmark
application performance focusing on network throughput. Interestingly, our
measurements reveal significant differences between the used kernels, but
also shortcomings in our software stack. For example, currently we see that
our version of lwIP performs poorly with gigabit networking. To thoroughly
investigate such performance issues, the current version adds support
for tracing the behaviour of Genode components. This will allow us to get a
profound understanding of all inter-component interaction that are on the
critical path for the performance of complex application-level workloads.
Thanks to the Genode architecture, we could come up with a strikingly simple,
yet powerful design for a tracing facility. Section
[Light-weight event tracing] explains how it works.
When it comes to multi-processor scalability, we used to shy away from such
inquiries because, honestly, we haven't paid much consideration to it. This
view has changed by now. With the current release, we implemented the
management of CPU affinities right into the heart of the framework, i.e.,
Genode's session concept. Additionally, we cracked a damn hard nut by enabling
Genode to use multiple CPUs on the NOVA hypervisor. This kernel is by far the
most advanced Open-Source microkernel for the x86 architecture. However,
NOVA's MP model seemed to inherently contradict with the API design of Genode.
Fortunately, we found a fairly elegant way to go forward and we're able to
tame the beast. Section [Enhanced multi-processor support] goes into more
detail.
Functionality-wise, we always considered the availability of Qt on Genode as a
big asset. With the current release, we are happy to announce that we finally
made the switch from Qt4 to Qt5. Section [Qt5 available on all kernels] gives
insights into the challenges that we faced during porting work.
In addition to those highlights, the new version comes with improvements all
over the place. To name a few, there are improved support for POSIX threads,
updated device drivers, an updated version of the Fiasco.OC kernel and
L4Linux, and new device drivers for Exynos-5. Finally, the problem of
verifying the integrity of downloaded 3rd-party source codes has been
addressed.
Qt5 available on all kernels
############################
Since its integration with Genode version 9.02, Qt4 is regarded as
one of the most prominent features of the framework. For users, combining Qt
with Genode makes the world of sophisticated GUI-based end-user applications
available on various microkernels. For Genode developers, Qt represents by far
the most complex work load natively executed on top of the framework API,
thereby stressing the underlying system in any way imaginable. We have been
keeping an eye on Qt version 5 for a while and highly anticipate the direction
where Qt is heading. We think that the time is right to leave Qt4 behind to
embrace Qt5 for Genode.
For the time being, both Qt4 and Qt5 are available for Genode, but Qt4 is
declared as deprecated and will be removed with the upcoming version 13.11.
Since Qt5 is almost API compatible to Qt4, the migration path is relatively
smooth. So we recommend to move your applications over to Qt5 during the
next release cycle.
In the following, we briefly describe the challenges we faced while adding Qt5
support to Genode, point you to the place where to find Qt5 in the source
tree, and give quick-start instructions for getting a Qt5 application
scenario running.
We found that the biggest architectural difference between version 4 and
version 5 is the use of the so-called Qt Platform Abstraction (QPA) interface,
which replaces the former Qt Window System (QWS).
Moving from QWS to QPA
======================
With Qt4, we relied on QWS
to perform the window handling. A Qt4 application used to create a session to
Genode's GUI server (called nitpicker) and applied its graphical output onto a
virtual framebuffer. The virtual framebuffer was not visible per se. To make
portions of the virtual framebuffer visible on screen, the application had to
create so-called nitpicker views. A view is a rectangular area of the physical
screen that displays a (portion of) the virtual framebuffer. The position,
size, and stacking order of views is managed by the application. For each Qt
window, the application would simply create a corresponding nitpicker view and
maintain the consistency of the view with the geometry of the Qt window. Even
though each Qt application seemingly operated as a full-screen application
with the windows managed by the application-local QWS, the use of nitpicker
views still allowed the integration of any number of Qt applications into one
windowed environment.
With the advent of compositing window managers, the typical way of how an
application interacts with the window system of the OS changed. Whereas
old-generation GUIs relied on a tight interplay of the application with the
window server in order to re-generate newly exposed window regions whenever
needed (e.g., revealing the window content previously covered by another
window), the modern model of a GUI server keeps all pixels of all windows in
memory regardless of whether the window is visible or covered by other
windows. The use of one pixel buffer per window seems wasteful with respect to
memory usage when many large windows are overlapping each other. On the other
hand, this technique largely simplifies GUI servers and makes the
implementation of fancy effects, like translucent windows, straight forward.
Since memory is cheap, the Qt developers abandoned the old method and fully
embraced the buffer-per-window approach by the means of QPA.
For Genode, we faced the challenge that we don't have a window server
in the usual sense. With nitpicker, we have a GUI server, but with a more
radical design. In particular, nitpicker leaves the management of window
geometries and stacking to the client. In contrast, QPA expects the window
system to provide both means for a user to interactively change the window
layout and a way for an application to define the properties (such as the
geometry, title, and visibility) of its windows.
The obviously missing piece was the software component that deals with window
controls. Fortunately, we already have a bunch of native nitpicker applications
that come with client-side window controls, in particular the so-called liquid
framebuffer (liquid_fb). This nitpicker client presents a virtual framebuffer
in form of a proper window on screen and, in turn, provides a framebuffer and
input service. These services can be used by other Genode processes, for
example, another nested instance of nitpicker.
This way, liquid_fb lends itself to be the interface between the nitpicker
GUI server and QPA.
For each QPA window, the application creates a new liquid_fb instance as a
child process. The liquid_fb instance will request a dedicated nitpicker
session, which gets routed through the application towards the parent of the
application, which eventually routes the request to the nitpicker GUI server.
Finally, the liquid_fb instance announces its input and framebuffer services
to its parent, which happens to be the application. Now, the application is
able to use those services in order to access the window. Because the
liquid_fb instances are children of the application, the application can
impose control over those. In particular, it can update the liquid_fb
configuration including the window geometry and title at any time. Thanks to
Genode's dynamic reconfiguration mechanism, the liquid_fb instances are able
to promptly respond to such reconfigurations.
Combined, those mechanisms give the application a way to receive user input
(via the input services provided by the liquid_fb instances), perform
graphical output (via the virtual framebuffers provided by the liquid_fb
instances), and define window properties (by dynamically changing the
respective liquid_fb configurations). At the same time, the user can use
liquid_fb's window controls to move, stack, and resize application windows as
expected.
[image qt5_screenshot]
Steps of porting Qt5
====================
Besides the switch to QPA, the second major change was related to the build
system. For the porting work, we use a Linux host system to obtain the
starting point for the build rules. The Qt4 build system would initially
generate all Makefiles, which could be inspected and processed at once. In
contrast, Qt5 generates Makefiles during the build process whenever needed.
When having configured Qt for Genode, however, the build on Linux will
ultimately fail. So the much-desired intermediate Makefiles won't be created.
The solution was to have 'configure' invoke 'qmake -r' instead of 'qmake'.
This way, qmake project files will be processed recursively. A few additional
tweaks were needed to avoid qmake from backing out because of missing
dependencies (qt5_configuration.patch). To enable the build of the Qt tools
out of tree, qmake-specific files had to be slightly adapted
(qt5_tools.patch). Furthermore, qtwebkit turned out to use code-generation
tools quite extensively during the build process. On Genode, we perform this
step during the 'make prepare' phase when downloading and integrating the Qt
source code with the Genode source tree.
For building Qt5 on Genode, we hit two problems. First, qtwebkit depends on
the ICU (International Components for Unicode) library, which was promptly
ported and can be found in the libports repository. Second, qtwebkit
apparently dropped the support of the 'QThread' API in favor of
POSIX-thread support only. For this reason, we had to extend the coverage
of Genode's pthread library to fulfill the needs of qtwebkit.
Once built, we entered the territory of debugging problems at runtime.
* We hit a memory-corruption problem caused by an assumption of 'QArrayData'
with regard to the alignment of memory allocated via malloc. As a
work-around, we weakened the assumptions to 4-byte alignment
(qt5_qarraydata.patch).
* Page faults in QWidgetAnimator caused by
use-after-free problems. Those could be alleviated by adding pointer
checks (qt5_qwidgetanimator.patch).
* Page faults caused by the slot function 'QWidgetWindow::updateObjectName()'
with a 'this' pointer of an incompatible type 'QDesktopWidget*'.
As a workaround, we avoid this condition by delegating the
'QWidgetWindow::event()' that happened to trigger the slot method to
'QWindow' (base class of 'QWidgetWindow') rather than to a
'QDesktopWidget' member (qt5_qwidgetwindow.patch).
* We observed that Arora presented web sites incomplete, or including HTTP
headers. During the evaluation of HTTP data, a signal was sent to another
thread, which activated a "user provided download buffer" for optimization
purposes. On Linux, the receiving thread was immediately scheduled and
everything went fine. However, on some kernels used by Genode, scheduling
is different, so that the original thread continued to execute a bit longer,
ultimately triggering a race condition. As a workaround, we disabled the
"user provided download buffer" optimization.
* Page faults in the JavaScript engine of Webkit. The JavaScript
'RegExp.exec()' function returned invalid string objects. We worked around
this issue by deactivating the JIT compiler for the processing of
regular expressions (ENABLE_YARR_JIT).
The current state of the Qt5 port is fairly complete. It covers the core, gui,
jscore, network, script, scriptclassic, sql, ui, webcore, webkit, widgets,
wtf, and xml modules. That said, there are a few known limitations and
differences compared to Qt4. First, the use of one liquid_fb instance per
window consumes more memory compared to the use of QWS in Qt4. Furthermore,
external window movements are not recognized by our QPA implementation yet.
This can cause popup menus to appear at unexpected positions. Key repeat is
not yet handled. The 'QNitpickerViewWidget' is not yet adapted to Qt5. For this
reason, qt_avplay is not working yet.
Test drive
==========
Unlike Qt4, which was hosted in the dedicated 'qt4' repository, Qt5 is
integrated in the libports repository. It can be downloaded and integrated
into the Genode build system by issuing 'make prepare' from within the
libports repository. The Qt5 versions of the known Qt examples are located at
libports/src/app/qt5. Ready-to-use run scripts for those examples are available
at libports/run.
Migration away from Qt4 to Qt5
==============================
The support for Qt4 for Genode has been declared as deprecated. By default,
it's use is inhibited to avoid name aliasing problems between both versions.
Any attempt to build a qt4-based target will result in a message:
!Skip target app/qt_launchpad because it requires qt4_deprecated
To re-enable the use of Qt4, the SPEC value qt4_deprecated must be defined
manually for the build directory:
!echo "SPECS += qt4_deprecated" >> etc/specs.conf
We will keep the qt4 repository in the source tree during the current
release cycle. It will be removed with version 13.11.
Light-weight event tracing
##########################
With Genode application scenarios getting increasingly sophisticated,
the need for thorough performance analysis has come into spotlight.
Such scenarios entail the interaction of many components.
For example, with our recent work on optimizing network performance, we
have to consider several possible attack points:
* Device driver: Is the device operating in the proper mode? Are there
CPU-intensive operations such as allocations within the critical path?
* Interface to the device driver: How frequent are context switches between
client and device driver? Is the interface designed appropriately for
the access patterns?
* TCP/IP stack: How does the data flow from the raw packet level to the
socket level? How dominant are synchronization costs between the involved
threads? Are there costly in-band operations performed, e.g., dynamic
memory allocations per packet?
* C runtime: How does integration of the TCP/IP stack with the C runtime
work, for example how does the socket API interfere with timeout
handling during 'select' calls?
* Networking application
* Timer server: How often is the timer consulted by the involved components?
What is the granularity of timeouts and thereby the associated costs for
handling them?
* Interaction with core: What is the profile of the component's interaction
with core's low-level services?
This example is just an illustration. Most real-world performance-critical
scenarios have a similar or even larger scope. With our traditional
tools, it is hardly possible to gather a holistic view of the scenario. Hence,
finding performance bottlenecks tends to be a series of hit-and-miss
experiments, which is a tiresome and costly endeavour.
To overcome this situation, we need the ability to gather traces of component
interactions. Therefore, we started investigating the design of a tracing
facility for Genode one year ago while posing the following requirements:
* Negligible impact on the performance, no side effects:
For example, performing a system call per traced event
is out of question because this would severely influence the flow of
control (as the system call may trigger the kernel to take a scheduling
decision) and the execution time of the traced code, not to speak of
the TLB and cache footprint.
* Kernel independence: We want to use the same tracing facility across
all supported base platforms.
* Accountability of resources: It must be clearly defined where the
resources for trace buffers come from. Ideally, the tracing tool should be
able to dimension the buffers according to its needs and, in turn, pay for
the buffers.
* Suitable level of abstraction: Only if the trace contains information at
the right level of abstraction, it can be interpreted for large scenarios.
A counter example is the in-kernel trace buffer of the Fiasco.OC kernel,
which logs kernel-internal object names and a few message words when tracing
IPC messages, but makes it almost impossible to map this low-level
information to the abstraction of the control flow of RPC calls. In
contrast, we'd like to capture the names of invoked RPC calls (which is an
abstraction level the kernel is not aware of). This requirement implies the
need to have useful trace points generated automatically. Ideally those
trace points should cover all interactions of a component with the outside
world.
* (Re-)definition of tracing policies at runtime: The
question of which information to gather when a trace point is passed
should not be solely defined at compile time. Instead of changing static
instrumentations in the code, we'd prefer to have a way to configure
the level of detail and possible conditions for capturing events at runtime,
similar to dtrace. This way, a series of different hypotheses could be
tested by just changing the tracing policy instead of re-building and
rebooting the entire scenario.
* Straight-forward implementation: We found that most existing tracing
solutions are complicated. For example, dtrace comes with a virtual
machine for the sandboxed interpretation of policy code. Another typical
source of complexity is the synchronization of trace-buffer accesses.
Because for Genode, low TCB complexity is of utmost importance, the
simplicity of the implementation is the prerequisite to make it an
integral part of the base system.
* Support for both online and offline analysis of traces.
We are happy to report to have come up with a design that meets all those
requirements thanks to the architecture of Genode. In the following, we
present the key aspects of the design.
The tracing facility comes in the form of a new TRACE service implemented
in core. Using this service, a TRACE client can gather information about
available tracing subjects (existing or no-longer existing threads),
define trace buffers and policies and assign those to tracing subjects,
obtain access to trace-buffer contents, and control the tracing state
of tracing subjects. When a new thread is created via a CPU session, the
thread gets registered at a global registry of potential tracing sources. Each
TRACE service manages a session-local registry of so-called trace subjects.
When requested by the TRACE client, it queries new tracing sources from the
source registry and obtains references to the corresponding threads. This way,
the TRACE session becomes able to control the thread's tracing state.
To keep the tracing overhead as low as possible, we assign a separate trace
buffer to each individually traced thread. The trace buffer is a shared memory
block mapped to the virtual address space of the thread's process. Capturing
an event comes down to a write operation into the thread-local buffer. Because
of the use of shared memory for the trace buffer, no system call is needed and
because the buffer is local to the traced thread, there is no need for
synchronizing the access to the buffer. When no tracing is active, a thread
has no trace buffer. The buffer gets installed only when tracing is started.
The buffer is not installed magically from the outside of the traced process
but from the traced thread itself when passing a trace point. To detect
whether to install a new trace buffer, there exists a so-called trace-control
dataspace shared between the traced process and its CPU service. This
dataspace contains control bits for each thread created via the CPU session.
The control bits are evaluated each time a trace point is passed by the
thread. When the thread detects a change of the tracing state, it actively
requests the new trace buffer from the CPU session and installs it into its
address space. The same technique is used for loading the code for tracing
policies into the traced process. The traced thread actively checks for
policy-version updates by evaluating the trace-control bits. If an update is
detected, the new policy code is requested from the CPU session. The policy
code comes in the form of position-independent code, which gets mapped into
the traced thread's address space by the traced thread itself. Once mapped,
a trace point will call the policy code. When called, the policy
module code returns the data to be captured into the trace buffer. The
relationship between the trace monitor (the client of TRACE service), core's
TRACE service, core's CPU service, and the traced process is depicted in
Figure [trace_control].
[image trace_control]
There is one trace-control dataspace per CPU session, which gets accounted
to the CPU session's quota. The resources needed for the
trace-buffer dataspaces and the policy dataspaces are paid-for by the
TRACE client. On session creation, the TRACE client can specify the amount
of its own RAM quota to be donated to the TRACE service in core. This
enables the TRACE client to define trace buffers and policies of arbitrary
sizes, limited only by its own RAM quota.
In Genode, the interaction of a process with its outside world is
characterized by its use of inter-process communication, namely synchronous
RPC, signals, and access to shared memory. For the former two types of
inter-process communication, Genode generates trace points automatically. RPC
clients generate trace points when an RPC call is issued and when a call
returned. RPC servers generate trace points in the RPC dispatcher, capturing
incoming RPC requests as well as RPC replies. Thanks to Genode's RPC
framework, we are able to capture the names of the RPC functions in the RPC
trace points. This information is obtained from the declarations of the RPC
interfaces. For signals, trace points are generated for submitting and
receiving signals. Those trace points form a useful base line for gathering
tracing data. In addition, manual trace points can be inserted into the code.
State of the implementation
===========================
The implementation of Genode's tracing facility is surprisingly low complex.
The addition to the base system (core as well as the base library) are
merely 1500 lines of code. The mechanism works across all base platforms.
Because the TRACE client provides the policy code and trace buffer to the
traced thread, the TRACE client imposes ultimate control over the traced
thread. In contrast to dtrace, which sandboxes the trace policy, we express
the policy module in the form of code executed in the context of the traced
thread. However, in contrast to dtrace, such code is never loaded into a large
monolithic kernel, but solely into the individually traced processes. So the
risk of a misbehaving policy is constrained to the traced process.
In the current form, the TRACE service of core should be considered as a
privileged service because the trace-subject namespace of each session
contains all threads of the system. Therefore, TRACE sessions should be routed
only for trusted processes. In the future, we plan to constrain the
namespaces for tracing subjects per TRACE session.
The TRACE session interface is located at base/include/trace_session/.
A simple example for using the service is available at os/src/test/trace/
and is accompanied with the run script os/run/trace.run. The test
demonstrates the TRACE session interface by gathering a trace of a thread
running locally in its address space.
Enhanced multi-processor support
################################
Multi-processor (MP) support is one of those features that most users take for
granted. MP systems are so ubiquitous, even on mobile platforms, that a
limitation to utilizing a single CPU only is almost a fallacy.
That said, MP support in operating systems is hard to get right. For this
reason, we successively deferred the topic on the agenda of Genode's
road map.
For some base platforms such as the Linux or Codezero kernels, Genode
always used to support SMP because the kernel would manage the affinity
of threads to CPU cores transparently to the user-level process. So on
these kernels, there was no need to add special support into the framework.
However, on most microkernels, the situation is vastly different. The
developers of such kernels try hard to avoid complexity in the kernel and
rightfully argue that in-kernel affinity management would contribute to kernel
complexity. Another argument is that, in contrast to monolithic kernels that
have a global view on the system and an "understanding" of the concerns of the
user processes, a microkernel is pretty clueless when it comes to the roles
and behaviours of individual user-level threads. Not knowing whether a thread
works as a device driver, an interactive program, or a batch process, the
microkernel is not in the position to form a reasonably useful model of the
world, onto which it could intelligently apply scheduling and affinity
heuristics. In fact, from the perspective of a microkernel, each thread does
nothing else than sending and receiving messages, and causing page faults.
For these reasons, microkernel developers tend to provide the bootstrapping
procedure for the physical CPUs and a basic mechanism to assign
threads to CPUs but push the rest of the problem to the user space, i.e.,
Genode. The most straight-forward way would make all physical CPUs visible
to all processes and require the user or system integrator to assign
physical CPUs when a thread is created. However, on the recursively
structured Genode system, we virtualize resources at each level, which
calls for a different approach. Section [Management of CPU affinities]
explains our solution.
When it comes to inter-process communication on MP systems, there is a
certain diversity among the kernel designs. Some kernels allow the user land
to use synchronous IPC between arbitrary threads, regardless of whether both
communication partners reside on the same CPU or on two different CPUs. This
convenient model is provided by Fiasco.OC. However, other kernels do not offer
any synchronous IPC mechanism across CPU cores at all, NOVA being a poster
child of this school of thought. If a user land is specifically designed for
a particular kernel, those peculiarities can be just delegated to the
application developers. For example, the NOVA user land called NUL is designed
such that a recipient of IPC messages spawns a dedicated thread on each
physical CPU. In contrast, Genode is meant to provide a unified API that
works well across various different kernels. To go forward, we had four
options:
# Not fully supporting the entity of API semantics across all base platforms.
For example, we could stick with the RPC API for synchronous communication
between threads. Programs just would happen to fail on some base platforms
when the called server resides on a different CPU. This would effectively
push the problem to the system integrator. The downside would be the
sacrifice of Genode's nice feature that a program developed
on one kernel usually works well on other kernels without any changes.
# Impose the semantics provided by the most restrictive kernel onto all
users of the Genode API. Whereas this approach would facilitate that
programs behave consistently across all base platforms, the restrictions
would be artificially imposed onto all Genode users, in particular the
users of kernels with less restrictions. Of course, we don't change
the Genode API lightheartedly, which attributes to our hesitance to go
into this direction.
# Hiding kernel restrictions behind the Genode API. This approach could come
in many different shapes. For example, Genode could transparently spawn a
thread on each CPU when a single RPC entrypoint gets created, following
the model of NUL. Or Genode could emulate synchronous IPC using the core
process as a proxy.
# Adapting the kernel to the requirements of Genode. That is, persuading
kernel developers to implement the features we find convenient, i.e., adding
a cross-CPU IPC feature to NOVA. History shows that our track record in
doing that is not stellar.
Because each of those options is like opening a different can of worms, we
used to defer the solution of the problem. Fortunately, however, we finally
kicked off a series of practical experiments, which led to a fairly elegant
solution, which is detailed in Section
[Adding multi-processor support to Genode on NOVA].
Management of CPU affinities
============================
In line with our experience of supporting
[https://genode.org/documentation/release-notes/10.02#Real-time_priorities - real-time priorities]
in version 10.02, we were seeking a way to express CPU affinities such that
Genode's recursive nature gets preserved and facilitated. Dealing with
physical CPU numbers would contradict with this mission. Our solution
is based on the observation that most MP systems have topologies that can
be represented on a two-dimensional coordinate system. CPU nodes close
to each other are expected to have closer relationship than distant nodes.
In a large-scale MP system, it is natural to assign clusters of closely
related nodes to a given workload. Genode's architecture is based on the
idea to recursively virtualize resources and thereby lends itself to the
idea to apply this successive virtualization to the problem of clustering
CPU nodes.
In our solution, each process has a process-local view on a so-called affinity
space, which is a two-dimensional coordinate space. If the process creates a
new subsystem, it can assign a portion of its own affinity space to the new
subsystem by imposing a rectangular affinity location to the subsystem's CPU
session. Figure [affinity_space] illustrates the idea.
[image affinity_space]
Following from the expression of affinities as a rectangular location within a
process-local affinity space, the assignment of subsystems to CPU nodes
consists of two parts, the definition of the affinity space dimensions as used
for the process and the association of sub systems with affinity locations
(relative to the affinity space). For the init process, the affinity space is
configured as a sub node of the config node. For example, the following
declaration describes an affinity space of 4x2:
! <config>
! ...
! <affinity-space width="4" height="2" />
! ...
! </config>
Subsystems can be constrained to parts of the affinity space using the
'<affinity>' sub node of a '<start>' entry:
! <config>
! ...
! <start name="loader">
! <affinity xpos="0" ypos="1" width="2" height="1" />
! ...
! </start>
! ...
! </config>
As illustrated by this example, the numbers used in the declarations for this
instance of the init process are not directly related to physical CPUs. If
the machine has just two cores, init's affinity space would be mapped
to the range [0,1] of physical CPUs. However, in a machine
with 16x16 CPUs, the loader would obtain 8x8 CPUs with the upper-left
CPU at position (4,0). Once a CPU session got created, the CPU client can
request the physical affinity space that was assigned to the CPU session
via the 'Cpu_session::affinity()' function. Threads of this CPU session
can be assigned to those physical CPUs via the 'Cpu_session::affinity()'
function, specifying a location relative to the CPU-session's affinity space.
Adding multi-processor support to Genode on NOVA
================================================
The NOVA kernel has been supporting MP systems for a long time. However
Genode did not leverage this capability until now. The main reason was that
the kernel does not provide - intentionally by the kernel developer - the
possibility to perform synchronous IPC between threads residing on different
CPUs.
To cope with this situation, Genode servers and clients would need to make
sure to have at least one thread on a common CPU in order to communicate.
Additionally, shared memory and semaphores could be used to communicate across
CPU cores. Both options would require rather fundamental changes to the Genode
base framework and the API. An exploration of this direction should in any
case be pursued in evolutionary steps rather than as one big change, also
taking into account that other kernels do not impose such hard requirements on
inter-CPU communication. To tackle the challenge, we conducted a series of
experiments to add some kind of cross-CPU IPC support to Genode/NOVA.
As a general implication of the missing inter-CPU IPC, messages between
communication partners that use disjoint CPUs must take an indirection through
a proxy process that has threads running on both CPUs involved. The sender
would send the message to a proxy thread on its local CPU, the proxy process
would transfer the message locally to the CPU of the receiver by using
process-local communication, and the proxy thread on the receiving CPU would
deliver the message to the actual destination. We came up with three options
to implement this idea prototypically:
# Core plays the role of the proxy because it naturally has access to all
CPUs and emulates cross-CPU IPC using the thread abstractions of the
Genode API.
# Core plays the role of the proxy but uses NOVA system calls directly
rather than Genode's thread abstraction.
# The NOVA kernel acts as the proxy and emulates cross-CPU IPC directly
in the kernel.
After having implemented the first prototypes, we reached the following
conclusions.
For options 1 and 2 where core provides this service: If a client can not
issue a local CPU IPC, it asks core - actually the pager of the client
thread - to perform the IPC request. Core then spawns or reuses a proxy thread
on the target CPU and performs the actual IPC on behalf of the client. Option
1 and 2 only differ in respect to code size and the question to whom to
account the required resources - since a proxy thread needs a stack and some
capability selectors.
As one big issue for option 1 and 2, we found that in order to delegate
capabilities during the cross-CPU IPC, core has to receive capability mappings
to delegate them to the target thread. However, core has no means to know
whether the capabilities must be maintained in core or not. If a capability is
already present in the target process, the kernel would just translate the
capability to the target's capability name space. So core wouldn't need to
keep it. In the other case where the target receives a prior unknown
capability, the kernel creates a new mapping. Because the mapping gets
established by the proxy in core, core must not free the capability.
Otherwise, the mapping would disappear in the target process. This means that
the use of core as a proxy ultimately leads to leaking kernel resources
because core needs to keep all transferred capabilities, just for the case a
new mapping got established.
For option 3, the same general functionality as for option 1 and 2 is
implemented in the kernel instead of core. If a local CPU IPC call
fails because of a BAD_CPU kernel error code, the cross-CPU IPC extension
will be used. The kernel extension creates - similar as to option 1 and 2 - a
semaphore (SM), a thread (EC), and a scheduling context (SC) on the remote
CPU and lets it run on behalf of the caller thread. The caller thread
gets suspended by blocking on the created semaphore until the remote EC has
finished the IPC. The remote proxy EC reuses the UTCB of the suspended caller
thread as is and issues the IPC call. When the proxy EC returns, it wakes up
the caller via the semaphore. Finally, the proxy EC and SC de-schedule
themselves and the resources get to be destroyed later on by the kernel's RCU
mechanism. Finally, when the caller thread got woken up, it takes care to
initiate the deconstruction of the semaphore.
The main advantage of option 3 compared to options 1 and 2 is that we don't
have to keep and track the capability delegations during a cross-CPU IPC.
Furthermore, we do not have potentially up to two additional address space
switches per cross-CPU IPC (from client to core and core to the server).
Additionally, the UTCB of the caller is reused by the proxy EC and does not
need to be allocated separately as for option 1 and 2.
For these reasons, we decided to go for the third option. From Genode's API
point of view, the use of cross-CPU IPC is completely transparent. Combined
with the affinity management described in the previous section, Genode/NOVA
just works on MP systems.
As a simple example for using Genode on MP systems, there is a ready-to-use
run script available at base/run/affinity.run.
Base framework
##############
Affinity propagation in parent, root, and RPC entrypoint interfaces
===================================================================
To support the propagation of CPU affinities with session requests, the
parent and root interfaces had to be changed. The 'Parent::Session'
and 'Root::Session' take the affinity of the session as a new argument.
The affinity argument contains both the dimensions of the affinity space
used by the session and the session's designated affinity location within
the space. The corresponding type definitions can be found at
base/affinity.h.
Normally, the 'Parent::Session' function is not used directly but indirectly
through the construction of a so-called connection object, which represents an
open session. For each session type there is a corresponding connection type,
which takes care of assembling the session-argument string by using the
'Connection::session()' convenience function. To maintain API compatibility,
we kept the signature of the existing 'Connection::session()' function using a
default affinity and added a new overload that takes the affinity as
additional argument. Currently, this overload is used in
cpu_session/connection.h.
For expressing the affinities of RPC entrypoints to CPUs within the affinity
space of the server process, the 'Rpc_entrypoint' takes the desired affinity
location of the entrypoint as additional argument. For upholding API
compatibility, the affinity argument is optional.
CPU session interface
=====================
The CPU session interface underwent changes to accommodate the new event
tracing infrastructure and the CPU affinity management.
Originally the 'Cpu_session::num_cpus()' function could be used to
determine the number of CPUs available to the session. This function
has been replaced by the new 'affinity_space' function, which returns the
bounds of the CPU session's physical affinity space. In the simplest case of
an SMP machine, the affinity space is one-dimensional where the width
corresponds to the number of CPUs. The 'affinity' function, which is used to
bind a thread to a specified CPU, has been changed to take an affinity
location as argument. This way, the caller can principally express the
affiliation of the thread with multiple CPUs to guide load-balancing in a CPU
service.
New TRACE session interface
===========================
The new event tracing mechanism as described in Section
[Light-weight event tracing] is exposed to Genode processes in the form
of the TRACE service provided by core. The new session interface
is located under base/include/trace_session/. In addition to the new session
interface, the CPU session interface has been extended with functions for
obtaining the trace-control dataspace for the session as well as the trace
buffer and trace policy for a given thread.
Low-level OS infrastructure
###########################
Event-driven operation of NIC bridge
====================================
The NIC bridge component multiplexes one physical network device among
multiple clients. It enables us to multiplex networking on the network-packet
level rather than the socket level and thereby take TCP/IP out of the
critical software stack for isolating network applications. As it
represents an indirection in the flow of all networking packets, its
performance is important.
The original version of NIC bridge was heavily multi-threaded. In addition to
the main thread, a timer thread, and a thread for interacting with the NIC
driver, it employed one dedicated thread per client. By merging those flows of
control into a single thread, we were able to significantly reduce the number
of context switches and improve data locality. These changes reduced the
impact of the NIC bridge on the packet throughput from 25% to 10%.
Improved POSIX thread support
=============================
To accommodate qtwebkit, we had to extend Genode's pthread library with
working implementations of condition variables, mutexes, and thread-local
storage. The implemented functions are attr_init, attr_destroy, attr_getstack,
attr_get_np, equal, mutex_attr, mutexattr_init, mutexattr_destroy,
mutexattr_settype, mutex_init, mutex_destroy, mutex_lock, mutex_unlock,
cond_init, cond_timedwait, cond_wait, cond_signal, cond_broadcast, key_create,
setspecific, and getspecific.
Device drivers
##############
SATA 3.0 on Exynos 5
====================
The previous release featured the initial version of our SATA 3.0 driver for
the Exynos 5 platform. This driver located at os/src/drivers/ahci/exynos5 has
reached a fully functional state by now. It supports UDMA-133 with up to
6 GBit/s.
For driver development, we set the goal to reach a performance equal to
the Linux kernel. To achieve that goal, we had to make sure to
operate the controller and the disks in the same ways as Linux does.
For this reason, we modeled our driver closely after the behaviour of the
Linux driver. That is, we gathered traces of I/O transactions to determine the
initialization steps and the request patterns that Linux performs to access
the device, and used those behavioral traces as a guide for our
implementation. Through step-by-step analysis of the traces, we not only
succeeded to operate the device in the proper modes, but we also found
opportunities for further optimization, in particular regarding the error
recovery implementation.
This approach turned out to be successful. We measured that our driver
generally operates as fast (and in some cases even significantly faster)
than the Linux driver on solid-state disks as well as on hard disks.
Dynamic CPU frequency scaling for Exynos 5
==========================================
As the Samsung Exynos-5 SoC is primarily targeted at mobile platforms,
power management is an inherent concern. Until now, Genode did not pay
much attention to power management though. For example, we completely
left out the topic from the scope of the OMAP4 support. With the current
release, we took the first steps towards proper power management on ARM-based
platforms in general, and the Exynos-5-based Arndale platform in particular.
First, we introduced a general interface to regulate clocks and voltages.
Priorly, each driver did its own part of configuring clock and power control
registers. The more device drivers were developed, the higher were the chances
that they interfere when accessing those clock, or power units.
The newly introduced "Regulator" interface provides the possibility to enable
or disable, and to set or get the level of a regulator. A regulator might be
a clock for a specific device (such as a CPU) or a voltage regulator.
For the Arndale board, an exemplary implementation of the regulator interface
exists in the form of the platform driver. It can be found at
os/src/drivers/platform/arndale. Currently, the driver implements
clock regulators for the CPU, the USB 2.0 and USB 3.0 host controller, the
eMMC controller, and the SATA controller. Moreover, it provides power
regulators for SATA, USB 2.0, and USB 3.0 host controllers. The selection of
regulators is dependent on the availability of drivers for the platform.
Otherwise it wouldn't be possible to test that clock and power state doesn't
affect the device.
Apart from providing regulators needed by certain device drivers, we
implemented a clock regulator for the CPU that allows changing the CPU
frequency dynamically and thereby giving the opportunity to scale down
voltage and power consumption. The possible values range from 200 MHz to
1.7 GHz whereby the last value isn't recommended and might provoke system
crashes due to overheating. When using Genode's platform driver for Arndale
it sets CPU clock speed to 1.6 GHz by default. When reducing
the clock speed to the lowest level, we observed a power consumption
reduction of approximately 3 Watt. Besides reducing dynamic power consumption
by regulating the CPU clock frequency, we also explored the gating of the clock
management and power management to further reduce power consumption.
With the CPU frequency scaling in place, we started to close all clock gates
not currently in use. When the platform driver for the Arndale board gets
initialized, it closes everything. If a device driver enables its clock
regulator, all necessary clock gates for the device's clock are opened. This
action saves about 0.7 Watt. The initial closing of all unnecessary power
gates was much more effective. Again, everything not essential for the working
of the kernel is disabled on startup. When a driver enables its power
regulator, all necessary power gates for the device are opened. Closing all
power gates saves about 2.6 Watt.
If we consider all measures taken to save power, we were able to reduce power
consumption to about 59% without performance degradation. When measuring power
consumption after boot up, setting the CPU clock to 1.6 GHz, and fully load
both CPU cores without the described changes, we measured about 8 Watt. With
the described power saving provisions enabled, we measured about 4.7 Watt.
When further reducing the CPU clock frequency to 200 MHz, only 1.7 Watt were
measured.
VESA driver moved to libports
=============================
The VESA framebuffer driver executes the initialization code located
in VESA BIOS of the graphics card. As the BIOS code is for real mode,
the driver uses the x86emu library from X11 as emulation environment.
We updated x86emu to version 1.20 and moved the driver from the 'os'
repository to the 'libports' repository as the library is third-party
code. Therefore, if you want to use the driver, the 'libports'
repository has to be prepared
('make -C <genode-dir>/libports prepare PKG=x86emu') and enabled in
your 'etc/build.conf'.
Runtime environments
####################
Seoul (aka Vancouver) VMM on NOVA
=================================
Since we repeatedly received requests for using the Seoul respectively
Vancouver VMM on NOVA, we improved the support for this virtualization
solution on Genode. Seoul now supports booting from raw hard disk images
provided via Genode's block session interface. Whether this image is actually
a file located in memory, or it is coming directly from the hard disk, or just
from a partition of the hard disk using Genode's part_blk service, is
completely transparent thanks to Genode's architecture.
Additionally, we split up the one large Vancouver run script into several
smaller Seoul run scripts for easier usage - e.g. one for disk, one for
network testing, one for automated testing, and one we call "fancy". The
latter resembles the former vancouver.run script using Genode's GUI to let the
user start VMs interactively. The run scripts prefixed with 'seoul-' can be
found at ports/run. For the fancy and network scripts, ready-to-use VM images
are provided. Those images are downloaded automatically when executing the run
script for the first time.
L4Linux on Fiasco.OC
====================
L4Linux has been updated from version 3.5.0 to Linux kernel version 3.9.0 thus
providing support for contemporary user lands running on top of L4Linux on both
x86 (32bit) and ARM platforms.
Noux runtime for Unix software
==============================
Noux is our way to use the GNU software stack natively on Genode. To improve
its performance, we revisited the address-space management of the runtime to
avoid redundant revocations of memory mappings when Noux processes are cleaned
up.
Furthermore, we complemented the support for the Genode tool chain to
cover GNU sed and GNU grep as well. Both packages are available at the ports
repository.
Platforms
#########
Fiasco.OC updated to revision r56
=================================
Fiasco.OC and the required L4RE parts have been updated to the current SVN
revision (r56). For us, the major new feature is the support of Exynos SOCs in
the mainline version of Fiasco.OC (www.tudos.org). Therefore Genode's
implementation of the Exynos5250 platform could be abandoned leading to less
maintenance overhead of Genode on Fiasco.OC.
Furthermore, Genode's multi-processor support for this kernel has been
improved so that Fiasco.OC users benefit from the additions described in
Section [Enhanced multi-processor support].
NOVA updated
============
In the process of our work on the multi-processor support on NOVA, we updated
the kernel to the current upstream version. Additionally, our customized branch
(called r3) comes with the added cross-CPU IPC system call and improvements
regarding the release of kernel resources.
Integrity checks for downloaded 3rd-party software
##################################################
Even though Genode supports a large variety of 3rd-party software, its
source-code repository contains hardly any 3rd-party source code. Whenever
3rd-party source code is needed, Genode provides automated tools for
downloading the code and integrating it with the Genode environment. As of
now, there exists support for circa 70 software packages, including the
tool chain, various kernels, libraries, drivers, and a few applications. Of
those packages, the code for 13 packages comes directly from their respective
Git repositories. The remaining 57 packages are downloaded in the form of tar
archives from public servers via HTTP or FTP. Whereas we are confident with
the integrity of the code that comes from Git repositories, we are less so
about the archives downloaded from HTTP or FTP servers.
Fortunately, most Open-Source projects provide signature files that allow
the user to verify the origin of the archive. For example, archives of
GNU software are signed with the private key of the GNU project. So the
integrity of the archive can be tested with the corresponding public key.
We used to ignore the signature files for many years but
this has changed now. If there is a signature file available for a package,
the package gets verified right after downloading. If only a hash-sum file
is provided, we check it against a known-good hash sum.
The solution required three steps, the creation of tools for validating
signatures and hashes, the integration of those tools into Genode's
infrastructure for downloading the 3rd-party code, and the definition of
verification rules for the individual packages.
First, new tools for downloading and validating hash sums and signatures were
added in the form of the shell scripts download_hashver (verify hash sum) and
download_sigver (verify signature) found at the tool/ directory. Under the
hood, download_sigver uses GNU GPG, and download_hashver uses the tools
md5sum, sha1sum, and sha256sum provided by coreutils.
Second, hooks for invoking the verification tools were added to the
tool-chain build script as well as the ports and the libports repositories.
The third and the most elaborative step, was going through all the packages,
looking for publicly available signature files, and adding corresponding
package rules. As of now, this manual process has been carried out for 30
packages, thereby covering the half of the archives.
Thanks to Stephan Mueller for pushing us into the right direction, kicking off
the work on this valuable feature, and for the manual labour of revisiting all
the 3rd-party packages!

791
doc/release_notes/14-02.txt Normal file
View File

@@ -0,0 +1,791 @@
===============================================
Release notes for the Genode OS Framework 14.02
===============================================
Genode Labs
During the release cycle of version 14.02, our development has been focused on
storage and virtualization. It goes without saying that proper support for
block-device access and file systems is fundamental for the use of
Genode as general-purpose OS. Virtualization is relevant as well because
it bridges the gap between the functionality we need and the features
natively available on Genode today.
Our work on the storage topic involved changes of the block-driver APIs to an
asynchronous mode of operation, overhauling most of the existing block-level
components, as well as the creation of new block services, most importantly a
block cache. At file-system level, we continued our line of work on FUSE-based
file systems, adding support for NTFS-3g. A new highlight, however, is a new
file-system service that makes the file systems of the NetBSD kernel available
to Genode. This is made possible by using rump kernels as described in Section
[NetBSD file systems using rump kernels].
Virtualization on Genode has a long history, starting with the original
support of OKLinux on the OKL4 kernel (OKLinux is no longer supported), over
the support of L4Linux on top of the Fiasco.OC kernel, to the support of the
Vancouver VMM on top of NOVA. However, whereas each of those variants has
different technical merits, all of them were developed in the context of
university research projects and were never exposed to real-world scenarios.
We were longing for a solution that meets the general expectations from a
virtualization product, namely the support for a wide range of guest OSes,
guest-host integration features, ease of use, and an active development.
VirtualBox is one of the most popular commodity virtualization products as of
today. With the current release, we are happy to announce the availability of
VirtualBox on top of Genode/NOVA. Section
[VirtualBox on top of the NOVA microhypervisor] gives insights into the
background of this development, the technical challenges we had to overcome,
and the current state of the implementation.
In addition to addressing storage and virtualization, the current release
comes with a new pseudo file system called trace_fs that allows the
interactive use of Genode's tracing facilities via Unix commands,
a profound unification of the various graphics back ends used throughout
the framework, a new facility for propagating status reports, and
improvements of the Noux runtime for executing Unix software on Genode.
VirtualBox on top of the NOVA microhypervisor
#############################################
Virtualization is an important topic for Genode for two distinct reasons.
It is repeatedly requested by users of the framework who consider
Genode as a microkernel-based hosting platform for virtual machines,
and it provides a smooth migration path from using Linux-based systems
towards using Genode as day-to-day OS.
Why do people consider Genode as a hosting platform for virtual machines
if there is an abundance of mature virtualization solutions on the market?
What all existing popular solutions have in common is the staggering complexity
of their respective trusted-computing base (TCB). The user of a virtual
machine on a commodity hosting platform has to trust millions of lines of
code. For example, with Xen, the TCB comprises the hypervisor and the Linux
system running as DOM0. For security-sensitive application areas, it is
almost painful to trust such a complex foundation. In contrast, the TCB of a
hosting platform based on Genode/NOVA is two orders of magnitude less complex.
Lowering the complexity reduces the likelihood for vulnerabilities and thereby
mitigates the attack surface of the system. It also enables the assessment of
security properties by thorough evaluation or even formal verification. In the
light of the large-scale privacy issues of today, the desire for systems that
are resilient against malware and zero-day exploits has never been higher.
Microkernel-based operating systems promise a solution. Virtualization enables
compatibility to existing software. Combining both seems natural. This is what
Genode/NOVA stands for.
From the perspective of us Genode developers who are in the process of
migrating from Linux-based OSes to Genode as day-to-day OS, we consider
virtualization as a stop-gap solution for all those applications that
do not exist natively on Genode, yet. Virtualization makes our transition
an evolutionary process.
Until now, NOVA was typically accompanied with a co-developed virtual machine
monitor called Seoul (formerly called Vancouver), which is executed as a
regular user-level process on top of NOVA. In contrast to conventional wisdom
about the performance of microkernel-based systems, the Seoul VMM on top of
NOVA is extremely fast, actually faster then most (if not all) commonly used
virtualization solutions. However, originating from a research project, Seoul
is quite challenging to use and not as mature as commodity VMMs that were
developed as real-world products. For example, there is a good chance that an
attempt to boot an arbitrary version of a modern Linux distribution might just
fail. In our experience, it takes a few days to investigate the issues, modify
the guest OS configuration, and tweak the VMM here and there, to run the OS
inside the Seoul VMM. That is certainly not a show stopper in appliance-like
scenarios, but it rules out Seoul as a general solution. Running Windows
OS as guest is not supported at all, which further reduces the application
areas of Seoul. With this in mind, it is unrealistic to propose the use
of Genode/NOVA as an alternative for popular VM hosting solutions.
Out of this realization, the idea was born to combine NOVA's virtualization
interface with a time-tested and fully-featured commodity VMM. Out of the
available Open-Source virtualization solutions, we decided to take a closer
look at VirtualBox, which attracted us for several reasons: First, it is
portable, supporting various host OSes such as Solaris, Windows OS, Linux,
and Mac OS X. Second, it has all the guest-integration features we could
wish for. There are extensive so-called guest additions for popular guest
OSes that vastly improve the guest-OS performance and allow a tight
integration with the host OS using shared folders or a shared clipboard.
Third, it comes with sophisticated device models that support all
important popular guest OSes. And finally, it is actively developed and
commercially supported.
However, moving VirtualBox over to NOVA presented us with a number of
problems. As a precondition, we needed to gain a profound understanding
of the VirtualBox architecture and the code base. To illustrate the challenge,
the source-code distribution of VirtualBox comprises 2.8 million lines of
code. This code contains build tools, the VMM, management tools, several
3rd-party libraries, middleware, the guest additions, and tests. The pieces
that are relevant for the actual VMM amount to 700 thousand lines. By
reviewing the architecture, we found that the part of VirtualBox that
implements the hypervisor functionality (the world switch) runs in the
kernel of the host OS (it is loaded on demand by the user-level VM process
through the _/dev/vboxdrv_ interface into the host OS kernel). It is
appropriately named VMMR0. Once installed into the host OS kernel, it
takes over the control over the machine. To put it blatantly simple, it runs
"underneath" the host OS. The VMMR0 code is kernel agnostic, which explains
the good portability of VirtualBox across various host OSes. Porting
VirtualBox to a new host OS comes down to finding a hook for installing the
VMMR0 code into the host OS kernel and adapting the VirtualBox runtime API
to the new host OS.
In the context of microkernel-based systems, however, it becomes clear that
this classical approach of porting VirtualBox would subvert the microkernel
architecture. Not only would we need to punch a hole into NOVA for loading
additional kernel code, but also the VMMR0 code would inflate the amount of
code executed in privileged mode by more than factor 20. Both implications
are gross violations of the microkernel principle. Consequently, we needed to
find a different way to marry NOVA with VirtualBox.
Our solution was the creation of a drop-in replacement of the VMMR0 code that
runs solely at user level and interacts with NOVA's virtualization
interface. Our VMMR0 emulation code is co-located with the VirtualBox
VM process. Architecturally, the resulting solution is identical to the
use of Seoul on top of NOVA. There is one VM process per virtual machine,
and each VM process is isolated from others by the NOVA kernel. In
addition to creating the VMMR0 emulation code, we needed to replace some parts
of the VirtualBox VMMR3 code with custom implementations because they
overlapped with functionality provided by NOVA's virtualization interface,
in particular the provisioning of guest-physical memory. Finally, we needed
to interface the VM process with Genode's API to let the VM process
interact with Genode's input, file-system, and framebuffer services.
The result of this undertaking is available at the _ports_ repository.
VirtualBox can be downloaded and integrated with Genode via the following
command issued from within the repository:
! make prepare PKG=virtualbox
To illustrate the integration of VirtualBox into a Genode system, there
is run script located at _ports/run/virtualbox.run_. It expects a
bootable ISO image containing a guest OS at _<build-dir>/bin/test.iso_.
The configuration of the VirtualBox process is as simple as
! <config>
! <image type="iso" file="/iso/test.iso" />
! </config>
VirtualBox will try to obtain the specified ISO file via a file-system
session. Furthermore, it will open a framebuffer session and an input session.
The memory assigned to the guest OS depends on the RAM quota assigned to the
VirtualBox process. Booting a guest OS stored in a VDI file is supported. The
image type must be changed to "vdi" accordingly.
Please note that this first version of VirtualBox is far from being complete
as it lacks many features (SMP, guest-addition support, networking), is not
optimized, and must be considered as experimental. However, we could
successfully run GNU/Linux, Android, Windows XP, Windows 7, HelenOS, Minix-3,
GNU Hurd, and of course Genode inside VirtualBox.
One point we are pretty excited about is that the porting effort to
Genode/NOVA did not require any change of Genode. From Genode's point of
view, VirtualBox is just an ordinary leaf node of the process tree, which
can happily co-exist with other processes - even if it is the Seoul VMM.
[image seoul-vbox-win7-tinycore]
In the screenshot above, VirtualBox is running besides the Seoul VMM on top of
Genode/NOVA. Seoul executes Tinycore Linux as guest OS. VirtualBox executes MS
Windows 7. Both VMMs are using hardware virtualization (VT-x) but are plain
user-level programs with no special privileges.
NetBSD file systems using rump kernels
######################################
In the previous release, we made FUSE-based file systems available to Genode
via a custom implementation of the FUSE API. Even though this step made
several popular file systems available, we found that the file systems most
important to us (such as ext) are actually not well supported by FUSE. For
example, write support on ext2 is declared as an experimental feature. In
hindsight it is clear why: FUSE is primarily being used for accessing file
systems not found in the Linux kernel. So it shines with supporting NTFS
but less so with file systems that are well supported by the Linux kernel.
Coincidentally, when we came to this realization, we stumbled upon the
wonderful work of Antti Kantee on so-called rump kernels:
:[https://wiki.netbsd.org/rumpkernel/]:
Rump kernel Wiki
The motivation behind the rump kernels was the development of
NetBSD kernel subsystems (referred to as "drivers") in the NetBSD user land.
Such subsystems like file systems, device drivers, or the TCP/IP stack are
linked against a stripped-down version of the NetBSD kernel that can be
executed in user mode and uses a fairly small "hypercall" interface to
interact with the outside world. A rump kernel contains everything needed to
execute NetBSD kernel subsystems but hardly anything else. In particular, it
does not support the execution of programs on top. From our perspective,
having crafted device-driver environments (DDEs) for Linux, iPXE, and OSS over
the years, a rump kernel sounded pretty much like a DDE for NetBSD. So we
started exploring rump kernels with the immediate goal of making time-tested
NetBSD file systems available to Genode.
To our delight, the integration of rump kernels into the Genode system went
fairly smooth. The most difficult part was the integration of the NetBSD build
infrastructure with Genode's build system. The glue between rump kernels and
Genode is less than 3,000 lines of code. This code enables us to reuse all
NetBSD file systems on Genode. A rump kernel instance that contains several
file systems such as ext2, iso9660, msdos, and ffs takes about 8 MiB of memory
when executed on Genode.
The support for rump kernels comes in the form of the dedicated _dde_rump_
repository. For downloading and integrating the required NetBSD source code,
the repository contains a Makefile providing the usual 'make prepare'
mechanism. To build the file-system server, make sure to add the _dde_rump_
repository to the 'REPOSITORIES' declaration of your _etc/build.conf_ file
within your build directory. The server then can be built via
! make server/rump_fs
There is a run script located at _dde_rump/run/rump_ext2.run_ to execute
a simple test scenario:
! make run/rump_ext2
The server can be configured as follows:
!<start name="rump_fs">
! <resource name="RAM" quantum="8M" />
! <provides><service name="File_system"/></provides>
! <config fs="ext2fs"><policy label="" root="/" writeable="yes"/></config>
!</start>
On startup, it requests a service that provides a block session. If
there is more than one block session in the system, the block session must be
routed to the right block-session server. The value of the _fs_ attribute of
the '<config>' node can be one of the following: _ext2fs_ for EXT2, _cd9660_ for
ISO-9660, or _msdos_ for FAT file-system support. _root_ defines the directory
of the file system as seen as root directory by the client. The server hands
most of its RAM quota to the rump kernel. This means the larger the quota is,
the larger the internal block caches of the rump kernel will be.
Base framework
##############
The base API has not underwent major changes apart from the addition of
a few new utilities and minor refinements. Under the hood, however, the inner
workings of the framework received much attention, including an extensive
unification of the startup code and stack management.
New 'construct_at' utility
==========================
A new utility located at 'base/include/util/construct_at.h' allows for the
manual placement of objects without the need to have a global placement new
operation nor the need for type-specific new operators.
New utility for managing volatile objects
=========================================
Throughout Genode, we maintain a programming style that largely avoids dynamic
memory allocations. For the most part, higher-level objects aggregate
lower-level objects as class members. For example, the nitpicker GUI server
is actually a compound of such aggregations (see
[https://github.com/genodelabs/genode/blob/master/os/src/server/nitpicker/main.cc#L803 - Nitpicker::Main]).
This functional programming style leads to robust programs but it poses a
problem for programs that are expected to adopt their behaviour at runtime.
For the example of nitpicker, the graphics back end of the GUI server takes
the size of the screen as constructor argument. If the screen size changes,
the once constructed graphics back end becomes inconsistent with the new
screen size. We desire a way to selectively replace an aggregated object by a
new version with updated constructor arguments. The new utilities found in
'os/include/util/volatile_object.h' solve this problem. A so-called
'Volatile_object' wraps an object of the type specified as template argument.
In contrast of a regular object, a 'Volatile_object' can be re-constructed any
number of times by calling 'construct' with the constructor arguments. It is
accompanied with a so-called 'Lazy_volatile_object', which remains
unconstructed until 'construct' is called the first time.
Changed interface of 'Signal_rpc_member'
========================================
We unified the 'Signal_rpc_member' interface to be more consistent with the
'Signal_rpc_dispatcher'. The new version takes an entrypoint as argument and
cares for dissolving itself from the entrypoint when destructed.
Filename as default label for ROM connections
=============================================
Since the first version of Genode, ROM services used to rely on a "filename"
provided as session argument. In the meanwhile, we established the use of the
session label to select routing policies as well as server-side policies.
Strictly speaking, the name of a ROM module is used as a key to a server-side
policy of ROM services. So why not to use the session label to express the
key as we do with other services? By assigning the file name as label for ROM
sessions, we may become able to remove the filename argument in the future by
just interpreting the last part of the label as filename. By keeping only the
label, we won't need to consider conditional routing (via '<if-arg>') based on
session arguments other than the label anymore, which would simplify Genode
configurations in the long run. This change is transparent at API level but
may be taken into consideration when configuring Genode systems.
New 'Genode::Deallocator' interface
===================================
By splitting the new 'Genode::Deallocator' interface from the former
'Genode::Allocator' interface, we become able to restrict the accessible
operations for code that is only supposed to release memory, but not
perform any allocations.
Closely related to the allocator interface, we introduced variants of the
'new' operator that take a reference (as opposed to a pointer) to a
'Genode::Allocator' as argument.
Unified main-stack management and startup code among all platforms
==================================================================
In contrast to the stacks of regular threads, which are located within a
dedicated virtual-address region called thread-context area, the stack of
the main thread of a Genode program used to be located within the BSS
segment. If the stack of a normal thread overflows, the program produces
an unresolvable page fault, which can be easily debugged. However,
an overflowing main stack would silently corrupt the BSS segment. With
the current release, we finally resolved this long-standing problem by
moving the main stack to the context area, too. The tricky part was that
the context area is created by the main thread. So we hit a hen-and-egg
problem. We overcame this problem by splitting the process startup
into two stages, both called from the crt0 assembly code. The first
stage runs on a small stack within the BSS and has the sole purpose
of creating the context area and a thread object for the main thread.
This code path (and thereby the stack usage) is the same for all programs.
So we can safely dimension the stage-1 stack. Once the first stage
returns to the crt0 assembly code, the stack pointer is loaded with the
stack that is now located within the context area. Equipped with the
new stack, the actual startup code ('_main') including the global
constructors of the program is executed.
This change paved the ground for several further code unifications and
simplifications, in particular related to the dynamic linker.
Low-level OS infrastructure
###########################
Revised block-driver framework
==============================
Whereas Genode's block-session interface was designed to work asynchronously
and supports the out-of-order processing of requests, those capabilities
remained unused by the existing block services as those services used to
operate synchronously to keep their implementation simple. However, this
simplicity came at the prize of two disadvantages: First, it prevented us
to fully utilize native command queuing of modern disk controllers. Second,
when chaining components such as a block driver, the part_blk server, and
a file system, latencies accumulated along the chain of services. This
hurts the performance of random access patterns.
To overcome this limitation, we changed the block-component framework to work
asynchronously and to facilitate the recently introduced server API.
Consequently, all users of the API underwent an update. The affected
components are rom_loopdev, atapi_drv, fb_block_adapter, http_block, usb_drv,
and part_blk. For some components, in particular part_blk, this step led to a
complete redesign.
Besides the change of the block-component framework, the block-session
interface got extended to support logical block addresses greater than
32bit (LBA48). Thereby, the block component framework can now support
devices that exceed 2 TiB in size.
Block cache
===========
The provisioning of a block cache was one of the primary motivations behind the
[https://genode.org/documentation/release-notes/13.11#Dynamic_resource_balancing - dynamic resource balancing]
concept that was introduced in Genode 13.11. We are now introducing the first
version of such a cache.
The new block cache component located at _os/src/server/blk_cache/_ is both
a block-session client as well as a block-session server serving a single
client. It is meant to sit between a block-device driver and a file-system
server. When accessing the block device, it issues requests at a granularity
of 4K and thereby implicitly reads ahead whenever a client requests a smaller
amount of blocks. Blocks obtained from the device or written by the client
are kept in memory. If memory becomes scarce, the block cache first tries
to request further memory resources from its parent. If the request
gets denied, the cache evicts blocks from memory to the block device following
a least-recently-used replacement strategy. As of now, the block cache supports
dynamic resource requests to grow on demand but support for handling yield
requests is not yet implemented. So memory once handed out to the block cache
cannot be regained. Adding support for yielding memory on demand will be
complemented in the next version.
To see how to integrate the block cache in a Genode scenario, there is a
ready-to-use run script available at _os/run/blk_cache.run_.
File-system infrastructure
==========================
In addition to the integration of NetBSD's file systems, there are
file-system-related improvements all over the place.
First, the 'File_system::Session' interface has been extended with a 'sync'
RPC function. This function allows the client of a file system to force
the file system to write back its internal caches.
Second, we extended the FUSE implementation introduced with the previous
release.
Since file systems tend to have a built-in caching mechanism, we need to
sync these caches at the end of a session when using the fuse_fs server.
Therefore, each FUSE file system port has to implement a 'Fuse::sync_fs()'
function that executes the necessary actions if requested. Further
improvements are related to the handling of symbolic links and error
handling. Finally, we added a libc plugin for accessing NTFS file systems
via the ntfs-3g library.
Third, we complemented the family of FUSE-based libc plugins with a family of
FUSE-based file-system servers. To utilize a FUSE file system, there is a
dedicated binary (e.g., _os/src/server/fuse_fs/ext2_) for each FUSE
file-system server.
Note that write support is possible but considered to be experimental at this
point. For now, using it is not recommended.
To use the ext2_fuse_fs server in Noux, the following configuration snippet
may be used:
! <start name="ext2_fuse_fs">
! <resource name="RAM" quantum="8M"/>
! <provides> <service name="File_system"/> </provides>
! <config>
! <policy label="noux -> fuse" root="/" writeable="no" />
! </config>
! </start>
Finally, the libc file-system plugin has been extended to support 'unlink'.
Trace file system
=================
The new _trace_fs_ server provides access to a trace session by providing a
file-system session as front end. Combined with Noux, it allows for the
interactive exploration and tracing of Genode's process tree using
traditional Unix tools.
Each trace subject is represented by a directory ('thread_name.subject') that
contains specific files, which are used to control the tracing process of the
thread as well as storing the content of its trace buffer:
:'enable': The tracing of a thread is activated if there is a valid policy
installed and the intend to trace the subject was made clear by writing '1'
to the 'enable' file. The tracing of a thread may be deactivated by writing a
'0' to this file.
:'policy': A policy may be changed by overwriting the currently used one in the
'policy' file. In this case, the old policy is replaced by the new one and
automatically used by the framework.
:'buffer_size': Writing a value to the 'buffer_size' file changes the size of
the trace buffer. This value is evaluated only when reactivating the tracing
of the thread.
:'events': The trace-buffer contents may be accessed by reading from the
'events' file. New trace events are appended to this file.
:'active': Reading the file will return whether the tracing is active (1) or
not (0).
:'cleanup': Nodes of untraced subjects are kept as long as they do not change
their tracing state to dead. Dead untraced nodes are automatically removed
from the file system. Subjects that were traced before and are now untraced
can be removed by writing '1' to the 'cleanup' file.
To use the trace_fs, a configuration similar to the following may be used:
! <start name="trace_fs">
! <resource name="RAM" quantum="128M"/>
! <provides><service name="File_system"/></provides>
! <config>
! <policy label="noux -> trace"
! interval="1000"
! subject_limit="512"
! trace_quota="64M" />
! </config>
! </start>
:'interval': sets the period the Trace_session is polled. The
time is given in milliseconds.
:'subject_limit': specifies how many trace subjects should by acquired at
max when the Trace_session is polled.
:'trace_quota': is the amount of quota the trace_fs should use for the
Trace_session connection. The remaining amount of RAM quota will be used
for the actual nodes of the file system and the 'policy' as well as the
'events' files.
In addition, there are 'buffer_size' and 'buffer_size_limit' that define
the initial and the upper limit of the size of a trace buffer.
A ready-to-use run script can by found in 'ports/run/noux_trace_fs.run'.
Unified interfaces for graphics
===============================
Genode comes with several programs that perform software-based graphics
operations. A few noteworthy examples are the nitpicker GUI server,
the launchpad, the scout tutorial browser, or the terminal. Most of those
programs were equipped with their custom graphics back end. In some
cases such as the terminal, nitpicker's graphics back end was re-used.
But this back end is severely limited because its sole purpose is the
accommodation of the minimalistic (almost invisible) nitpicker GUI server.
The ongoing work on Genode's new user interface involves the creation of
new components that rely on a graphics back end. Instead of further
diversifying the zoo of graphics back ends, we took the intermediate step
to consolidate the existing back ends into one unified concept such that
application-specific graphics back ends can be created and extended using
modular building blocks. The new versions of nitpicker, scout, launchpad,
liquid_fb, nitlog, and terminal have been changed to use the new common
interfaces:
:os/include/util/geometry.h: Basic data structures and operations needed
for 2D graphics.
:os/include/util/color.h: Common color representation and utilities.
:os/include/os/pixel_rgba.h: Class template for representing a pixel.
:os/include/os/pixel_rgb565.h: Template specializations for RGB565 pixels.
:os/include/os/surface.h: Target surface, onto which graphics operations
can be applied.
:os/include/os/texture.h: Source texture for graphics operations that
transfer 2D pixel data to a surface.
The former _os/include/nitpicker_gfx/_ directory is almost deserted. The only
remainders are functors for the few graphics operations actually required by
nitpicker. For the scout widgets, the corresponding functors have become
available at the public headers at _demo/include/scout_gfx/_.
Because the scout widget set is used by at least three programs and will
most certainly play a role in new GUI components, we undertook a major
cleanup of the parts worth reusing. The result can be found at
_demo/include/scout/_.
New session interface for status reporting
==========================================
Genode has a uniform way of how configuration information is passed from
parents to children within the process tree by the means of "config" ROM
modules. Using this mechanism, a parent is able to steer the behaviour of
its children, not just at their start time but also during runtime.
Until now, however, there was no counterpart to the config mechanism, which
would allow a child to propagate runtime information to its parent. There
are many use cases for such a mechanism. For example, a bus-controller driver
might want to propagate a list of devices attached to the bus. When a new
device gets plugged in, this list should be updated to let the parent
take the new device resource into consideration. Another use case would be the
propagation of status information such as the feature set of a plugin.
Taken to the extreme, a process might expose its entire internal state to its
parent in order to allow the parent to kill and restart the process, and
feed the saved state back to the new process instance.
To cover these use cases, we introduced the new report-session interface. When
a client opens a report session, it transfers a part of its RAM quota to the
report server. In return, the report server hands out a dataspace dimensioned
according to the donated quota. Upon reception of the dataspace, the client
can write its status reports into the dataspace and inform the server about
the update via the 'submit' function. In addition to the mere reporting of
status information, the report-session interface is designed to allow the
server to respond to reports. For example, if the report mechanism is used to
implement a desktop notification facility, the user may interactively respond
to an incoming notification. This response can be reflected to the originator
of the notification via the 'response_sigh' and 'obtain_response' functions.
The new _report_rom_ component is both a report service and a ROM service. It
reflects incoming reports as ROM modules. The ROM modules are named
after the label of the corresponding report session.
Configuration
-------------
The report-ROM server hands out ROM modules only if explicitly permitted by a
configured policy. For example:
! <config>
! <rom>
! <policy label="decorator -> pointer" report="nitpicker -> pointer"/>
! <policy ... />
! ...
! </rom>
! </config>
The label of an incoming ROM session is matched against the 'label' attribute
of all '<policy>' nodes. If the session label matches a policy label, the
client obtains the data from the report client with the label specified in the
'report' attribute. In the example above, the nitpicker GUI server sends
reports about the pointer position to the report-ROM service. Those reports
are handed out to a window decorator (labeled "decorator") as ROM module.
XML generator utility
=====================
With the new report-session interface in place, comes the increased
need to produce XML data. The new XML generator utility located at
_os/include/util/xml_generator.h_ makes this extremely easy, thanks to
C++11 language features. For an example application, refer to
_os/src/test/xml_generator/_ and the corresponding run script at
_os/run/xml_generator.run_.
Dynamic ROM service for automated testing
=========================================
The new _dynamic_rom_ service provides ROM modules that change during the
lifetime of a ROM session according to a timeline. The main purpose of this
service is the automated testing of programs that are able to respond to ROM
module changes, for example configuration changes.
The configuration of the dynamic ROM server contains a '<rom>' sub node per
ROM module provided by the service. Each '<rom>' node hosts a 'name' attribute
and contains a sequence of sub nodes that define the timeline of the ROM
module. The possible sub nodes are:
:'<inline>': The content of the '<inline>' node is assigned to the content
of the ROM module.
:'<sleep>': Sleeps a number of milliseconds as specified via the 'milliseconds'
attribute.
:'<empty>': Removes the ROM module.
At the end of the timeline, it re-starts at the beginning.
Nitpicker GUI server
====================
The nitpicker GUI server has been enhanced to support dynamic screen
resizing. This is needed to let nitpicker respond to screen-resolution
changes, or when using a nested version of nitpicker within a resizable
virtual framebuffer window.
To accommodate Genode's upcoming user-interface concept, we introduced the
notion of a parent-child relationship between nitpicker views. If an existing
view is specified as parent at construction time of a new view, the parent
view's position is taken as the origin of the child view's coordinate space.
This allows for the grouping of views, which can be atomically repositioned by
moving their common parent view. Another use case is the handling of popup
menus in Qt5, which can now be positioned relative to their corresponding
top-level window. The relative position is maintained transparently to Qt when
the top-level window gets repositioned.
Libraries and applications
##########################
Noux runtime for executing Unix software
========================================
Noux plays an increasingly important role for Genode as it allows the use
of the GNU software stack. Even though it already supported a variety of
packages including bash, gcc, binutils, coreutils, make, and vim, some
programs were still limited by Noux' not fully complete POSIX semantics,
in particular with regard to signal handling. For example, it was not
possible to cancel the execution of a long-running process via Control-C.
To overcome those limitations, we enhanced Noux by adding the _kill_ syscall,
reworking the _wait_ and _execve_ syscalls, as well as adding
signal-dispatching code to the Noux libc. Special attention had to be paid to
the preservation of pending signals during the process creation via _fork_ and
_execve_.
The current implementation delivers signals each time a Noux syscall
returns. Signal handlers are executed as part of the normal control flow. This
is in contrast to traditional Unix implementations, which allow the
asynchronous invocation of signal handlers out of band with the regular
program flow. The obvious downside of our solution is that a program that got
stuck in a busy loop (and thereby not issuing any system calls) won't respond
to signals. However, as we regard the Unix interface just as a runtime and not
as the glue that holds the system together, we think that this compromise is
justified to keep the implementation simple and kernel-agnostic. In the worst
case, if a Noux process gets stuck because of such a bug, we certainly can
live with the inconvenience of restarting the corresponding Noux subsystem.
To complement our current activities on the block and file-system levels,
the e2fsprogs-v1.42.9 package as been ported to Noux. To allow the
block-device utilities to operate on Genode's block sessions, we added a new
"block" file system to Noux. Such a block file system can be mounted using a
'<block>' node within the '<fstab>'. By specifying a label attribute, each
block session request can be routed to the proper block session provider:
! <fstab>
! ...
! <dir name="dev">
! <block name="blkdev0" label="block_session_0" />
! </dir>
! ...
! </fstab>
In addition to this file system, support for the DIOCGMEDIASIZE ioctl
request was added. This request is used by FreeBSD and therefore by our
libc to query the size of the block device in bytes.
Qt5 refinements
===============
Our port of Qt5 used to rely on custom versions of synchronization
primitives such as 'QWaitCondition' and 'QMutex'. However, since most of the
usual pthread synchronization functions as relied on by Qt5's regular POSIX
back end have been added to Genode's pthread library by now, we could replace
our custom implementations by Qt5's POSIX version.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
The development of our base-hw kernel platform during this release cycle was
primarily geared towards adding multi-processor support. However, as we
haven't exposed the code to thorough testing yet, we deferred the integration
of this feature for the current release.
We increased the number of usable ARM platforms by adding basic support for
the ODROID XU board.
NOVA microhypervisor
====================
The port of VirtualBox to Genode prompted us to improve the NOVA platform in
the following respects.
NOVA used to omit the propagation of the FPU state of the guest OS to the
virtual machine monitor (VMM) during the world switch between the guest OS and
the VMM. With the Vancouver VMM, which is traditionally used on NOVA, this
omission did not pose any problem because Vancouver would never touch the FPU
state of the guest. So the FPU context of the guest was always preserved
throughout the handling of virtualization events. However, in contrast to the
Vancouver VMM, VirtualBox relies on the propagation of the FPU state between
the guest running in VT-X non-root mode and the guest running within the
VirtualBox recompiler. Without properly propagating the FPU state between both
virtualization back ends, both the guest OS in non-root mode and VirtualBox's
recompiler would corrupt each other's FPU state. After first implementing an
interim solution in our custom version of the kernel, the missing FPU context
propagation had been implemented in the upstream version of NOVA as well.
In contrast to most kernels, NOVA did not allow a thread to yield its current
time slice to another thread. The only way to yield CPU time was to block on
a semaphore or to perform an RPC call. Unfortunately both of those instruments
require the time-receiving threads to explicitly unblock the yielding thread
(by releasing the semaphore or replying to the RPC call). However, there are
situations where the progress of a thread may depend on an external
condition or a side effect produced by another (unknown) thread. One
particular example is the spin lock used to protect (an extremely short)
critical section of Genode's lock metadata. Apparently VirtualBox presented
us with several more use cases for thread-yield semantics. Therefore, we
decided to extend NOVA's kernel interface with a new 'YIELD' opcode to the
'ec_control' system call.

1123
doc/release_notes/14-05.txt Normal file

File diff suppressed because it is too large Load Diff

1136
doc/release_notes/14-08.txt Normal file

File diff suppressed because it is too large Load Diff

1047
doc/release_notes/14-11.txt Normal file

File diff suppressed because it is too large Load Diff

899
doc/release_notes/15-02.txt Normal file
View File

@@ -0,0 +1,899 @@
===============================================
Release notes for the Genode OS Framework 15.02
===============================================
Genode Labs
Genode's [https://genode.org/about/road-map - roadmap] for this year puts a
strong emphasis on the consolidation and cultivation of the existing feature
set. With the first release of the year, version 15.02 pays tribute to this
mission by stepping up to extensive and systematic automated testing. As
a precondition for scaling up Genode's test infrastructure, the release
features a highly modular tool kit for exercising system scenarios on a growing zoo
of test machines. Section [Modular tool kit for automated testing] explains
the new tools in detail. In the spirit of improving the existing feature
set, Genode 15.02 vastly improves the performance and stability of our version of
VirtualBox running on the NOVA microhypervisor, solves long-standing shortcomings
of memory management on machines with a lot of RAM, addresses NOVA-related
scalability limitations, stabilizes our Rump-kernel-based file-system server,
and refines the configuration interface of the Intel wireless driver.
As the most significant new feature, the new version introduces virtualization
support for ARM to our custom base-hw kernel. Section [Virtualization on ARM]
outlines the design and implementation of this feature, which was greatly
inspired by NOVA's virtualization architecture and has been developed over the
time span of more than a year.
With respect to platform support, we are happy to accommodate the upcoming
USB-Armory board, which is a computer in the form factor of a USB
stick especially geared towards security applications. Section
[Support for the USB-Armory board] covers the background and the current
state of this line of work.
Virtualization on ARM
#####################
The ARMv7 architecture of recent processors like Cortex-A7, Cortex-A15, or
Cortex-A17 CPUs support hardware extensions to facilitate virtualization of
guest operating systems. With the current release, we enable the use of these
virtualization extensions in our custom base-hw kernel when running on the
Cortex-A15-based Arndale board.
While integrating ARM's virtualization extension, we aimed to strictly follow
microkernel-construction principles. The primary design is inspired by the
[https://hypervisor.org/ - NOVA OS Virtualization Architecture]. It is based on a
microhypervisor that provides essential microkernel mechanisms along with
basic primitives to switch between virtual machines (VMs). On top of the
microhypervisor, classical OS services are implemented as
ordinary, unprivileged user-level components. Those services can be used by other
applications. Services may be shared between applications or instantiated
separately, according to security and safety needs. Correspondingly,
following the NOVA principles, each VM has its own associated virtual-machine
monitor (VMM) that runs as an unprivileged user-level component. VMM implementations
can range from simple ones that just emulate primary device requirements to highly
complex monitors including sophisticated device models, like VirtualBox. The
NOVA approach allows to decouple the TCB complexity of one VM with respect to
another, as well as with respect to all components not related to
virtualization at all.
Along those lines, we extended the base-hw kernel/core conglomerate with API
extensions that enable user-level VMM components to create and control virtual
machines.
Design
======
The ARM virtualization extensions are based on the so-called security
extensions, commonly known as
[https://genode.org/documentation/articles/trustzone - TrustZone].
The ARM designers did not follow the
Intel approach to split the CPU into a "root" and a "guest" world while having all prior
existing CPU modes available in both worlds. Instead, ARM added a new privilege level
to the non-secure side of TrustZone that sits underneath the ordinary kernel
and userland privilege levels. It is subjected to a hypervisor-like kernel. All
instructions used to prepare a VM's environment have to be executed in this so
called "hyp" mode. In hyp mode, some instructions
differ from their regular behaviour on the kernel-privilege level.
For this reason, prior-existing kernel code cannot simply be reused in
hyp mode without modifications.
The base-hw kernel is meant to execute Genode's core component on bare hardware.
Core, which is an ordinary user-level component, is
linked together with a slim kernel library that is executed in privileged kernel
mode. To enable ARM hardware virtualization, we pushed this approach
even further by executing core in three different privilege levels. Thereby,
core shares the same view on hardware resources and virtual memory across all
levels. A code path is executed on a higher privilege level only if the code
would fail to execute on a lower privilege level.
Following this approach, we were able to keep most of the existing kernel code
with no modifications.
[image avirt_overview]
Genode's ARM kernel (core) runs across all privilege levels
The hypervisor part of core is solely responsible to switch between VMs and the
host system. Therefore, it needs to load/store additional CPU state that
normally remains untouched during context switches of ordinary tasks. It also needs to
configure the VM's guest-physical to host-physical memory translations. Moreover, the
virtualization extensions of the ARMv7 architecture are not related to the CPU
cores only. The interrupt controller and the CPU-local timers are also
virtualization-aware. Therefore, the hypervisor has to load/store state specific
to those devices, too. Nevertheless, the hypervisor merely reloads those
devices. It does not interpret their state.
In contrast to the low-complexity hypervisor, a user-level VMM can be complex
without putting the system's security at risk. It contains potentially complex
device-emulation code and assigns hardware resources such as memory and
interrupts to the VM. The VMM is an ordinary user-level component running
unprivileged. Of course, as a plain user-level component, it is not able to
directly access hardware resources. Hence an interface between VMMs and the
kernel is needed to share the state of a virtual machine. In the past, we faced a similar
problem when building a VMM for our former TrustZone experiments. It was natural
to build upon the available solution and to extend it where necessary. Core
provides a so-called VM service. Each VM corresponds to a session of this
service. The session provides the following extended interface:
:CPU state:
The CPU-state function returns a dataspace containing the virtual machine's
state. The state is initialized by the VMM before bootstrapping the VM, gets updated
by the hypervisor whenever it switches away from the VM, and can be used by
the VMM to interpret the behavior of the guest OS. Moreover, the CPU state can be
updated after the virtual machine monitor emulated instructions
for the VM.
:Exception handler:
The second function is used to register a signal handler that gets informed
whenever the VM produces a virtualization fault.
:Run:
The run function starts or resumes the execution of the VM.
:Pause:
The pause function removes the VM from the kernel's scheduler.
:Attach:
This function attaches a given RAM dataspace to a designated area of the
guest-physical address space.
:Detach:
The detach function invalidates a designated area of the guest-physical
address space.
:Attach_pic: Tells the hypervisor to attach the CPU's virtual interface of the
virtualization-aware interrupt controller to a designated area of the
guest-physical address space.
Implementation
==============
By strictly following the micro-kernel construction principles when integrating the
hypervisor into the base-hw kernel, we reached a minimally invasive solution. In
doing so, we took the time to separate TrustZone-specific code that was formerly
an inherent part of the kernel on ARMv7 platforms. Now, TrustZone- and
virtualization-specific aspects are incorporated into the kernel only if
actually used. The change in complexity of the whole core component expressed in
lines of code is shown in the table below. As can be seen, the additional code in
the root of the trusted computing base when using virtualization is about 700-800
LOC.
Platform | with TrustZone, no VT | TrustZone/VT optional
-----------------------------------------------------------------
hw_arndale | 17970 LOC | 18730 LOC
----------------------------------------------------------------
hw_imx53_qsb | 17900 LOC | 17760 LOC
----------------------------------------------------------------
hw_imx53_qsb_tz | 18260 LOC | 18320 LOC
----------------------------------------------------------------
hw_rpi | 17500 LOC | 17430 LOC
----------------------------------------------------------------
hw_panda | 18040 LOC | 17880 LOC
----------------------------------------------------------------
hw_odroid_xu | 17980 LOC | 18050 LOC
Besides the VM world switch, we enabled support for the so-called "large
physical address extension" (LPAE), which is obligatory when using
virtualization. It allows for addressing a 40-bit instead of only 32-bit physical
address space. Moreover, to execute in hypervisor mode, the bootstrap code of
the kernel had to be set up properly. Hence, when booting on the Arndale board,
the kernel now prepares the non-secure TrustZone world first, and finally leaves the
secure world forever.
To test and showcase the ARM virtualization features integrated in base-hw, we
implemented a minimal, exemplary VMM. It can be found in
_repos/os/src/server/vmm_. The VMM emulates a simplified variant of ARM's
Versatile Express Cortex-A15 development platform. Currently, it only comprises
support for the CPU, the timer, the interrupt controller, and a UART device. It is
written in 1100 lines of C++ in addition to the base Genode libraries. The VMM
is able to boot a vanilla Linux kernel compiled with a slightly modified
standard configuration (no-SMP), and a device tree description stripped down to
the devices provided by the VMM. This release includes an automated run test that
executes the Linux kernel on top of the VMM on Genode. It can be started via:
! make run/vmm
[image avirt_screen]
Three Linux serial consoles running in parallel on top of Genode
Modular tool kit for automated testing
######################################
In
[https://genode.org/documentation/release-notes/13.05#Automated_quality-assurance_testing - Genode version 13.05],
we already introduced comprehensive support for the automated testing of
Genode scenarios. Since then, Genode Labs has significantly widened the scope
of its internal test infrastructure, both in terms of the coverage of the test
scenarios as well as the variety of the used hardware platforms.
The centerpiece of our test infrastructure is the so-called run tool. Steered
by a script (run script), it performs all the steps necessary to test drive
a Genode system scenario. Those steps are:
# *Building* the components of a scenario
# *Configuration* of the init component
# Assembly of the *boot directory*
# Creation of the *boot image*
# *Powering-on* the test machine
# *Loading* of the boot image
# Capturing the *LOG output*
# *Validation* of the scenario behavior
# *Powering-off* the test machine
Each of those steps depends on various parameters such as the
used kernel, the hardware platform used to run the scenario, the
way the test hardware is connected to the test infrastructure
(e.g., UART, AMT, JTAG, network), the way the test hardware is powered or
reseted, or the way of how the scenario is loaded into the test hardware.
Naturally, to accommodate the growing variety of combinations of those
parameters, the complexity of the run tool increased over time.
This growth of complexity prompted us to eventually turn the run tool into a
highly modular and extensible tool kit.
Originally, the run tool consisted of built-in rules that could be
extended and tweaked by a kernel-specific supplement called run environment.
The execution of a run script used to depend on the policies built into
the run tool, the used run environment, and optional configuration
parameters (run opts).
The new run tool kit replaces most of the formerly built-in policies by the
ability to select and configure different modules for the various steps.
The selection and configuration of the modules is expressed in the run-tool
configuration. There exist the following types of modules:
:boot-dir modules:
These modules contain the functionality to populate the boot directory
and are specific to each kernel. It is mandatory to always include the
module corresponding to the used kernel.
_(the available modules are: linux, hw, okl4, fiasco, pistachio, nova,_
_codezero, foc)_
:image modules:
These modules are used to wrap up all components used by the run script
in a specific format and thereby prepare them for execution.
Depending on the used kernel, different formats can be used. With these
modules, the creation of ISO and disk images is also handled.
_(the available modules are: uboot, disk, iso)_
:load modules:
These modules handle the way the components are transfered to the
target system. Depending on the used kernel there are various options
to pass on the components. For example, loading from TFTP or via JTAG is handled
by the modules of this category.
_(the available modules are: tftp, jtag, fastboot)_
:log modules:
These modules handle how the output of a currently executed run script
is captured.
_(the available modules are: qemu, linux, serial, amt)_
:power_on modules:
These modules are used for bringing the target system into a defined
state, e.g., by starting or rebooting the system.
_(the available modules are: qemu, linux, softreset, powerplug, amt)_
:power_off modules:
These modules are used for turning the target system off after the
execution of a run script.
_(the available modules are: powerplug)_
When executing a run script, only one module of each category must be used.
Each module has the form of a script snippet located under the
_tool/run/<step>/_
directory where _<step>_ is a subdirectory named after the module type.
Further instructions about the use of each module (e.g., additional
configuration arguments) can be found in the form of comments inside the
respective script snippets.
Thanks to this modular structure,
the extension of the tool kit comes down to adding a file at the corresponding
module-type subdirectory. This way, custom work flows (such as tunneling JTAG
over SSH) can be accommodated fairly easily.
Usage examples
==============
To execute a run script, a combination of modules may be used. The combination
is controlled via the RUN_OPT variable used by the build framework. Here are a
few common exemplary combinations:
Executing NOVA in Qemu:
!RUN_OPT = --include boot_dir/nova \
! --include power_on/qemu --include log/qemu --include image/iso
Executing NOVA on a real x86 machine using AMT for resetting the target system
and for capturing the serial output while loading the files via TFTP:
!RUN_OPT = --include boot_dir/nova \
! --include power_on/amt --power-on-amt-host 10.23.42.13 \
! --power-on-amt-password 'foo!' \
! --include load/tftp --load-tftp-base-dir /var/lib/tftpboot \
! --load-tftp-offset-dir /x86 \
! --include log/amt --log-amt-host 10.23.42.13 \
! --log-amt-password 'foo!'
Executing Fiasco.OC on a real x86 machine using AMT for resetting, USB serial
for output while loading the files via TFTP:
!RUN_OPT = --include boot_dir/foc \
! --include power_on/amt --amt-host 10.23.42.13 --amt-password 'foo!' \
! --include load/tftp --tftp-base-dir /var/lib/tftpboot \
! --tftp-offset-dir /x86 \
! --include log/serial --log-serial-cmd 'picocom -b 115200 /dev/ttyUSB0'
Executing base-hw on a Raspberry Pi using powerplug to reset the hardware,
JTAG to load the image and USB serial to capture the output:
!RUN_OPT = --include boot_dir/hw \
! --include power_on/powerplug --power-on-powerplug-ip 10.23.42.5 \
! --power-on-powerplug-user admin \
! --power-on-powerplug-password secret \
! --power-on-powerplug-port 1
! --include power_off/powerplug --power-off-powerplug-ip 10.23.42.5 \
! --power-off-powerplug-user admin \
! --power-off-powerplug-password secret \
! --power-off-powerplug-port 1
! --include load/jtag \
! --load-jtag-debugger /usr/share/openocd/scripts/interface/flyswatter2.cfg \
! --load-jtag-board /usr/share/openocd/scripts/interface/raspberrypi.cfg \
! --include log/serial --log-serial-cmd 'picocom -b 115200 /dev/ttyUSB0'
After the run script was executed successfully, the run tool will print the
string 'Run script execution successful.". This message can be used to check
for the successful completion of the run script when doing automated testing.
Meaningful default behaviour
============================
To maintain the ease of use of creating and using a build directory, the
'create_builddir' tool equips a freshly created build directory with a meaningful
default configuration that depends on the selected platform. For example, if
creating a build directory for the Linux base platform, RUN_OPT
is initially defined as
! RUN_OPT = --include boot_dir/linux \
! --include power_on/linux --include log/linux
Low-level OS infrastructure
###########################
Improved management of physical memory
======================================
On machines with a lot of memory, there exist constraints with regard to
the physical address ranges of memory:
* On platforms with a non-uniform memory architecture, subsystems should
preferably use memory that is local to the CPU cores the subsystem is using.
Otherwise the performance is impeded by costly memory accesses to
the memory of remote computing nodes.
* Unless an IOMMU is used, device drivers program physical addresses
into device registers to perform DMA operations. Legacy devices such as
USB UHCI controllers expect a 32-bit address. Consequently, the memory
used as DMA buffers for those devices must not be allocated above 4 GiB.
* When using an IOMMU on NOVA, Genode represents the address space
accessible by devices (by the means of DMA) using a so-called device PD
([https://genode.org/documentation/release-notes/13.02#DMA_protection_via_IOMMU]).
DMA transactions originating from PCI devices are subjected to the virtual
address space of the device PD.
All DMA buffers are identity-mapped with their physical addresses within
the device PD. On 32-bit systems with more than 3 GiB of memory, this
creates a problem. Because the device PD is a regular user-level component, the
upper 1 GiB of its virtual address space is preserved for the kernel. Since
no user-level memory objects can be attached to this
area, the physical address range to be used for DMA buffers is limited
to the lower 3 GiB.
Up to now, Genode components had no way to influence the allocation of
memory with respect to physical address ranges. To solve the problems outlined
above, we extended core's RAM services to take allocation constraints
as session arguments when a RAM session is created. All dataspaces created
from such a session are subjected to the specified constraints. In particular,
this change enables the AHCI/PCI driver to allocate DMA buffers at suitable
physical address ranges.
This innocent looking feature to constrain RAM allocations raises a problem
though: If any component is able to constrain RAM allocations in
arbitrary ways, it would become able to scan the physical address space for
allocated memory by successively opening RAM sessions with the constraints set
to an individual page and observe whether an allocation succeeds or not. Two
conspiring components could use this information to construct a covert storage
channel.
To prevent such an abuse, the init component filters out allocations
constrains from RAM-session requests unless explicitly permitted. The
permission is granted by supplementing the RAM resource assignment of
a component with a new 'constrain_phys' attribute. For example:
! <resource name="RAM" quantum="3M" constrain_phys="yes"/>
Init component
==============
Most of Genode's example scenarios in the form of run scripts support
different platforms. However, as the platform details vary, the run scripts
have to tweak the configuration of the init component according to the
features of the platform.
For example, when declaring an explicit route to a framebuffer driver named
"fb_drv", the run script won't work on Linux because on this platform, the
framebuffer driver is called "fb_sdl".
Another example is the role of the USB driver. Depending on the platform, the
USB driver is an input driver, a block driver, a networking driver, or a
combination of those.
Consequently, run scripts with support
for a great variety of platforms tend to become convoluted with
platform-specific conditionals.
To counter this problem, we enhanced init to support aliases for component
names. By defining the following aliases in the init configuration
! <alias name="nic_drv" child="usb_drv"/>
! <alias name="input_drv" child="usb_drv"/>
! <alias name="block_drv" child="usb_drv"/>
the USB driver becomes reachable for session requests routed to either "usb_drv",
"nic_drv", "input_drv", and "block_drv". Consequently, the routing
configuration of components that use either of those drivers does no longer
depend on any platform-intrinsic knowledge.
RTC session interface
=====================
Until now, the RTC session interface used an integer to return the current
time. Although this is preferable when performing time-related
calculations, a structured representation is more convenient to use, i.e., if
the whole purpose is showing the current time. This interface change is only
visible to components that use the RTC session directly.
Since the current OS API of Genode lacks time-related functions, most users
end up using the libc, which already converts the structured time stamp
internally, or provide their own time related functions.
Update of rump-kernel-based file systems
========================================
We updated the rump-kernel support to a newer rump-kernel version (as of mid of
January 2015). This way, Genode is able to benefit from upstream stability
improvements related to the memory management. Furthermore, we revised the
Genode backend to allow the rump_fs server to cope well with a large amount of
memory assigned to it. The latter is useful to utilize the block cache of the
NetBSD kernel.
Libraries and applications
##########################
As a stepping stone in the
[https://github.com/genodelabs/genode/issues/1399 - forthcoming community effort]
to bring the Nix package manager to Genode, ports of libbz2 and sqlite have
been added to the _repos/libports/_ repository.
Runtime environments
####################
VirtualBox on NOVA
==================
Whereas our previous efforts to run VirtualBox on Genode/NOVA were mostly
concerned with enabling principal functionality and with the addition of
features, we took the release cycle of Genode 15.02 as a chance to focus
on performance and stability improvements.
:Performance:
Our goal with VirtualBox on NOVA is to achieve a user experience
comparable to running VirtualBox on Linux. Our initial port of VirtualBox used
to cut a lot of corners with regards to performance and timing accuracy
because we had to concentrate on more fundamental issues of the porting
work first. Now, with the feature set settled, it was time to revisit
and solidify our interim solutions.
The first category of performance improvements is the handling of timing,
and virtual guest time in particular. In our original version,
we could observe a substantial drift of the guest time compared to the host time.
The drift is not merely inconvenient but may even irritate the guest OS
because it violates its assumptions about the behaviour of certain virtual devices.
The drift was caused by basing the timing on a simple jiffies counter
that was incremented by a thread after sleeping for a fixed period. Even
though the thread almost never executes, there is still a chance that it gets
preempted by the kernel and resumed only after the time slices of
concurrently running threads have elapsed. This can take tens of milliseconds.
During this time, the jiffies counter remains unchanged. We could
significantly reduce the drift by basing the timing on absolute time values
requested from the timer driver. Depending on the used guest OS, however,
there is still a residual inaccuracy left, which is subject to ongoing
investigations.
The second type of improvements is related to the handling of virtual
interrupts. In its original habitat, VirtualBox relies on so-called
external-interrupt virtualization events. If a host interrupt occurs while the
virtual machine is active, the virtualization event is forwarded by the
VirtualBox hypervisor to the virtual machine monitor (VMM).
On NOVA, however, the kernel does not propagate this
condition to the user-level VMM because the occurrence of host interrupts should
be of no matter to the VMM. In the event of a host interrupt, NOVA takes
a normal scheduling decision (eventually activating the user-level device driver
the interrupt belongs to) and leaves the virtual CPU (vCPU) in a runnable
state - to be rescheduled later. Once the interrupt is handled, the vCPU gets
resumed. The VMM remains out of the loop. Because the update of the VirtualBox
device models ultimately relies on the delivery of external-interrupt
virtualization events, the lack of this kind of event introduced huge delays
with respect to the update of device models and the injection of virtual
interrupts. We solved this problem by exploiting a VirtualBox-internal
mechanism called POKE. By setting the so-called POKE flag, an I/O thread is
able to express its wish to force the virtual machine into the VMM. We only
needed to find the right spots to set the POKE flag.
Another performance-related optimization is the caching of RTC time
information inside VirtualBox. The original version of the gettimeofday
function used by VirtualBox contacted the RTC server for obtaining the
wall-clock time on each call. After the update to VirtualBox 4.3, the rate of those
calls increased significantly. To reduce the costs of these calls, our
new version of gettimeofday combines infrequent calls to the RTC driver
with a component-local time source based on the jiffies mechanism mentioned above.
With these optimizations in place,
simple benchmarks like measuring the boot time of Window 7 or the time of
compiling Genode within a Debian VM suggest that our version of VirtualBox
has reached a performance that is roughly on par with the Linux version.
:Stability:
Since the upgrade to VirtualBox 4.3.16 in release 14.11, we fixed several
regression issues caused by the upgrade. Beside that, we completed the
support to route serial output of guests to Genode, lifted the restriction
to use just one fixed VESA mode, and enabled support for 32-bit Windows 8
guests on 64-bit Genode/NOVA. The 64-bit host restriction stems from
the fact that Windows 8 requires support for the non-executable bit (NX)
feature of page tables. The 32-bit version of the NOVA kernel does not leverage
the physical address extension (PAE) feature, which is a pre-requisite for
using NX on 32-bit.
In the course of the adaptation, our port of VirtualBox now evaluates the
PAE and HardwareVirtExUX XML tags of .vbox files:
!<VirtualBox xmlns=...>
! <Machine uuid=...>
! <Hardware ..>
! <CPU ...>
! <HardwareVirtExUX enabled="true"/>
! <PAE enabled="true"/>
! ...
The PAE tag specifies whether to report PAE capabilities to the guest
or not. The HardwareVirtExUx tag is used by our port to decide whether to stay
for non-paged x86 modes in Virtualbox's recompiler (REM) or not. Until now, we used REM
to emulate execution when the guest was running in real mode and protected mode
with paging disabled. However, newer Intel machines support the unrestricted guest
feature, which makes the usage of REM in non-paged modes not strictly
necessary anymore. Setting the HardwareVirtExUx tag to false accommodates
older machines with no support for the unrestricted-guest feature.
Device drivers
##############
iPXE-based network drivers
==========================
We enabled and tested the driver with Intel I218-LM and I218-V PCI devices.
Intel wireless stack
====================
In this release, several small issues regarding the wireless stack are fixed.
From now on, the driver only probes devices on the PCI bus that correspond to
the PCI_CLASS_NETWORK_OTHER device class. Prior to that, the driver probed all
devices attached to the bus resulting in problems with other devices, e.g.
the GPU, when accessing their extended PCI config space.
Since the driver uses cooperative scheduling internally, it must never block
or, in case it blocks, must schedule another task. Various sleep functions
lacked this scheduling call and are now fixed. Furthermore, a bug in the timer
implementation has been corrected, which caused the scheduling of wrong timeouts.
In addition to these fixes, patches for enabling the support for
Intel 7260 cards were incorporated.
Up to now, the configuration of the wireless driver was rather inconvenient because
it did not export any information to the system. The driver now creates two
distinct reports to communicate its state and information about the wireless
infrastructure to other components. The first one is a list of all available
access points. The following exemplary report shows its structure:
!<wlan_accesspoints>
! <accesspoint ssid="skynet" bssid="00:01:02:03:04:05" quality="40"/>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:06" quality="70" protection="WPA-PSK"/>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:07" quality="10" protection="WPA-PSK"/>
!</wlan_accesspoints>
Each '<accesspoint>' node has attributes that contain the SSID and the BSSID
of the access point as well as the link quality (signal strength). These
attributes are mandatory. If the network is protected, the node will also
have an attribute describing the type of protection in addition.
The second report provides information about the state of the connection
with the currently associated access point:
!<wlan_state>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:06" quality="70"
! protection="WPA-PSK" state="connected"/>
!</wlan_state>
Valid state values are 'connected', 'disconnected', 'connecting' and
'disconnecting'.
The driver obtains its configuration via a ROM module. This ROM
module contains the selected access point and can be updated during runtime.
To connect to an access point, a configuration like the following is used:
!<selected_accesspoint ssid="foobar" bssid="01:02:03:04:05:06"
! protection="WPA-PSK" psk="foobar123!"/>
To disconnect from an access point, an empty configuration can be set:
!<selected_accesspoint/>
For now, the prevalent WPA/WPA2 protection using a pre-shared key is supported.
Improved UART driver for Exynos5
================================
The UART driver for the Exynos5 SoC has been enhanced by enabling the RX
channel. This improvement was motivated by automated tests, where a run script
needs to interact with some component via a terminal connection.
Touchscreen support
===================
We enabled support of Wacom USB touchscreen devices via dde_linux - a port of
Linux USB driver to Genode. In order to make touchscreen coordinates
usable by Genode's input services, they must be calibrated
to screen-absolute coordinates. The screen resolution is not determined
automatically by the USB driver. It can, however, be configured as a sub
node of the '<hid>' XML tag of the USB driver's configuration:
!<start name="usb_drv">
! ...
! <config uhci=... ohci=... xhci=...>
! <hid>
! <screen width="1024" height="768"/>
! </hid>
! ...
USB session interface
=====================
We enhanced our USB driver with the support of remote USB sessions. This
feature makes it possible to implement USB-device drivers outside the USB
server using a native Genode API. The new USB session can be found under
_repos/os/include/usb_session_ and can be used to communicate with the USB
server, which merely acts as a host controller and HUB driver in this scenario.
Under _repos/os/include/usb_, there are a number of convenience
and wrapper functions that operate directly on top of a USB session. These
functions are meant to ease the task of USB-device-driver programming by hiding
most of the USB session management, like packet-stream handling.
We also added a USB terminal server, which exposes a Genode terminal session to
its clients and drives the popular PL2303 USB to UART adapters using the new
USB-session interface.
A practical use case for this component is the transmission of logging data on
systems where neither UART, AMT, nor JTAG are available. A run script
showcasing this feature can be found at _repos/dde_linux/run/usb_terminal.run_.
RTC proxy driver for Linux
==========================
There are a handful of run scripts that depend on the RTC service. So far,
it was not possible to run these tests on Linux due to the lack of an RTC
driver on this platform. To address this problem, we created a proxy driver
that uses the time() system call to provide a
reasonable base period on Linux.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Support for the USB-Armory board
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With [https://www.crowdsupply.com/inverse-path/usb-armory - USB Armory],
there is an intriguing hardware platform for Genode on the horizon.
In short, USB Armory is a computer in the form factor of a USB
stick. It is meant for security applications such as VPNs,
authentication tokens, and encrypted storage. It is based on the
FreeScale i.MX53 SoC, which is well supported by Genode, i.e.,
Genode can be used as secure-world OS besides Linux running in the
normal world.
Apart from introducing a novel form factor, this project is
interesting because it strives to be an 100% open platform, which
includes hardware, software, and firmware. This motivated us to
bring Genode to this platform.
The underlying idea is to facilitate
[https://genode.org/documentation/articles/trustzone - ARM TrustZone] to
use Genode as a companion to a Linux-based OS on the platform.
Whereas Linux would run in the normal world of TrustZone, Genode runs
in the secure world. With Linux, the normal world will control the
communication over USB and provide a familiar environment to implement
USB-Armory applications. However, security-critical functions and data like
cryptographic keys will reside exclusively in the secure world. Even in
the event that Linux gets compromised, the credentials of the user
will stay protected.
The support of the USB Armory platform was added in two steps:
First, we enabled our base-hw kernel to run as TrustZone monitor with
Genode on the "secure side". Since the USB Armory is based on the
FreeScale i.MX53 SoC, which Genode already supported, this step went
relatively straight-forward.
Second, we enabled a recent version of the Linux kernel (3.18) to run in the
normal world. The normal world is supervised by a user-level Genode component
called tz_vmm (TrustZone Virtual Machine Monitor). The tz_vmm is, among
others, responsible for providing startup and hardware information to the
non-secure guest. The Linux kernel version we used previously as TrustZone
guest on i.MX53 boards expected this information to be communicated via
so-called ATAGs. The new version, however, expects this to be done via a
device tree blob. As a consequence, the tz_vmm had to be adapted to properly
load this blob into the non-secure RAM. The original USB-Armory device tree
was modified to blind out the RAM regions that get protected by the TrustZone
hardware. This way, Linux won't attempt to access them. Furthermore,
to keep basic user interaction simple, our device tree tells Linux to use the
same non-secure UART as Genode for console I/O.
The kernel itself received some modifications, for two reasons. First,
we don't want Linux to rely on resources that are protected to keep
the secure world secure. This is why the driver for the interrupt controller
that originally made use of the TrustZone interrupt configuration, had to be
adapted. Second, to prevent Linux from disturbing Genode activities, we
disabled most of the dynamic clock and power management as it may sporadically
gear down or even disable hardware that Genode relies on. Furthermore, we
disabled the Linux drivers for I2C interfaces and the GPIO configuration as
these are reserved for Genode.
IPC helping
~~~~~~~~~~~
In traditional L4 microkernels, scheduling parameters (like time-slice
length and priority) used to be bound to threads. Usually, those parameters
are defined at thread creation time. The initial version
of base-hw followed this traditional approach. However, it has a few problems:
* For most threads, the proper *choice of scheduling parameters* is very
difficult if not impossible. For example, the CPU-time demands of a
server thread may depend on the usage patterns of its clients. Most
theoretical work in the domain of scheduling presumes the knowledge of
job lengths in advance of computing a schedule. But in practice and in
particular in general-purpose computing, job lengths are hardly known a priori.
As a consequence, in most scenarios, scheduling parameters are
set to default values.
* With each thread being represented as an independent schedulable entity,
the kernel has to take a scheduling decision each time a thread performs an
IPC call because the calling thread gets blocked and the called thread
may get unblocked. In a microkernel-based system, those events occur at a
much higher rate than the duration of typical time slices, which puts the
scheduler in a *performance-critical* position.
* Regarding IPC calls, a synchronous flow of control along IPC call chains is
desired. Ideally, an IPC call should have the same characteristics as
a function call with respect to scheduling. When a client thread performs an
IPC call, it expects the server to immediately become active to
handle the request. But if the kernel treats each thread independently,
it may pick any other thread and thereby introduce *high latencies* into
IPC operations.
To counter those problems, the NOVA microhypervisor introduced a new approach
that decouples scheduling parameters from threads. Instead of selecting
threads for execution, the scheduler selects so-called scheduling contexts.
For a selected scheduling context, the kernel dynamically determines a
thread to execute by taking IPC relationships into account. When a thread
performs an IPC, the thread's scheduling context will be used to execute
the called server. In principle, a server does not need CPU time on its own
but always works with CPU resources provided by clients.
The new version of the base-hw kernel adapts NOVA's approach with slight
modifications. Each thread owns exactly one scheduling context for its entire
lifetime. However, by the means of "helping" during an IPC call, the caller
lends its scheduling context to the callee. Even if the callee is still busy
and cannot handle the IPC request right away, the caller helps because it
wants the callee to become available for its request as soon as
possible. Consequently, a thread has potentially many scheduling contexts at
its disposal, its own scheduling context plus all scheduling contexts
provisioned by helpers. This works transitively.
Purged outdated platforms
~~~~~~~~~~~~~~~~~~~~~~~~~
We removed the support for two stale platforms that remained unused for
more than a year, namely FreeScale i.MX31 and the TrustZone variant
of the Coretile Versatile Express board.
NOVA
====
On Genode/NOVA, we used to employ one pager thread in core for each thread
in the system. We were forced to do so because not every page
fault can be resolved immediately. In some situations, core asynchronously
propagates the fault to an external component for the resolution.
In the meantime, the
pager thread leaves the page fault unanswered. Unfortunately, the kernel
provides no mechanism to support this scenario besides just blocking the
pager thread using a semaphore. This, in turn, means that the pager thread is not
available for other page-fault requests. Ultimately, we had to setup a
dedicated pager per thread.
This implementation has the downside of "wasting" memory for a lot of
pager threads. Moreover, it becomes a denial-of-service vector as soon as more
threads get created than core can accommodate. The number of threads is
limited per address space - also for core - by the size of Genode's context
area, which typically means 256 threads.
To avoid the downsides mentioned, we extended the NOVA IPC reply syscall to
specify an optional semaphore capability. The NOVA kernel validates the
capability and blocks the faulting thread in the semaphore. The faulted thread
remains blocked even after the pager has replied to the fault message. But
the pager immediately becomes available for other
page-fault requests. With this change, it suffices to maintain only one pager
thread per CPU for all client threads.
The benefits are manifold. First, the base-nova implementation converges more
closely to other Genode base platforms. Second, core can not run out of threads
anymore as the number of threads in core is fixed for a given setup. And the
third benefit is that the helping mechanism of NOVA can be leveraged for
concurrently faulting threads.
Build system and tools
######################
Tools for convenient handling of port contrib directories
=========================================================
We supplemented our tools for the ports mechanism with two convenient
scripts:
:_tool/ports/shortcut_:
Creates a symbolic link from _contrib/<port-name>-<hash>_ to
_contrib/<port-name>_. This is useful when working on the third-party
code contained in the _contrib_ directory.
:_tool/ports/current_:
Prints the current contrib directory of a port. When switching
branches back and forth, the hash of the used port might change.
The script provides a shortcut to looking up the hash file for a
specific port within the repositories and printing its content.

1216
doc/release_notes/15-05.txt Normal file

File diff suppressed because it is too large Load Diff

791
doc/release_notes/15-08.txt Normal file
View File

@@ -0,0 +1,791 @@
===============================================
Release notes for the Genode OS Framework 15.08
===============================================
Genode Labs
The version 15.08 marks the beginning of Genode as day-to-day OS as one of the
project's core developers switched to using Genode/NOVA on his machine,
stressing the OS infrastructure we created over the course of the last seven
years. Thanks to components like VirtualBox, the Noux runtime for GNU software,
the Linux wireless stack and Rump-kernel-based file systems, the transition
went actually much smoother than expected. So other members of the team plan
to follow soon. Section [Genode as day-to-day operating system] gives an
overview of the taken approach. Genode's use as general-purpose OS provided
the incentive for most of the improvements featured by the current release,
starting with the addressing of the long-standing kernel-memory management
deficiencies of the NOVA kernel (Section [NOVA kernel-resource management]),
over enhancements of Genode's tracing and file-system facilities, to vast
improvements of the guest-host integration of VirtualBox when running on
Genode.
The release is accompanied with a second line of work led by our friends
at Codelabs: Enabling Genode to run on top of their Muen separation
kernel as described in Section [Genode on top of the Muen Separation Kernel].
Muen is a low-complexity kernel for the 64-bit x86 architecture that
statically partitions the machine into multiple domains. In contrast to
microkernels like the ones already supported by Genode, the assignment
of physical resources (such as memory, CPU time, and devices) happens at
system-integration time. Since an isolation kernel does not have to deal
with dynamic resource management at runtime, it is less complex than
a general-purpose microkernel. This makes it relatively easy to reason about
its strong isolation properties, which, in turn, makes it attractive for
high-assurance computing. With Genode being able to run within a Muen
domain, the rich component infrastructure of Genode can be combined with
the strong isolation guarantees of Muen.
Genode on top of the Muen Separation Kernel
###########################################
_This section was written by Adrian-Ken Rueegsegger and Reto Buerki who_
_conducted the described line of work independent from Genode Labs._
After completing our x86_64 port of the Genode base-hw kernel, which was
featured in the
[https://genode.org/documentation/release-notes/15.05#Principal_support_for_the_64-bit_x86_architecture - previous release (15.05)],
we immediately started working on our main goal: running a Genode system as
guest on the Muen Separation Kernel (SK). This would enable the Muen platform
to benefit from the rich ecosystem of Genode.
For those who have not read the 15.05 Genode release notes, [https://muen.sk - Muen]
is an Open-Source microkernel, which uses the [https://spark-2014.org/ - SPARK]
programming language to enable light-weight formal methods for high assurance.
The 64-bit x86 kernel, currently consisting of a little over 5'000 LOC, makes
extensive use of the latest Intel virtualization features and has been formally
proven to contain no runtime errors at the source-code level.
The new 'hw_x86_64_muen' platform, as the name implies, extends the 'hw_x86_64'
base-hw kernel by replacing the PIC and timer drivers with paravirtualized
variants.
In contrast to other kernels supported by Genode, the architecture with Muen is
different in the sense that the entire 'hw_x86_64_muen' Genode system runs as
guest VM in VMX non-root mode on the SK. From the perspective of Muen, Genode
is executed on top of the kernel like any other guest OS without special
privileges.
[image muen_system_overview]
Genode running on top of the Muen Separation Kernel alongside other subjects
This loose coupling of Muen and Genode base-hw enables the robust combination
of a static, low-complexity SK with a feature-rich and extensive OS framework.
The result is a flexible platform for the construction of component-based
high-assurance systems.
People interested in giving the 'hw_x86_64_muen' platform a spin can find a
small tutorial at _repos/base-hw/doc/x86_64_muen.txt_.
NOVA kernel-resource management
###############################
For several years, the NOVA kernel has served as Genode's primary base
platform on x86. The main reasons for this choice are: the kernel provides -
among the supported x86 kernels - the richest feature set like the support of
IOMMUs, virtualization, and SMP. It also offers a clean design and a stable
kernel interface. The available kernel-interface specification and the
readable and modern source base are a pleasure to work with. Hence, Genode
Labs is able to fully commit to the maintenance and further evolution of this
kernel.
Nevertheless, since the beginning, the vanilla kernel lacks one essential
feature to reliably host Genode as user-land, namely the proper management of
the memory used by the kernel itself (in short kernel-memory management). In
the past, we already extended the kernel to free up kernel resources when
destroying kernel objects, e.g., protection domains and page-tables, threads,
semaphores, and portals. Still, on Genode/NOVA, a component may trigger
arbitrary kernel-memory consumption during RPC by delegating memory,
capabilities, or by creating other components via Genode's core component. If
the kernel memory gets depleted, the kernel panics with an "Out of memory"
message and the entire Genode scenario stops.
In principal, the consumption of kernel memory can be deliberately provoked by
a misbehaving (greedy) component. But also during the regular day-to-day usage
of Genode, can such a situation occur when the system is used in a highly
dynamic fashion. For example, compiling and linking source code within the
noux environment constantly creates and destroys protection domains, threads,
and memory mappings. Our nightly test of compiling Genode within noux triggers
this condition every once in a while.
The main issue here is that the consumption of kernel memory is not accounted
by Genode. The kernel interface does not support such a feature. Kernels like
seL4 as well as Genode's custom base-hw kernel show how this problem can be
solved.
To improve the current situation - where the overall kernel memory is a fixed
amount - we extended NOVA in the following ways: First, the NOVA kernel
accounts any kernel memory consumption per protection domain. Second, each
process has a limited amount of kernel-memory quota it can use. Last, the
kernel detects when the quota limit of a protection domain is reached.
If the third condition occurs, the kernel stops the offending thread and
(optionally) notifies a handler thread. This so called out-of-memory (OOM)
handler thread receives information about the current situation and may
respond to it in the following ways:
* Stop the thread of the depleted protection domain, or
* Transfer kernel-memory quota between protection domains (upgrading the limit
if desired), or
* Free up kernel memory if possible, e.g., revoke memory delegations, which
can be re-created.
We implemented the steps above inside the NOVA kernel and extended Genode's
core component to handle such OOM situations. All system calls beside the IPC
call/reply may now return an error code upon depletion of the quota. Most of
these system calls can solely be performed by core and are handled inside
core's NOVA-specific platform code.
In the case of IPC call/reply operations, we desired to handle OOM cases
transparently to Genode user-level components. Therefore, each thread in
Genode/NOVA now gets constructed with an OOM IPC portal attached. This portal
is served by the pager thread in core and is traversed on OOM occurrences
during IPC operations. If a pager thread receives such an OOM IPC, it decodes
the involved IPC sender and IPC receiver and locates the appropriate
core-internal paging objects. The currently implemented out-of-memory policy
tries to upgrade the quota. If this is not possible, an attempt to revoke
memory mappings from the OOM-causing protection domain is made. This
implicitly frees-up some kernel memory (e.g., mapping nodes). If none of the
responses suffices, the handler stops the OOM-causing thread and writes a
message to the system log.
The current policy implementation constitutes a rather rough heuristic, which
may not suffice under all circumstances. In the future, we would like to
specify a distinct policy per component, e.g. depending on prior known memory
usage patterns. For example, some components follow well-known usage patterns
and therefore a fixed upper quota limit can be specified. Other components are
highly dynamic and desire quota upgrades on demand. There are many more
combinations imaginable.
Our current plan is to collect more experience over the next months with this
new kernel mechanism. Based on our observations, we may externalize such
policy decisions and possibly make them configurable per component.
The current implementation however, already avoids the situation that the
kernel goes out of service if a single component misbehaves
kernel-memory-wise.
Genode as day-to-day operating system
#####################################
At the beginning of June, Genode reached the probably most symbolic milestone
in the project's history: Norman - one of the core developers - replaced his
Linux-based working environment with a Genode-based system. This system is
composed of the following ingredients:
[image turmvilla_scenario]
The machine used is a Lenovo Thinkpad X201. We settled on this five-year-old
machine for several reasons. First, it is a very solid platform with a nice
form factor. Second, it features Intel's AMT (Active Management Technology),
which is handy to obtain low-level system logs in the case something goes
wrong. Third, refurbished machines of this type can be obtained for as little
as 200 EUR. Finally, an older machine reinforces the need for good performance
of the operating system. So it creates a natural incentive for Norman to find
and address performance bottlenecks.
Our modified version of the NOVA microhypervisor is the used kernel.
The user interface is based on our custom GUI stack including the nitpicker
GUI server as well as the window manager and its companion components
(decorator, layouter, pointer) we introduced in
[https://genode.org/documentation/release-notes/14.08#New_GUI_architecture - version 14.08].
The display is driven by the VESA driver. User input is handled by the PS/2
driver for handling the laptop keyboard and trackpoint, and the USB driver for
handling an externally connected keyboard and mouse.
Network connectivity is provided by our port of the Intel Wireless stack that
we introduced with the version
[https://genode.org/documentation/release-notes/14.11#Intel_wireless_stack - 14.11].
Our custom AHCI driver provides access to the physical hard disk. File-system
access is provided by our
[https://genode.org/documentation/release-notes/14.02#NetBSD_file_systems_using_rump_kernels - Rump-kernel-based file-system server].
A simple Genode shell called CLI monitor allows the user to start and kill
subsystems dynamically. Initially, the two most important subsystems are
VirtualBox and Noux.
VirtualBox executes a GNU/Linux-based guest OS that we refer to as "rich OS".
The rich OS serves as a migration path from GNU/Linux to Genode. It is used
for all tasks that cannot be accomplished directly on Genode yet. At the
beginning of the transition, the daily routine still very much depends on the
rich OS. By moving more and more functionality over to the Genode world, we
will eventually be able to make the rich OS obsolete step by step. Thanks to
VirtualBox' excellent host-guest-integration features, the VirtualBox window
can be dynamically resized and the guest mouse cursor integrates seamlessly
with Genode's pointer. VirtualBox is directly connected to the wireless
network driver. So common applications like Firefox can be used.
The noux runtime allows us to use command-line-based GNU software directly on
Genode. Coreutils and Bash are used for managing files. Vim is used for
editing files. Unlike the rich OS, the noux environment has access to the
Genode partition of the hard disk. In particular, it can be used to update the
Genode system. It has access to a number of pseudo files that contain status
information of the underlying components, e.g., the list of wireless access
points. Furthermore, it has limited access to the configuration interfaces of
the base components. For example, it can point the wireless driver to the
access point to use, or change the configuration of the nitpicker GUI server
at runtime.
As a bridge between the rich OS and the Genode world, we combine VirtualBox'
shared-folder mechanism with Genode's VFS infrastructure. The shared folder is
represented by a dedicated instance of a RAM file system, which is mounted in
both the VFS of VirtualBox and the VFS of noux.
As evidenced by Norman's use since June, the described system setup is
sufficient to be productive. So other members of the Genode team plan to
follow in his footsteps soon. At the same time, the continued use of the
system from day to day revealed a number of shortcomings, performance
limitations, and rough edges, which we eventually eliminated. It goes without
saying that this is an ongoing effort. Eating our own dog food forces us to
address the right issues to make the daily life more comfortable.
Feature-wise the switch to Genode motivated three developments, namely the
enhancement of Genode's CLI monitor, the improvement of the window manager,
and the creation of a CPU-load monitoring tool.
Interactive management of subsystem configurations
==================================================
The original version of CLI monitor obtained the configuration data of its
subsystems at start time via the Genode::config mechanism. But for managing
complex scenarios, the config node becomes very complex. Hence, it is
preferable to have a distinct file for each subsystem configuration.
The new version of CLI monitor scans the directory '/subsystems' for files
ending with ".subsystem". Each file has the same syntax as the formerly used
subsystem nodes. This change has the welcome implication that subsystem
configurations can be changed during the runtime of the CLI monitor, e.g., by
using a concurrently running instance of noux with access to the _subsystems/_
directory. This procedure has become an essential part of the daily work flow
as it enables the interactive evolution of the Genode system.
Window-management improvements
==============================
To make the window manager more flexible while reducing its complexity at the
same time, we removed the formerly built-in policy hosting the decorator and
layout components as children of the window manager. Those components are no
longer child components but siblings. The relationship of the components is
now solely expressed by the configuration of their common parent, i.e., init.
This change clears the way to dynamically replace those components during
runtime (e.g., switching between different decorators).
To improve the usability of the windowed GUI, we enabled the layouter to
raise windows on click and to let the keyboard focus follow the pointer.
Furthermore, the window manager, the decorator, and the floating window
layouter became able to propagate the usage of an alpha channel from the
client application to the decorator. This way, the decorator can paint the
decoration elements behind the affected windows, which would otherwise be
skipped. Consequently, partially transparent windows can be properly displayed.
CPU-load monitoring
===================
During daily system use, we started to wish to know in detail where the CPU
cycles are spent. For example, the access of a file by the rich OS involves
several components, including the guest OS itself, VirtualBox, rump_fs (file
system), part_blk (partition access), ahci_drv (SATA device access), core, and
NOVA. Investigating performance issues requires a holistic view of all those
components. For this reason, we enhanced our existing tracing infrastructure
(Section [Enhanced tracing facilities]) to allow the creation of CPU-load
monitoring tools. The first tool in this category is the graphical CPU-load
monitor located at _gems/app/cpu_load_display/_, which displays a timeline of
the CPU load where each thread is depicted with a different color. Thanks to
this tool, we have become able to explore performance issues in an interactive
way. In particular, it helped us to identify and resolve a long-standing
inaccuracy problem in our low-level timer service.
Base framework and low-level OS infrastructure
##############################################
Improved audio support
======================
In the previous release, we replaced our old audio driver with a new one that
provided the same audio-out session interface. Complementing the audio-out
session, we are now introducing a new audio-in session interface that can be
used to record audio frames. It is modeled after the audio-out interface in
the way how it handles the communication between the client and the server. It
uses shared memory in the form of the Audio_in::Stream to transport the frames
between the components. A server component captures frames and puts them into
a packet queue, which is embedded in the Audio_in::Stream. The server
allocates packets from this queue to store the recorded audio frames. If the
queue is already full, the server will override already allocated packets and
will notify the client by submitting an 'overrun' signal. The client has to
cope with this situation, e.g., by consuming packets more frequently. A client
can install a signal handler to respond to a progress signal, which is sent by
the server when a new Audio_in::Packet has been submitted to the packet queue.
For now, all audio-in server components only support one channel (left)
although the audio-in session interface principally supports multiple
channels.
The _dde_bsd_ audio_drv is the first and currently only audio driver component
that was extended to provide the audio-in session. To express this fact, the
driver was renamed from _audio_out_drv_ to _audio_drv_. In contrast to its
playback functionality, which is enabled by default, recording has to be
enabled explicitly by setting the configuration attribute 'recording' to
'yes'. If the need arises, playback may be disabled by setting 'playback' to
'no'. In addition, it is now possible to configure the driver by adjusting the
mixer in the driver's configuration node. For the time being, the interface as
employed by the original OpenBSD mixer utility is used.
The following snippet shows how to enable and configure recording on a
Thinkpad X220 where the headset instead of the internal microphone is used as
source:
! <start name="audio_drv">
! <resource name="RAM" quantum="8M"/>
! <provides>
! <service name="Audio_out"/>
! <service name="Audio_in"/>
! </provides>
! <config recording="yes">
! <mixer field="outputs.master" value="255"/>
! <mixer field="record.adc-0:1_source" value="sel2"/>
! <mixer field="record.adc-0:1" value="255"/>
! </config>
! </start>
In addition to selecting the recording source, the playback as well as the
recording volume are raised to the maximum. Information about all available
mixers and settings in general may be obtained by specifying the 'verbose'
attribute in the config node.
The enriched driver is accompanied by a simple monitor application, which
directly plays back all recorded audio frames and shows how to use the
audio-in session. It can be tested by executing the
_repos/dde_bsd/run/audio_in.run_ run script.
There are also changes to the audio-out session itself. The length of a period
was reduced from 2048 to 512 samples to accommodate for a lower latency when
mixing audio-out packets. A method for invalidating all packets in the queue
was also added.
File-system infrastructure
==========================
Unlike traditional operating systems that rely on a global name space for
files, each Genode component has a distinct view on files. Many low-level
components do not even have the notion of files. Whereas traditional operating
systems rely on a virtual file system (VFS) implemented in the OS kernel,
Genode's VFS has the form of a library that can optionally be linked to a
component. The implementation of this library originated from the noux runtime
introduced in version
[https://genode.org/documentation/release-notes/11.02#Noux_-_an_execution_environment_for_the_GNU_userland - 11.02],
and was later integrated into our C runtime in version
[https://genode.org/documentation/release-notes/14.05#Per-process_virtual_file_systems - 14.05].
With the current release, we take the VFS a step further by making it
available to components without a C runtime. Thereby, low-complexity
security-sensitive components such as CLI monitor become able to benefit from
the powerful VFS infrastructure.
The VFS itself received a welcome improvement in the form of private RAM file
systems. A need for process-local storage motivated a conversion of the
existing ram_fs server component to an embeddable VFS file system. This
addition to the set of VFS plugins enables components to use temporary file
systems without relying on the resources of an external component.
Unified networking components
=============================
Having had a good experience with our Block::Driver implementation, which
wraps the block-session interface and takes care of the packet-stream
handling, thus easing the implementation of driver and other block components,
we observed that this approach did not provide enough flexibility for
NIC-session servers. For example, NIC servers are bi-directional and when a
network packet arrives the server has to make sure that there are enough
resources available to dispatch the network packet to the client. This has to
be done because the server must never block, e.g., by waiting for allocations
to succeed or for an empty spot in the packet queue of a client. Therefore,
such a non-blocking NIC server needs to validate all preconditions for
dispatching the packet in advance and, if they cannot be met, drop the network
packet.
In order to implement this kind of behavior, NIC-session servers must have
direct access to the actual NIC session. For this reason, we removed the
Nic::Driver interface from Genode and added a Nic::Session_component that
offers common basic packet-stream-signal dispatch functionality. Servers may
now inherit from this component and implement their own policy.
We adjusted all servers that implement NIC sessions to the new interface
(dde_ipxe, wifi, usb, nic_bridge, OpenVPN, ...), and thereby unified all
networking components within Genode.
Enhanced tracing facilities
===========================
Recent Genode-based system scenarios like the one described in Section
[Genode as day-to-day operating system] consist of dozens of components that
interact with each other. For reasoning about the behaviour of such scenarios
and identifying effective optimization vectors, tools for gathering a holistic
view of the system are highly desired.
With the introduction of our light-weight
[https://genode.org/documentation/release-notes/13.08#Light-weight_event_tracing - event-tracing facility]
in version 13.08, we laid the foundation for such tools. The current release
extends core's TRACE service with the ability to obtain statistics about CPU
utilization. More specifically, it enables clients of core's TRACE service to
obtain the execution times of trace subjects (i.e., threads). The execution
time is delivered as part of the 'Subject_info' structure. In addition to the
execution time, the structure delivers the information about the affinity of
the subject with a physical CPU.
At the current stage, the feature is available solely on NOVA since this is
our kernel of choice for using Genode as our day-to-day OS. On all other base
platforms, the returned execution times are 0. To give a complete picture of
the system's threads, the kernel's idle threads (one per CPU) are featured as
trace subjects as well. Of course, idle threads cannot be traced but their
corresponding trace subjects allow TRACE clients to obtain the idle time of
each CPU.
By obtaining the trace-subject information in periodic intervals, a TRACE
client is able to gather statistics about the CPU utilization attributed to
the individual threads present (or no longer present) in the system. One
instance of such a tool is the new trace-subject reporter located at
_os/src/app/trace_subject_reporter_. It acts as a TRACE client, which delivers
the gathered trace-subject information in the form of XML-formatted data to a
report session. This information, in turn, can be consumed by a separate
component that analyses the data. In contrast to the low-complexity
trace-subject reporter, which requires access to the privileged TRACE services
of core, the (potentially complex) analysing component does not require access
to core's TRACE service. So it isn't as critical as the trace-subject monitor.
The first representative of a consumer of trace-subject reports is the
CPU-load display mentioned in Section [CPU-load monitoring] and depicted in
Figure [nano3d].
In addition to the CPU-monitoring additions, the tracing facilities received
minor refinements. Up to now, it was not possible to trace threads that use a
CPU session other than the component's initial one. A specific example is
VirtualBox, which employs several CPU sessions, one for each priority. This
problem has been solved by associating the event logger of each thread with
its actual CPU session. Consequently, the tracing mechanism has become able to
trace VirtualBox, which is pivotal for our further optimizations.
Low-complexity software rendering functions
===========================================
Our ambition to use Genode as our day-to-day OS raises the need for custom
graphical applications. Granted, it is principally possible to base such
applications on Qt5, which is readily available to native Genode components.
However, for certain applications like status displays, we prefer to avoid the
dependency on an overly complex GUI tool kit. To accommodate such
applications, Genode hosts a small collection of low-complexity graphics
functions called painters. All of Genode's low-complexity graphical components
such as nitpicker, launchpad, window decorator, or the terminal are based on
this infrastructure.
With the current release, we extend the collection with two new painters
located at _gems/include/polygon_gfx_. Both draw convex polygons with an
arbitrary number of points. The shaded-polygon painter interpolates the color
and alpha values whereas the textured-polygon painter applies a texture to the
polygon. The painters are accompanied by simplistic 3D routines located at
_gems/include/nano3d/_ and a corresponding example (_gems/run/nano3d.run_).
[image nano3d]
With the nano3d demo and our new CPU load display, the screenshot above shows
two applications that make use of the new graphics operations.
Device drivers
##############
Completing the transition to the new platform driver
====================================================
Until now, the platform driver on x86-based machines was formed by the ACPI
and PCI drivers. The ACPI driver originally executed the PCI driver as a slave
(child) service. The ACPI driver parsed the ACPI tables and provided the
relevant information as configuration during the PCI-driver startup. We
changed this close coupling to the more modern and commonly used
[https://genode.org/documentation/release-notes/14.02#New_session_interface_for_status_reporting - report_rom mechanism].
When the new ACPI driver finishes the ACPI table parsing, it provides the
information via a report to any interested and registered components. The
report contains among other the IRQ re-routing information. The PCI driver is
a component, which - according to its session routing configuration - plays
the role of a consumer of the ACPI report.
With this change of interaction of ACPI and PCI driver, the policy for devices
must be configured solely at the PCI driver and not at the ACPI driver. The
syntax, however, stayed the same as introduced with release 15.05.
Finally, the PCI driver 'pci_drv' got renamed to 'platform_drv' as already
used on most ARM platforms. All files and session interfaces containing
PCI/pci in the names were renamed to Platform/platform. The x86 platform
interfaces moved to _repos/os/include/platform/x86/_ and the implementation of
the platform driver to _repos/os/src/drivers/platform/x86/_.
An example x86 platform configuration snippet looks like this:
!<start name="acpi_drv" >
! <resource .../>
! <route>
! ...
! <service name="Report"> <child name="acpi_report_rom"/> </service>
! </route>
!</start>
!
!<start name="acpi_report_rom" >
! <binary name="report_rom"/>
! <resource .../>
! <provides> <service name="ROM" /> <service name="Report" /> </provides>
! <config>
! <rom> <policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/> </rom>
! </config>
! <route> ... </route>
!</start>
!
!<start name="platform_drv" >
! <resource name="RAM" quantum="3M" constrain_phys="yes"/>
! <provides> <service name="Platform"/> </provides>
! <route>
! <service name="ROM">
! <if-arg key="label" value="acpi"/> <child name="acpi_report_rom"/>
! </service>
! ...
! </route>
! <config>
! <policy label="ps2_drv"> <device name="PS2"/> </policy>
! <policy label="nic_drv"> <pci class="ETHERNET"/> </policy>
! <policy label="fb_drv"> <pci class="VGA"/> </policy>
! <policy label="wifi_drv"> <pci class="WIFI"/> </policy>
! <policy label="usb_drv"> <pci class="USB"/> </policy>
! <policy label="ahci_drv"> <pci class="AHCI"/> </policy>
! <policy label="audio_drv"> <pci class="AUDIO"/> <pci class="HDAUDIO"/> </policy>
! </config>
!</start>
In order to unify and simplify the writing of run scripts, we added the
commonly used platform configuration to the file
_repos/base/run/platform_drv.inc_. This file may be included by any test run
script in order to setup a default platform driver configuration.
In addition, the snippet provides the following functions:
'append_platform_drv_build_components', 'append_platform_drv_config' and
'append_platform_drv_boot_modules'. The functions add necessary information to
the 'build_components', 'config' and 'boot_modules' run variables. The
_platform_drv.inc_ also contains the distinction between various ARM/x86
platforms and includes the necessary pieces. Hence, run scripts are largely
relieved from platform-specific peculiarities.
The body of an example run script looks like this:
! set build_components { ... }
!
! source ${genode_dir}/repos/base/run/platform_drv.inc
! append_platform_drv_build_components
!
! build $build_components
!
! create_boot_directory
!
! set config { ... }
!
! append_platform_drv_config
!
! append config { ... }
!
! install_config $config
!
! append_platform_drv_boot_modules
!
! build_boot_image $boot_modules
!
! run_genode_until ...
BCM57cxx network cards
======================
During Hack'n Hike 2015, we had access to a server that featured a Broadcom
network card. Therefore Guido Witmond performed the first steps to enable
Broadcom's BCM 57cxx cards. With this preliminary work in place, we were
quickly able to perform the additional steps required to add BCM 57cxx support
to Genode.
VESA driver refinements
=======================
The VESA driver now reports the frame buffer's line width instead of the
visible width to the client. This fixes a possible distortion if these widths
differ, at the cost that content in the right-most area might be invisible in
such cases.
VirtualBox
##########
Policy-based mouse pointer
==========================
In the previous release, we implemented support for the transparent
integration of the guest mouse pointer with nitpicker via the VirtualBox guest
additions and the vbox_pointer component, which is capable of rendering
guest-provided mouse-pointer shapes. Now, we extended vbox_pointer by a
policy-based configuration that allows the selection of ROMs containing the
actual mouse shape based on the nitpicker session label or domain. With this
feature in place, it is possible to integrate several VirtualBox instances as
well as dedicated pointer shapes for specific components. To see the improved
vbox_pointer in action give _run/vbox_pointer_ a shot.
Dynamic adaptation to screen size changes
=========================================
VirtualBox now notifies the guest operating system about screen-size changes
(for example if the user resizes a window, which shows the guest frame
buffer). The VirtualBox guest additions can use this information to adapt the
guest frame buffer to the new size.
SMP support
===========
Guest operating systems can now use multiple virtual CPUs, which are mapped to
multiple host CPUs. The number of virtual CPUs can be configured in the
'.vbox' file.
Preliminary audio support
=========================
At some point, the use of VirtualBox as a stop-gap solution for using Genode
as everyday OS raises the need to handle audio. With this release, we address
this matter by enabling preliminary audio support in our VirtualBox port. A
back end that uses the audio-out and audio-in sessions to playback and record
sound samples has been added. It disguises itself as the OSS back end that is
already used by vanilla VirtualBox. Since Genode pretends to be FreeBSD in the
eyes of VirtualBox (because Genode's libc is based on FreeBSD's libc), the
provisioning of an implementation of the OSS back end as used on FreeBSD host
systems is the most natural approach. The audio support is complemented by
adding the necessary device models for the virtual HDA as well as the AC97
devices to our VirtualBox port.
For now, it is vital to have the guest OS configure the virtual device in a
way that considers the current implementation. For example, we cannot
guarantee distortion-free playback or recording if the guest OS uses a period
that is too short, typically 10ms or less. There are also remaining issues
with the mixing/filtering code in VirtualBox. Therefore, we bypass it to
achieve better audio quality. As a consequence, the device model of the VM has
to use the same sample rate as is used by the audio-out and audio-in sessions
(44.1kHz).
Enabling audio support is done be adding
! <AudioAdapter controller="HDA" driver="OSS" enabled="true"/>
to the .vbox file manually or configuring the VM accordingly by using the GUI.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Bender chain loader on base-hw x86_64
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On Intel platforms, we use the Bender chain loader from the
[https://github.com/alex-ab/morbo - Morbo multiboot suite] to detect available
COM ports of PCI plug-in cards, the AMT SOL device, or as fall back the
default comport 1. The loader stores the I/O port information of the detected
cards into the BIOS data area (BDA), from where it is retrieved by core on
boot and subsequently used for logging. With this release, we added the BDA
parsing to base-hw on x86-64 and enabled the feature in the run tool. As a
prerequisite, we had to fix an issue in bender triggered by the loading of
only one (large) multi-boot kernel. Consequently, its binary in
_tool/boot/bender_ was updated.
Revised page-table handling
~~~~~~~~~~~~~~~~~~~~~~~~~~~
One of the main advantages of the base-hw platform is that the memory trading
concept of Genode is universally applied even with regard to kernel objects.
For instance, whenever a component wants to create a thread, it pays for the
thread's stack, UTCB, and for the corresponding kernel object. The same
applies to objects needed to manage the virtual address space of a component
with the single exception of page tables.
Normally, when the quota, which was donated by a component to a specific
service, runs out, the component receives an exception the next time it tries
to invoke the service. The component can respond by upgrading the respective
session quota. However, in the context of page-fault resolution, this is
particularly difficult to do. The allocation and thereby the shortage of
memory becomes evident only when the client produces a page fault. Therefore,
there is no way to inform the component to upgrade its session quota before
resolving the fault.
Instead of designing a sophisticated protocol between core and the other
components to solve this problem, we decided to simplify the current
page-fault resolution by using a static set of page-tables per component.
Formerly, page tables were dynamically allocated from core's memory allocator.
Now, an array of page tables gets allocated during construction of a
protection domain. When a component runs out of page tables, all of its
mappings get flushed, and the page tables are populated from scratch. This
change greatly simplifies the page-table handling inside of base-hw.
Dynamic interrupt mode setting on x86_64
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On x86-based hardware, user-level device drivers have become able to specify
the trigger mode and polarity of the interrupts when requesting an IRQ
session. On ARM, those session parameters are ignored. This change enables the
x86_64 platform to support devices, which use arbitrary trigger modes and
polarity settings, e.g., AHCI on QEMU and real hardware.
Fiasco.OC
=========
Genode's device-driver support when using the Fiasco.OC kernel as base
platform received an upgrade.
First, principle support for the Raspberry Pi was added. To make this platform
useful in practice, a working USB driver is important. I.e., the network
interface is connected via USB. Hence the USB driver got enabled for
Fiasco.OC, too. As a result, Genode's software stack can now be used on the
Raspberry Pi by using either our custom base-hw kernel or Fiasco.OC.
Second, support for the Odroid-X2 platform using the Exynos4412 SoC was added,
which includes the drivers for clock management (CMU), power management
(PMU) as well as USB.
Thanks to Reinier Millo Sánchez and Alexy Gallardo Segura for having
contributed this line of work.
Removal of deprecated features
##############################
We dropped the support for the *ARM Versatile Express* board from the Genode
source tree to relieve our automated testing infrastructure from supporting a
platform that remained unused for more than two years.
The device driver environment kit (DDE Kit) was originally intended as a
common API among the execution environments of ported user-level device
drivers. However, over the course of the past years, we found that this
approach could not fulfill its promise while introducing a number of new
problems. We reported our experiences in the release notes of versions
[https://genode.org/documentation/release-notes/12.05#Re-approaching_the_Linux_device-driver_environment - 12.05] and
[https://genode.org/documentation/release-notes/14.11#Roundup - 14.11].
To be able to remove the DDE-Kit API, we reworked the USB driver, our port of
the Linux TCP/IP stack, and the wireless driver accordingly.

1429
doc/release_notes/15-11.txt Normal file

File diff suppressed because it is too large Load Diff

652
doc/release_notes/16-02.txt Normal file
View File

@@ -0,0 +1,652 @@
===============================================
Release notes for the Genode OS Framework 16.02
===============================================
Genode Labs
With version 16.02, we add RISC-V to Genode's supported CPU architectures,
enable the secure pass-through of individual USB devices to virtual machines,
and update the support for the Muen and seL4 kernels.
Trustworthy hardware becomes an increasingly pressing problem. With each new
generation of today's commodity hardware comes a dramatic increase of
complexity, the addition of proprietary companion processors, and opaque
firmware blobs. Even with a perfectly secure operating system, the user's
privacy and security remains at risk as there is no way to assess the
trustworthiness of our underlying hardware. RISC-V is a new hardware
architecture that tries to overcome this problem by the means of open source
and transparency. It is designed to scale from micro controllers to
general-purpose computers, and to be both synthesizable as FPGA softcores and
implementable in ASICs. The prospect of a scalable and trustworthy open-source
hardware platform motivated us to add RISC-V to Genode's supported CPU
architectures. Section [New support for the RISC-V CPU architecture] gives a
brief overview of this line of work.
Thanks to the growing number of our regular developers using Genode as day to
day OS, we create a natural incentive to address typical desktop-OS work
flows. In particular, the new version comes with the ability to assign
individual USB devices to VirtualBox instances. Conceptually, this looks like
a relatively straight-forward feature. But as discussed in Section
[Assignment of USB devices to virtual machines], we had to overcome a number of
challenging problems caused by the inherently dynamic nature of USB-device
hot-plugging. Also on the account of day-to-day computing, the GUI stack
received welcomed usability improvements like keyboard shortcuts for certain
window-management operations.
With respect to Genode's underlying base platforms, we are happy to announce
the updates of the Muen and seL4 kernels. The Muen separation kernel received
an update to version 0.7, which accommodates Genode's regular work flows (via
run scripts) much better than the previous version. As described in Section
[Muen separation kernel], this change clears the way to subject Muen to
Genode's regular automated tests. The seL4 kernel represents an exciting
playground as a future base platform for Genode. We have updated the kernel to
version 2.1, which prompted us to fundamentally revisit the low-level resource
management of Genode on this kernel. A summary of this undertaking is presented
in Section [seL4 version 2.1].
According to the [https://genode.org/about/road-map - road map], we originally planned to
revise the framework API in this release. Even though this topic is
[https://github.com/genodelabs/genode/issues/1832 - very actively pursued], we
decided to not rush it. We find it important to provide a smooth migration path
from the old API to the new one. Determining the best path is actually trickier
than revising the API, though. To let our decisions settle a bit, we postpone
the transition to the upcoming release.
Assignment of USB devices to virtual machines
#############################################
As a migration strategy for running Genode on a daily basis, using VirtualBox
to execute a feature-rich OS is vital. In release
[https://genode.org/documentation/release-notes/15.05#USB-device_pass-through_support - 15.05],
we added USB pass-through support to VirtualBox by enabling its integrated USB
proxy service. Since we use the open-source edition of VirtualBox, we were
merely able to use the OHCI device model and were therefore limited to using
USB 1.x devices in low and full speed mode only. To make matters worse, when
using the OHCI controller model, it is difficult if not impossible to access
USB mass-storage devices. Usually, VirtualBox facilitates the EHCI or xHCI
device models for the pass-through of storage devices. Unfortunately, those
models are only available as a proprietary extension, which cannot be used by
our VirtualBox port.
Having support for the pass-through of high-speed and super-speed USB devices
is a must in such controller models. Therefore, we either have to implement
these models ourselves or port existing ones from another VMM or emulator to
fill the gap. We went for porting existing models first because device-model
development from scratch could end up being time consuming if we want to
guarantee them to work with a variety of different OS drivers.
QEMU xHCI device model
----------------------
QEMU features a NEC xHCI (UPD720200) device model that works well with Windows
guests. For this reason, we decided to give porting this device model a shot.
We applied the DDE approach and started by creating a QEMU emulation
environment so that only the bare minimum amount of source code needed to be
taken from the QEMU sources. It came down to a handful of source files, mainly
the USB core and the xHCI device model files. We iteratively extended the
emulation environment until the QEMU sources compiled and linked fine. One
particular cumbersome issue we had to overcome was the emulation of the QEMU
Object Model. Since QEMU is written in C, it uses its own object model to
implement inheritance. This object model is used throughout QEMU. We took the
easy way out and just used a C++ wrapper class that contains all QEMU objects
that are used in the USB subsystem.
The next step was to develop a USB host device model. This model connects a
USB device attached to Genode's USB host-controller driver to the xHCI device
model. Lucky for us, QEMU already contains a USB host device model that uses
libusb, which we could use as blueprint. We implemented a USB host device that
leverages Genode's custom USB session interface. This host device reacts to a
USB device report coming from another component such as the host-controller
driver. It tries to claim all devices it finds in that report and then creates
a QEMU USB device for each of them that is attached to the xHCI device model.
The xHCI device model needs infrastructure that normally is provided by QEMU
itself such as a timer queue and PCI device handling. We introduced a QEMU
USB controller interface _repos/libports/include/qemu/usb.h_ whose back-end
library interface has to be implemented by a component, i.e. the VMM, that
wants to use the library.
In the end, this work resulted in a small library that contains the xHCI
device model and works in a standalone way. All required resources have to be
provided by the component using the library. This makes it easy to integrate
the library in different VMMs because the user of the library is not forced to
employ the library in a certain way but free to use it any way he chooses.
xHCI device model wrapper in VirtualBox
---------------------------------------
We implemented an xHCI device model _repos/port/src/virtualbox/devxhci.cc_ in
VirtualBox that merely wraps the QEMU USB library and provides the back-end
functionality required by the library to glue QEMU's xHCI device model to
VirtualBox. For now, this device is always part of a VM because there is
currently no way to disable it from within the VirtualBox configuration
front end. Therefore, it is necessary to always give VirtualBox access to a
_usb_devices_ ROM module.
We removed the afore mentioned USB proxy service from our VirtualBox port
because it became redundant with the advent of our xHCI device model.
USB device report filter
------------------------
With the xHCI support in VirtualBox in place, we had to come up with a
mechanism to select, which USB devices it may access. Since USB devices are
usually hot-plugged by the user of the system, we need to be able to configure
the access permissions dynamically at run-time. On this account, we created a
component that intercepts the report from the USB host-controller driver. On
the one hand, this USB device report-filter component screens the device
report coming from the USB host-controller driver by checking each reported
device against a given white list of devices. Only approved devices are
reported to a consumer of the report, i.e. VirtualBox. On the other hand, this
component generates a new configuration for the USB host-controller driver.
The configuration has to be changed each time the filter component finds a
suitable device because the driver will hand out access to a given device to a
client only if there is a valid policy. As we do not know in advance, which
devices might be plugged in, this policy must be maintained dynamically. The
report filter will send the device report only if the host-controller driver
has changed its configuration. This ensures that a matching policy will be in
effect at the time when the client component tries to access the device.
The configuration of the report-filter component can also be changed at run
time.
See _repos/os/src/app/usb_report_filter/README_ for more details on how the
USB device report filter may be configured.
Example configuration
---------------------
The following figure illustrates the interplay and configuration of the
involved components:
[image qemu_xhci]
When the user plugs in a USB device, the USB host-controller driver generates
a device report that is consumed by the USB device report-filter component
(1). The filter component then examines the report and checks if it contains a
device it should report to its report consumer. It then reconfigures the
host-controller driver (2). Afterwards it sends a report to its consumer (3).
The consumer, in this case a VMM, then accesses the USB device (4).
New support for the RISC-V CPU architecture
###########################################
We became aware of [https://riscv.org - RISC-V] when attending several talks
about the project at [https://fosdem.org - FOSDEM] in 2015. RISC-V aims to be
an open-source hardware architecture and is now complemented by many projects
that target the release of real hardware or ASICs (for example,
[https://www.lowrisc.org - the LowRISC project]). We have experience with various
major CPU architectures and many systems on a chip and, therefore, embrace a
sharp eye on certain platform properties. Intel's ME and ARM's Trustzone
practically lock out operating systems of certain hardware and firmware
features. The true nature of these mechanisms becomes increasingly dubious,
especially when trying to build a secure open-source operating system. Intel's
AMT technology for instance comes with a complete TCP/IP stack that intercepts
packets from the integrated NIC and a VNC server that can magically expose a
mouse and a keyboard at the USB controller. If you are interested in more
details about this topic
[https://blog.invisiblethings.org/papers/2015/x86_harmful.pdf - Intel x86 considered harmful]
by Joanna Rutkowska is a very good read. We decided to have a deeper look at
the RISC-V architecture as an alternative open hardware platform. Especially,
since the LowRISC project promises a completely open system on chip, including
the peripherals.
RISC-V comes with a lot of optional features, so it can cover a large field of
applications reaching from simple I/O processors to general-purpose computing.
For example, there are 64 and 32 bit ISA (instruction set architecture)
versions, three page table formats with the option to omit paging at all, up
to four privilege modes, and a minimal integer core ISA (I). Everything else,
like multiplication and division (M), atomic instructions (A), and floating
point support (F) are subject to ISA extensions and are completely optional
for a specific hardware implementation.
For Genode, we chose to add the RISC-V support to our custom _base-hw_ kernel.
Since Genode may be used as a general purpose OS, we implemented the kernel
using the 64 bit RISC-V version, the Sv39 three-level page table format, and
the so-called general-purpose extension (G), which is the abbreviation for the
IAMF extensions. The current implementation provides the kernel and the
necessary adaptations of the user level part of core.
For testing, we used the RISC-V instruction emulator called
[https://github.com/riscv/riscv-isa-sim - Spike]. There also exists a RISC-V
implementation for various Zynq FPGAs. Genode's Zynq board support has kindly
been added and contributed by Mark Vels.
In the current state, basic Genode applications including core, init, and
components that use shared libraries can be executed on top of our RISC-V
port. We did not enable the libc and postponed further activity as the
platform currently does not specify the interaction with peripherals.
Steps to test Genode on RISC-V
------------------------------
# Building the instruction emulator
! # download the front end server
! git clone https://github.com/ssumpf/riscv-fesvr.git
!
! # build the front end server
! cd riscv-fesvr
! mkdir build
! cd build
! export RISCV=<installation path>
! ../configure --prefix=$RISCV
! (sudo) make install
!
! # download the instruction emulator
! cd ../../
! git clone https://github.com/ssumpf/riscv-isa-sim.git
! cd riscv-isa-sim
!
! # build the emulator
! mkdir build
! cd build
! ../configure --prefix=$RISCV --with-fesvr=$RISCV
! (sudo) make install
!
! # add $RISCV/bin to path
! export PATH=$RISCV/bin:$PATH
# Building Genode and running a test scenario
! # download Genode
! cd ../../
! git clone https://github.com/genodelabs/genode.git
!
! # build the Genode tool chain
! cd genode
! ./tool/tool_chain riscv
!
! # create RISC-V build directory
! ./tool/create_builddir hw_riscv
! cd build/hw_riscv
!
! # build and execute the printf run script
! make run/printf
GUI stack usability improvements
################################
Motivated by the daily use of Genode as desktop OS by an increasingly number
of developers, the window-layouter component of the
[https://genode.org/documentation/release-notes/15.11#GUI_stack - GUI stack]
received welcomed usability improvements.
Configurable window placement
-----------------------------
The policy of the window layouter can be adjusted via its configuration. For
a given window label, the window's initial position and its maximized state
can be defined as follows:
! <config>
! <policy label="mupdf" maximized="yes"/>
! <policy label="nit_fb" xpos="50" ypos="50"/>
! </config>
Keyboard shortcuts
------------------
The window layouter has become able to respond to key sequences. However,
normally, the layouter is not a regular nitpicker client but receives only
those input events that refer to the window decorations. It never owns the
keyboard focus. In order to propagate global key sequences to the layouter,
nitpicker must be explicitly configured to direct key sequences initiated with
certain keys to the decorator. For example, the following nitpicker
configuration routes key sequences starting with the left windows key to the
decorator. The window manager, in turn, forwards those events to the layouter.
! <start name="nitpicker">
! ...
! <config>
! ...
! <global-key name="KEY_LEFTMETA" label="wm -> decorator" />
! ...
! </config>
! ...
! </start>
The response of the window layouter to key sequences can be expressed in the
layouter configuration as follows:
! <config>
! <press key="KEY_LEFTMETA">
! <press key="KEY_TAB" action="next_window">
! <release key="KEY_TAB">
! <release key="KEY_LEFTMETA" action="raise_window"/>
! </release>
! </press>
! <press key="KEY_LEFTSHIFT">
! <press key="KEY_TAB" action="prev_window">
! <release key="KEY_TAB">
! <release key="KEY_LEFTMETA" action="raise_window"/>
! </release>
! </press>
! </press>
! <press key="KEY_ENTER" action="toggle_fullscreen"/>
! </press>
! </config>
Each '<press>' node defines the policy when the specified 'key' is pressed.
It can be equipped with an 'action' attribute that triggers a window action.
The supported window actions are:
:next_window: Focus the next window in the focus history.
:prev_window: Focus the previous window in the focus history.
:raise_window: Bring the focused window to the front.
:toggle_fullscreen: Maximize/unmaximize the focused window.
By nesting '<press>' nodes, actions can be tied to key sequences. In the
example above, the 'next_window' action is executed only if TAB is pressed
while the left windows-key is kept pressed. Furthermore, key sequences can
contain specific release events. In the example above, the release of the left
windows key brings the focused window to front, but only if TAB was pressed
before.
Device drivers
##############
USB host-controller driver enhancements
=======================================
The _usb_drv_ component now solely uses a policy to grant other components
access to USB devices exposed by its raw interface (USB session). On the basis
of the 'label' attribute, it will choose a pre-configured device that is
identified by either the 'bus' and 'dev' or the 'vendor' and 'product'
attribute tuple. To accommodate policy decisions made at run time, the USB
driver is now able to reload its configuration on demand. The USB device
report now contains a 'bus' and a 'dev' attribute as well in order to identify
a USB device more precisely. In addition to that, there is also a generated
'label' attribute in form of 'usb-<bus>-<dev>' that may be used to form
policies while configuring the system dynamically, e.g., when using the
_usb_report_filter_ component.
USB mass-storage driver
=======================
Up to now, access to USB storage devices was provided by the USB
host-controller driver only. However, its ability to do so is limited. E.g.,
it only supports one storage device and the storage device cannot be changed
at run-time. With this release we add a USB mass-storage driver that supports
UMS bulk-only devices that use the SCSI Block Commands set (direct-access).
This is still most common for USB sticks. Devices using different command
sets, e.g SD/HC devices or some external disc drives, will not work properly
if at all. The driver uses the USB session interface to access the USB device
and provides its service as block session to its client.
This component is part of the first step providing the ability to mount and
use USB sticks dynamically when using Genode as a general purpose OS. In the
future, the _usb_drv_ component should solely be the host-controller driver
while other tasks are handled by dedicated USB driver components such as this
one.
Audio output on Linux
=====================
The audio-out driver for Linux was modernized by replacing its multi-threaded
architecture by an event-driven architecture using Genode's server API. In
addition, the playback is now driven by a timer. For now it is a periodic
timer that triggers every 11 ms which is roughly the current audio-out period.
The driver now also behaves like the other BSD-based audio-out driver, i.e.,
it always advances the play pointer. That is vital for the audio-out stack
above the driver to work properly (e.g., the mixer).
Libraries and applications
##########################
New Genode-world repository
===========================
With a growing number of users and contributors comes the desire to bring more
and more existing software to Genode. Most of such libraries and applications,
however, are outside of the scope of Genode as an OS framework. In contrast to
device drivers, protocol stacks, and low-level OS services, which we subject
to our regular automated tests, most 3rd-party software is pretty independent
from Genode. The attempt to integrate the growing pool of such diverse
software into the main repository does not scale.
For this reason, we introduce the new
[https://github.com/genodelabs/genode-world - Genode World] repository, which
is the designated place for hosting ported applications, libraries, and games.
To use it, you first need to obtain a clone of Genode:
! git clone https://github.com/genodelabs/genode.git genode
Now, clone the _genode-world.git_ repository to _genode/repos/world:_
! git clone https://github.com/genodelabs/genode-world.git genode/repos/world
By placing the _world_ repository under the _repos/_ directory, Genode's tools
will automatically incorporate the ports provided by the _world_ repository.
For building software of the _world_ repository, the build-directory
configuration _etc/build.conf_ must be extended with the following line:
! REPOSITORIES += $(GENODE_DIR)/repos/world
*Word of caution*
In contrast to the components found in the mainline Genode repository, the
components within the _world_ repository are not subjected to the regular
quality-assurance measures of Genode Labs. Hence, problems are to be expected.
If you encounter bugs, build problems, or stability issues, please report them
to the [https://github.com/genodelabs/genode-world/issues - issue tracker] or
the [https://genode.org/community/mailing-lists - mailing list].
Updated 3rd-party software
==========================
The following 3rd-party code packages of the _ports_ and _libports_
repositories have been ported or updated:
* Lynx 2.8.8rel.2 (noux package)
* OpenSSH 7.1p1 (noux package)
* tar-1.27 (noux package)
* libssh 0.7.2
* Lighttpd 1.4.38
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Within the last months, the initialization code of our custom kernel got
re-arranged to simplify the addition of new architectures, e.g., the RISC-V
port (Section [New support for the RISC-V CPU architecture]) while also making
its implementation leaner. A positive side effect of this work was the
generalization of multi-processor and L2-cache support for ARM's Cortex-A9
CPUs. For instance, the Wandboard (Freescale i.MX6 SoC) is now driven with all
four cores, and its memory can be accessed with full speed.
Besides those feature additions, we fixed an extremely rare and tricky race
condition in the implementation of the kernel-protected capabilities,
introduced in release 15.05. A capability's lifetime within a component is
tracked by a reference-counting like mechanism that is under control of the
component itself. When the kernel transfered a capability to a component, and
the very same capability was deleted within the component simultaneously, the
received capability was marked as invalid, which led to diverse, sporadic
faults. This deficit in the capabilities reference-counting is solved with the
current release.
Muen separation kernel
======================
Build integration
-----------------
Building Genode scenarios running on top of the
[https://muen.sk - Muen separation kernel] has been greatly simplified by
properly integrating the Muen system build process into the Genode build system.
As described in the
[https://genode.org/documentation/release-notes/15.08#Genode_on_top_of_the_Muen_Separation_Kernel - 15.08 release notes],
the architecture with Muen is different since the entire hw_x86_64_muen Genode
system runs as a guest VM on top of the separation kernel. This means that the
Genode base-hw image must itself be packaged into the final Muen system image
as an additional step after the Genode system build.
The packaging process of a Muen system image is performed by the new
_image/muen_ run-tool plugin, which processes the following RUN_OPT parameters.
:--image-muen-external-build:
Muen system is built automatically or externally
:--image-muen-system:
Muen system policy
:--image-muen-components:
Muen system components required for the given system policy
:--image-muen-hardware:
Muen target hardware platform
:--image-muen-gnat-path:
Path to GNAT toolchain
:--image-muen-spark-path:
Path to SPARK toolchain
The options are automatically added to the _etc/build.conf_ file for the
hw_x86_64_muen base-hw platform. The
[https://genode.org/documentation/platforms/muen - documentation] has been
updated to reflect the new, simplified build process.
A port file was added to facilitate the download of the Muen sources v0.7 and
to check the required dependencies.
Using the new _image/muen_ script in combination with iPXE allows to run the
Genode test suite via the autopilot tool.
MSI support
-----------
Muen employs Intel VT-d interrupt remapping (IR) besides DMA remapping for
secure device assignment. As a consequence, PCI devices using Message Signaled
Interrupts (MSI) must be programmed to trigger requests in remappable format
(see Intel VT-d specification, Section 5.1.2.2 for further details).
To enable the use of MSIs with the base-hw kernel, a platform-specific
function has been introduced that returns the necessary MSI parameters for a
given PCI device. If either the platform or the specific device does not
support MSI, the function returns false.
On hw_x86_64_muen, the function consults the Muen subject info page to supply
the appropriate information to the IRQ session. This allows Genode device
drivers to transparently use MSIs for passed-through PCI devices.
seL4 version 2.1
================
By the end of 2015, the [https://sel4.systems/ - seL4 kernel] version 2.0 was
published. With the current release, we update Genode's preliminary support
for this kernel from the experimental branch of one year ago to the master
branch of version 2.1. Note that this line of work is still considered as an
exploration. As of now, there is still a way to go until we can leverage seL4
as a fully featured base platform. Under the hood of Genode, the transition to
the version 2.1 master branch had the following implications.
In contrast to the experimental branch, the seL4 master branch has no way to
manually define the allocation of kernel objects within untyped memory ranges.
Instead, the kernel maintains a built-in allocation policy. This policy rules
out the deallocation of once-used parts of untyped memory. The only way to
reuse memory is to revoke the entire untyped memory range. Consequently, we
cannot share a large untyped memory range for kernel objects of different
protection domains. In order to reuse memory at a reasonably fine granularity,
we need to split the initial untyped memory ranges into small chunks that can
be individually revoked. Those chunks are called "untyped pages". An untyped
page is a 4 KiB untyped memory region.
The bootstrapping of core has to employ a two-stage allocation approach now.
For creating the initial kernel objects for core, which remain static during
the entire lifetime of the system, kernel objects are created directly out of
the initial untyped memory regions as reported by the kernel. The so-called
"initial untyped pool" keeps track of the consumption of those untyped memory
ranges by mimicking the kernel's internal allocation policy. Kernel objects
created this way can be of any size. For example the CNode, which is used to
store page-frame capabilities is 16 MiB in size. Also, core's CSpace uses a
relatively large CNode.
After the initial setup phase, all remaining untyped memory is turned into
untyped pages. From this point on, newly created kernel objects cannot exceed
4 KiB in size because one kernel object cannot span multiple untyped memory
regions. The capability selectors for untyped pages are organized similarly to
those of page-frame capabilities. There is a new 2nd-level CNode
(UNTYPED_CORE_CNODE) that is dimensioned according to the maximum amount of
physical memory (1M entries, each entry representing 4 KiB). The CNode is
organized such that an index into the CNode directly corresponds to the
physical frame number of the underlying memory. This way, we can easily
determine an untyped page selector for any physical addresses, i.e., for
revoking the kernel objects allocated at a specific physical page. The
downside is the need for another 16 MiB chunk of meta data. Also, we need to
keep in mind that this approach won't scale to 64-bit systems. We will
eventually need to replace the PHYS_CORE_CNODE and UNTYPED_CORE_CNODE by CNode
hierarchies to model a sparsely populated CNode. The following figure
illustrates the layout of core's capability space.
[image sel4_core_cspace_master]
Organization of core's capability space on seL4
For each protection domain, core maintains a so-called VM CSpace that holds
capability selectors for page frames and page tables. The size constraint of
kernel objects has the immediate implication that the VM CSpaces of protection
domains must be organized via several levels of CNodes. I.e., as the top-level
CNode of core has a size of 2^12, the remaining 20 PD-specific CSpace address
bits are organized as a 2nd-level 2^4 padding CNode, a 3rd-level 2^8 CNode,
and several 4th-level 2^8 leaf CNodes. The latter contain the actual selectors
for the page tables and page-table entries of the respective PD.
As another slight difference from the experimental branch, the master branch
requires the explicit assignment of page directories to an ASID pool.
Functionality-wise the update to version 2.1 brings no changes. The
preliminary support is still limited to Genode's most fundamental mechanisms
like the bootstrapping, the creation of protection domains, the execution of
threads, and inter-component communication. User-level device drivers are not
supported yet. Such functional improvements are scheduled for Genode 16.08.
Linux
=====
We started to experience crashes of our dynamic linker (ldso) when using
Genode's _base-linux_ platform on recent Linux kernels. Ldso is primarily a
shared object, which is linked to dynamic binaries. But ldso is also an
executable, which, once started loads the dynamically-linked binary along with
all shared libraries required by the binary. Up to now, ldso had to be loaded
at a link address defined at compilation time, which we enforced through
linker-script magic. Unfortunately, this does not work any longer on recent
Linux versions. The kernel notices that ldso is a shared object and loads it
at an arbitrary (randomized) address, which ultimately results in a
segmentation fault during ldso initialization. We found a fix for this issue
by marking ldso as an executable in the ELF header. But since ldso is linked
to all dynamic binaries (it contains Genode's base libraries) the GNU linker
then refused to link because ldso was not marked as a shared object.
Therefore, we decided to implement true self relocation within ldso. This
feature only works on Genode's base-linux platform as it requires some
symbol-address magic.

1315
doc/release_notes/16-05.txt Normal file

File diff suppressed because it is too large Load Diff

1126
doc/release_notes/16-08.txt Normal file

File diff suppressed because it is too large Load Diff

729
doc/release_notes/16-11.txt Normal file
View File

@@ -0,0 +1,729 @@
===============================================
Release notes for the Genode OS Framework 16.11
===============================================
Genode Labs
In contrast to most parts of the framework, the fundamental low-level
protocols, which define the interaction between parent and child components
have remained unchanged since the very first Genode version. From this
interplay, the entire architecture follows. That said, certain initial design
choices were not perfect. They partially resulted from limitations of the
kernels we used during Genode's early years and from our pre-occupation with a
certain style of programming. Over the years, the drawbacks inherent in our
original design became more and more clear and we drafted rough plans to
overcome them. However, reworking the fundamental protocols of a system that
already accommodates hundreds of component implementations cannot be taken
lightly. Because of this discomfort, we repeatedly deferred the topic -
until now. With the rapidly growing workloads carried by Genode, we
deliberately decided to address long-standing deficiencies rather than adding
the features we originally planned according to the
[https://genode.org/about/road-map - road map].
Section [Asynchronous parent-child interactions] presents the reworking of
Genode's component interplay at the lowest level. With this change in place,
we feel much more comfortable to scale up our workloads in the upcoming
releases.
Functionality-wise, the most prominent topic of the current release is the
vastly improved NIC-routing component. Since we introduced the first version
of the NIC router in the previous release, we took an iterative approach to
shape the component according to its most prominent use cases. Section
[Further improved virtual networking] summarizes the changes and the
motivation behind them.
Even though we added support for seL4 in the previous release, the NOVA
hypervisor is still our go-to kernel for x86-based hardware because of its
feature set. For this reason, we continuously improve this kernel and the
NOVA-specific components like VirtualBox. Section [NOVA hypervisor] covers
the introduction of an asynchronous map operation to NOVA.
Further topics of the current release range from added smart-card support,
over a new timeout API, to a VFS-based time-based password generator. With
respect to the road map, we postponed most topics originally planned. In
particular, we intended to enable the use of Genode on top of Xen by following
the footsteps of the existing Muen support - using our custom
base-hw kernel within a Xen DomU domain. However, before proceeding this
route, we decided to modernize the kernel design, in particular with respect
to bootstrapping and address-space management. Some parts of this line of work
are already present in the current release, for example the unification of the
boot-module handling as explained in Section
[Unified handling of boot modules].
Asynchronous parent-child interactions
######################################
When Genode was born in 2006, the L4 microkernels of the time universally
lacked an asynchronous inter-process-communication (IPC) mechanism.
Consequently, we designed the first version of Genode with the presumption
that components had to interact solely synchronously. To us, this seemed to be
the "right" way because the synchronous low-footprint IPC was presumably the
key for L4's good performance. It felt natural to leverage this benefit to the
maximum extent possible.
To illustrate the implications of this line of thinking for Genode, let's take
a look at a simple scenario where a parent component hosts two children and one
child provides a service to the other child.
[image simple_scenario]
During the creation of a session, the kernel's IPC mechanism serves three
purposes. First, it is used to communicate information between different
protection domains, in this case the parent, the client, and the server.
Second, it implicitly dictates the flow of control between the involved
parties because the caller blocks until the callee replies to the IPC call.
Third, the IPC is the mechanism to delegate authority (like the authority to
access the server's session object) between protection domains. The latter is
realized with the kernel's ability to carry capabilities as IPC message
payload. If this sounds a bit too abstract, please consider reviewing Section
3.1. "Capability-based security" of the
[https://genode.org/documentation/genode-foundations-16-05.pdf - Genode Foundations].
Using solely a synchronous IPC mechanism, the sequence of establishing a
session in the given scenario is as follows. In the context of Genode,
we usually refer to synchronous IPC as RPC (remote procedure call).
[image sync_session_seq]
The sequence looks straightforward:
# The client issues an RPC call to its parent, requesting a session for a
service of the given type while also passing a number of session-construction
arguments along with the request.
# Given the service name as provided with the session request, the parent
determines the server to ask for a new session. It requests a session
on behalf of the client by performing an RPC call to the server's prior
registered "root" capability. This capability refers to an interface for
creating and closing sessions.
# The server responds to the invocation of its root interface by creating
a new session object along with a session capability.
Whereas the session object is local to the server, the corresponding
session capability can be passed (delegated) to other components.
Each component in possession of the session capability is able to interact
with the server's corresponding session object via RPC calls.
The server returns the session capability to the parent as the result of the
parent's RPC call.
# The parent forwards the session capability to the client as the result of
the client's original RPC call.
Even though the simplicity of this protocol seems nice, it has inherent
limitations:
First, as the parent performs a synchronous RPC call to the server on behalf
of the client, it must trust the server to eventually respond to the RPC call.
If the server doesn't, the parent may block forever. In contrast to the client
that actually uses the service and thereby relies on the liveliness of the
server, the parent should not need to trust the server to be responsive. To
deal with the risk of an unresponsive server, Genode's existing runtime
environments (like the init component), maintain a dedicated thread for each
child. The session requests originating from a child are handled by the
corresponding parent-local child thread. In the worst case - if the server
fails to respond - only a single child thread stays blocked but the other
parts of the runtime environment remain unaffected. Consequently, runtime
environments have to be multi-threaded components. This, in turn, comes at the
cost of added complexity, in particular the need for error-prone inter-thread
synchronization.
Second, the approach keeps the parent's state implicitly stored in the stacks
of the parent's threads. This becomes a problem in dynamic runtime
environments that need to kill subsystems at arbitrary times. E.g., imagine
the situation where the client component is to be destroyed while the parent's
call to the server's root interface is still pending. The safe destruction of
the child - including its associated parent-local child thread - requires the
parent to abort the RPC call, which is a complex and - again - error-prone
operation.
Third, even though not inherent to synchronous RPC, Genode's original design
facilitated the use of a session capability as argument for requesting the
parent to close a specific session. However, the use of capabilities as
re-identifiable tokens is not well supported by most kernels, including seL4
([https://sel4.systems/pipermail/devel/2014-November/000114.html - discussion]
on the seL4 mailing list).
Asynchronous communication throughout Genode
--------------------------------------------
In 2008, we acknowledged the sole reliance on synchronous RPC as too limiting
and introduced an
[https://genode.org/documentation/release-notes/8.11#Asynchronous_notifications - API for asynchronous notifications].
On the traditional L4 kernels, we implemented the API by using Genode's
core component as a proxy for signal delivery. The use of asynchronous
notifications soon became natural and wide-spread throughout Genode. Today,
most session interfaces combine three forms of inter-component communication,
namely synchronous RPC calls, asynchronous notifications, and shared memory.
The new Genode API introduced in
[https://genode.org/documentation/release-notes/16.05#The_great_API_renovation - version 16.05]
further cultivated the modeling of Genode components as single-threaded state
machines instead of multi-threaded programs.
Still, until now, the most fundamental mechanism of Genode - the protocol
between parent and child components - has remained synchronous. The reasons
are twofold. First, our workaround for realizing runtime environments in a
multi-threaded way worked too well. So we were not constantly bothered by this
design problem. Second and more importantly, redesigning the fundamental
mechanism of the framework while not breaking the more than 300 existing
components is quite scary. But in anticipation of the rapidly scaling
workloads imposed on Genode, we had to take on the problem sooner or later.
We figured that now - with the modernized framework API in place - it's the
right time. From redesigning the interplay of parent and child components, we
will become able to create single-threaded runtime environments that behave
completely deterministically while consuming less resources than
multi-threaded programs. By the explicit enumeration of possible states, we
greatly ease the validation/evaluation of such crucial components.
New session-creation procedure
------------------------------
Following the asynchronous approach, the sequence of creating a session now
looks as follows:
[image async_session_seq]
The dotted lines are asynchronous notifications, which have fire-and-forget
semantics. A component that triggers a signal does not block.
The following points are worth noting:
* Sessions are identified via IDs, which are plain numbers as opposed to
capabilities. The IDs as seen by the client and server belong to different
ID name spaces.
IDs of sessions requested by the client are allocated by the client. IDs
of sessions requested at the server are allocated by the parent.
* The parent does no longer need to perform RPC calls to any of its children.
Hence, the need for multiple threads in runtime environments disappears.
* Each activation of the parent merely applies a state change of the session's
meta data structures maintained at the parent, which capture the entire
state of session requests. There is no hidden state stored on the parent's
stack.
* The information about pending session requests is communicated from the
parent to the server via a ROM session. At startup, the server requests
a ROM session for the ROM module "session_requests" from its parent. The
parent implements this ROM session locally. Since ROM sessions support
versions, the parent can post version updates of the "session_requests"
ROM with the regular mechanisms already present in Genode.
* The involved parties can potentially run in parallel.
Outcome and current state
-------------------------
Intuitively, the sequence of steps required to establish a session has
become more complicated. However, for the users of the framework, the entire
procedure is completely transparent. With a few tricks, we were actually able
to implement this fundamental change while keeping almost all existing
components untouched. One trick is the introduction of a server-local proxy
mechanism, which translates the requests obtained from the "session_requests"
ROM to component-local RPC calls on the server's root interface. So from the
perspective of an existing server component, a session request still looks
like a synchronous RPC request from the outside. Of course, the proxy is meant
as an intermediate solution until we have crafted a convenient front-end API
for the asynchronous mode of operation.
Even though the biggest share of components remains unaffected by the change,
this is not true for all components. In particular, runtime environments had
to be reworked, in some cases quite fundamentally. These include core, init,
noux, the loader, GDB monitor, launcher, CLI monitor, and the platform driver.
The change does not only affect the interplay between components but also
required a reconsideration of the child-creation procedure.
Besides the architectural improvement, this line of work had two welcome
effects.
First, in contrast to the original design, which relied on capabilities as
re-identifiable tokens, the new version greatly alleviates the need for
re-identifying capabilities on seL4. So we are able to eliminate a
long-standing problem with Genode on this kernel.
Second, the work called for new data structures for the safe interaction with
ID spaces (_base/id_space.h_) and object registries (_base/registry.h_). Those
data structures will possibly be useful in a lot of places that currently use
plain (and fairly unsafe) AVL trees or lists.
At the API level, the change is almost transparent to regular components,
except for two details. The upgrading of session quota is no longer
possible by a mere RPC call to the parent. Instead, 'Connection' objects
received a new 'upgrade_ram' method that must be used instead. Speaking
of 'Connection' objects, we had to remove the (fairly obscure) 'KEEP_OPEN'
feature, which is conceptually incompatible with the new design.
Further improved virtual networking
###################################
The
[https://genode.org/documentation/release-notes/16.08#Virtual_networking_and_support_for_TOR - previous release]
introduced the NIC router - a component that individually routes IP
packets between multiple NIC sessions, translates between different IP
subnets, and also supports port forwarding and NAT. For the first version of
the NIC router, we focused on the technical realization. Now, besides
some optimization and restructuring, we took the chance to polish the
configuration interface of the component. The goal was to make the interface
more intuitive and reduce pitfalls to a minimum. Roughly speaking, the
handling of the NIC router became more tailored to its/our typical use cases.
Let's create a practical setup to explain the changes in detail. Assume that
there are two virtual subnets 192.168.1.0/24 and 192.168.2.0/24 within our
Genode system. They connect as Virtnet A and B to the router. The standard
gateway of the virtual networks is the NIC router with IP 192.168.*.1 . The
router's uplink, on the other hand, is connected to the NIC driver. It
interfaces the machine with our real-world home network 10.0.2.0/24. The home
network is connected to the internet through its standard gateway 10.0.2.1.
[image nic_router_basic]
The basic router configuration for this setup without any routing rules would
be as follows:
! <policy label_prefix="virtnet_a" domain="virtnet_a" />
! <policy label_prefix="virtnet_b" domain="virtnet_b" />
!
! <domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1" />
! <domain name="virtnet_a" interface="192.168.1.1/24" />
! <domain name="virtnet_b" interface="192.168.2.1/24" />
The first thing to notice is the changed usage of the policy tag. Previously,
the policy label - normally solely designated to correlate sessions with
configuration domains - was misused also as unique peer identifier in the
routing rules. This approach disregarded advanced label-matching techniques
such as the 'label_prefix' used above. Now, the whole NIC-router-specific
enhancement of the policy tag moved to the new '<domain>' tag, leaving the
policy tag only with its original purpose to select policies. Note that even
if this modification gives the impression, the router is not yet capable of
handling multiple NIC sessions at one domain at a time.
In the domain tag, the 'interface' attribute replaces the old policy attribute
named 'src'. That means, it tells the router which IP identity to use when
talking as itself to the domain. But in addition to that, the 'interface'
attribute also defines which subnet this identity and the domain belong to.
This reflects a basic decision we made during the reworking process: The new
NIC router is aware of subnets. Sessions of the same subnet have the same
configuration domain. We came to this conclusion as it solves some fundamental
problems with the old version. First, the equivalence of domain and subnet
enables us to link a default gateway to a subnet by adding the 'gateway'
attribute to the domain tag. In our example, this is done in the uplink
domain. The 'gateway' attribute is optional for a domain and replaces the
former 'via' attributes of the different routing rules. It is more efficient
and natural to have this value set only once at the corresponding subnet than
having it scattered all over the routing rules of the remote domains as done
before. If a domain has no default gateway, it drops all packets with a
foreign recipient.
The second advantage of a domain being equivalent to a subnet is that handling
ARP broadcasts becomes easy. It can be excluded that such ARP broadcasts
concern sessions outside the source domain anymore. And as sessions in the
same domain are not distinguishable to the routing, the broadcast can be sent
to all of them without breaking any rules.
Now, let's enhance our example by some routing rules. One pretty complicated
thing to do with the old NIC router was port forwarding. You had to combine
different routing rules, explicitly enable the back routing at the remote
side, and take care that NAT was applied - a lot of opportunities for
mistakes. With the new version, it became easier. Let's assume we have an HTTP
server in Virtnet A and an NTP server in Virtnet B. We want the NIC router to
act as proxy for their services in our home network.
[image nic_router_servers]
In order to achieve this, the uplink domain must be enhanced by two rules:
! <policy label_prefix="virtnet_a" domain="virtnet_a" />
! <policy label_prefix="virtnet_b" domain="virtnet_b" />
!
! <domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1" />
! <tcp-forward port="443" domain="virtnet_a" to="192.168.1.2" />
! <udp-forward port="123" domain="virtnet_b" to="192.168.2.2" />
! </domain>
!
! <domain name="virtnet_a" interface="192.168.1.1/24" />
! <domain name="virtnet_b" interface="192.168.2.1/24" />
The TCP forwarding rule for port 443 (HTTP+TLS/SSL) redirects to IP address
192.168.1.2 in Virtnet A and the UDP forwarding rule for port 123 (NTP)
redirects to IP address 192.168.2.2 in Virtnet B. The Virtnet domains remain
empty as the router keeps track of the redirected transfers and routes back
reply packets automatically. Also automatically, the router applies NAT for the
server as it is in the nature of port forwarding.
Next, we add some clients to Virtnet B that like to talk to our home network
and the internet. We want them to be hidden via NAT when they do so. For
internet communication, they shall furthermore be limited to HTTP+TLS/SSL and
IMAP+TLS/SSL.
[image nic_router_client]
This is what the router configuration looks now:
! <policy label_prefix="virtnet_a" domain="virtnet_a" />
! <policy label_prefix="virtnet_b" domain="virtnet_b" />
!
! <domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1" />
! <tcp-forward port="443" domain="virtnet_a" to="192.168.1.2" />
! <udp-forward port="123" domain="virtnet_b" to="192.168.2.2" />
! <nat domain="virtnet_b" tcp-ports="1000" udp-ports="1000">
! </domain>
!
! <domain name="virtnet_a" interface="192.168.1.1/24" />
! <domain name="virtnet_b" interface="192.168.2.1/24" >
! <tcp dst="10.0.2.0/24"> <permit-any domain="uplink" /> </tcp>
! <udp dst="10.0.2.0/24"> <permit-any domain="uplink" /> </udp>
! <tcp dst="0.0.0.0/0">
! <permit port="443" domain="uplink" />
! <permit port="993" domain="uplink" />
! </tcp>
! </domain>
There are several new tag types. One of them is the NAT configuration for
Virtnet B in the uplink domain. In contrast to the former NIC-router version
where NAT settings were part of the source domain, NAT is now configured in
the target domain with a sub-tag for each source. This has the advantage
of supporting heterogeneous NAT configurations for a packet source depending
on which domain it talks to. Besides, it is more intuitive to read. Apart from
that, the NAT settings haven't changed.
Furthermore, there are the new TCP and UDP tags in the Virtnet-B domain. The
first two of them have a 'permit-any' sub-tag. With this combination, we open
all ports to IP addresses of the 10.0.2.0/24 subnet, our home network, and
route them to the uplink domain. TCP packets that don't match these first two
rules may fall back to the third. This TCP rule doesn't have all ports opened
but only 443 (HTTP+TLS/SSL) and 993 (IMAP+TLS/SSL). Both ports are again bound
to the uplink domain. As the IP filter 0.0.0.0/0 of the surrounding rule isn't
restrictive, we now also route packets to a foreign destination. The NIC
router redirects such packets to the default gateway of our home network.
Compared to the old router version where IP and UDP/TCP routing had to be
combined for this purpose, the new TCP and UDP rules with their
port-permission sub-rules have some notable advantages. Like port-forwarding
rules, TCP and UDP rules always imply link-state tracking in order to route
back reply packets automatically. This can be seen also in our example as no
further routing rules had to be added to the uplink domain. This aspect is
clear from the outermost rule and not dependent on sub-rules anymore.
Furthermore, the strict separation of UDP and TCP routing prevents
configuration faults and increases readability. Last but not least, the
'permit-any' rule allows something new. Opening all ports for an address range
was previously only possible without link-state tracking as it could be
expressed only on the IP level.
At this point, we have thoroughly discussed the layer-3 routing abilities of
the new NIC router and our focus has indeed moved more into this direction.
Even though IP routing is still available, we found that it should be more
clearly separated from the rest. To illustrate this feature, we enhance our
example again. We want the Virtnets to be allowed to communicate to each other
without any restrictions. For that purpose, we add two more rules to the
router configuration:
! <policy label_prefix="virtnet_a" domain="virtnet_a" />
! <policy label_prefix="virtnet_b" domain="virtnet_b" />
!
! <domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1" />
! <tcp-forward port="443" domain="virtnet_a" to="192.168.1.2" />
! <udp-forward port="123" domain="virtnet_b" to="192.168.2.2" />
! <nat domain="virtnet_b" tcp-ports="1000" udp-ports="1000">
! </domain>
!
! <domain name="virtnet_a" interface="192.168.1.1/24" />
! <ip dst="192.168.2.0/24" domain="virtnet_b"/>
! </domain>
!
! <domain name="virtnet_b" interface="192.168.2.1/24" >
! <tcp dst="10.0.2.0/24"> <permit-any domain="uplink" /> </tcp>
! <udp dst="10.0.2.0/24"> <permit-any domain="uplink" /> </udp>
! <tcp dst="0.0.0.0/0">
! <permit port="443" domain="uplink" />
! <permit port="993" domain="uplink" />
! </tcp>
! <ip dst="192.168.1.0/24" domain="virtnet_a"/>
! </domain>
As you can see, each of the new IP rules in the Virtnet domains match the
addresses of the opposite subnet and route to the corresponding domain. As
mentioned, the new IP rules and UDP/TCP rules are not combined anymore to
clearly distinguish IP routing from layer-3 routing because this decision has
far-reaching effects. First, in contrast to UDP and TCP routing, IP routing is
stateless. Thus, for each IP routing rule one has to be sure to have a
back-routing rule at the remote domain or else bidirectional communication
won't happen. And second, NAT does not apply to IP-routed packets. So, if
you're not aware of such packets, you may unintentionally reveal information
about a private network.
For more details on the new NIC router, you may refer to the comprehensive
documentation in the _repos/os/src/server/nic_router/README_ file and the
basic NIC-router test at _libports/run/nic_router.run_ .
Base framework
##############
Improved RPC mechanism
======================
Since we introduced Genode's current API for synchronous RPCs in
[https://genode.org/documentation/release-notes/11.05#New_API_for_type-safe_inter-process_communication - version 11.05],
inter-component communication within Genode has become almost a child's play.
The RPC framework leverages the C++ type system and templates to a great
effect. In contrast to the traditional use of IDL compilers, the interaction
with RPC objects provided by other components is robust and natural because
no language boundaries need to be crossed.
Still, a few differences between RPC calls and regular function calls remain.
In particular, there exist a few restrictions with regard to the types of
RPC function arguments. Those types did not just need to be POD (plain old
data) types but they had to be default-constructible, too. Whereas the former
restriction still applies (non-POD objects that include references or
vtables cannot be used as arguments), the latter limitation has been lifted
now. Generally, non-default-constructible types are a way to attain
simpler code because the special case of an "invalid" object does not need
to be considered. I.e., values of such types can be kept as constants as
opposed to variables. If an object exists (as equivalent to successful
instantiation), it is valid. With the improved RPC mechanism, the RPC
framework does no longer stay in the way in this respect.
Thanks to Edgard Schmidt for this welcome contribution!
Unification and tightening of session labels
============================================
In Genode, each session requested by a client component is labeled according
to the components that intermediate the session request. The client can
optionally specify a label of choice along with the session request. Its
parent prefixes the client-provided label by a label of its own. If the
session request is further passed to the parent's parent, the grandparent
prepends its own label. This works recursively. Consequently, the final label
as seen by the server is the product of the labeling policies of all
components on the route of the session request.
The label is used for two purposes. First, the server uses the label as
a key for a server-side policy selection. E.g., depending on the session label
received by the disk-partition server, the server decides which partition to
hand out to the client. Second, the label is used by intermediate components
to take session-routing decisions. E.g., based on the label of a file-system
session request, a parent component may route the request to one of several
file-system servers.
Originally, Genode did not impose a specific way of how labels are formed.
It was up to each intermediate component to filter the label of a session
request in any way desired. However, in practice, this freedom remained unused
and the very simple successive prefixing of labels prevails in all our use
cases. Each intermediate node concatenates its own label in front of the label
supplied by the originator of the session request. The different parts of the
label are separated with the character sequence '" -> "'. Some corner cases
were handles specially for aesthetic reasons. For example, if a client
provided no label, the parent would skip the pending separator. That said,
since each intermediate component had to provide the labeling policy, not all
components were consistent in these respects. Since we found no use for
arbitrary labeling policies, we decided to make the only prominent way of
session labeling mandatory for all intermediate components. We thereby removed
the aesthetically motivated corner cases and possible ambiguities. I.e., with
the original policy, it was not possible to distinguish a unlabeled session
requested by a client from a labeled session requested by the client's parent.
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).
Transition to new framework API
===============================
Since we fundamentally revised Genode's API in
[https://genode.org/documentation/release-notes/16.05#The_great_API_renovation - version 16.05],
we gradually adapt our existing components. Given that Genode comes with
over 300 components, this is no small feat. But with 30 percent of the
components converted, we already made substantial progress.
In some respects, the conversion is actually nearly complete. In particular,
the move away from format-string-based text output to our new type-safe output
facility has been applied to almost all components now. The former 'PDBG'
macro that is quite useful for temporary debug messages has been replaced with
a new version that must be manually included via the _base/debug.h_ header
file. Like the regular log functions, the new PDBG facility uses the type-safe
text-output facility.
Minor API adjustments
---------------------
While applying Genode's new API, we refined the API in the following respects:
We added a dedicated 'String' constructor overload to better accommodate
string literals. This overload covers the common case for initializing a
string from a literal without employing the 'Output' mechanism. This way, such
strings can by constructed without calling virtual functions, which in turn
makes the 'String' usable during the self-relocation phase of the dynamic
linker.
Up till now, several Genode components still rely on the use of 'snprintf'
whenever strings must be assembled out of smaller pieces. As we like to shun
format strings from Genode altogether, we needed an alternative mechanism.
Since we introduced the new type-safe text-output facilities in Genode 16.05,
there is an obvious solution: Let the 'String' constructor accept an arbitrary
list of arguments, which are turned into their respective textual
representation and appear concatenated in the resulting string. Consequently,
strings can be assembled with the same flexibility as log output. For the
construction of 'String' objects from character buffers of a known size, the
'Cstring' utility can be used, which takes a 'char const *' and an optional
length as arguments.
Several low-level types received support for the new output facilities, e.g.,
'Xml_node' or the network-related headers in _os/net/_.
In anticipation of the forthcoming package-management infrastructure, we try
to unify Genode's executable binaries across kernels and architectures
wherever reasonable. Of course, the latter is not possible with respect to the
used instructions. But unifying symbol information is deemed worthwhile. For
this reason, we changed the 'Genode::size_t' type to be always defined as an
'unsigned' 'long'. This is in contrast to GCC's built-in '__SIZE_TYPE__',
which is defined as 'unsigned int' on 32-bit architectures but 'unsigned long'
on 64-bit architectures.
OS-level infrastructure and device drivers
##########################################
New timeout-handing API
=======================
The new timeout API offers tools for easily multiplexing a single time
source among different timeouts. In general, the time source can be
implemented individually but we expect that the most prominent use case will
be the multiplexing of timer sessions. Thus, the timeout library also provides
a convenience tool for this use case. A library-usage example can be found
under _os/src/test/timeout_. If you're interested in implementing
your own time source, you can find an example at _os/include/os/timer.h_ .
Support for smart cards
=======================
We ported the [https://pcsclite.alioth.debian.org/pcsclite.html - PC/SC Lite]
library to Genode, which provides a commonly used API for communicating with
smart cards. It supports USB smart card readers, using the
[https://pcsclite.alioth.debian.org/ccid.html - CCID] library as driver.
The CCID driver itself requires [https://libusb.info - libusb] to access the
USB device.
Vanilla PC/SC Lite is structured as a client-server architecture, consisting
of the 'pcscd' daemon, which runs on a privileged user account and manages all
card reader devices, and one or more non-privileged client applications, which
communicate with pcscd to access the card readers. On Genode, pcscd's role as
privileged device manager is not really needed, since the devices can also be
managed using Genode's configuration mechanisms. For this reason, we merged
the part of pcscd which implements the API with the pcsc-lite client library.
In the current state, a Genode application using PC/SC Lite can access a single
card reader device, which is selected using its USB product ID and vendor ID in
the application's configuration and in the policy of the USB driver.
More configuration details can be found in the README files of the PC/SC Lite,
CCID, and libusb libraries in the libports repository and in the accompanying
_smartcard.run_ script.
Libraries and applications
##########################
Time-based password generation
==============================
A time-based one-time password authentication client that adheres to the
Google Authenticator standard has been introduced into the
[https://github.com/genodelabs/genode-world - world repository].
Single use, time-based passwords are commonly used as an additional
authentication step for web-based services. In this scheme, a user generates
and presents a six digit passcode to a service generated using a shared secret
and a timestamp. This short passcode length makes manual entry convenient so
that the shared secret may be stored on a separate device than the service
client, such as a smartphone, layering the security properties of both
devices.
The 'gtotp' VFS plugin provides these passcodes by embedding the generator as
a special file in the file-system layer of a component. This approach provides
readily available passcodes for programmatic and manual use without enlarging
the code base to encompass a GUI, command-line, or networked interface.
At the time of this release, the common use case is to manually retrieve codes
for clients running in VirtualBox by reading special files with an isolated
instance of the Noux runtime. Storing the shared secret on the same device
contradicts the recommendations of the standard but the trade-off is that the
software stack required to host the shared secret is significantly smaller
than that found on a mobile device.
Random number generator testing
===============================
No random number generator can be proved to be good, but empirical statistical
tests can prove that some are bad. A port of the TestU01 RNG test suite is
provided in the world repository. The TestU01 batteries give independent
assurance of the fitness of Genode's CPU jitter based RNG and are available
for testing future physical and non-phyical RNGs.
VirtualBox on top on the NOVA hypervisor
########################################
Both VirtualBox-based virtual machine monitors on Genode got updated to the
latest revision as provided by Oracle, namely 4.3.40 and 5.1.10 - mainly to
stay close to the upstream versions.
Platforms
#########
Unified handling of boot modules
================================
Until now, the way of passing boot modules from the boot procedure to the core
component, which core provides as ROM modules, varied from platform to
platform. Either we used a multiboot-compliant bootloader that accepts
multiple modules, or the platform provided some specific way of linking binary
modules together with the kernel, e.g., the Elfweaver tool of OKL4.
By unifying the boot-module handover, we further reduce platform specific core
code. Thereby, maintenance costs are decreased, and code analysis becomes
easier. With this new solution, when issuing to build the core component:
! make core
within the build system, only a core library gets built. Not until all
binaries needed by a run-script are available, a final image is linked
together using the core library and all additional binaries. The core
component now can access its ROM modules directly via addresses contained in
its binary. As a side effect of this change, there is no core binary in the
'bin' or 'core' directory of the corresponding build directory available
anymore. Instead, you will find the core binary with no ROM modules, but
including debug information under 'var/run/*.core' within your build
directory. The concrete name depends on the name of the run-script.
The new approach is used on all platforms except Linux where the ROM modules
still need to be accessed via the file-system.
NOVA hypervisor
===============
We extended the kernel to support the asynchronous delegation of kernel
resources. Up to now, resources could only be delegated during RPC or during
the initial protection-domain construction. With this extension, the
construction and setup of new protection domains, threads, and especially
virtual CPUs for the VirtualBox VMM became more straightforward and several
quirks inside the 'core' component could be dropped. The added kernel syscall
expects the NOVA-kernel capabilities of the source and target protection
domains, which effectively renders the operation solely available to 'core' -
as only holder of the NOVA protection domain capabilities.
Additionally, we changed the CPU ID enumeration in Genode/NOVA to a
predictable order. The lower CPU IDs used via the Genode 'Cpu_session'
interface now correspond to the first hyper-thread of all physical CPU cores.
For example, on a quad-core machine with hyper-threading enabled Genode's CPU
IDs 0-3 refer to the first hyper-threads of all physical cores and IDs 4-7 to
the second hyper-threads.

1033
doc/release_notes/17-05.txt Normal file

File diff suppressed because it is too large Load Diff

651
doc/release_notes/17-08.txt Normal file
View File

@@ -0,0 +1,651 @@
===============================================
Release notes for the Genode OS Framework 17.08
===============================================
Genode Labs
The flagship feature of Genode 17.08 has been in the works for more than a
year: The support for hardware-accelerated graphics on Intel Gen-8 GPUs. This
is an especially challenging topic because it is riddled with terminology,
involves highly complex software stacks, carries a twisted history with it,
and remains to be a moving target. It took up a lot of patience to build up a
profound understanding of the existing driver architectures and the mechanisms
offered by modern graphics hardware. On the other hand, with the proliferation
of hardware-based sandboxing features like virtual GPU memory and hardware
contexts, we found that now is the perfect time for a clean-slate design of a
microkernelized GPU driver.
Section [Hardware-accelerated graphics for Intel Gen-8 GPUs] introduces this
work, which includes our new GPU multiplexer as well as the integration with
the client-side Mesa protocol stack.
The second focus of the current release is the extension of Genode's supported
base platforms. Most prominently, we upgrade the seL4 kernel to version 6.0
while extending the architecture support from 32-bit x86 to ARM and 64-bit
x86 (Section [The seL4 kernel on ARM and 64-bit x86 hardware]). To bring
Genode closer to cloud-computing scenarios, we added basic support for
executing Genode scenarios as Xen DomU domains (Section [Genode as Xen DomU]).
Furthermore, the Muen separation kernel has been updated to a current version.
As a cross-kernel effort, there is work under way to boot Genode-based
systems via UEFI, currently addressing the NOVA, base-hw, and seL4 kernels.
Among the many other functional additions are a new VFS plugin for accessing
FAT file systems, new components like _sequence_ and _fs_report_ that aid new
system compositions, and our evolving custom package-management
infrastructure.
Hardware-accelerated graphics for Intel Gen-8 GPUs
##################################################
The ability to leverage hardware-accelerated graphics is generally taken for
granted in modern commodity operating systems. The user experience of
modern desktop environments, web-browser performance, and obviously games
depend on it. On the other hand, the benefit of hardware-accelerated graphics
comes at the expense of tremendous added complexity in the lower software
stack, in particular in system components that need to be ultimately trusted.
For example, with circa 100 thousand lines of code, the Intel GPU driver in
the Linux kernel is an order of magnitude more complex than a complete modern
microkernel. In a monolithic-kernel-based system, this complexity is
generally neglected because the kernel is complex anyway. But in
microkernel-based scenarios optimized for a trusted computing base in the
order of a few ten thousand lines of code, it becomes unacceptable.
Fortunately, recent generations of graphics hardware provide a number of
hardware features that promise to solve this conflict, which prompted us to
investigate the use of these features for Genode.
During this year's Hack'n'Hike event, we ported the ioquake3 engine to Genode.
As preliminary requirement, we had to resurrect OpenGL support in our aging
graphics stack and enable support for current Intel HD Graphics devices (IGD).
We started by updating Mesa from the old 7.8.x to a more recent 11.2.2 release.
Since we focused mainly on supporting Intel devices, we dropped support for the
Gallium back end as Intel still uses the old DRI infrastructure. This decision,
however, also influenced the choice of the software rendering back end. Rather
than retaining the softpipe implementation, we now use swrast. In addition, we
changed the available OpenGL implementation from OpenGL ES 2.x to the fully
fledged OpenGL 4.5 profile, including the corresponding shader language
version. As with the previous Mesa port, EGL serves as front end API for
system integration and loads a DRI back-end driver (i965 or swrast). EGL
always requests the back-end driver 'egl_drv.lib.so' in form of a shared
object. Genode's relabeling features are used to select the proper back end
via a route configuration. The following snippet illustrates such a
configuration for software rendering:
! <start name="gears" caps="200">
! <resource name="RAM" quantum="32M"/>"
! <route>
! <service name="ROM" label="egl_drv.lib.so">
! <parent label="egl_swrast.lib.so"/>
! </service>
! <any-service> <parent/> <any-child/> </any-service>
! </route>
! </start>
With the graphics-stack front end in place, it was time to take care of the
GPU driver. In our case this meant implementing the DRM interface in our
ported version of the Intel i915 DRM driver. Up to now, this driver was solely
used for mode setting while we completely omitted supporting the render
engine.
[image mesa_genode]
With this new and adapted software stack, we successfully could play ioquake3
on top of Genode with a reasonable performance in 1080p on a Thinkpad X250.
During this work, we gathered valuable insights into the architecture of a
modern 3D-graphics software stack as well as into recent Intel HD Graphics
hardware. We found that the Intel-specific Mesa driver itself is far more
complex than its kernel counter part. The DRM driver is mainly concerned with
resource and execution management whereas the Mesa driver programs the GPU.
For example, amongst others, Mesa compiles the OpenGL shaders into a
GPU-specific machine code that is passed on to the kernel for execution.
While inspecting the DRM driver, it became obvious that one of the reasons for
its complexity is the need to support a variety of different HD Graphics
generations as well as different features driven by software-usage patterns.
For our security related use cases, it is important to offer a clear isolation
and separation mechanism per client. Hardware features provided by modern
Intel GPUs like per-process graphics translation tables (PPGTT) and hardware
contexts that are unique for each client make it possible to fulfill these
requirements.
By focusing on this particular feature set and thus limiting the supported
hardware generations, the development of a maintainable GPU multiplexer for
Genode became feasible. After all, we strive to keep all Genode components as
low complex as possible, especially resource multiplexers like such a GPU
multiplexer.
[image intel_gpu_drv]
This image shows multiple GPU-session clients and the resources they are
using. The fence registers as well as the aperture is partitioned between
them, the PPGTT is backed by the system memory, and the contexts are located
in disjoint GGTT regions.
Within four months, we implemented an experimental GPU multiplexer for Intel
HD Graphics Gen8 (Broadwell class) devices. We started out defining a GPU
session interface that is sufficient to implement the API used by the DRM
library. For each session, the driver creates a context consisting of a
hardware context, a set of page tables (PPGTT), and a part of the aperture.
The client may use the session to allocate and map memory buffers used by the
GPU. Each buffer is always eagerly mapped 1:1 into the PPGTT by using the
local virtual address of the client. Special memory buffers like an image
buffer are additionally mapped through the aperture to make use of the
hardware-provided de-tiling mechanism. As is essential in Genode components,
the client must donate all resources that the driver might need to fulfill the
request, i.e., quota for memory and capability allocations. Clients may
request the execution of their workload by submitting an execution buffer. The
GPU multiplexer will then enqueue the request and schedule all pending
requests sequentially. Once the request is completed, the client is notified
via a completion signal.
[image multi_gl]
Example scenario of multiple OpenGL programs that use the new GPU multiplexer
for hardware-accelerated rendering.
We consider this first version of the GPU driver as experimental. As of now,
it only manages the render engine of the GPU. Mode-setting or rather display
handling must be performed by another component. Currently, the VESA driver is
used for this purpose. It also lacks any power-management functionality and
permanently keeps the GPU awake. Both limitations will be addressed in future
releases and support for Gen9+ (Skylake) and newer devices might be added.
In its current incarnation, the GPU multiplexer component consists of about
4,200 lines of code whereas the Mesa DRI i965 driver complements the driver at
the client side with about 78,000 lines of code.
The seL4 kernel on ARM and 64-bit x86 hardware
##############################################
With the 16.08 release, we brought the seL4 support to a level to be
considered being on par with the other supported kernels. At the time,
Genode's use of seL4 was limited to 32-bit x86 platforms.
In the current release, we extend the platform support to ARM and 64-bit x86.
We started this line of work with an incremental kernel upgrade from version
3.2.0 to 5.2.0 and finally to seL4 6.0. Through these upgrades, we were able
to drop several Genode-specific seL4 patches, which were required in the 16.08
release. One major improvement of version 6.0 compared to earlier versions is
the handling of device-memory announcements by the kernel to Genode's roottask
_core_.
With the kernel update in place, we inspected the x86-specific part thoroughly
while splitting and separating it properly into architecture-agnostic and
architecture-dependent parts. Upon this work, we added the
architecture-specific counterparts for x86_64 and ARM. One major work item was
to make the page-table handling in Genode's core aware and generic enough to
handle the different page-table sizes of the three architectures.
For the ARM support, we decided to enable the i.MX6 FreeScale based SoC,
namely the Wandboard Quad board. Since the seL4 kernel interface provides no
timeout support, we revived a user-level timer driver that we originally
developed for our custom base-hw kernel: The so-called EPIT timer, which is
part of most i.MX SoCs.
We finished the essential work for the mentioned three platforms in
less time than expected and, thereby, had spare time to address additional
features.
First, we enabled multiprocessor support for Genode/seL4 on x86 and
thread-priority support for all seL4 platforms. Additionally, we were able to
utilize the seL4 benchmark interface for Genode's trace infrastructure in
order to obtain utilization information about threads and CPUs. The Genode
components _top_ (text-based) and _cpu_load_monitor_ (graphical) are now
usable on Genode/seL4.
Finally, as we are currently exploring the support for booting various kernels
via UEFI on x86, we took the chance to investigate the steps needed to boot
seL4 via UEFI. UEFI firmware does not always provide a compatibility support
module (CSM) for legacy BIOS boot support. Hence, we extended the seL4 kernel
for Genode according to the Multiboot2 specification, which enables us to
start Genode/seL4 together with GRUB2 - as an UEFI capable bootloader - on
machines missing CSM support.
Base framework and OS-level infrastructure
##########################################
Simplified IOMMU handling
=========================
When IOMMUs are used on x86, all host memory targeted via direct memory
accesses (DMA) by devices must eagerly be registered in the respective I/O
page table of the device. Up to now, Genode supports IOMMUs on NOVA only. On
this kernel, a device protection domain is represented as a regular protection
domain with its virtual memory layout being used for both the CPU's MMU and
the device. Traditionally, mappings into such virtual memory spaces are
inserted on demand as responses to page faults. However, as there are no page
faults for DMA transactions, DMA buffers must always be eagerly mapped. The
so-called device PD hid this gap for NOVA. In anticipation of adding IOMMU
support for more kernels, we desired to generalize the device-PD mechanism by
introducing an explicit way to trigger the insertion of DMA memory into the
proper page tables.
We extended the PD-session interface by a 'map' function, which takes a
virtual memory region of the PD's virtual address space as argument. The page
frames of the previously attached dataspaces are added eagerly by core to the
IOMMU page-tables. With this explicit 'map' support, we were able to replace
the Genode/NOVA-specific device-PD implementation with a generic one, which
will easily accommodate other kernels in the future.
New report server for capturing reports to files
================================================
The report session is a simple mechanism for components to publish structured
data without the complexity of a file-system layer. In the simplest case, a
client component will produce a report and communicate it directly to a
component acting as a server. The disadvantage is that the report client
becomes reliant on the liveliness and presence of the consumer component. So
in the more robust case, the _report_rom_ component acts as the server hosting
the report service as well as a ROM service for components consuming reports.
The _report_rom_ server permits ROM access only to clients matching an
explicit configuration policy. This is good for security but opaque to a user.
Reports can only be read where an explicit policy is in place and only a
single report session can report to an active ROM session.
The new _fs_report_ component is a friendlier and more flexible report server.
Reports are written to a file system using a file and directory hierarchy that
expresses session routing. This allows for intuitive report inspection and
injection via a file system. When used with the _ram_fs_ and _fs_rom_ servers,
it can also replicate the functionality of _report_rom_.
New runtime environment for starting components sequentially
============================================================
The _init_ component is a prime example of software with an emphasis on
function over features. It is the fundamental building block for combining
components yet its behavior is simple and without heuristics. Like other
contemporary init managers, it starts components in parallel, but to a more
extreme degree in that it has no concept of "runlevels" or "targets", all
components are started as soon as possible. The concrete sequence of execution
is instead determined by when server components make service announcements and
how quickly they respond to client requests.
In some cases, the execution of one component must not occur until the
execution of another component ends, be it that the first produces output that
is consumed by the second, or that the two contend for a service that cannot
be multiplexed. Init contains no provisions to enforce ordering. But we are
free to define new behaviors in other management components.
The solution to the problem of ordering is the _sequence_ component. Sequence
walks a list of children and executes them in order, one at a time. With only
one child active, there is no need for any local resource or routing
management. By applying the same session label transformations as init,
external routing and policy handling are unchanged.
An example of ordering a producer and consumer within an init configuration
follows:
! <start name="sequence">
! <resource name="RAM" quantum="128M"/>
! <config>
! <start name="producer">
! <config .. />
! </start>
! <start name="consumer">
! <config .. />
! </start>
! </config>
! <route>
! <service name="LOG" label_prefix="producer">
! <child name="log_a"/> </service>
! <service name="LOG" label_prefix="consumer">
! <child name="log_b"/> </service>
! <any-service> <parent/> <any-child/> </any-service>
! </route>
! </start>
Support for boot-time initialized frame buffer
==============================================
UEFI-based systems do not carry along legacy BIOS infrastructure, on which
our generic VESA driver depends. Hence, when booting via UEFI, one has to use
either a hardware-specific driver like our Intel-FB driver or - alternatively -
facilitate generic UEFI mechanisms.
Instead of booting in VGA text mode and leaving the switch to a graphics mode
(via real-mode SVGA BIOS subroutines) to the booted OS, UEFI employs the
so-called graphics output protocol as a means to setup a reasonable default
graphics mode prior booting the operating system. In order to produce
graphical output, the operating system merely has to know the physical address
and layout of the frame buffer. Genode's core exposes this information as the
_platform_info_ ROM module. The new _fb_boot_drv_ driver picks up this
information to provide a Genode framebuffer session interface. Hence, on
UEFI-based systems, it can be used as a drop-in replacement for the VESA
driver. In contrast to the VESA driver, however, it is not able to switch
graphics modes at runtime.
The new component is located at _os/src/drivers/framebuffer/boot/_. Thanks
to Johannes Kliemann for this contribution.
Extended non-blocking operation of the VFS
==========================================
In
[https://genode.org/documentation/release-notes/17.02#VFS_support_for_asynchronous_I_O_and_reconfiguration - version 17.02],
we added support for non-blocking reads from the VFS in the form of the
'read_ready()', 'queue_read()', and 'complete_read()' functions. Since then,
it has become obvious that blocking within the VFS is not only problematic in
the VFS server itself when multiple clients are connected, but also when the
VFS is deployed in a multi-threaded environment and a VFS plugin needs to
reliably wait for I/O-completion signals.
For this reason, we reworked the interface of the VFS even more towards
non-blocking operation and adapted the existing users of the VFS accordingly.
The most important changes are:
* Directories are now created and opened with the 'opendir()' function and
the directory entries are read with the 'queue_read()' and 'complete_read()'
functions.
* Symbolic links are now created and opened with the 'openlink()' function and
the link target is read with the 'queue_read()' and 'complete_read()'
functions and written with the 'write()' function.
* The 'write()' function does not wait for signals anymore. This can have the
effect that data written by a VFS library user has not been processed by a
file-system server when the library user asks for the size of the file or
closes it (both done with RPC functions at the file-system server). For this
reason, a user of the VFS library should request synchronization before
calling 'stat()' or 'close()'. To make sure that a file-system server has
processed all write request packets that a client submitted prior the
synchronization request, synchronization is now requested at the file-system
server with a synchronization packet instead of an RPC function. Because of
this change, the synchronization interface of the VFS library has been split
into the 'queue_sync()' and 'complete_sync()' functions.
Making block sessions read-only by default
==========================================
Genode server components are expected to apply the safest and strictest
behavior when exposing cross-component state or persistent data. In practice
block and file-system servers only allow access to clients with explicitly
configured local policies. The file-system servers enforce an additional
provision that sessions are implicitly read-only unless overridden by policy.
This release introduces a similar restriction to the AHCI driver and partition
multiplexer. Clients of these servers require an affirmative 'writeable'
attribute on policies to permit the writing of blocks. Write permission at
these servers may also be revoked by components that forward block-session
requests by placing 'writeable="no"' into session-request arguments.
All users of _ahci_drv_ and _part_blk_ are advised that this change may break
existing configurations without explicit 'writeable' policies.
Refined time handling
=====================
Release 17.05 introduced a
[https://genode.org/documentation/release-notes/17.05#New_API_for_user-level_timing - new API for user-level timing]
named _timeout framework_. Together with this new framework came a
comprehensive test that stresses all aspects of the interface. During the past
few months, this test has turned out to be an enrichment for Genode far beyond
its original scope. As the test significantly raised the standards in
user-level timing, it also sharpened our view on the measurement precision of
various timer drivers and timestamps, which act as input for the framework.
This revealed several problems previously unidentified. For instance, we
improved the accuracy and stability of the time values provided by the drivers
for the Raspberry-Pi timer, the Cortex-A9 timer, the PIT, and the LAPIC. We
also were able to further optimize the calibration of the TSC in the NOVA
kernel.
Additionally, the test also helped us to refine the timeout framework itself.
The initial calibration of the framework - that previously took about 1.5
seconds - is now performed much quicker. This makes microseconds-precise time
available immediately after the timer connection switched to the modern
fine-grained mode of operation, which is a prerequisite for hardware drivers
that need such precision during their early initialization phase. The
calculations inside the framework also became more flexible to better fit the
characteristics of all the hardware and kernels Genode supports.
Finally, we were able to extend the application of the timeout framework. Most
notably, our C runtime uses it as timing source to the benefit of all
libc-using components. Another noteworthy case is the USB driver on the
Raspberry Pi. It previously couldn't rely on the default Genode timing but
required a local hardware timer to reach the precision that the host
controller expected from software. With the timeout framework, this workaround
could be removed from the driver.
FatFS-based VFS plugin
======================
Genode has supported VFAT file-systems since the 9.11 release when the
[http://elm-chan.org/fsw/ff/00index_e.html - FatFS] library was first ported.
The 11.08 release fit the library into the libc plugin architecture and
in 12.08 FatFS was used in the _ffat_fs_ file-system server. Now, the 17.08
release revisits FatFS to mold the library into the newer and more flexible
VFS plugin system. The _vfs_fatfs_ plugin may be fitted into the VFS server or
used directly by arbitrary components linked to the VFS library. As the
collection of VFS plugins in combination with the VFS file-system server has a
lower net maintenance cost than multiple file-system servers, the _ffat_fs_
server will be retired in a future release.
Enhanced GUI primitives
=======================
Even though we consider Qt5 as the go-to solution for creating advanced
graphical user interfaces on top of Genode, we also continue to explore an
alternative approach that facilitates Genode's component architecture to an
extreme degree. The so-called menu-view component takes an XML description of
a dialog as input and produces rendered pixels as output. It also gives
feedback to user input such as the hovered widget at a given pointer position.
The menu view does not implement any application logic but is meant to be
embedded as a child component into the actual application. This approach
relieves the application from the complexity (and potential bugs) of widget
rendering. It also reinforces a rigid separation of a view and its underlying
data model.
The menu view was first introduced in
[https://genode.org/documentation/release-notes/14.11#New_menu_view_application - version 14.11].
The current release improves it in the following ways:
* The new '<float>' widget aligns a child widget within a
larger parent widget by specifying the boolean attributes 'north', 'south',
'east', and 'west'. If none is specified, the child is centered. If opposite
attributes are specified, the child is stretched.
* A new '<depgraph>' widget arranges child widgets in the form of a
dependency graph, which will be the cornerstone for Genode's upcoming
interactive component-composition feature. As a prerequisite for
implementing the depgraph widget, Genode's set of basic graphical primitives
received new operations for drawing sub-pixel-accurate anti-aliased lines
and bezier curves.
* All geometric changes of the widget layout are animated now. This includes
structural changes of the new '<depgraph>' widget.
[image depgraph]
The menu-view component is illustrated by the run script at
_gems/run/menu_view.run_.
C runtime
=========
The growing number of ported applications used on Genode is accompanied by the
requirement of extensive POSIX compatibility of our C runtime. Therefore, we
enhanced our implementation by half a dozen features (e.g., O_ACCMODE
tracking) during the past release cycle. We thank the contributors of patches
and test cases and will continue our efforts to accommodate more ported
open-source components in the future.
Libraries and applications
##########################
Mesa adjustments
================
The Mesa update required the adaption of all components that use OpenGL.
In particular that means the Qt5 framework. Furthermore, we also enabled
OpenGL support in our SDL1 port.
As playground, there are a few OpenGL examples. The demos are located under
_repos/libports/src/test/mesa_demos_, which use the EGLUT bindings. There
are also some SDL based examples in the world repository under
_repos/world/src/test/sdl_opengl_.
Package management
==================
The previous release featured the initial version of Genode's
[https://genode.org/documentation/release-notes/17.05#Package_management - custom package-management tools].
Since then, we continued this line of work in three directions.
First, we refined the depot tools and the integration of the depot with our
custom work-flow ("run") tool. One important refinement is a simplification of
the depot's directory layout for library binaries. We found that the initial
version implied unwelcome complexities down the road. Instead of placing
library binaries in a directory named after their API, they are now placed
directly in the architecture directory along with regular binaries.
Second, driven by the proliferated use of the depot by more and more run
scripts, we enhanced the depot with new depot recipes as needed.
Third, we took the first steps to use the depot on-target. The experimentation
with on-target depots is eased by the new 'create_tar_from_depot_binaries'
function of the run tool, which allows one to assemble a new depot in the form
of a tar archive out of a subset of packages. Furthermore, the new
_depot_query_ component is able to scan an on-target depot for runtime
descriptions and returns all the information needed to start a subsystem based
on the depot content. The concept is exemplified by the new
_gems/run/depot_deploy.run_ script, which executes the "fs_report" test case
supplied via a depot package.
Platforms
#########
Genode as Xen DomU
==================
We want to widen the application scope of Genode by enabling users to easily
deploy Genode scenarios on Xen-based cloud platforms.
As a first step towards this goal, we enhanced our run tool to support running
Genode scenarios as a local Xen DomU, managed from within the Genode build
system on Linux running as Xen Dom0.
The Xen DomU runs in HVM mode (full virtualization) and loads Genode from an
ISO image. Serial log output is printed to the text console and graphical
output is shown in an SDL window.
To use this new target platform, the following run options should be defined in
the 'build/x86_*/etc/build.conf' file:
! RUN_OPT = --include boot_dir/$(KERNEL)
! RUN_OPT += --include image/iso
! RUN_OPT += --include power_on/xen
! RUN_OPT += --include log/xen
! RUN_OPT += --include power_off/xen
The Xen DomU is managed using the 'xl' command line tool and it is possible to
add configuration options in the 'xen_args' variable of a run script. Common
options are:
* Disabling the graphical output:
! append xen_args { sdl="0" }
* Configuring a network device:
! append xen_args { vif=\["model=e1000,mac=02:00:00:00:01:01,bridge=xenbr0"\] }
* Configuring USB input devices:
! append xen_args { usbdevice=\["mouse","keyboard"\] }
Note that the 'xl' tool requires super-user permissions. Interactive
password input can be complicated in combination with 'expect' and is not
practical for automated tests. For this reason, the current implementation
assumes that no password input is needed when running 'sudo xl', which can
be achieved by creating a file '/etc/sudoers.d/xl' with the content
! user ALL=(root) NOPASSWD: /usr/sbin/xl
where 'user' is the Linux user name.
Execution on bare hardware (base-hw)
====================================
UEFI support
------------
Analogously to our work on the seL4 and NOVA kernels in this release, we
extended our base-hw kernel to become a Multiboot2 compliant kernel. When used
together with GRUB2, it can be started on x86 UEFI machines missing legacy
BIOS support (i.e., CSM).
RISC-V
------
With Genode version 17.05, we updated base-hw's RISC-V support to privileged
ISA revision 1.9.1. Unfortunately, this implied that dynamic linking was not
supported on the RISC-V architecture anymore. Since dynamic linking is now
required for almost all Genode applications by default, this became a severe
limitation. Therefore, we revisited our RISC-V implementation - in particular
the kernel entry code - to lift the limitation of being able to execute only
statically linked binaries.
Additionally, we integrated the Berkeley Boot Loader (BBL), which bootstraps
the system and implements the machine mode, more closely into our build
infrastructure. We also added a new timer implementation to base-hw by using
the _set timeout SBI_ call of BBL.
What still remains missing is proper FPU support. While we are building the
Genode tool chain with soft float support, we still encounter occasions where
FPU code is generated, which in turn triggers compile time errors. We will
have to investigate this behavior more thoroughly, but ultimately we want to
add FPU support for RISC-V to our kernel and enable hardware floating point in
the tool chain.
Muen separation kernel
======================
Besides updating the Muen port to the latest kernel version as of end of June,
Muen has been added to Genode's automated testing infrastructure. This
includes the revived support for VirtualBox 4 on top of this kernel.
NOVA microhypervisor
====================
The current release extends NOVA to become a Multiboot2 compliant kernel. Used
together with GRUB2, NOVA can now be started on x86 UEFI machines missing
legacy BIOS support (called CSM).
GRUB2 provides the initial ACPI RSDP (Root System Description Pointer) to a
Multiboot2 kernel. The RSDP contains vital information required to bootstrap
the kernel and the operating system in general on today's x86 machines. To
make this information available to the user-level ACPI and ACPICA drivers, the
kernel propagates the RSDP to Genode's core, which - in turn - exposes it to
the user land as part of the _platform_info_ ROM module.
In order to ease the setup of an UEFI bootable image, we added a new image
module to our run-tool infrastructure. The run option 'image/uefi' can be used
instead of 'image/iso' in order to create a raw image that contains a EFI
system partition in a GUID partition table (GPT). The image is equipped by the
new 'image/uefi' module with the GRUB2 boot loader, a GRUB2 configuration, and
the corresponding Genode run scenario. The final image can be copied with 'dd'
to a bootable USB stick. Additionally, we added support to boot such an image
on Qemu leveraging [https://www.tianocore.org - TianoCore's] UEFI firmware.
As a side project, minor virtualization support for AMD has been added to
Virtualbox 4 and to the NOVA kernel on Genode. This enables us to run a 32-bit
Windows 7 VM on a 32-bit Genode/NOVA host on an (oldish) AMD Phenom II X4 test
machine.

899
doc/release_notes/18-02.txt Normal file
View File

@@ -0,0 +1,899 @@
===============================================
Release notes for the Genode OS Framework 18.02
===============================================
Genode Labs
After being developed for over a decade, Genode remained a mystery for many
people who looked at the project from a distance as it does not seem to fit
any established category of software. In 2018 - declared as the Year of Sculpt
on our [https://genode.org/about/road-map - roadmap] - this will hopefully
change. Genode 18.02 features the first revision of Sculpt, which is a
Genode-based operating system for general-purpose computing. After being used
as day-to-day OS by the entire team of Genode Labs for several months, we feel
that the time is right to share the system with a broader audience (Section
[Sculpt for Early Adopters]).
One fundamental feature of Sculpt is the ability to install and deploy
software from within the running operating system, which is universally
expected from any modern general-purpose OS. Section
[On-target package installation and deployment] presents Genode's unique
take on the topic of software installation and deployment.
Besides Sculpt, the current release has no shortage of other improvements.
Genode's growing arsenal of 3rd-party software received profound updates and
additions, including VirtualBox, Muen, seL4, several GNU packages, and
libraries. Also the user-level networking stack - including the Linux-based
LxIP stack and our custom NIC-router component - received a lot of attention.
Thanks to the added network driver for i.MX-based hardware, this networking
infrastructure becomes usable on embedded platforms based on this SoC.
Furthermore, the current release continues the cultivation of the Nim
programming language for Genode components.
Sculpt for Early Adopters
#########################
The current release features the first revision of Sculpt, which is a
Genode-based operating system for general-purpose computing. This initial
version is called Sculpt for Early Adopters (EA). Its target audience are
enthusiasts who are already familiar with Genode and are eager to use a
Genode-based operating system on their machines. As outlined on the
[https://genode.org/about/road-map - roadmap], later versions will become
increasingly approachable.
[image sculpt_overview]
Please refer to the official
[https://genode.org/documentation/articles/sculpt-ea - Sculpt documentation]
to step right into the adventure.
On-target package installation and deployment
#############################################
In May last year, we introduced the package-management concept for Genode to
pursue two goals. First, to overcome the naturally limited scalability of
composing Genode systems solely from source. This limit became evident in
complex system scenarios that incorporate a huge amount of 3rd party software.
Thanks to the introduced _depot_ concept and its integration in Genode's
workflow - in particular the run tool - the work of system integration became
much more structured (by caring about packages instead of individual build
targets), robust (by avoiding conditions in run scripts), and quick (by the
accelerated test cycle when using pre-built packages).
The second goal is the ability to update and extend a running Genode system on
the fly. We are happy to have reached this goal with the current release. As
exemplified by the Sculpt scenario, packages cannot only be used as building
blocks for system images but also as subsystems dynamically installed and
deployed on target. Even though installation and deployment are closely
related topics, both involve distinct challenges, which allow Genode to shine.
Installation / update
=====================
In traditional operating systems, the installation and update of system
software is the job of privileged programs. For example, a package manager in
a GNU/Linux system is typically executed with root privileges. This is
troublesome because the functionality of such a program is extremely complex.
In particular it is exposed to the network and has to parse content
originating from potentially untrusted parties. Therefore, potential software
vulnerabilities should be expected. However, in modern OSes, these programs
are just assumed to behave correctly. If this overly optimistic assumption
doesn't hold, the entire system is at risk.
Genode helps us to mitigate this problem by modelling each installation step
as a distinct component composition where each component has a well-defined
and extremely narrow role. The installation is an iterative sequence that
is orchestrated by the so-called download-manager component
(Figure [depot_download]).
[image depot_download]
Initially, the download manager receives a list of content to be installed
into the local depot, which is stored on the file system. The depot may
already be populated with (portions of) this content. In the first step, the
download manager must determine the parts that are missing. To do that, it
does not access the file system directly but instead hands over this task to a
disposable helper component called _depot-query_ that is spawned within a
dynamic init instance. This indirection has two benefits. First, the download
manager is not bothered with the complexity of accessing the file system. It
does not even have any notion of files. Second, the download manager is
effectively shielded from the file system. Should the file system misbehave,
the liveliness of the download manager remains unaffected.
[image depot_download_query_deps]
The depot-query component reports its findings to a report session. The report
eventually reaches the download manager as an updated ROM module. Given the
list of missing content, the download manager has to determine the information
of where to obtain the content from and the public key of the content creator.
This information is contained within the depot. So the download manager issues
another request to the depot-query component in order to obtain it.
[image depot_download_query_url]
Once the depot-query component has responded, the download manager knows what
content to get, where to get it, and how to verify it. To download the
content, it changes the dynamic init instance as follows.
[image depot_download_fetch]
The depot-query component is now gone. Actually, the entire depot has moved
out of sight. Instead, a fresh _fetchurl_ component is spawned. This component
is connected to the network as well as the writeable download directory
_public/_. Internally, fetchurl employs a complex software stack, which
includes the C runtime, curl, libssl, and libssh. Hence, we expect this
component to be vulnerable. Since it is facing the network, we assume that
vulnerabilities are exploitable. In the worst case where the component is
completely in the hands of an attacker, it may write wrong content into the
_public/_ location. But compared to executing curl or wget as root on a
traditional Unix system, the reach of an attack is quite limited. For example,
the mere existence of the download manager remains completely out of view of
fetchurl. However, the content of _public/_ must not be trusted. To reinforce
trust in the downloaded content, the content is accompanied with cryptographic
signatures created by the content creator. Before we touch the content, we
first check its authenticity. To perform this verification step, the download
manager reshapes the dynamic init instance as follows.
[image depot_download_verify]
Note that fetchurl exists no more and network connectivity is cut, effectively
disposing any form of malware that might have infected fetchurl. Next a new
_verify_ component enters the picture. It is configured with a list of content
to check, the signatures of the content, and the public key of the content's
presumed creator. Since it accesses the _public/_ location exclusively, it is
not prone to any potential time-of-check to time-of-use problems during the
verification. Under the hood, the _verify_ component employs a hugely complex
implementation based on GnuPG. It would be naive to fully trust this code.
However, when embedded in our scenario, the reach of a bug is limited because
the verify component has no access to any mutable system state. It could
merely give the wrong answer (which is of course bad but there is no way we
can magically solve this).
Knowing that the downloaded content is indeed the same content as intended
by the creator, it is time for extraction. For this step, the download
manager - again - reshapes the dynamic init instance:
[image depot_download_extract]
This time, both the _public/_ location as well as the trusted _depot/_ are
visible and a new _extract_ component is spawned. As the depot may host
content from multiple sources, which potentially distrust each other, the
content of each content provider resides in a dedicated subdirectory within
the depot. Instead of handing over access to the entire depot to the extract
tool, we mediate the file-system access via a _chroot_ component that limits
the view to the depot-provider's respective subdirectory. In the worst case
where a misbehaving content provider delivers a forged (but correctly signed)
archive to exploit a vulnerability of the extract component, the reach of the
attack remains limited to the content provider's space within the depot.
After the extraction step has completed, the depot is populated with the new
content, which may - in turn - include new dependency information. At this
point, the download manager starts a new iteration. This iterative process
terminates as soon as the depot-query component signals that no content of
the software installation is missing.
The bottom line here is that we are able to use complex and useful software
like curl, libarchive, liblzma, and GnuPG while largely distrusting it. In
contrast to this software that sums up to hundreds of thousand lines of code,
the download manager comprises less than 1000 lines of code. The software
installation procedure described above is implemented by the 'depot_download'
subsystem hosted in the gems repository and illustrated by an equally named
run script. It also forms the basis of the install/update mechanism of the
Sculpt scenario.
Deployment
==========
Once software has entered the system in the form of depot content, the
remaining question is how to turn this content into running subsystems. The
answer is given by the following illustration.
[image sculpt_deploy_runtime]
Like for the installation process described above, the scenario employs a
dynamic init instance that is accompanied by an orchestrating component. The
latter is called _depot-deploy_. The depot-deploy component queries
information from the depot using the same depot-query component that was used
during the installation. Based on the returned _blueprint_ information for the
to-be-deployed subsystems, it generates the configuration for the dynamic init
instance. The subsystems hosted within this init instance access the depot
content via mere ROM sessions as provided by the FS-ROM component. This makes
the use of the depot transparent to the hosted subsystems.
The depot-deploy component is located in the gems repository and accompanied
by a same-named run script. More importantly, it is featured in the deploy
runtime of the Sculpt system.
Base framework and OS-level infrastructure
##########################################
Increased default warning level
===============================
For building Genode components written in C++, the compiler
flags -Wextra, -Weffc++, and -Werror are now enabled in addition
to -Wall by default.
If this strict warning level is inapplicable for a given component or
library, it is possible to explicitly disable the strictness in the
respective build-description file by adding the following line:
! CC_CXX_WARN_STRICT =
We adjusted almost all the code of the base, base-<kernel>, os, and demo
repositories to comply with this new warning level. For most components
hosted in the higher-level repositories (libports, ports, dde_*, gems),
the strictness is disabled as of now and will be enabled component-wise
wherever feasible.
While adjusting our code base, we identified the following patterns worth
mentioning:
* A class with virtual functions can no longer publicly inherit base
classes without a vtable. The inherited object may either be moved
to a member variable, or inherited privately. The latter would be
used for classes that inherit 'List::Element' or 'Avl_node'. In order
to enable the 'List' and 'Avl_tree' to access the meta data, the
'List' must become a friend.
* Instead of adding a virtual destructor to abstract base classes,
we inherit the new 'Interface' class, which contains a virtual
destructor. This way, single-line abstract base classes can stay
as compact as they are. The 'Interface' utility resides in
_base/include/util/interface.h_.
* With the new warning level, all member variables must be explicitly
initialized. Basic types may be initialized with '='. All other types
are initialized with braces '{ ... }' or as class initializers. If
basic types and non-basic types appear in a row, it is nice to only
use the brace syntax (also for basic types) and align the braces.
* If a class contains pointers as members, it must now also provide a
copy constructor and assignment operator. In most cases, one
would make them private, effectively disallowing the objects to be
copied. Unfortunately, this warning cannot be fixed by inheriting
our existing 'Noncopyable' class (the compiler fails to detect that
the inheriting class cannot be copied and still gives the error).
For now, we have to manually add declarations for both the copy
constructor and the assignment operator as private class members.
Those declarations should be prepended with a comment like this:
! /*
! * Noncopyable
! */
! Thread(Thread const &);
! Thread &operator = (Thread const &);
In the future, we plan to revisit these occurrences and try to replace
the pointers with references. In the presence of at least one
reference member, the compiler would no longer implicitly generate
a copy constructor. So we could remove the manual declaration.
The following caveats are expected, even if you disable the strictness
in your component:
* If your component has a class called 'Interface', it may collide with
the new 'Genode::Interface' class. You may have to disambiguate the
names.
* The 'Genode::Rpc_client' is no longer a 'Genode::Capability'. Hence,
classes inherited from 'Genode::Rpc_client' cannot refer to a
'Capability' but must refer to 'Genode::Capability'.
* The 'Surface' class is no longer copyable, which led to API
changes of users of this class. E.g., the 'Nitpicker_buffer'
utility does no longer offer accessors for the contained surfaces
but a new 'apply_to_surface' method that takes a lambda function as
argument.
Init
====
Init selects session routes based on the requested service and the client's
label. The latter can be matched as 'label' (exact match), 'label_prefix', or
'label_suffix' (either end of the label matches). With the new version, these
options are complemented with an additional 'label_last' attribute that covers
the prominent case where the last part of the label identifies a requested
resource at the server. A typical example is the routing of a ROM session
based on the name of the requested ROM module.
Reflecting the core log to the application level
================================================
Core records now log messages in a ring buffer and exports this
memory as ROM named 'core_log'. User applications may monitor this ring buffer
and present or transfer the content as appropriate. The example component in
_repos/os/src/app/log_core_ transforms the content into normal log
messages, which may be routed to graphical terminals or stored on
file systems, e.g. by using the fs_log server.
NIC-router improvements
=======================
During the past three months, the NIC router has received several improvements
that were mainly inspired by our daily experience with the component as part
of our Sculpt based working environments.
The most notable new feature is the support for multiple NIC sessions at one
domain. If multiple NIC-session clients connect to one domain, the NIC router
acts as a simple hub between them. I.e., for every packet that is routed to
the domain, each connected session receives a copy of the packet. The same
applies for domain-local packets, meaning packets that target an IP address
inside the IP subnet of the domain they came from. This domain-local
forwarding applies before considering any other routing rules. So, in other
words, it is not possible to route such traffic to another domain.
Furthermore, the logging features of the NIC router were improved. First, the
router is now capable of periodically sending a report via Genode's report
session. This can be activated by adding the new '<report>' node to the router
configuration:
! <config>
! <report interval_sec="5" bytes="yes" config="yes">
! ...
! </config>
So far, the report provides per-domain information about the amount of sent
and received data ('bytes' attribute) and the current IPv4 configuration like
IP address, subnet mask, and gateway address ('config' attribute).
Second, there is a new verbosity option in the '<config>' node:
! <config verbose_domain_state="yes">
When this option is set, the NIC router will output a short message to the log
for each general state change of a domain. Currently, this includes the
IP-configuration state (IP address, subnet mask, gateway address) and the
number of connected NIC sessions. This is a useful addition because the
purpose of the regular verbose option is to give a very deep insight into
almost every activity of the router, which is vital for debugging
sophisticated problems but normally floods the log. Therefore, the regular
verbose option is not viable for complex setups like a Sculpt desktop
environment. In such a context, the new domain-state verbosity is pretty
discreet but already gives a good hint on why, for instance, packets get
dropped despite the routing rules being correct.
Last but not least, the timeout configuration of the NIC router has been
reworked and now allows for a much more precise adaption to the network
environment. The former 'rtt_sec' attribute of the '<config>' node has been
replaced by the following new attributes (default values shown):
! <config dhcp_discover_timeout_sec="10"
! dhcp_request_timeout_sec="10"
! dhcp_offer_timeout_sec="10"
! udp_idle_timeout_sec="30"
! tcp_idle_timeout_sec="600"
! tcp_max_segm_lifetime_sec="30">
Details about the new attributes can be found in the
_os/src/server/nic_router/README_ file. The default values should be
appropriate for the common use case so that specifying them is normally not
necessary.
New watch mechanism for file-system session
===========================================
The file-system session already provided a way for watching files or
directories for changes. However, the original mechanism was arguably hard to
use. In addition to opening the to-be-watched file-system node, the client had
to submit a so-called content-changed request into the session's request
queue. In turn, the server delivered the change notification by acknowledging
this request.
The new mechanism is much less bureaucratic. A file or directory can be
watched by opening a watch handle rather than submitting a 'CONTENT_CHANGED'
packet to the server. Whenever a change happens at a node with an open watch
handle, a CONTENT_CHANGED packet will be sent from the server to the client.
This serializes the registration with other handle operations and separates
I/O handle state from notification handle state.
C runtime
=========
We changed libc's handling of 'clock_gettime' to be explicitly configurable
rather than relying on built-in heuristics. With the new version, the libc
opens a timer session as a time source only if the 'rtc' attribute of the
'<libc>' configuration node is defined. If not configured, 'clock_gettime'
returns 0.
This change may require the adjustment of components that implicitly rely on
the libc as time source. To enable such a component to use relative time
(based on a timer session) but no wall-clock time, one can manually provide a
pseudo real-time clock value as follows:
! <vfs>
! <dir name="dev">
! <log/> <null/> <inline name="rtc">2000-01-01 00:00</inline>
! </dir>
! </vfs>
! <libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
GUI stack and terminal improvements
===================================
Nit-FB improvements
-------------------
The nit_fb component provides a framebuffer and input service while using the
nitpicker GUI server as back end. The new version adds the 'initial_width' and
'initial_height' attributes, which accommodate the use case where nit_fb is
used in a dynamic fashion like as a client of a window system. Here, the
initial dimensions define the initial window size but - in contrast to the
existing 'width' and 'height' attributes - the actual size can change
afterwards.
Terminal resizing
-----------------
The terminal-session interface gained the ability to propagate resize events
from the server to the client. The new version of the graphical terminal uses
this mechanism to support window resizing as well as dynamically changing the
font size. At the client side, noux has become able to reflect terminal-size
changes to noux applications. Applications based on ncurses (e.g., vim) are
able to gracefully respond to such changes now.
Using chroot to enforce read-only file-system access
====================================================
By placing a chroot component in-between a file-system client and server, the
client's view on the file system can be limited to a specific directory. With
the current release, chroot can additionally be used to restrict a writeable
file-system session to become read-only. This is accomplished by the new
'writeable' attribute of chroot's policy nodes. By default, it is set to "no".
API changes
===========
Noncopyable AVL node/tree
-------------------------
Copying an AVL node generally violates the integrity of the corresponding
tree. To rule out subtle bugs where AVL nodes are accidentally copied, AVL
nodes are no longer copyable.
New 'Buffered_xml' utility
--------------------------
The 'Buffered_xml' utility located at _os/buffered_xml.h_ simplifies the
implementation of dynamically reconfigurable components that need to keep a
verbatim copy of certain parts of their configuration during configuration
updates.
New 'List_model' utility
------------------------
More and more components respond to dynamic configuration updates. For most
components, such updates are quite simple: replace an old internal state by a
new one. But in cases like init, menu_view, or window decorator, a
differential update is in order. Until now, each of these components employed
custom code for this task. As this code is not trivial, a common solution is
preferable. This solution comes in the form of the new 'List_model' utility
located at _base/include/util/list_model.h_. It introduces a light-weight
formalism to feed a component-internal data model from an externally-provided
XML structure.
Dynamically expandable reporter utility
---------------------------------------
In many cases, components that generate reports don't explicitly handle the
situation where the default buffer size of 4096 bytes is exceeded by the
report. This problem is easy to miss because reports are often small at
testing time but become larger when deployed in complex scenarios. In most
cases, the best way to handle an 'Xml_generator::Buffer_exceeded' exception is
upgrading the report session. The new 'Expanding_reporter' that accompanies
the original 'Reporter' in _os/reporter.h_ eases the handling of this common
case.
Languages and runtime environments
##################################
Nim programming language
========================
A new Nim library for constructing Genode servers is now available in the
World repository. This module provides utilities for the asynchronous
session-creation procedure introduced in the
[https://genode.org/documentation/release-notes/16.11#New_session-creation_procedure - 16.11]
release. Some introductory code snippets are provided here for the
adventurous.
An example of server creation using the 'genodeservers' module:
! import romclient, genodeservers
!
! var
! sessionsRom = newRomClient "session_requests"
! # synchronously open a ROM client to the parent
! romContent = sessionsRom.stream.readAll()
! # copy the ROM content to a heap string
! requestsParser = initSessionRequestsParser(romContent)
! # a state machine for parsing 'session_requests' XML
!
! for id, service, label in requestsParser.create:
! # the `create` iterator provider for the parser
! # hides the details of parsing the XML data
! discard txBufSize = requestsParser.argInt "tx_buf_size"
! # extract typed session arguments from the current parser state
! discard label.lastLabelElement()
! # label handling utilities are provided
! if service == "MyService":
! myCreateSessionProc(id, label)
!
This module streamlines the handling of session metadata, but the developer
must still provide hand-crafted wrappers over the C++ methods for managing
RPC objects and passing session capabilities to the parent. Most notoriously
a global pointer symbol, `genodeEnv`, is used to expose the component
environment object. In the future, this will be replaced by a typed object
passed from runtime to an application entry procedure.
! type MySessionCapability {.
! importcpp: "My_session::Session_capability",
! header: "my_session/capability.h".}
! # import a capability type
!
! type MyNativeSessionBase {.
! importcpp: "My_session::Session_rpc_object",
! header: "my_session/rpc_object.h".}
! # import C++ session RPC object
!
! type MyNativeSession = Constructible[MyNativeSessionBase]
! # apply the C++ Constructible template to defer calling
! # the object constructor
!
! proc construct(cppObj: MyNativeSession) {.
! importcpp: "#.construct(*genodeEnv)".}
! # call the C++ constructor, passing the global Genode::Env
!
! proc manage(cppObj: MyNativeSession): MySessionCapability {.
! importcpp: "genodeEnv->ep().manage(*#)".}
! # call a method from the gobal Env, dereferencing
! # thru the Constructible template
!
! type MyNimSessionObj = ref object
! cppImpl: MyNativeSession
! cap: MySessionCapability
! id: SessionId
! # C++ RPC objects are best kept in native
! # reference-counted Nim objects
!
! proc manage(obj: MyNimSessionObj) =
! obj.cppImpl.construct() # call our wrapped constructor
! GC_ref(obj)
! # manually increase the reference count on our session
! # object to prevent the component entrypoint from
! # referencing an RPC object that has been lost and
! # freed from the heap
! obj.cap = obj.cppImpl.manage() # store our capability
!
! proc myCreateSessionProc(id: SessionId): MyNimSessionObj =
! result = new MyNimSessionObj
! # create our object on the heap
! result.manage()
! # construct and manage our RPC object
! result.id = id
! # store the session id from our parent
Procedures for calling Nim code from an RPC object, dissolving
and destructing RPC objects, and managing the session lifetime
are exercises left to the reader.
Updated VirtualBox
==================
Our VirtualBox port got updated from version 5.1.22 to version 5.1.32 in order
to leverage the security updates and improved audio support. Additionally the
boot time of Linux guests got improved by adjusting our custom virtualization
back end.
Libraries and applications
##########################
New trace-logging component
===========================
The new trace-logger component can be used to easily gather, process, and
export different types of tracing data. Furthermore, it marks the next step
towards a user framework that makes access to Genode's manifold tracing
abilities
([https://genode.org/documentation/release-notes/13.08#Light-weight_event_tracing - 13.08],
[https://genode.org/documentation/release-notes/13.11#Improved_event_tracing - 13.11],
[https://genode.org/documentation/release-notes/15.08#Enhanced_tracing_facilities - 15.08])
intuitive and convenient.
The component can filter the available tracing subjects according to session
label policies and thread names. The processing of the tracing data can then
be configured for each selected subject individually, for groups of subjects,
or for all subjects together. The resulting data is exported as log output.
This is an example configuration of the trace logger, which shows the default
value for each attribute (except policy.thread and policy.label):
! <config verbose="no"
! session_ram="10M"
! session_arg_buffer="4K"
! session_parent_levels="0"
! period_sec="5"
! activity="no"
! affinity="no"
! default_policy="null"
! default_buffer="4K">
!
! <policy label="init -> timer" />
! <policy label_suffix=" -> ram_fs" />
! <policy label_prefix="init -> encryption -> "
! thread="worker"
! policy="null"
! buffer="4K" />
! </config>
The most important features so far when it comes to processing the traced
data are:
* Trace CPU activity and affinity ('activity' and 'affinity' attribute),
* Install individual policies for the creation of further tracing data
('policy' attributes) for instance, 'rpc_name' for a log of issued RPC calls),
* Dimensioning the subject-local trace buffers and the frequency of Trace Logger
data examination ('buffer' and 'period' attributes), and
* Configure the session to the Tracing server ('session' attributes).
A comprehensive documentation of the trace-logger component can be found in
_os/src/app/trace_logger/README_. An example of how to use the component is
given through the run script _os/run/trace_logger.run_.
New component for extracting archives
=====================================
The new 'extract' component located at _libports/src/app/extract_ extracts
the content of an arbitrary number of tar.xz archives according to its
configuration. It is used by the depot-download subsystem described in
Section [On-target package installation and deployment]. The component
is accompanied by the run script _libports/run/extract.run_ that illustrates
its use.
New signature-checking tool based on GnuPG
==========================================
The on-target installation of software packages requires a way to verify
cryptographic signatures of downloaded content within a Genode system.
The new 'verify' component located at _ports/src/app/verify_ facilitates the
code of GnuPG to verify detached OpenPGP signatures against public keys.
Since GnuPG depends on libgcrypt and libgpg-error, ports of those libraries
were added to the libports repository. The component comes with the run
script _ports/run/verify.run_ that demonstrates its usage.
Fetchurl component for downloading files
========================================
Fetchurl is a component for downloading files from the network, based
on the curl library. It used to reside in the genode-world repository.
Since it has become a mandatory part of Genode's on-target software
installation mechanism, we have moved it to the _libports_ repository now.
Besides this relocation, fetchurl received a welcome modernization. In
particular, the new version uses the modern socket-fs infrastructure of
the libc instead of relying on the deprecated libc_lwip plugin as a hard-wired
dependency.
New interactive FLIF image viewer
=================================
A simple image viewing application for the FLIF lossless image format was
written from scratch using the FLIF reference decoder library. The viewer can
be used to interactively view a directory of images and supports animation of
GIF-like FLIF files.
Ported 3rd-party software
=========================
With the current release, the following 3rd-party software becomes available
on Genode:
:[https://www.libarchive.org/ - libarchive]: is a library for uncompressing
and extracting various archive formats. It nicely wraps format-specific
libraries like zlib behind a unified and easy-to-use API. The port can
be found in the _libports_ repository.
:[https://lz4.github.io/lz4/ - lz4] and [https://tukaani.org/xz/ - liblzma]:
implement modern compression algorithms as supported by libarchive.
Thanks to Ben Larson for contributing the port of these libraries.
:[https://www.tcl.tk/ - Tcl]: is used as scripting language for various
Genode tools. With the new 'check_abi' tool described in Section
[Automated ABI consistency checks], the Tcl shell 'tclsh' has become
a dependency of the build system. Therefore, we made 'tclsh' available as
noux package. Note, however, that this port comprises solely the
functionality needed for simple scripting.
:[https://flif.info/ - FLIF]: is a library for the Free Lossless Image
Format. Thanks to Emery Hemingway for making it available in the
genode-world repository.
:[https://github.com/json-c/json-c/wiki - JSON-C]:
is a library for processing JSON-formatted data. Thanks to
Johannes Kliemann for contributing the port to the genode-world
repository.
:[https://www.nlnetlabs.nl/projects/ldns/ - Drill (ldns)]:
provides a utility for DNS testing. Thanks to Emery Hemingway for adding it
to the genode-world repository as a side activity of improving Genode's
network stack.
Updated packages for the Noux runtime environment
=================================================
The current release updates the following noux packages: less (version 487),
grep (version 3.1), coreutils (version 8.29), tar (version 1.30), findutils
(version 4.6), which (version 2.21), sed (version 4.4), and bash (version
4.4.18). Thanks to Hinnerk van Bruinehsen for this welcome contribution.
Device drivers
##############
Ethernet-driver for i.MX-based Wandboard
========================================
The current release contains a port of the Linux kernel driver for the
Ethernet card family originally produced by Freescale. We followed our
established approach to tailor an independent device-driver environment (DDE)
for the specific driver. To profit from synergies with the existing drivers of
the _dde_linux_ repository, we took the Linux kernel 4.4.3 as reference.
For now the current version is limited to support the Wandboard Quad as this
is the i.MX-based board that is nightly tested by our infrastructure. The
support of other boards using the same IP core is planned for future releases.
The driver can be found in _dde_linux/src/drivers/nic/fec_. To test the driver,
no further configuration is needed and you can have a look at one of the
automatic network tests, like _lwip.run_, as a reference.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Thanks to Johannes Schlatow from the TU Braunschweig, the support of the
Zynq-7000 boards by our base-hw kernel got extended. It is now possible to use
all CPU cores instead of only the primary one.
Updated Muen separation kernel
==============================
The Muen SK port has been updated to the latest development version 0.9. The
most notable features and improvements are the Crash Audit facility and support
for MirageOS/Solo5 subjects which may be executed alongside Genode/base-hw.
Thanks to this feature, the Muen project has reached a milestone by
self-hosting the [https://muen.sk] website on a Muen system. Currently, the
network driver is provided by a Linux subject but with some work it should be
possible to replace it with a Genode/base-hw nic_drv in the future.
Further details regarding Muen v0.9 can be found in the project's release
notes [https://groups.google.com/forum/#!topic/muen-dev/FPL9sc4yaBE].
Updated seL4 kernel
===================
Our remaining patches regarding UEFI framebuffer support got integrated into
the upstream codebase of the seL4 kernel. Hence, we updated our seL4 port to
the upstream version containing our patches.
Build system and tools
######################
Package management
==================
The package-management tools introduced last year have become a vital part
of Genode's workflow.
:Package management documentation:
[https://genode.org/documentation/developer-resources/package_management]
Prompted by the development of the on-target installation and deployment
mechanism featured in the current release, the tools received the following
refinements:
:Use of tar.xz as archive format: This change significantly reduces the size of
published depot content compared to the previously used tar.gz format.
:Subdirectories for archive versions:
In the original version of the depot layout, archives were named as
'<archive-name>-<version>'. Hence, the depot - in particular the download
location - had directories that grew in two dimensions. First, when new
archives were added. Second, when new versions of existing archives were
added (usually corresponding to Genode's release cycle). In the mid-term,
this would have resulted in a huge number of directory entries, e.g., in the
_src/_ subdirectory. To avoid this problem, the new version uses the scheme
'<archive-name>/<version>' instead. This way, at the _src/_ level, each
archive has one subdirectory (the number of subdirectories corresponds to
the number of archives). Inside the subdirectory, there is one entry per
version.
:Controlled rebuild of binary archives:
When calling the depot/create tool for a binary archive with 'FORCE=1', the
underlying source archives are re-extracted and the binary archive is
rebuilt. This is usually done after local changes in the source tree to
apply version updates to depot archives as needed. However, the implicit
rebuild is superfluous whenever the source-version remains the same. This is
particular inconvenient when re-creating pkg archives that refer to a large
number of src archives. Here, all binaries referenced by the pkg archive are
rebuilt each time. The new 'REBUILD' argument allows the user to skip
superfluous rebuilds in such situations. Normally, 'FORCE=1' implies
'REBUILD=1'. However, by explicitly specifying 'REBUILD=', existing binary
archives whose versions remain unchanged are kept instead of being rebuilt.
Offline validation of XML configurations
========================================
The _tool/run_ tool now automatically checks configurations against
target-specific XML schemes. Each component may define a configuration
scheme-file in its _target.mk_ file as follows:
! CONFIG_XSD = my_config.xsd
When the run tool checks the configuration of an instance of Genode's init
component, it additionally iterates through all start nodes of this
configuration. For each start node, it checks whether the according component
provides a configuration-scheme file and, if so, applies it to the
configuration inside the start node. This is done recursively. I.e., also the
child configurations of a sub-init of a sub-init ... of the top-level init
are covered this way.
Whenever the run tool detects an error in one of the checked configurations,
it stops and points out the location of the error. By now, there exist
configuration schemes for the init, the NIC router, and the trace logger
components. Our intention is that every component that interprets its
configuration will eventually be accompanied by such a scheme - not only to
validate actual configuration input but also to serve as documentation for
users of the component.
Automated ABI consistency checks
================================
In [https://genode.org/documentation/release-notes/17.02#Genode_Application_Binary_Interface - version 17.02],
we introduced a kernel-agnostic ABI, which ultimately paved the ground for
Genode's package management. For the time being, the ABI is not set in stone.
It is expected to evolve for some time until it hopefully approaches ABI
stability in the mid term. Whenever Genode's API changes, the ABI may be
affected. For example, symbol sizes may grow. Until now, side effects on the
ABI had to be curated manually. In practice, however, such side effects are
too easy to miss. Therefore, the current release adds a mandatory ABI checking
step to the build process. A new _tool/check_abi_ tool is invoked whenever a
shared object is built. It reports flaws in the ABI definition (such as
duplicated symbols) as well as inconsistencies between a shared object and its
ABI.

766
doc/release_notes/18-05.txt Normal file
View File

@@ -0,0 +1,766 @@
===============================================
Release notes for the Genode OS Framework 18.05
===============================================
Genode Labs
The driver behind the release 18.05 is the rapid evolution of the Sculpt
general-purpose OS. Following the initial version from February, which was
targeted at early adopters, the new Sculpt for The Curious (TC) introduces a
much more welcoming and empowering user experience (Section
[Sculpt for The Curious]).
It goes without saying that the interactive and dynamic nature of the Sculpt
scenario puts a lot more pressure on Genode's components compared to static
workloads. For example, Sculpt calls for the dynamic adjustment of user-level
network routing, the dynamic detection and management of partitions and file
systems, the support of USB storage devices from diverse vendors, and a way to
adapt the visual appearance to a great variety of screen resolutions. Most
improvements described below are our responses to these challenges.
That said, the release is not short of new features either. E.g., it features
the initial port of OpenJDK's HotSpot VM for executing Java programs on Genode
directly (Section [Java language support]), improves the support for the NXP
i.MX family of SoCs (Section [NXP i.MX SoC]), and enhances the VFS with new
plugins for copy-on-write and the auditing of file accesses
(Section [New VFS plugins]).
The release is complemented by the annual update of the Genode Foundations
book (PDF), which covers the fundamentals of the framework in great detail
(Section [New revision of the Genode Foundations book]).
Sculpt for The Curious
######################
With Sculpt for The Curious (TC), Genode 18.05 features the second revision of
the Sculpt general-purpose OS. Compared to the initial version for Early
Adopters (EA), it features a new interactive system-management component that
streamlines common tasks like the management of storage devices, or
configuring the network connectivity. The highlights of the new version of the
base system image are:
* Live-customization of almost all aspects of the system,
* The ability to install and run software in memory only,
* Hotplugging of USB storage devices,
* New support for NVMe storage devices in addition to SATA disks,
* Interactive network configuration including Wifi connectivity,
* Interactive management and inspection of storage devices and partitions,
* The option to host a complete and customized Sculpt installation on a
USB stick,
* Automated on-demand installation of software packages with visual feedback,
* Scalable fonts that are automatically adjusted to the screen resolution, and
* UEFI boot supported by default.
The base image is extensible by downloadable software packages that may
originate from different sources, safeguarded by cryptographic signatures.
It contains several example subsystems as a starting point:
* Basic GUI components like a window manager, a scalable backdrop, a
font server, and a simple software-rendering demo,
* A light-weight noux runtime for executing command-line-based software
such as GNU coreutils, bash, and vim.
* A package for downloading the installer and a suitable virtual-machine
configuration for Debian Linux,
* VirtualBox running Debian Linux,
* An example for running libretro-based games,
* A disposable VM that runs Firefox on TinyCore Linux, executed either in
VirtualBox or the light-weight Seoul virtual-machine monitor,
* A Qt5-based text editor.
Please refer to the updated
[https://genode.org/documentation/articles/sculpt-tc - Sculpt documentation]
to explore Sculpt TC.
The Sculpt version included with the current release requires the user to
build a boot image by hand. Following the steps described in the
documentation, this procedure takes a few minutes. We plan to provide
downloadable boot images a few weeks down the road once Sculpt TC received
intensive day-to-day testing by the early adopters. Your feedback is very
welcome!
New revision of the Genode Foundations book
###########################################
The "Genode Foundations" book received its annual revision, which reflects
the evolution of the framework over the past year. Specifically, the changes
since the last year's edition are:
: <div class="visualClear"><!-- --></div>
: <p>
: <div style="clear: both; float: left; margin-right:20px;">
: <a class="internal-link" href="https://genode.org">
: <img class="image-inline" src="https://genode.org/documentation/genode-foundations-title.png">
: </a>
: </div>
: </p>
* Changed boot-loader infrastructure on PC hardware
* Package management
* Structural changes of Genode's custom base-hw kernel
* API improvements: Unicode handling, support for XML-based data models,
timeout-handling API
: <div class="visualClear"><!-- --></div>
To examine the changes in detail, please refer to the book's
[https://github.com/nfeske/genode-manual/commits/master - revision history].
Storage infrastructure
######################
VFS library and plugin interface
================================
The VFS (Virtual-File-System) library was expanded to meet new requirements
for the Sculpt scenario. The traditional file-system medium for component
state and configuration sculpting is the *ram_fs* server, but with the
limitation that files stored in the server are ephemeral. Any changes to
the initial state are lost when a system is shut down or the *ram_fs* server
is restarted. Now that persistent storage is usually served by a VFS plugin
hosted by the VFS server, it was a natural progression to introduce a means
for indicating VFS changes with 'File_system' session notifications. To this
end the VFS server was amended to send session notifications, and notification
support was added to the Rump and FatFs VFS plugins, allowing Ext2 and FAT
file-systems to host dynamic component state and configuration information.
Using the VFS for serving font data produced from files stored in the VFS made
it practical to allow VFS plugins to introspect the file system. Plugins now
have the means to access arbitrary paths from the file-system root or they may
host and expose their own internal file systems.
While the core of the VFS library is small compared to contemporaries in other
operating systems, the moment came to promote the VFS from a static to a
shared library. Components that use the C runtime have always loaded the VFS
dynamically as a subsystem of _libc.lib.so_, but native components carried the
bulk of its implementation. The VFS library is now provided as a shared
library and is included with the front-end server in the _src/vfs_ depot
archive. This change affects components that have been rebuilt against the
shared library but do not have their ROM policies updated to allow access to
the _vfs.lib.so_ ROM.
New VFS plugins
===============
File-system introspection has made two additional plugins possible, the *audit*
and *cow* plugins.
The *audit* plugin logs VFS paths as they are accessed to a dedicated LOG
session. This is useful for finding the files required by third-party
components without relying on documentation or auditing source code.
The *cow* plugin emulates copy-on-write behavior by copying the contents of
files lying in a read-only path to a read-write path as they are opened. This
plugin is considered a proof-of-concept and under-performing, but opens a way
of experimenting with seeding user-managed file-systems from immutable
file-system archives.
Plugins of this kind are most appropriately instantiated in the VFS server
with policies to restrict the intended components into paths provided by the
plugins. This prevents a component from escaping the effect of the plugin. An
example of "auditing" a libc component follows:
! <start name="audit_fs">
! <binary name="vfs"/>
! <config>
! <vfs>
! <dir name="data"> <!-- source files -->
! <tar "data.tar"/>
! <ram/>
! </dir>
! <dir name="audit"> <!-- virtual path that captures /data -->
! <audit path="/data"/>
! </dir>
! </vfs>
! <!-- route into virtual audit path -->
! <policy label_suffix="audit" root="/audit" writeable="yes"/>
! </config>
! </start>
!
! <start name="app">
! <config>
! <libc stdout="/log" stderr="/log"/>
! <vfs>
! <log/>
! <fs label="audit"/>
! </vfs>
! </config>
! </start>
Improved disk-partition discovery and access
============================================
The 'part_blk' component, which parses the partition table on a block device
and provides access to each partition through a block session, was extended to
make it easier to implement a management component on top of it. It now
features additional attributes in its report. For one the block size of each
partition as well as the type of the file system on the partition are
reported. The file system probing implementation is minimal and only contains
file systems that are commonly used on Genode systems, i.e., FAT32 and Ext2.
Furthermore, on GPT formatted disks, each partition has an 'expandable'
attribute that contains the number of blocks by which the partition can be
grown. The following exemplary report illustrates the adjustments:
!<partitions type="gpt" total_blocks="500118192" gpt_total="500118125" gpt_used="302254080">
! <partition number="1" name="BIOS boot partition"
! type="21686148-6449-6e6f-744e-656564454649" guid="db0701aa-02ae-474d-92d0-82738bfce5d2"
! start="2048" length="2048" block_size="512"/>
! <partition number="2" name="EFI System"
! type="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" guid="74e43226-2afb-4575-bdda-83bf72f5a6e7"
! start="4096" length="262144" block_size="512" file_system="FAT32"/>
! <partition number="3" name="GENODE"
! type="0fc63daf-8483-4772-8e79-3d69d8477de4" guid="a950091d-87ba-4800-85bf-7b6a58abe6d5"
! start="235147264" length="67108864" block_size="512" file_system="Ext2"
! expandable="197862064"/>
!</partitions>
The heuristics of how the component probes the partition table were also
loosened. Instead of explicitly enabling support for GPT, the component will
now always try to parse the MBR as well as the GPT. It will bail out if both
are considered valid since using GPT/MBR hybrid tables is not supported and it
should be up to the user to make an educated decision. In cases where there is
no partition table, a 'partitions' report of 'type="disk"' will be generated
in which the complete disk is presented as partition number '0'. This is
needed as compatibility fallback for Sculpt EA installations.
Creating and modifying GUID partition tables
============================================
Part of the enhancements of Sculpt TC is the ability to manipulate the block
device used by Sculpt. We implemented a component called 'gpt_write', which
can create and modify a GPT and its entries. It considers alignment
constraints to make better use of 512e devices. It will, however, not perform
any boundary checking. It does not handle overlapping partitions and only when
applying a partition, it makes sure that the partition will fit. The following
configuration illustrates its operation:
!<start name="gpt_write">
! <resource name="RAM" quantum="2M"/>
! <config verbose="yes" initialize="yes" align="4K">
! <actions>
! <add entry="1" type="BIOS" label="GRUB BIOS" start="2048" size="1M"/>
! <add entry="2" type="EFI" label="EFI System" start="4096" size="16M"/>
! <add entry="3" type="Linux" label="GENODE" start="36864" size="128M"/>
! <add type="BDP" label="FAT32 Data" size="max"/>
! <delete entry="1"/>
! <delete label="FAT32 Data"/>
! <modify label="GENODE" new_label="GENODE*" new_size="max"/>
! </actions>
! </config>
!</start>
Please read _repos/gems/src/app/gpt_write/README_ for more detailed information
on how to use the component and feel free to check out the run script
_repos/gems/run/gpt_write.run_.
User-level networking
#####################
NIC router
==========
The NIC router has received major improvements that were mainly motivated by
our daily experience with the Sculpt scenario where the router serves as NAPT
component in front of the virtual machines that host our work OS's. In this
role, it is subject to a permanent load driven by real-world tasks.
Furthermore, it has to have a user interface that makes it a pleasant
experience to deploy in a dynamic environment. This led to our primary goal:
We had to overcome the need to restart the NIC router, and thereby all
components that depend on it, whenever its configuration changes and while
doing so, not to interrupt the communication of its client unnecessarily.
We managed to make the NIC router fully re-configurable at runtime in a way
that it always tries to keep as much state information as possible throughout
the process. This means that network communication going through the NIC
router is not affected by a configuration update unless the configuration
change affects parts that were involved in an existing communication channel.
One prerequisite for this feature was that NIC session clients can connect at
any time to the NIC router regardless of whether there is a matching domain
for the session or not. As long as a session has no domain, the NIC router
does not send any packet to it and drops all packets coming from it. But, at
least, the session and the corresponding client component stay alive, even if
their already assigned domain disappears with a new configuration.
At the uplink, in contrast, the lifetime of the session remains bound to the
lifetime of the domain. The uplink domain-tag received a new attribute
named 'label' (only considered at the domain-tag of the uplink). It denotes
the label of the uplink session. With these two particularities of the uplink
domain, one can now easily switch between different NIC session servers. The
NIC router will close and request the corresponding NIC session with the
current 'label' value if the 'domain' node is removed/added or the label
changes. Thereby, the NIC router can now be used to dynamically switch between
network interfaces like wireless and wired adapters.
Furthermore, we improved the NIC router's ability to handle DNS server
information. Domains can wait for the DNS server info of the DHCP client of
another domain. This is done with the new attribute 'dns_server_from' in the
'<dhcp_server>' tag. Each time the DNS server info of the remote domain
changes, the DHCP server with the 'dns_server_from' attribute will toggle the
link state of each session at its domain. This can be used by clients as a
hint to request their DHCP info anew from the NIC router and thereby receive
the updated DNS server information.
When it comes to protocols, the most notable change is that the NIC router now
also supports routing and NAPT for ICMP. With the new '<icmp>' sub node of the
'<domain>' tag, ICMP routes to other domains can be created. Instead of ports,
the ICMP IDs are used for NAPT. Similar to the 'udp-ports' and 'tcp-ports'
attributes, the size of the ID space for each NAPT client is configured via
the new 'icmp-ids' attribute in the '<nat>' tag.
Last but not least, the following small features were also added to the NIC
router:
:Attribute 'verbose_packets' for the '<config>' and the '<domain>' node:
Toggles the logging of most important protocol header fields globally or
domain-locally. The 'verbose' attribute does not affect this kind of debug
output anymore.
:Report DNS server info:
If the 'config' attribute in the '<report>' node is enabled, the NIC router
will now also report the DNS server info for each domain.
:Attribute 'config_triggers' in the '<report>' node:
Toggles whether the NIC router immediately sends a report whenever the IPv4
configuration of a domain changes, regardless of any timeouts.
:IPv4 point-to-point support:
If a domain receives an IP configuration with a subnet mask of
255.255.255.255 it will switch to point-to-point IPv4 (requires a valid
gateway address at the domain).
:ICMP destination unreachable on non-routable packets:
The NIC router now responds with an ICMP "destination unreachable" packet to
packets that are not routable at an interface with a domain.
For more information, have a look at the _os/src/server/nic_router/README_
file. Examples can be found in the run scripts
_dde_linux/run/nic_router_uplinks.run_,
_libports/run/nic_router_dyn_config.run_, and _os/run/ping_nic_router.run_.
NIC dump
========
The output level of the NIC dump component can now be configured per protocol
by using the protocol names as attributes: 'eth', 'arp', 'ipv4', 'dhcp',
'udp', 'icmp', and 'tcp'.
The available debug levels are:
:no: Do not print out this protocol.
:name: Print only the protocol name.
:default: Print a short summary of the most important header values.
:all: Print all available header values.
Additionally, you can set a default debug level for protocols that are not
configured using the 'default' attribute.
For more information, please refer to _os/src/server/nic_dump/README_.
GUI stack
#########
With Sculpt becoming more and more end-user oriented, Genode's GUI stack came
into focus. It was time to reconsider several interim solutions that worked
well in the past but would not scale up to a modern general-purpose OS. Two
concrete examples are the support of scalable fonts and Unicode characters. In
the past, Genode used to restrict textual output to the Latin-1 character set
and employed pixel-based fonts only. The current release overcomes these
limitations by featuring completely new text-output facilities.
UTF-8 support and improved text rendering
=========================================
The UTF-8 text encoding overcomes the severely limited code-point range of the
ASCII and Latin-1 character sets by representing characters by a varying
number of bytes. Today, UTF-8 is generally considered as the standard encoding
for text. The new UTF-8 decoder at _os/util/utf8.h_ clears the path for
Genode's native GUI components to follow suit. The first beneficiary is
Genode's graphical terminal, which has become able to display Unicode
characters and pass user input as UTF-8-encoded data to its terminal-session
client.
Terminal enhancements
=====================
Speaking of the graphical terminal, the current incarnation got a welcome
overhaul. First, we reduced its complexity by removing obsolete features like
built-in keyboard-layout handling, which are no longer needed when combining
the terminal with our modern input-filter component. Furthermore, the terminal
has become dynamically resizeable, forwarding screen-size changes to the
terminal client. Should the client be a Noux runtime, such a change is
reflected to the running application as a SIG_WINCH signal. The application -
e.g., Vim - responds to the signal by requesting the new terminal size.
Finally, the terminal protocol was changed from 'linux' escape sequences to
'screen' escape sequences in the anticipation of making the terminal more
flexible in the future.
Text rendering
==============
Throughout Genode, many GUI components reused the text-output utilities
of the nitpicker GUI server. These utilities, however, relied on a simple
pixel font format. To make the text output more flexible, nitpicker's text
painter located at _nitpicker_gfx/text_painter.h_ has been replaced by a
completely new implementation that decouples the font format from the
glyph rendering and takes UTF-8 strings as input. In the process, the glyph
rendering got a lot more sophisticated, supporting horizontal sub-pixel
positioning and filtering.
Font-format support
===================
To remove the omnipresent use of fixed-size pixel fonts throughout Genode,
the following new components entered the picture:
First, the new 'ttf_font' library implements nitpicker's font interface by
using the TrueType renderer of the STB single-header library.
Second, the new 'vfs_ttf' VFS plugin uses the 'ttf_font' library to export a
rendered TrueType font as a virtual file system. The various font properties
as well as the actual glyph images become accessible as regular files. This
way, an application that needs to draw text can read the glyph data directly
from its VFS instead of depending on a font-rendering library.
Third, the new 'Vfs_font' utility located at _gems/include/gems/vfs_font.h_
implements nitpicker's font interface by obtaining the glyphs from the
component-local VFS. It is complemented by the 'Cached_font' utility, which
implements an LRU glyph cache.
With this infrastructure in place, several existing GUI components could
be updated, most prominently the graphical terminal and the menu-view
widget-rendering engine. By facilitating the VFS as interface for propagating
glyph data, components no longer need to manage fonts and their configuration
individually. They just access their VFS. When integrating the component into
a scenario, one can decide whether to mount a font-rendering library directly
at the component, or - alternatively - route a file-system session to a
central font server. The latter is just a regular VFS server with the fonts
mounted as pseudo file systems. Since the glyph renderer is a VFS plugin, it
could be replaced by another implementation in the future without touching any
component.
Modernized API for input-event processing
=========================================
Genode's input-session interface changed very little over the years. Even
though it received evolutionary enhancements from time to time, its design
resembled a traditional C-style interface from the medieval era. We found that
the interface left too much room for interpretation. In particular, the meta
data per event type was defined in a rather ad-hoc way, which raised
uncertainties. For example, is a button-press event accompanied with a
positional value or not? To remove these uncertainties, the current release
replaces the 'Input::Event', with a new implementation that facilitates a safe
way of accessing event meta data. Besides this design change, there is one
noteworthy semantic change as well. With the new interface, symbolic character
information are provided along with their corresponding press events rather
than as distinct events, which - according to our practical findings - greatly
simplifies the consumer side of the 'Input::Event' interface.
Improved keyboard-focus handling
================================
The nitpicker GUI server multiplexes one screen among multiple GUI clients in
a secure way. One aspect remained underdeveloped so far, which is the keyboard
focus handling. Nitpicker's 'Session:focus' call previously triggered a one-off
focus change at call time. This focus change did not pass the same code paths
as a focus change triggered by a "focus" ROM update, which led to
inconsistencies.
The new version changes the implementation of 'Session::focus' such that the
relationship of the caller and the focused session is preserved beyond the
call time. Whenever the calling session is focused in the future, the
specified session will receive the focus instead. So 'Session::focus' no
longer represents a single operation but propagates the information about the
inter-session relationship. This information is taken into account whenever
the focus is evaluated regardless of how the change is triggered. This makes
the focus handling in scenarios like the window manager more robust.
Device drivers
##############
NVMe storage devices
====================
Since NVMe devices have become common in contemporary systems, it is time to
provide a driver for such devices on Genode. With this release, we introduce a
component that is able to drive consumer-grade NVMe storage devices, i.e.,
there is no support for namespace management or other enterprise-grade
features. For now, to keep things simple, the driver uses the device in an
old-fashioned way and uses only one I/O queue with at most 128 entries. That
is to say it does not exploit the parallelism necessary to unlock the full
potential of NVMe storage. Nonetheless, it performs well. The following
snippet illustrates its configuration:
!<start name="nvme_drv">
! <resource name="ram" quantum="8M"/>
! <provides><service name="Block"/></provides>
! <config>
! <report namespace="yes"/>
! <policy label_prefix="client1" writeable="yes"/>
! </config>
!</start>
The component will generate a report, which contains all active namespaces, if
reporting is enabled by setting the 'namespace' attribute of the '<report>'
node to 'yes'. A report may look like the following example:
!<controller model="QEMU NVMe Ctrl" serial="FNRD">
! <namespace id="1" block_count="32768" block_size="512"/>
!</controller>
For an example on how to integrate this component, please have a look at the
_repos/os/run/nvme.run_ script.
While implementing the NVMe driver, a new component for testing block-sessions
was used. In contrast to the already existing 'blk_bench' and 'blk_cli'
components, it features a variety of different test patterns, which can be
selected in its configuration and can be used to test a block component more
thoroughly. For more information please refer to
_repos/os/src/app/block_tester/README_
NXP i.MX SoC
============
We extended the Linux kernel driver port for Ethernet cards found in NXP i.MX
SoC, which was introduced in the previous release. Now does it not only
support i.MX6Q SoC based boards like the Wandboard, but the i.MX53 and i.MX6SX
SoC as well. The new driver was successfully tested with the i.MX53 Quick
Start Board and the Nitrogen6 SOLOX. The latter board even contains two
Ethernet cards. But due to technical limitations of the board design, the same
driver instance has to be used for both cards. Currently, the driver is
tweaked to run on different boards via its configuration ROM. When no
configuration is provided, it appropriates the values for successfully
executing on the Wandboard. The following is an example configuration for the
i.MX53:
! <config>
! <card name="fec0" type="fsl,imx25-fec" mii="rmii" irq="87" mmio="0x63fec000"/>
! </config>
As a side effect of enabling networking on the Nitrogen6 SOLOX, support for
GPIO based signals has been added to the framework too. The existing GPIO
driver for i.MX53 SoC got extended to additionally support the i.MX6 family.
There are some known limitations when using different drivers like Ethernet
and SD-card drivers on the Wandboard right now. At the moment, those drivers
adjust clock parameters and I/O pin configurations independently from each
other, which can lead to inconsistencies. We plan to address those issues with
the implementation of a platform driver for the i.MX6 SoC family.
Improved USB-storage driver
===========================
We improved the stability of the USB-storage driver (usb_block_drv) and
made it compatible with a lot more devices as the driver has become a pivotal
ingredient of the Sculpt scenario. Due to the changes, the way the driver
operates has changed. On the one hand, now it first tries to use 10-byte
Command Descriptor Blocks (CDB) in its SCSI layer and will only switch to
16-byte CDBs when it encounters a device whose blocks cannot be completely
accessed via the former descriptor size. On the other hand, because some
tested devices stopped working after issuing a USB device reset, the reset was
made optional. By setting the 'reset_device' attribute in the '<config>' node
to 'yes', the driver is instructed to perform the USB device reset.
Libraries and applications
##########################
Packaged Qt5 framework
======================
We created package recipes for all previously ported Qt5 libraries and their
dependencies and adapted the run scripts accordingly. Please note that the
host tools needed for building Qt applications (moc, rcc, uic) are not built
automatically anymore, but need to be built and installed manually with the
new 'tool/tool_chain_qt5' script.
Java language support
=====================
Over the course of the past year, we started to look into Java support for
Genode with the ultimate goal of porting an existing Java Virtual Machine
(JVM), which translates and executes Java byte code, to Genode. After
investigating possible JVM candidates, it became obvious that
[https://openjdk.java.net - OpenJDK] is the only viable option when looking for
a functional, maintained, feature complete, and open-source Java SDK.
Therefore, we decided upon OpenJDK version 9 and started to port OpenJDK's
HotSpot virtual machine.
In the first step, we followed the approach to enable HotSpot's internal
Just-in Time (JIT) compiler, which translates byte code into machine code and
is the option with the most to offer performance wise. But we also wanted
support for ARM platforms and soon realized, there was almost no JIT compiler
support for ARM other than for Linux. The Linux version is deeply integrated
into the Linux system libraries (e.g., glibc), which makes it very hard to
bring the compiler onto Genode. For example, Genode uses FreeBSD's libc and
that would now have to offer glibc semantics.
After additional research, we found the so-called interpreter version of the
HotSpot VM. This version does not compile byte code, but interprets and
emulates the code at runtime. It is of course slower than the JIT compiler
version, but also machine-architecture independent, so the same HotSpot VM can
be compiled for x86 and ARM platforms. With the JVM running on Genode, we
added networking and file-system access support via Genode's VFS layer. Note,
there is no graphical toolkit support as of now, but most standard library
classes should work. Also, the byte code has to be compiled on a different
host system (e.g., Linux, *BSD) as of now, since we did not bring the Java
compiler to Genode.
To give Java a spin, a run script can be found under _ports/run/java.run_.
Ada language support
====================
Support for components and libraries written in the Ada/SPARK programming
language experienced a rework with the final goal of seamless integration with
the base framework. We added a new _ada_ library, which contains a (currently
minimal) runtime taken from the sources of our GCC port and thus is always
consistent with the tool chain in use. It is built as a shared library
_ada.lib.so_ that needs to be added to the list of boot modules.
The example in _libports/src/test/ada_ showcases the implementation of an Ada
component using a custom library _test-ada_, which is also implemented in Ada.
Seoul VMM on NOVA
=================
The Seoul/Vancouver VMM - introduced to Genode with release 11.11 - received
some renovations to be able to run recent Linux VMs. Namely the output of the
guest during early boot is now visible and the network models got revised.
Additionally, the Seoul VMM has been packaged and can be used in Sculpt.
Ported software
===============
The [https://dnsprivacy.org/wiki/display/DP/DNS+Privacy+Daemon+-+Stubby - Stubby]
DNS daemon has been ported to begin experimentations with DNS as a native
service. There is a tendency for DNS configuration frameworks to diverge
between operating systems and releases, an inconvenience that is magnified
when maintaining virtual machines. Name-server configuration via DHCP has been
the only constant, so hosting DNS natively and configuring virtual-machines
with the *nic_router* DHCP server presents itself as a viable solution to the
guest resolver quagmire. Expect DNS services in later Sculpt releases.
Platforms
#########
Accessing PCI via ECAM/MMCONF
=============================
The platform driver on x86 is trusted with guarding access to PCI
devices. Up to now, I/O ports have been used to configure the PCI subsystem.
On modern x86 architectures, PCI devices can be configured by using Memory
Mapped I/O (MMIO). This method was introduced with PCI Express and is called
Enhanced Configuration Access Mechanism (ECAM). For Each PCI device a separate
4 KiB MMIO page exists to serves as the configuration interface between OS and
PCI device.
The exact location of all the 4K MMIO pages of the PCI devices is machine
specific and must be determined during the bootstrap phase. The ACPI driver on
Genode is in charge of this procedure and reports the location of the
ECAM/MMCONF region to the platform driver via the 'acpi' ROM.
Besides using a modern PCI interface, switching to ECAM/MMCON served to ease
the execution of Genode/hw on top of the Muen separation kernel.
Kernel-agnostic platform-information handling
=============================================
Up to now, special kernel-specific information was propagated to components
such as Virtualbox, the Seoul VMM, and the timer by reusing the
kernel-provided data structures. For Genode/NOVA, the hypervisor info page
(HIP) was exported as an ordinary Genode ROM. With the rise of Sculpt and the
packaging of components in a - as far as possible - kernel-independent way,
the propagation of kernel-specific information became a stumbling block.
With this release we abandon the 'hypervisor_info_page' ROM of Genode/NOVA and
replace it with a Genode ROM called 'platform_info'. The 'platform_info' ROM
is planned to contain solely information about the host hardware, which may
not be gathered otherwise by Genode components. In the current state it
contains information required by VMMs, namely whether AMD SVM or Intel VMX is
available and usable. Additionally, the ROM contains information about the
frequency of the time stamp counter.
Updated seL4 kernel to version 9.0.1
====================================
Thanks to Hinnerk van Bruinehsen, the seL4 version used by Genode has been
updated to 9.0.1.
Updated Muen separation kernel
==============================
With the addition of memory-mapped access to the PCI config-space in Genode,
base-hw subjects on Muen now only see the effectively assigned physical
devices. This makes it possible to run Genode in parallel with other subjects
and to pass-through different PCI devices for each instance.
The Muen update also brings a much simplified subject info structure plus some
tweaks to the Muen system policy XML format to facilitate easier integration
of new hardware platform specifications.
Build system and tools
######################
Validating 3rd-party code downloads via SHA256
==============================================
This release removes support for verifying source code of third-party ports
with the SHA1 hash algorithm. Last year, SHA1 was banished as a credible
cryptographic hash function after the demonstration of a full collision
attack. Since the
[https://genode.org/documentation/release-notes/14.05 - 14.05 release],
port files have been verified using SHA1, this release replaces all file
digests with SHA256 digests. Any port definitions maintained in external
repositories are required to make these replacements as well. No collisions
have been discovered against source code archives but nonetheless there is an
obligation to widen our margin of safety.
Creating GPT-based disk images by default
=========================================
Up to now Genode's run tool was able to create x86 bootable images in three
flavours:
* Either as ISO bootable by BIOS legacy - 'image/iso', or as
* GPT partitioned disk image only bootable by UEFI - 'image/uefi', or as
* MBR partitioned disk image only bootable by BIOS legacy - 'image/disk'.
With Sculpt came the demand to have a single image type that is in principle
bootable by both UEFI and BIOS legacy. Additionally with Sculpt, we began to
prefer working with GPT partitioned devices.
In the light of the new demands, we changed the 'image/disk' run tool support
to create a GPT partitioned disk image bootable by a legacy BIOS and by UEFI.

Some files were not shown because too many files have changed in this diff Show More