Compare commits

...

270 Commits

Author SHA1 Message Date
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
2024 changed files with 49773 additions and 20515 deletions

26
README
View File

@@ -65,34 +65,24 @@ 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':
:'depot':
Local depot and public archive of Genode packages. Please refer to
! doc/depot.txt
for more details.
Directory used by Genode's package-management tools. It contains the public
keys and download locations of software providers.
Additional community-maintained components

View File

@@ -1 +1 @@
20.11
21.02

View File

@@ -93,6 +93,24 @@ 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
~~~~~~~~~~~~~~~~~

View File

@@ -4,6 +4,118 @@
===========
Sculpt OS release 21.03 | 2021-03-24
####################################
| Version 21.03 of the Sculpt operating system makes the system resilient
| against classes of driver failures, adds configurable real-time priorities,
| and introduces interfaces for screen capturing and user-event injection.
Sculpt OS 21.03 incorporates the many improvements of the latest two Genode
releases. Thanks to Genode's concept of
[https://genode.org/documentation/release-notes/21.02#Pluggable_network_device_drivers - pluggable device drivers],
the system has reached a new level of robustness against malfunctioning
drivers. For example, if the Intel graphics driver trips over an unsupported
external display, the driver gets automatically restarted while all graphical
applications keep running. Or as another example, should the overly complex
Wifi driver have a hick-up, it can be restarted with a simple mouse click
without harming the networking stacks running on top.
Even though Genode supports static-priority scheduling since more than a
decade, Sculpt did not make this feature available to end users so far. The
new version changes that. For each component, the user can now take a
deliberate decision about the hard scheduling priority, e.g., prioritizing
latency-critical multi-media applications over computational workloads or
virtual machines.
Speaking of workloads, to push the limits of what is possible with Sculpt OS,
the new version introduces additional interfaces that can be assigned to
components. First, it has become possible to redirect the interaction of a
component with the kernel through another component, thereby enabling features
like dynamic CPU-load balancing to be implemented as plain user-level
services. Second, there are new interfaces for capturing the screen and for
injecting input events. The latter interfaces pave the ground for virtual
keyboards, screen-sharing application, or remote administration scenarios.
Under the hood, there are plenty of improvements that make the life of
Sculpt users better. The keyboard layout can now be picked from a menu.
The Chromium-based Falkon web browser runs circles around the previous
version. Menu items and file lists appear nicely sorted. Terminal windows
immediately respond to global font-size changes. On modern Intel machines,
Sculpt leverages Intel Hardware P-states (HWP) for power and thermal
management now. You can find an illustrated tour of these and more changes in
a dedicated
[https://genodians.org/nfeske/2021-03-24-sculpt-os - article at Genodians.org].
The updated [https://genode.org/documentation/articles/sculpt-21-03 - manual]
goes into detail about the use of the new system.
The ready-to-use system image for version 21.03 is available at the
[https://genode.org/download/sculpt - Sculpt download page].
Genode OS Framework release 21.02 | 2021-02-25
##############################################
| The highlights of version 21.02 are the addition of VirtualBox 6,
| mobile-data connectivity via LTE, pluggable network drivers, initial
| support for the Pine-A64-LTS board, and revived work on RISC-V.
Many topics of the current release draw a connection to our overarching goal
to use Genode on the Pinephone by the end of the year. Besides the obvious
steps of enabling the hardware - starting with the Pine-A64-LTS board - the
release introduces mobile-data connectivity as a Genode feature, and changes
the network-driver architecture in anticipation of dynamic power-management
schemes.
For PC hardware, the flagship feature of version 21.02 is the addition of
VirtualBox 6, giving us the prospect to eventually replace the aging port of
VirtualBox 5. Speaking of VirtualBox, the release comes with profound
improvements of the USB-device pass-through abilities, most importantly
covering audio headsets.
Besides these prominent features, the new version comes with many further
improvements. Just to name a few, virtual machines on ARM have become
able to provide VirtIO-block devices to guests, named pipes can now
be used to connect components, Genode's RISC-V support received an
update to ISA spec 1.10, and OpenSSL has been bumped to version 1.1.1.
For the full story, please refer to the
[https:/documentation/release-notes/21.02 - release documentation of version 21.02...]
Road Map for 2021 | 2021-01-15
##############################
| In 2021, we plan to bring Genode to the Pinephone, advance the framework's
| GPU support, and focus on development workflows.
During the annual road-map discussion on Genode's public
[https://genode.org/community/mailing-lists - mailing list],
the following hot topics for this year emerged.
First and most inspiring for many Genode developers, we aspire to have
Genode running on the Pinephone with basic feature-phone functionality by the
end of the year. Since this will involve substantial device-driver-related
developments, the team will take this line of work as an opportunity to
advance the tooling and workflows for carrying out such tasks. This, in turn,
will hopefully ease the on-boarding of new driver developers in the future.
Closely related to the Pinephone scenario, the project will make optimizations
a top priority this year. The opportunities are plenty, ranging from
micro-optimizations, over API refinements, to architectural changes if
needed.
Another recurring topic is the request for GPU support, which is required
by many modern workloads such as video conferencing or streaming on mobile
device. Therefore, we will revamp our past developments of GPU multiplexing
on Intel hardware while also starting the investigation of GPUs on ARM-based
devices.
More information about our review of the past year, this year's focus, and a
rough schedule are presented at our official
[https:/about/road-map - road-map page].
Genode OS Framework release 20.11 | 2020-11-27
##############################################
@@ -211,7 +323,7 @@ please consult the
Road Map for 2020 | 2020-01-20
##############################
| In 2019, we will be concerned about dwarfing the barrier of entry into
| In 2020, we will be concerned about dwarfing the barrier of entry into
| the Genode world.
Following the last year's leitmotif of "bridging worlds", we turn our
@@ -2954,7 +3066,7 @@ applications, most prominently, it serves as the foundation of the KDE project.
Since the release 9.05, the official distribution of Genode supports Qt4 as a
regular feature. The document "Portierung von Qt auf Genode" _(german)_
describes the challenging endeavor of porting this high-complexity C++
framework to Genode. Major problems to overcome had been the missing C libary
framework to Genode. Major problems to overcome had been the missing C library
(at the time when the project started), the integration of the Qt4 project
files with Genode's build system, the adaption of Qt4 to the basic primitives
provided by Genode, and the integration of Qt4 with Genode's GUI. In addition

663
doc/release_notes/21-02.txt Normal file
View File

@@ -0,0 +1,663 @@
===============================================
Release notes for the Genode OS Framework 21.02
===============================================
Genode Labs
Genode 21.02 stays close to the plan laid out on our
[https://genode.org/about/road-map - road map], featuring a healthy dose
of optimizations, extends the framework's ARM SoC options, and introduces
three longed-for new features.
First, we extended our concept of pluggable device drivers to all network
drivers, including Ethernet and Wifi.
As reported in Section [Pluggable network device drivers], such drivers can
now gracefully be started, restarted, removed, and updated at runtime without
disrupting network-application stacks.
Second, the release features the infrastructure needed for mobile-data
communication over LTE, which is a prerequisite for our ambition to use Genode
on the Pinephone. Section [LTE modem stack] gives insights into the involved
components and the architecture.
Third, we are happy to feature the initial version of VirtualBox 6 for
Genode. Section [VirtualBox 6.1.14] gives an overview of the already
supported feature set and the outlook to reach feature-parity to our version
of VirtualBox 5 soon.
Speaking of VirtualBox in general (both versions), we were able
to significantly improve the USB-device pass-through abilities, specifically
covering audio headsets.
Further noteworthy improvements of the current release range from added
VirtIO-block device support for virtual machines on ARM
(Section [VirtIO block devices for virtual machines on ARM]),
revived developments on RISC-V (Section [RISC-V]),
over VFS support for named pipes (Section [VFS support for named pipes]),
to streamlined tooling (Section [Build system and tools]).
Pluggable network device drivers
################################
The results of our approach to
[https://genode.org/documentation/release-notes/20.08#The_GUI_stack__restacked - pluggable framebuffer and input drivers]
encouraged us to take on the third major driver category, namely networking
drivers, which subsumes not only Ethernet drivers but also wireless networking
drivers and mobile baseband drivers. The latter two are of course particularly
interesting for mobile communication devices.
Similarly to the story linked above for the framebuffer and input drivers,
Genode's network drivers used to play the roles of NIC servers, providing a
network-interface service to network applications. As a consequence, the
lifetime of a network application was always bound to the lifetime of the
underlying NIC driver. This is unfortunate because those drivers can be
obscenely complex, putting the liveliness of the dependent application stack
at risk.
[image layered_nic_multi_app_risk]
However, in most scenarios, networking applications do not operate directly on
a network interface because this would prevent the use of the network interface
by more than one application at a time. Instead, there is usually a NIC
multiplexing component in-between the driver and one or multiple applications.
In most contemporary scenarios this is the NIC router that acts as NIC client
towards the driver and as NIC server towards the applications.
Thus, we contemplated the idea of letting the NIC driver operate as NIC client
of the NIC router instead. This would decouple the application from the
driver's lifetime while the driver's special role would be modeled solely by a
routing policy. However, even though the data channel of the NIC interface is
bi-directional, we realized that the reversal of the role of the driver does
not only entail the communication of network payload but also propagation of
the link state and the MAC address. This prompted us to introduce a new Genode
session type called "Uplink" that precisely models the NIC-driver-as-client
scenario.
[image nic_router_services]
In a nutshell, an Uplink session is almost the same as a NIC session with only
three minor differences. First, the MAC address is given by the client (the
driver) as an argument at session-creation time. Second, the roles of the TX
and RX packet streams are interchanged compared to a NIC session. I.e., the
_client_ transmits via TX and receives through RX while at the server side it's
vice-versa. And third - as a mere interface optimization - the link state of an
uplink session is always "up". The session is requested by the client (the
driver) only in the event of a "link-up" edge. Analogously, whenever the link
goes "down", the client closes the session again.
With this new session interface in place, the NIC router becomes the only
long-running component in the scenario. It provides both a NIC and an uplink
session interface. The NIC session interface is used by network applications.
The uplink session interface is used by drivers. Inside the router, uplink
sessions are treated the same as NIC sessions. Therefore, we decided that the
well known '<policy>' tags in the configuration are now simply applied to both
session types. This means, that each '<uplink>' tag that connected a driver in a
router configuration can now be replaced by a '<policy>' tag with a label
attribute that matches the driver's session request.
[image nic_uplink_multi_app]
We divided the process for this architectural change into the following
autonomous steps:
# Introduce the uplink session and uplink-session support in the NIC router.
# Let NIC drivers support both modes, "NIC session server" and "Uplink session
client" depending on a new _transitional_ <config>-tag attribute 'mode'.
This attribute is optional and has two possible values, 'uplink_client'
and 'nic_server', of which it defaults to the latter.
# Adapt all network scenarios in the basic Genode repositories to use NIC
drivers only with '<config mode="uplink_client">'.
# Remove support for the "NIC session server" mode from all NIC drivers and
with it also the transitional 'mode' attribute.
All steps except the last one are completed by now. The transitional 'mode'
attribute and the "NIC session server" mode will remain available in all NIC
drivers until the next Genode release in order to give others the opportunity
to gracefully adapt their NIC drivers and network scenarios to the change.
Further information
-------------------
The overarching topic of pluggable device drivers was covered by our recent
presentation at [https://fosdem.org/2021/ - FOSDEM 2021]. You can find the
video recording and the presentation slides at the following link.
:Pluggable device drivers for Genode:
_presented at FOSDEM 2021_
[https://fosdem.org/2021/schedule/event/microkernel_pluggable_device_drivers_for_genode/]
LTE modem stack
###############
With the current release, Genode adds LTE broadband modem support for packet data
connections. This way, it becomes possible to browse the internet using the SIM
card of your broadband service provider. For a description of the protocols and
the general terminology when talking about LTE modems, our
[https://genodians.org/ssumpf/2020-12-04-mbim - LTE modem support for Genode]
Genodians article is a good starting point.
From the device side, LTE modems register themselves as USB devices at the USB
host controller. The speciality is that a modem offers two interfaces. First, a USB
network interface (like NCM or ECM) and second, a
[https://www.usb.org/document-library/class-definitions-communication-devices-12 - Wireless Mobile Communication Device],
which is a challenge/response control channel to the modem and used to configure
the device. For the actual communication through the control channel, there exist two
binary protocols: Namely, Mobile Broadband Interface Model (MBIM) and Qualcomm
Mobile Station Interface (QMI). Whereas the former is a USB standard, QMI is a
proprietary protocol by Qualcomm. Therefore, we picked a modem that supports the
MBIM standard for our line of work.
USB modem support
=================
In order to enable modem communication, we added the Linux USB modem driver for
MBIM to our _dde_linux_ device driver environment. This driver implements the
NCM and WDM interfaces for the modem and provides a network uplink session for
the NCM network interface and a terminal session for the WDM interface.
[image lte_mbim]
MBIM protocol
=============
MBIM is a binary protocol that is, for example, implemented by
[https://www.freedesktop.org/wiki/Software/libmbim/ - libmbim]. Therefore, we
ported _libmbim_ to Genode. Since it requires _glib_, we had to enable features
and improve our _glib_ support on Genode. The _libmbim_ library offers MBIM command handling only.
For actually triggering modem-communication, the _mbimcli_ tool is required. We
ported _mbimcli_ and changed its front end to trigger a modem packet-connection
sequence via _libmbim_ through the terminal session of the USB modem driver.
During this sequence, the SIM card is unlocked through the PIN, the packet
service is attached, and connection information (e.g., IP, gateway, DNS server)
is retrieved. The connection data is then used by _mbimcli_ to configure the
uplink of Genode's NIC router, which in turn makes the network connectivity available
to network applications. The holistic view is shown in image [lte_mbim].
Base framework and OS-level infrastructure
##########################################
NIC router
==========
The NIC router received two practical features, the consideration of
multiple DNS server entries on DHCP and an ARP-less mode for domains.
The latter was motivated by the fresh support for LTE modems (see Section
[LTE modem stack]). An LTE modem normally doesn't respond to ARP. So when
using it as uplink for the NIC router, the corresponding domain can't request
IP-to-MAC-address resolutions as usual. This is addressed through the new
optional attribute 'use_arp' in '<domain>' tags of the NIC router configuration.
By default, it is set to 'yes', which yields the same behavior as in the past.
However, when set to 'no' for a domain, this domain will prevent sending ARP
requests in general. This leaves the question how to determine the destination
MAC address for a packet that shall be sent at this domain when only the
destination IP address is known. This is solved by the router by simply using
the source MAC address also as destination MAC address, an approach that we
could observe also in other IP stacks and that worked just fine in our tests.
The ARP-less domain mode is demonstrated through the run script
_repos/os/run/nic_router_disable_arp.run_.
The consideration of multiple DNS-server entries on DHCP comes in two parts.
First, when acting as DHCP client at a domain, the router will now parse all
option 6 entries in DHCP ACK replies from the server and memorize them as part
of the resulting IP config of the domain. These entries will then also be
reported if '<report config="yes"/>' is set in the router's config. A router
report with multiple DNS server entries will look like this:
! <state>
! <domain name="uplink_1" ipv4="10.0.0.3/24" gw="10.0.0.1">
! <dns ip="10.0.0.2"/>
! <dns ip="1.1.1.1"/>
! <dns ip="8.8.8.8"/>
! ...
! </domain>
! <domain name="uplink_2" ipv4="168.192.0.200/24" gw="168.192.0.1">
! <dns ip="168.192.0.10"/>
! <dns ip="168.192.0.8"/>
! ...
! </domain>
! ...
! </state>
On the other hand, when acting as DHCP server at a domain, one has two
options. Option 1 is to configure the DHCP server to fetch DNS server entries
automatically from another domain:
! <domain name="downlink" interface="10.0.1.1/24">
! <dhcp-server dns_server_from="uplink_1" .../>
! </domain>
In this case, the router will now reflect not only one but all DNS server
entries from the source domain ("uplink") through the DHCP replies sent at the
destination domain ("downlink") without changing the entry order. This approach
is demonstrated through the new _repos/os/run/nic_router_dhcp_unmanaged.run_
run script.
Option 2 is to configure the DNS server entries manually at the DHCP
server:
! <domain name="downlink" interface="10.0.1.1/24">
! <dhcp-server ...>
! <dns-server ip="10.0.0.2"/>
! <dns-server ip="1.1.1.1"/>
! <dns-server ip="8.8.8.8"/>
! </dhcp-server>
! </domain>
The order of the '<dns-server>' tags determines the order of
option 6 entries in the replies of the DHCP server. Besides its use for static
DNS server configurations, this option can also be used for more sophisticated
forwarding of DNS server entries through a separate management component. The
management component could listen to the reported IP config of the source
domains, apply custom policies like address filters to the result, and
re-configure the DHCP servers of the destination domains accordingly. This
approach is demonstrated in the new _repos/os/run/nic_router_dhcp_managed.run_
run script.
Please note that the former 'dns_server' attribute of the '<dhcp-server>' tag
is no longer considered by the router as the new '<dns-server>' tag replaces it.
Thus, you might want to adapt your NIC router scenarios accordingly.
VFS support for named pipes
===========================
The VFS-pipe plugin received new support for named pipes. The main motivation was to
easily stream data from pure Genode components to libc components via
file-system sessions that can be attached to stdin, stdout, and stderr. This
feature further makes it possible to chain the data flow between several components together,
similarly to how it is done on Unix. Additionally, the thread synchronization
has been improved so that large data chunks can be transferred without
blocking.
A named pipe can be created by adding a '<fifo>' sub node to the '<pipe>' node
of the VFS:
! <vfs>
! <pipe>
! <fifo name="upstream"/>
! </pipe>
! ...
! </vfs>
Each pipe is exposed as a set of pseudo files.
! /upstream
! /.upstream/in/in
! /.upstream/out/out
The _/upstream_ pseudo file can be opened either as read-only or write-only
file. It allows for the access of both ends of the pipe. In contrast, each of
the pseudo files _/.upstream/in/in_ and _/.upstream/out/out_ represents only
one end of the pipe, which can be subjected to an individual directory-based
access-control policy.
Thanks to Sid Hussmann for contributing this valuable feature!
Terminal
========
While
[https://genode.org/documentation/release-notes/20.08#The_GUI_stack__restacked - revising the GUI stack]
in Genode 20.08, we largely abolished the use of the framebuffer and input
session interfaces. The graphical terminal, however, still relied on those
interfaces instead of the GUI session. In practice, there was always a gui_fb
component needed as an intermediate between the terminal and the GUI server.
To complete the GUI-stack transition, we changed the terminal to use the GUI
session directly and adjusted all current scenarios that use the terminal.
One useful feature of the gui_fb component was the definition of an initial
window size. This enabled packages such as Sculpt's system shell to present
terminal windows with a reasonable default size smaller than the entire
screen.
To accommodate this special case, the initial terminal size can now be
explicitly configured in the terminal configuration.
! <config>
! <initial width="800" height="600"/>
! ...
! </config>
While we were at it, we also enhanced the terminal with the ability to
dynamically respond to font changes. So the adjustment of the global font
settings in Sculpt OS takes immediate effect on all terminal windows.
OpenSSL 1.1.1i, curl 7.70.0
===========================
OpenSSL experienced some quite important security updates during the last
months. This prompted us to update our port to version 1.1.1i. During
the porting work, we kept an eye on performance and enabled CPU-specific
optimizations where feasible. Optimizations are enabled by default on
x86 and ARMv8. For ARMv7, we enable NEON-based functions only when the
build SPECS include "neon" to support common SoCs that lack these
capabilities in the default configuration. Please note, the updated
port does only provide one combined depot archive "openssl" that
replaces the former "libcrypto" and "libssl" archives. The libraries
are still distinct for compatibility with existing applications and
build systems. As a side effect, we also updated the curl library to
version 7.70, which is compatible with recent OpenSSL versions.
Thanks to Pirmin Duss for his valuable contribution to this update.
Virtualization
##############
VirtualBox 6.1.14
=================
Genode supports virtualization with VirtualBox
[https://genode.org/documentation/release-notes/14.02#VirtualBox_on_top_of_the_NOVA_microhypervisor - since 2014].
Back then, we enabled VirtualBox version 4 to support use cases with unmodified
Linux and Windows guests like Sculpt's predecessor
[https://genode.org/documentation/release-notes/15.11#Genode_as_desktop_OS - "Turmvilla"].
In 2016, we updated VirtualBox to version 5 to enable recent guest OS
versions notably Ubuntu 16.04 and Windows 10. VirtualBox 5 is an
integral part of Sculpt OS since its first release.
As VirtualBox 5 is no longer maintained upstream and also shows its age
when running recent versions of Windows 10, we accepted the challenge
to once again enable a new version of this VMM. This time we did not
go for a NOVA-specific port but exclusively use the kernel-agnostic
virtualization interfaces introduced in
[https://genode.org/documentation/release-notes/19.05#Kernel-agnostic_virtual-machine_monitors - Genode 19.05].
This way, VirtualBox 6 is prepared to run on NOVA, seL4, and Fiasco.OC alike with
minimal extra efforts.
The first development snapshot we publish with this release is ready to
run Linux and Windows guests with limited support for multiple cores,
integrates network and USB-passthrough as well as preliminary support
for Guest Additions like mouse integration and display. We are
committed to finalize the feature set and optimize the performance of
VirtualBox 6 until the upcoming Sculpt release but do not plan to replace
version 5 completely yet. In fact, the update paves the way to explore
more experimental grounds like enablement of GPU-based
acceleration of guest OSes.
As a starting point for exploring VirtualBox 6 on Genode, we recommend the run script
_ports/run/virtualbox6.run_.
VirtualBox 5
============
With this release, we extended our VirtualBox port and made USB
pass-through more robust.
So far, we most prominently use VirtualBox on Intel systems that feature
VT-x. This release enables support for also running 64bit guests on AMD
systems with SVM.
When it comes to USB pass-through support, we rely on the xHCI device-model
ported from Qemu. With this release, we updated the 3rd-party sources to
version 5.2.0 and the type of the exposed device has changed to QEMU xHCI. Due to
this change, older guest OSes - namely Windows 7 - that relied on the NEC
xHCI device will no longer work.
Thanks to the update, it becomes possible to use USB devices requiring isochronous
transfers, in particular audio devices, with Windows 10 guests. For now
we focused on USB-Audio-Class v1 devices using adaptive
synchronisation, which enables a variety of popular USB headsets for
the passthrough use case.
A glimpse into our USB machinery unveils that fine-tuned buffering and USB
transfer configuration is the key to robust USB passthrough. On one hand, the
handling of isochronous OUT transfers in our host connection batches multiple
packets and queues transfers, which helps to smoothen out playback in case other
Genode components utilize the CPU concurrently. On the other hand, the number of
IN requests queued is increased but the number of packets per request set to 1.
We obtained the best results by following this configuration observed in Linux
and Windows guests alike.
VirtIO block devices for virtual machines on ARM
================================================
With release
[https://genode.org/documentation/release-notes/20.02#Custom_virtual_machine_monitor_on_ARM - 20.02],
the first VirtIO device models entered Genode's virtual
machine monitor for ARM. They enabled a virtual machine to access network and
terminal services. This time, the VMM got extended with a block device model,
which again is compliant to the VirtIO 1.1 specification. Moreover, the generic
model implementation, which is common to all VirtIO devices, got polished fairly.
The new block device model is not configurable yet. By now, the VMM is
hard-coded to provide exactly one block device. Consequently, one route to a
Block service needs to be provided to the VMM component.
The execution of the test run-script in _repos/os/run/vmm_arm.run_ shows
the new VirtIO block device in action.
Device drivers
##############
Power-gating of PCI devices on x86
==================================
PCI devices have several PCI capabilities that describe the feature set
the device supports, as defined by the PCI specification. The platform driver - which
is the gatekeeper of devices on Genode - got extended to power on and power off
devices whenever the PCI power capability is supported. When powering on, a device reset
is issued if it is supported by the PCI device. During release of a driver from a
device, all DMA memory associated to the device is
flushed from the IO-MMU TLB to avoid any further access.
Additionally, the platform driver has become able to respond to configuration
changes. Special care must be taken if the configuration of a running device
driver changes. If the configuration re-evaluation concludes that a driver is no longer
permitted to use an already assigned PCI device, the Platform session
will be closed forcefully, making the device inaccessible to the driver.
The extended features of the platform driver supplement our previous work of
restarting respectively replacing a running graphics driver in Sculpt OS. The driver
manager, as used by Sculpt, uses Genode's heartbeat monitoring to check for the
liveliness of the Intel framebuffer driver and restarts it automatically if the
driver becomes unresponsive. Restarting
involves closing the Platform session, thereby powering off the Intel device,
and reopening the Platform session, thereby powering and resetting the
Intel device into a functional state.
This self-healing mechanism can be seen in action in the recording of our
[https://fosdem.org/2021/schedule/event/microkernel_pluggable_device_drivers_for_genode/ - FOSDEM talk]
about pluggable device drivers.
USB drivers
===========
Additional HID devices
~~~~~~~~~~~~~~~~~~~~~~
It's a sad truth that some popular USB keyboards and mice do not fully
comply with the USB HID standard. The Linux kernel comes with dozens
of special functions to fix up quirks and enable these devices
for Linux systems also. With the current release, we adopt quirk functions
for Apple HID devices and mice based on the Holtek chipset (e.g., the
Sharkoon Drakonia) that are applied automatically if one of these
devices is plugged.
USB robustness
~~~~~~~~~~~~~~
We improved the robustness of the USB HID driver with regard to device
reconnection, as well as the robustness of the DWC OTG host driver for
the Raspberry Pi when used with HID devices.
Isochronous transfers
~~~~~~~~~~~~~~~~~~~~~
While looking more closely into supporting isochronous transfers
driven by the USB pass-through use-case, we encountered and addressed shortcomings
in the current implementation in the USB host-controller driver
when dealing with IN transfers containing multiple isochronous frames.
However, this is only a first step as we identified significant potential for
optimization and robustness improvements.
Platforms
#########
Pine-A64-LTS single board computer
==================================
Our [https://genode.org/about/road-map - road map] envisions
the use of Genode on the Pinephone by the end of the year. As a first stepping
stone, the current release adds basic board support for the
[https://pine64.com/product-category/pine-a64-ltslong-term-supply/ - Pine-A64-LTS]
single-board computer. We take this line of work as a welcome opportunity to
thoroughly document the porting process. You can find the work explained in
great detail in the following article series.
# [https://genodians.org/nfeske/2020-12-10-pine-fun-warmup - Warming up for some Pine fun]
# [https://genodians.org/nfeske/2020-12-17-pine-fun-serial - Bare-metal serial output]
# [https://genodians.org/nfeske/2021-01-28-pine-fun-kernel-skeleton - Kernel skeleton]
# [https://genodians.org/nfeske/2021-02-11-pine-fun-debugging - How did we come here?]
# [https://genodians.org/nfeske/2021-02-18-pine-fun-user-land - Excursion to the user land]
The latest state of this line of work is available at a dedicated repository:
:Genode board support for Allwinner SoCs:
[https://github.com/nfeske/genode-allwinner]
RISC-V
======
RISC-V development has been on the hold at Genode Labs for a while. But with the
current release this has changed. One of the main goals we had for a long time
is the use of Qemu instead of the Spike emulator for our test infrastructure, since
every other platform runs on Qemu, Spike causes additional overhead at Genode
Labs.
By updating the privileged ISA specification support from 1.9.1 to 1.10,
we became able to use recent Qemu versions (e.g., 4.2.1).
Thanks to this change, we could remove the _spike_ board and add a new
_riscv_qemu_ board to our _base_hw_ kernel implementation.
As another nice side effect, Qemu ships its own OpenSBI machine binary, which
implements the machine mode and SBI calls. It can be enabled through the "-bios"
command line option. With a machine mode for ISA 1.10 in place, we were able to
remove the old [https://github.com/ssumpf/bbl-lite - BBL] machine mode
implementation from Genode.
For more information on this topic please refer to the corresponding
[https://genodians.org/ssumpf/2021-02-24-riscv - Genodians article].
In order to improve development speed, we were able to reduce the link time for
_core_ and its debugging variant from about 50 to 5 seconds. Additionally, we
fixed long standing link errors that were caused by mixing up soft float and
hard float objects as well as misconfigured linker scripts.
Removal of Muen separation kernel support
=========================================
Since
[https://genode.org/documentation/release-notes/15.08#Genode_on_top_of_the_Muen_Separation_Kernel - version 15.08],
Genode supported the use of the [https://muen.sk - Muen] separation kernel as
underlying platform. The driving force behind the original development was the
joyful collaboration with the Muen developers Adrian-Ken Rueegsegger and Reto
Buerki and the prospect for products that combine the rigidity of a separation
kernel with the dynamic workloads enabled by Genode.
However, over the past 5 years, this potential synergy remained untapped.
In hindsight, the stacking of one microkernel-based system onto another
microkernel-based system is a tough sell. Hosting dynamic workloads in a Linux
VM atop Muen is certainly more relatable to Muen users. Vice versa, for Genode
users, Genode on bare hardware is less complex and more flexible than using
the framework atop a separation kernel.
Without adoption of the joint platform, neither of both teams can justify the
ongoing effort needed for the continued maintenance of Genode on Muen. Hence,
we [https://github.com/genodelabs/genode/issues/3995 - concluded] to remove
Muen as an officially supported platform.
Build system and tools
######################
Streamlined distinction of boards by build and run tools
========================================================
In
[https://genode.org/documentation/release-notes/20.05#Board_support_outside_the_Genode_main_repository - Genode 20.05],
we introduced the principle ability to decouple board-support packages from
the project's main repository. We thereby want to enable developers outside
the Genode core team to port Genode to diverse hardware platforms.
With the current release, we further refined the structure of the code base and
the tooling to largely eliminate remaining points of friction when hosting
board support in external repositories.
We ultimately removed the use of board-specific SPEC values throughout the
build system and run scripts. SPEC values are now solely used to refer to
aspects of an instruction-set architecture, e.g., x86, 64bit, or arm_v8a.
In run scripts, the new convenience function 'have_board' has become the
preferred way to distinguish the behavior of run scripts depending on the
targeted board now. It replaces all former uses of 'have_spec <board>'.
Moreover, the long deprecated option of the _create_builddir_ tool to create
board-specific build directories has been removed.
To simplify the hosting of board support in separate source-code repositories,
board-specific properties have moved from run-tool scripts to the new notion
of *board property directories*. Such directories named
_<repo>/board/<board>/_ contain files with board-specific information.
In particular, the 'image_link_address' file contains the physical
link address of the system image taking the board's physical memory
constraints into account, and the 'arch' file contains the CPU
architecture of the SoC. The run tool picks up this information
from the board-property files.
Furthermore, the *packaging* of the board-specific base-hw kernel has
become more formalized by leveraging the board-property directories.
This makes the packaging vastly simpler. Regardless of where the board-support
is hosted, the _content.mk_ file for a kernel source archive 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. 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 resulting depot archives
have become 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.
Compiler cache
==============
The [https://ccache.dev - ccache] tool is a fantastic way to accelerate the
developer workflow when repeatedly building software. Since ccache is -
strictly speaking - orthogonal to the build system, configuring the Genode
build system for the use of ccache was left to each developer.
Setting up ccache is not straight-forward though. One must manually create
hooks (symlinks shadowing the compiler executables), tweak the PATH
environment variable, and customize the CROSS_DEV_PREFIX in
_etc/tools.conf_. In short, only seasoned developers jump through those hoops.
Many others may miss out on the joys of ccache.
With the current release, the build-system front end makes ccache easily
available by enabling a simple option in the _etc/build.conf_ file:
! CCACHE := yes

View File

@@ -14,121 +14,92 @@ 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.
Review of 2019
Review of 2020
##############
For the road map 2019, we picked "bridging worlds" as our guiding theme:
(1) Lowering the friction when combining existing software with Genode,
(2) Fostering interoperability with widely used protocols and APIs, and
(3) Making Genode easier to approach and generally more practical.
The overarching theme of our road map for 2020 was "Dwarfing the barrier of
entry", which expressed the ambition to reach a wider audience. On that
account, we identified four promising directions: First, making Sculpt OS
palatable for a wider circle. Second, fostering the public perception of the
high quality of Genode to reinforce the confidence of people who are sceptical
towards novel operating-system technology. Third, lowering the barrier of
entry by providing frictionless tooling. And fourth, publicly presenting use
cases that prove the fitness and flexibility of Genode. These directions
certainly did a good job of motivating the working topics of last year's four
releases
[https://genode.org/documentation/release-notes/20.02 - 20.02],
[https://genode.org/documentation/release-notes/20.05 - 20.05],
[https://genode.org/documentation/release-notes/20.08 - 20.08], and
[https://genode.org/documentation/release-notes/20.11 - 20.11].
With respect to (1), we identified Genode's custom tooling (build
system, run scripts, ports mechanism, depot tools) as a point of
friction. They are arguably powerful and flexible but require a lot of
up-front learning. This is certainly a burden unacceptable for a casual
developer without a black belt in Make and Expect/Tcl. The new
[https://genode.org/documentation/release-notes/19.11#New_tooling_for_bridging_existing_build_systems_with_Genode - Goa]
tool rearranges the existing tools in a way that puts the concerns of casual
developers into focus, allowing for the use of commodity build systems,
eliminating Tcl syntax from the equation, running sub-second test cycles, and
streamlining the packaging of software.
The UI improvements of Sculpt OS in version 20.02 largely eliminated the need
to use the command line as presented
[https://www.youtube.com/watch?v=vmgWgzeKAjU - here].
The second direction - software quality - motivated the steady improvements of
our POSIX runtime, ultimately enabling highly sophisticated workloads like the
Chromium web engine on Genode. Regarding our stated commitment to 64-bit ARM
hardware, in particular supporting the NXP i.MX8 SoC, we covered 64-bit
multi-core virtualization, HDMI, touch input, OLED, networking, LTE, USB,
clock and power management, VirtIO, up to running Sculpt OS on this platform.
On account of (2), we
[https://genode.org/documentation/release-notes/19.05#Broadened_CPU_architecture_support_and_updated_tool_chain - switched to C++17]
by default, fostered the use of
[https://genodians.org/ssumpf/2019-02-27-java-19-02 - Java],
updated Qt5, and put
[https://genode.org/documentation/release-notes/19.11#C_runtime_with_improved_POSIX_compatibility - POSIX]
compatibility into the spotlight. We were eventually able to dissolve the need
for our custom Unix runtime (Noux) because all features of Noux are covered by
our regular libc now.
Our biggest step towards (3) is the [https://genodians.org] website we
started in winter 2019, which gives individual members of our community
an easy way to present thoughts, projects, and experiences.
Complementing Genode's formal documentation, it also conserves practical
tips and tricks that were previously not covered in written form.
When speaking of "bridging worlds", we should not forget to mention the
tremendous effort to bring Sculpt-OS-like workloads to the 64-bit ARM world.
Thanks to the added support for
[https://genode.org/documentation/release-notes/19.08#64-bit_ARM_and_NXP_i.MX8 - multi-core AARCH64],
hardware-based
[https://genode.org/documentation/release-notes/19.11#Virtualization_of_64-bit_ARM_platforms - virtualization],
and network/USB/graphics drivers for the i.MX8 SoC, the flexibility of Sculpt
OS will eventually become available on PC hardware and ARM-based devices
alike.
Over the course of 2019, we admittedly skipped a few topics originally
mentioned on our road map. In particular, the user-visible side of
Sculpt OS received less attention than originally envisioned. We also
deferred several ideas we had in mind about reworking our GUI stack.
Instead, we expanded our work in the areas of storage (block-level APIs,
test infrastructure,
[https://genode.org/documentation/release-notes/19.11#Preliminary_block-device_encrypter - block encryption])
and
[https://genode.org/documentation/release-notes/19.08#Flexible_keyboard_layouts - input processing].
This shift of focus is mostly attributed to the priorities of Genode Labs'
customers who fund our work.
Granted, Genode's audience hasn't increased by a large margin as a direct
result of these efforts. But as illustrated by the fruitful road-map
discussion for 2021 on the
[https://genode.org/community/mailing-lists - mailing list],
our community is more engaged and enthusiastic than ever before.
2020 - Dwarfing the barrier of entry
####################################
2021 - Optimization and Platform diversity
##########################################
Genode as a technology is there. For more than one decade, we walked unfathomed
territory, fought with countless deep rabbit holes, took risky decisions,
tracked back, explored design spaces, developed taste and distaste, pruned
technical debt, and eventually found formulas of success. Today, there are no
(fundamental) unsolved questions. All the puzzle pieces are in place. There
could be no better proof than our daily use of Sculpt OS. The time is right
to make Genode palatable for a wider circle. We identified four actionable
topics to achieve that.
For the initial conquering of 64-bit ARM territory, restraining our focus to
one particular SoC - namely NXP i.MX8 - was a healthy approach. Now it is the
right time to optimize and to branch out the development to further
platforms. The following key aspects of our road map for 2021 reflect that.
:User friendliness of Sculpt OS:
:Pinephone:
By the end of the year, we want be able to use Genode on the
[https://pine64.com/product-category/pinephone/ - Pinephone]
as a feature phone, covering basic web-browsing needs, placing calls, and
SMS.
Until now, Sculpt OS is not exactly friendly towards users who are
unfamiliar with the Unix command-line tools. Since Sculpt is not Unix
based, this is a bit paradoxical. 2020 will give Sculpt OS a friendlier
and discoverable user experience. In this context, we will inevitably
put our attention to Genode's GUI stack.
:Linux-device-driver environment re-imagined:
We are convinced that we have to dramatically reduce the engineering
effort needed to port device drivers from the Linux kernel to Genode. With
many years of driver-porting experience under our belts, we plan to condense
the lessons learned in the form of new tooling and documentation. This, in
turn, will hopefully pave the ground for more and more developers
contributing to Genode's device-driver coverage in the future.
:Perception of high quality:
:Developer experience:
Speaking of new developers, we see Genode's existing tool set as a barrier
because it requires a rather steep learning curve. Hence, this year, we will
have a fresh take on tooling and workflows. The starting point will be the
experimental [https://github.com/nfeske/goa - Goa] tool, which in principle
allows developers to use familiar build systems for Genode development. We
plan to extend Goa to cover more build systems, and shape the tool towards
system-integration tasks and quick compile-test cycles targeting embedded
devices.
Compared to commodity operating systems who stood the test of time,
Genode is a young and largely unproven technology. It understandably calls
for skepticism. All the more we must leave no doubts about our high
quality standards. There must be no room for uncertainty. Hence, during
2020, we will intensify the consolidation and optimization of the framework
and its API, and talk about it.
:Optimization:
Motivated by usage scenarios like the Pinephone, we are eager to tap into
plenty of opportunities for optimization. Based on data gathered by improved
system tracing, we consider interface refinements to improve the batching of
I/O (file-system access, networking), micro-optimizations of hot code paths
(like TLS lookup, parsers, and allocators), as well as structural changes
(like the consolidation of low-level services).
:Enjoyable tooling:
Genode's success at large will depend on developers. As of today, software
development for Genode requires a huge up-front learning curve. This is
fine for people who are already convinced of Genode. But it unacceptable
for casual developers who want to get their toes wet. We should aim for
tooling that allows new developers to keep up their flow and beloved
tools. The recently introduced [https://genodians.org/nfeske/2019-11-25-goa - Goa]
tooling is our first take in this respect. It is certainly too early to call
Goa a success. In order to find out if we are on the right track, we want to
expose Goa to as many problems as possible, primarily by the means of
porting software. Also, things like IDE usage or adapters for a variety of
build systems will certainly move into focus in 2020.
:Convincing use cases:
Use cases can give exemplary proof of the fitness of Genode. We already
took a few baby steps to extend the range of documented use cases beyond
Sculpt OS last year. The boot2java scenenario comes in mind. 2020 will
hopefully see several more illustrations of Genode's versatility.
:GPU support:
Distantly related to optimization, GPU support is an increasingly requested
feature. We already
[https://genode.org/documentation/release-notes/17.08#Hardware-accelerated_graphics_for_Intel_Gen-8_GPUs - wetted our toes]
in the past. But GPU support has not yet become routinely supported in
system scenarios like Sculpt OS. In 2021, we want to change that, making GPU
support a feature that can be relied on. We will primarily address Intel
graphics first but also explore GPUs on ARM-based devices.
Apart from this overall theme, we plan to continue our commitment to the
NXP i.MX SoC family, revisit Genode's low-latency audio support, and
extend the cultivation of Ada/SPARK within (and on top of) Genode.
Milestones for 2020
Milestones for 2021
###################
In the following, we present a rough schedule of the planned work. As usual,
@@ -136,64 +107,65 @@ it is not set in stone. If you are interested in a particular line of work,
please get in touch.
February - Release 20.02
February - Release 21.02
========================
* Consolidation: removal of the Noux runtime
* Library version of the init component
* Updated audio drivers
* Sculpt
* 64-bit ARM (i.MX8)
* Revised administrative user interface
* System image without Unix tools
* Pluggable device drivers (NIC, WLAN, framebuffer, input)
* VirtualBox 6
* Sculpt: basic UI for the consistent block encrypter (CBE)
* 64-bit ARM
* VirtIO block-device support for virtual machines
* Base platform support for the Pine A64 board (kernel base framework)
May - Release 20.05
May - Release 21.05
===================
* Updated "Genode Foundations" book
* Consolidation
* Block-level components (update to Genode's modern block APIs)
* ARM device drivers (introducing the notion of a platform driver)
* Improved STL support (e.g., threading and mutexes)
* Continuous POSIX-compliance testing
* Systematic network-stack stress and performance tests
* Desktop: panel and virtual desktops
* Use case: Genode-based network router
* Goa: broadened support for 3rd-party build systems
* Native tool chain, including Git
* Sculpt
* Interactive device management
* Keyboard-controlled administration
* Support for BSPs maintained outside of Genode's mainline repository
* Annual documentation update, including the "Genode Foundations" book
* GPU support
* MESA update
* Experiments on ARM (e.g., Vivante on i.MX8, or Mali-400 on A64)
* Sculpt OS on Pine A64 (USB, input, framebuffer, SD-card, networking)
* 64-bit ARM
* Platform-driver consolidation between ARM and x86
* PCI-express support for MNT Reform (i.MX8)
* Tool-chain update (e.g., switching to hard-float on ARM)
* Modernized client-side NIC and uplink APIs
* Goa
* Broadened architecture support and testing workflow
* API projects
* Inter-project dependencies
August - Release 20.08
August - Release 21.08
======================
* Revisited GUI-related framework interfaces
* Extended tooling for performance monitoring
* Goa: Qt development workflow
* Desktop
* Native mail client
* Native web browser
* Sculpt
* Configurable CPU resources
* On-screen documentation
* Block encryption via our
[https://genode.org/documentation/release-notes/19.11#Preliminary_block-device_encrypter - consistent block encrypter]
implemented in Ada/SPARK
* USB audio
* Initial version of a kernel implemented in Ada/SPARK
* Linux DDE re-imagined
* Improved tooling
* Exploring Goa-based development workflow
* GPU support
* GPU multiplexer for Intel Gen9 graphics
* Harmonization of GPU driver with Intel framebuffer driver
* Initial version of a custom kernel (Spunky) implemented in Ada/SPARK
* System-level tracing infrastructure for guiding and validating optimizations
* Pinephone
* Touchscreen and display
* Mobile web browser
* Goa
* CMake-based Qt5 applications
* QML-based applications
November - Release 20.11
November - Release 21.11
========================
* Consolidation of capability-space management across kernels
* CPU-load balancing
* Hardware-accelerated graphics on i.MX8 (experimental)
* Reworked audio stack (interfaces, mixing)
* Sculpt: component lifetime management, shutdown protocol
* VFS plugins for lwext4 and FUSE-based file systems
* Pinephone
* Mobile data connectivity (LTE)
* Phone calls (audio)
* SMS
* seL4
* Update to current kernel version, MCS scheduling
* Combining CAmkES with Genode
* SMMU (I/O-MMU for ARM) support for our custom (base-hw) kernel
* Multi-monitor support

View File

@@ -31,33 +31,25 @@ but build upon of each other:
:'nova':
NOVA hypervisor developed at University of Technology Dresden
See [https://genode.org/documentation/platforms/nova]
:'foc':
Fiasco.OC is a modernized version of the Fiasco microkernel with a
completely revised kernel interface fostering capability-based
security. It is not compatible with L4/Fiasco.
See [https://genode.org/documentation/platforms/foc]
:'hw':
The hw platform allows the execution of Genode on bare ARM and x86 hardware
without the need for a separate kernel. The kernel functionality is
included in core except in the special case of the Muen separation
kernel.
See [https://genode.org/documentation/platforms/hw] and
[https://genode.org/documentation/platforms/muen]
included in core.
:'okl4':
OKL4 kernel (x86_32 and ARM) developed at Open-Kernel-Labs.
See [https://genode.org/documentation/platforms/okl4]
:'pistachio':
L4ka::Pistachio kernel developed at University of Karlsruhe.
See [https://genode.org/documentation/platforms/pistachio]
:'fiasco':
L4/Fiasco kernel developed at University of Technology Dresden.
See [https://genode.org/documentation/platforms/fiasco]
:'sel4':
seL4 microkernel developed at NICTA/General Dynamics

View File

@@ -1,4 +1 @@
This repository contains the L4/Fiasco-specific implementation of Genode.
For instructions to build and start the Fiasco version of Genode, please
consult the documentation located at 'base-fiasco/doc/fiasco.txt'.

View File

@@ -1 +1 @@
SPECS += fiasco x86_32
SPECS += fiasco

View File

@@ -1 +1 @@
2020-11-26 054bb0a83a4a6b5bec210f87a20359f6dceba4ad
2021-03-11 d5d038d82badefdb0ec442be4dc7b23064ad2831

View File

@@ -14,7 +14,10 @@
/* core includes */
#include <core_log.h>
namespace Fiasco {
#include <l4/sys/kdebug.h>
}
void Genode::Core_log::out(char const c) { Fiasco::outchar(c); }
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
void Core_log::out(char const c) { Fiasco::outchar(c); }

View File

@@ -1,4 +1,4 @@
LIBS := core-fiasco
CORE_OBJ := core-fiasco.o
CORE_LIB := core-fiasco.a
include $(BASE_DIR)/src/core/target.inc

View File

@@ -27,154 +27,153 @@
/* core includes */
#include <util.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
class Mapping
{
private:
addr_t _dst_addr;
Fiasco::l4_fpage_t _fpage;
public:
/**
* Constructor
*/
Mapping(addr_t dst_addr, addr_t src_addr,
Cache_attribute cacheability, bool,
unsigned l2size, bool rw, bool)
:
_dst_addr(dst_addr),
_fpage(Fiasco::l4_fpage(src_addr, l2size, rw, false))
{
if (cacheability == WRITE_COMBINED)
_fpage.fp.cache = Fiasco::L4_FPAGE_BUFFERABLE;
}
/**
* Construct invalid flexpage
*/
Mapping() : _dst_addr(0), _fpage(Fiasco::l4_fpage(0, 0, 0, 0)) { }
Fiasco::l4_umword_t dst_addr() const { return _dst_addr; }
Fiasco::l4_fpage_t fpage() const { return _fpage; }
/**
* Prepare map operation
*
* On Fiasco, we need to map a page locally to be able to map it to
* another address space.
*/
void prepare_map_operation()
{
addr_t core_local_addr = _fpage.fp.page << 12;
size_t mapping_size = 1 << _fpage.fp.size;
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
if (_fpage.fp.write)
touch_read_write((unsigned char volatile *)(core_local_addr + i));
else
touch_read((unsigned char const volatile *)(core_local_addr + i));
}
}
};
/**
* Special paging server class
*/
class Ipc_pager
{
private:
Fiasco::l4_threadid_t _last { }; /* origin of last fault message */
addr_t _pf_addr { 0 }; /* page-fault address */
addr_t _pf_ip { 0 }; /* instruction pointer of faulter */
Mapping _reply_mapping { }; /* page-fault answer */
public:
/**
* Wait for a new page fault received as short message IPC
*/
void wait_for_fault();
/**
* Reply current page-fault and wait for a new one
*
* Send short flex page and wait for next short-message (register)
* IPC -- pagefault
*/
void reply_and_wait_for_fault();
/**
* Request instruction pointer of current page fault
*/
addr_t fault_ip() { return _pf_ip; }
/**
* Request fault address of current page fault
*/
addr_t fault_addr() { return _pf_addr & ~3; }
/**
* Set parameters for next reply
*/
void set_reply_mapping(Mapping m) { _reply_mapping = m; }
/**
* Set destination for next reply
*/
void set_reply_dst(Native_capability pager_object) {
_last.raw = pager_object.local_name(); }
/**
* Answer call without sending a flex-page mapping
*
* This function is used to acknowledge local calls from one of
* core's region-manager sessions.
*/
void acknowledge_wakeup();
/**
* Returns true if the last request was send from a core thread
*/
bool request_from_core()
{
enum { CORE_TASK_ID = 4 };
return _last.id.task == CORE_TASK_ID;
}
/**
* Return badge for faulting thread
*
* As Fiasco has no server-defined badges for page-fault messages, we
* interpret the sender ID as badge.
*/
unsigned long badge() const {
return convert_native_thread_id_to_badge(_last); }
bool write_fault() const { return (_pf_addr & 2); }
bool exec_fault() const { return false; }
/**
* Return true if last fault was an exception
*/
bool exception() const
{
/*
* Reflection of exceptions is not supported on this platform.
*/
return false;
}
};
class Mapping;
class Ipc_pager;
}
class Genode::Mapping
{
private:
addr_t _dst_addr;
Fiasco::l4_fpage_t _fpage;
public:
/**
* Constructor
*/
Mapping(addr_t dst_addr, addr_t src_addr,
Cache_attribute cacheability, bool,
unsigned l2size, bool rw, bool)
:
_dst_addr(dst_addr),
_fpage(Fiasco::l4_fpage(src_addr, l2size, rw, false))
{
if (cacheability == WRITE_COMBINED)
_fpage.fp.cache = Fiasco::L4_FPAGE_BUFFERABLE;
}
/**
* Construct invalid flexpage
*/
Mapping() : _dst_addr(0), _fpage(Fiasco::l4_fpage(0, 0, 0, 0)) { }
Fiasco::l4_umword_t dst_addr() const { return _dst_addr; }
Fiasco::l4_fpage_t fpage() const { return _fpage; }
/**
* Prepare map operation
*
* On Fiasco, we need to map a page locally to be able to map it to
* another address space.
*/
void prepare_map_operation()
{
addr_t core_local_addr = _fpage.fp.page << 12;
size_t mapping_size = 1 << _fpage.fp.size;
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
if (_fpage.fp.write)
touch_read_write((unsigned char volatile *)(core_local_addr + i));
else
touch_read((unsigned char const volatile *)(core_local_addr + i));
}
}
};
class Genode::Ipc_pager
{
private:
Fiasco::l4_threadid_t _last { }; /* origin of last fault message */
addr_t _pf_addr { 0 }; /* page-fault address */
addr_t _pf_ip { 0 }; /* instruction pointer of faulter */
Mapping _reply_mapping { }; /* page-fault answer */
public:
/**
* Wait for a new page fault received as short message IPC
*/
void wait_for_fault();
/**
* Reply current page-fault and wait for a new one
*
* Send short flex page and wait for next short-message (register)
* IPC -- pagefault
*/
void reply_and_wait_for_fault();
/**
* Request instruction pointer of current page fault
*/
addr_t fault_ip() { return _pf_ip; }
/**
* Request fault address of current page fault
*/
addr_t fault_addr() { return _pf_addr & ~3; }
/**
* Set parameters for next reply
*/
void set_reply_mapping(Mapping m) { _reply_mapping = m; }
/**
* Set destination for next reply
*/
void set_reply_dst(Native_capability pager_object) {
_last.raw = pager_object.local_name(); }
/**
* Answer call without sending a flex-page mapping
*
* This function is used to acknowledge local calls from one of
* core's region-manager sessions.
*/
void acknowledge_wakeup();
/**
* Returns true if the last request was send from a core thread
*/
bool request_from_core()
{
enum { CORE_TASK_ID = 4 };
return _last.id.task == CORE_TASK_ID;
}
/**
* Return badge for faulting thread
*
* As Fiasco has no server-defined badges for page-fault messages, we
* interpret the sender ID as badge.
*/
unsigned long badge() const {
return convert_native_thread_id_to_badge(_last); }
bool write_fault() const { return (_pf_addr & 2); }
bool exec_fault() const { return false; }
/**
* Return true if last fault was an exception
*/
bool exception() const
{
/*
* Reflection of exceptions is not supported on this platform.
*/
return false;
}
};
#endif /* _CORE__INCLUDE__IPC_PAGER_H_ */

View File

@@ -18,12 +18,8 @@
#include <platform.h>
#include <util.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/kdebug.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {

View File

@@ -15,9 +15,13 @@
#ifndef _CORE__INCLUDE__PLATFORM_H_
#define _CORE__INCLUDE__PLATFORM_H_
/* Genode includes */
#include <base/allocator_avl.h>
/* base-internal includes */
#include <base/internal/capability_space.h>
/* core includes */
#include <synced_range_allocator.h>
#include <platform_generic.h>
#include <platform_thread.h>
@@ -25,150 +29,149 @@
#include <boot_modules.h>
#include <assertion.h>
namespace Genode { class Platform; }
namespace Genode {
class Platform : public Platform_generic
{
private:
class Genode::Platform : public Platform_generic
{
private:
/*
* Noncopyable
*/
Platform(Platform const &);
Platform &operator = (Platform const &);
/*
* Noncopyable
*/
Platform(Platform const &);
Platform &operator = (Platform const &);
/*
* Shortcut for the type of allocator instances for physical resources
*/
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
/*
* Shortcut for the type of allocator instances for physical resources
*/
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
char _core_label[1]; /* to satisfy _core_pd */
Platform_pd *_core_pd = nullptr; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Phys_allocator _region_alloc; /* virtual memory allocator for core */
Rom_fs _rom_fs { }; /* ROM file system */
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
char _core_label[1]; /* to satisfy _core_pd */
Platform_pd *_core_pd = nullptr; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Phys_allocator _region_alloc; /* virtual memory allocator for core */
Rom_fs _rom_fs { }; /* ROM file system */
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
addr_t _vm_start = 0; /* begin of virtual memory */
size_t _vm_size = 0; /* size of virtual memory */
addr_t _vm_start = 0; /* begin of virtual memory */
size_t _vm_size = 0; /* size of virtual memory */
/*
* We do not export any boot module loaded before FIRST_ROM.
*/
enum { FIRST_ROM = 3 };
/*
* We do not export any boot module loaded before FIRST_ROM.
*/
enum { FIRST_ROM = 3 };
/**
* Setup base resources
*
* - Map and provide KIP as ROM module
* - Initializes region allocator
*/
void _setup_basics();
/**
* Setup base resources
*
* - Map and provide KIP as ROM module
* - Initializes region allocator
*/
void _setup_basics();
/**
* Setup RAM, IO_MEM, and region allocators
*/
void _setup_mem_alloc();
/**
* Setup RAM, IO_MEM, and region allocators
*/
void _setup_mem_alloc();
/**
* Setup I/O port space allocator
*/
void _setup_io_port_alloc();
/**
* Setup I/O port space allocator
*/
void _setup_io_port_alloc();
/**
* Setup IRQ allocator
*/
void _setup_irq_alloc();
/**
* Setup IRQ allocator
*/
void _setup_irq_alloc();
/**
* Parse multi-boot information and update ROM database
*/
void _init_rom_modules();
/**
* Parse multi-boot information and update ROM database
*/
void _init_rom_modules();
/**
* Setup pager for core-internal threads
*/
void _setup_core_pager();
/**
* Setup pager for core-internal threads
*/
void _setup_core_pager();
addr_t _rom_module_phys(addr_t virt) { return virt; }
addr_t _rom_module_phys(addr_t virt) { return virt; }
public:
/**
* Pager object representing the pager of core namely sigma0
*/
struct Sigma0 : public Pager_object
{
/**
* Constructor
*/
Sigma0();
int pager(Ipc_pager &) override { /* never called */ return -1; }
};
/**
* Return singleton instance of Sigma0 pager object
*/
static Sigma0 &sigma0();
/**
* Core pager thread that handles core-internal page-faults
*/
struct Core_pager : public Platform_thread, public Pager_object
{
/**
* Constructor
*/
Core_pager(Platform_pd &core_pd);
int pager(Ipc_pager &) override { /* never called */ return -1; }
};
/**
* Return singleton instance of core pager object
*/
Core_pager &core_pager();
public:
/**
* Pager object representing the pager of core namely sigma0
*/
struct Sigma0 : public Pager_object
{
/**
* Constructor
*/
Platform();
Sigma0();
int pager(Ipc_pager &) override { /* never called */ return -1; }
};
/**
* Return singleton instance of Sigma0 pager object
*/
static Sigma0 &sigma0();
/**
* Core pager thread that handles core-internal page-faults
*/
struct Core_pager : public Platform_thread, public Pager_object
{
/**
* Accessor for core pd object
* Constructor
*/
Platform_pd &core_pd()
{
if (_core_pd)
return *_core_pd;
Core_pager(Platform_pd &core_pd);
ASSERT_NEVER_CALLED;
}
int pager(Ipc_pager &) override { /* never called */ return -1; }
};
/**
* Return singleton instance of core pager object
*/
Core_pager &core_pager();
/**
* Constructor
*/
Platform();
/**
* Accessor for core pd object
*/
Platform_pd &core_pd()
{
if (_core_pd)
return *_core_pd;
ASSERT_NEVER_CALLED;
}
/********************************
** Generic platform interface **
********************************/
/********************************
** Generic platform interface **
********************************/
Range_allocator &core_mem_alloc() override { return _ram_alloc; }
Range_allocator &ram_alloc() override { return _ram_alloc; }
Range_allocator &io_mem_alloc() override { return _io_mem_alloc; }
Range_allocator &io_port_alloc() override { return _io_port_alloc; }
Range_allocator &irq_alloc() override { return _irq_alloc; }
Range_allocator &region_alloc() override { return _region_alloc; }
addr_t vm_start() const override { return _vm_start; }
size_t vm_size() const override { return _vm_size; }
Rom_fs &rom_fs() override { return _rom_fs; }
Range_allocator &core_mem_alloc() override { return _ram_alloc; }
Range_allocator &ram_alloc() override { return _ram_alloc; }
Range_allocator &io_mem_alloc() override { return _io_mem_alloc; }
Range_allocator &io_port_alloc() override { return _io_port_alloc; }
Range_allocator &irq_alloc() override { return _irq_alloc; }
Range_allocator &region_alloc() override { return _region_alloc; }
addr_t vm_start() const override { return _vm_start; }
size_t vm_size() const override { return _vm_size; }
Rom_fs &rom_fs() override { return _rom_fs; }
size_t max_caps() const override { return Capability_space::max_caps(); }
size_t max_caps() const override { return Capability_space::max_caps(); }
void wait_for_exit() override;
};
}
void wait_for_exit() override;
};
#endif /* _CORE__INCLUDE__PLATFORM_H_ */

View File

@@ -17,188 +17,193 @@
#ifndef _CORE__INCLUDE__PLATFORM_PD_H_
#define _CORE__INCLUDE__PLATFORM_PD_H_
/* Genode includes */
#include <base/allocator.h>
/* core includes */
#include <platform_thread.h>
#include <address_space.h>
namespace Fiasco {
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
class Platform_thread;
class Platform_pd : public Address_space
{
private:
/*
* Noncopyable
*/
Platform_pd(Platform_pd const &);
Platform_pd &operator = (Platform_pd const &);
enum {
VERSION_BITS = 10,
PD_FIRST = 0x10,
PD_MAX = (1 << 11) - 1, /* leave 0x7ff free for L4_INVALID_ID */
PD_VERSION_MAX = (1 << 10) - 1,
PD_INVALID = -1,
THREAD_MAX = (1 << 7),
};
unsigned _pd_id = 0;
unsigned _version = 0;
Fiasco::l4_taskid_t _l4_task_id { }; /* L4 task ID */
/**********************************************
** Threads of this protection domain object **
**********************************************/
Platform_thread *_threads[THREAD_MAX];
/**
* Initialize thread allocator
*/
void _init_threads();
/**
* Thread iteration for one task
*/
Platform_thread *_next_thread();
/**
* Thread allocation
*
* Again a special case for Core thread0.
*/
int _alloc_thread(int thread_id, Platform_thread &thread);
/**
* Thread deallocation
*
* No special case for Core thread0 here - we just never call it.
*/
void _free_thread(int thread_id);
/******************
** PD allocator **
******************/
struct Pd_alloc
{
unsigned reserved : 1;
unsigned free : 1;
unsigned version : VERSION_BITS;
Pd_alloc(bool r, bool f, unsigned v)
: reserved(r), free(f), version(v) { }
Pd_alloc() : reserved(0), free(0), version(0) { }
};
static Pd_alloc *_pds()
{
static Pd_alloc static_pds[PD_MAX];
return static_pds;
}
/**
* Protection-domain creation
*
* The syscall parameter propagates if any L4 kernel function
* should be used. We need the special case for the Core startup.
*/
void _create_pd(bool syscall);
/**
* Protection domain destruction
*
* No special case for Core here - we just never call it.
*/
void _destroy_pd();
/**
* Protection domain allocation
*
* Find free L4 task and use it. We need the special case for Core
* startup.
*/
int _alloc_pd(signed pd_id);
/**
* Protection domain deallocation
*
* No special case for Core here - we just never call it.
*/
void _free_pd();
/***************
** Debugging **
***************/
void _debug_log_pds(void);
void _debug_log_threads(void);
public:
/**
* Constructor
*/
Platform_pd(Allocator &md_alloc, char const *name);
/**
* Constructor used for core's PD
*/
Platform_pd(char const *name, signed pd_id);
/**
* Destructor
*/
~Platform_pd();
/**
* Register quota donation at allocator guard
*/
void upgrade_ram_quota(size_t) { }
/**
* Initialize L4 task facility
*/
static void init();
/**
* Bind thread to protection domain
*
* \return true on success
*/
bool bind_thread(Platform_thread &thread);
/**
* Unbind thread from protection domain
*
* Free the thread's slot and update thread object.
*/
void unbind_thread(Platform_thread &thread);
/**
* Assign parent interface to protection domain
*/
void assign_parent(Native_capability) { }
int pd_id() const { return _pd_id; }
/*****************************
** Address-space interface **
*****************************/
void flush(addr_t, size_t, Core_local_addr) override;
};
class Platform_pd;
}
class Genode::Platform_pd : public Address_space
{
private:
/*
* Noncopyable
*/
Platform_pd(Platform_pd const &);
Platform_pd &operator = (Platform_pd const &);
enum {
VERSION_BITS = 10,
PD_FIRST = 0x10,
PD_MAX = (1 << 11) - 1, /* leave 0x7ff free for L4_INVALID_ID */
PD_VERSION_MAX = (1 << 10) - 1,
PD_INVALID = -1,
THREAD_MAX = (1 << 7),
};
unsigned _pd_id = 0;
unsigned _version = 0;
Fiasco::l4_taskid_t _l4_task_id { }; /* L4 task ID */
/**********************************************
** Threads of this protection domain object **
**********************************************/
Platform_thread *_threads[THREAD_MAX];
/**
* Initialize thread allocator
*/
void _init_threads();
/**
* Thread iteration for one task
*/
Platform_thread *_next_thread();
/**
* Thread allocation
*
* Again a special case for Core thread0.
*/
int _alloc_thread(int thread_id, Platform_thread &thread);
/**
* Thread deallocation
*
* No special case for Core thread0 here - we just never call it.
*/
void _free_thread(int thread_id);
/******************
** PD allocator **
******************/
struct Pd_alloc
{
unsigned reserved : 1;
unsigned free : 1;
unsigned version : VERSION_BITS;
Pd_alloc(bool r, bool f, unsigned v)
: reserved(r), free(f), version(v) { }
Pd_alloc() : reserved(0), free(0), version(0) { }
};
static Pd_alloc *_pds()
{
static Pd_alloc static_pds[PD_MAX];
return static_pds;
}
/**
* Protection-domain creation
*
* The syscall parameter propagates if any L4 kernel function
* should be used. We need the special case for the Core startup.
*/
void _create_pd(bool syscall);
/**
* Protection domain destruction
*
* No special case for Core here - we just never call it.
*/
void _destroy_pd();
/**
* Protection domain allocation
*
* Find free L4 task and use it. We need the special case for Core
* startup.
*/
int _alloc_pd(signed pd_id);
/**
* Protection domain deallocation
*
* No special case for Core here - we just never call it.
*/
void _free_pd();
/***************
** Debugging **
***************/
void _debug_log_pds(void);
void _debug_log_threads(void);
public:
/**
* Constructor
*/
Platform_pd(Allocator &md_alloc, char const *name);
/**
* Constructor used for core's PD
*/
Platform_pd(char const *name, signed pd_id);
/**
* Destructor
*/
~Platform_pd();
/**
* Register quota donation at allocator guard
*/
void upgrade_ram_quota(size_t) { }
/**
* Initialize L4 task facility
*/
static void init();
/**
* Bind thread to protection domain
*
* \return true on success
*/
bool bind_thread(Platform_thread &thread);
/**
* Unbind thread from protection domain
*
* Free the thread's slot and update thread object.
*/
void unbind_thread(Platform_thread &thread);
/**
* Assign parent interface to protection domain
*/
void assign_parent(Native_capability) { }
int pd_id() const { return _pd_id; }
/*****************************
** Address-space interface **
*****************************/
void flush(addr_t, size_t, Core_local_addr) override;
};
#endif /* _CORE__INCLUDE__PLATFORM_PD_H_ */

View File

@@ -24,167 +24,169 @@
#include <platform_pd.h>
#include <assertion.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
class Platform_pd;
class Platform_thread : Interface
{
private:
/*
* Noncopyable
*/
Platform_thread(Platform_thread const &);
Platform_thread &operator = (Platform_thread const &);
int _thread_id = THREAD_INVALID; /* plain thread number */
Fiasco::l4_threadid_t _l4_thread_id;
typedef String<32> Name;
Name const _name; /* thread name that will be
registered at the kernel
debugger */
Platform_pd *_platform_pd = nullptr; /* protection domain thread
is bound to */
Pager_object *_pager = nullptr;
public:
enum {
THREAD_INVALID = -1, /* invalid thread number */
};
/**
* Constructor
*/
Platform_thread(size_t, const char *name, unsigned priority,
Affinity::Location, addr_t utcb);
/**
* Constructor used for core-internal threads
*/
Platform_thread(const char *name);
/**
* Destructor
*/
~Platform_thread();
/**
* Start thread
*
* \param ip instruction pointer to start at
* \param sp stack pointer to use
*
* \retval 0 successful
* \retval -1 thread could not be started
*/
int start(void *ip, void *sp);
/**
* Pause this thread
*/
void pause();
/**
* Enable/disable single stepping
*/
void single_step(bool) { }
/**
* Resume this thread
*/
void resume();
/**
* This thread is about to be bound
*
* \param thread_id local thread ID
* \param l4_thread_id final L4 thread ID
* \param pd platform pd, thread is bound to
*/
void bind(int thread_id, Fiasco::l4_threadid_t l4_thread_id,
Platform_pd &pd);
/**
* Unbind this thread
*/
void unbind();
/**
* Override thread state with 's'
*
* \throw Cpu_session::State_access_failed
*/
void state(Thread_state s);
/**
* Read thread state
*
* \throw Cpu_session::State_access_failed
*/
Thread_state state();
/**
* Set the executing CPU for this thread
*
* SMP is not supported on L4/Fiasco.
*/
void affinity(Affinity::Location) { }
/**
* Request the affinity of this thread
*/
Affinity::Location affinity() const { return Affinity::Location(); }
/************************
** Accessor functions **
************************/
/**
* Return/set pager
*/
Pager_object &pager() const
{
if (_pager)
return *_pager;
ASSERT_NEVER_CALLED;
}
void pager(Pager_object &pager) { _pager = &pager; }
/**
* Return identification of thread when faulting
*/
unsigned long pager_object_badge() const {
return convert_native_thread_id_to_badge(_l4_thread_id); }
/**
* Set CPU quota of the thread to 'quota'
*/
void quota(size_t) { /* not supported*/ }
/**
* Return execution time consumed by the thread
*/
Trace::Execution_time execution_time() const { return { 0, 0 }; }
/*******************************
** Fiasco-specific Accessors **
*******************************/
int thread_id() const { return _thread_id; }
Fiasco::l4_threadid_t native_thread_id() const { return _l4_thread_id; }
Name name() const { return _name; }
};
class Platform_thread;
}
class Genode::Platform_thread : Interface
{
private:
/*
* Noncopyable
*/
Platform_thread(Platform_thread const &);
Platform_thread &operator = (Platform_thread const &);
int _thread_id = THREAD_INVALID; /* plain thread number */
Fiasco::l4_threadid_t _l4_thread_id;
typedef String<32> Name;
Name const _name; /* thread name that will be
registered at the kernel
debugger */
Platform_pd *_platform_pd = nullptr; /* protection domain thread
is bound to */
Pager_object *_pager = nullptr;
public:
enum {
THREAD_INVALID = -1, /* invalid thread number */
};
/**
* Constructor
*/
Platform_thread(size_t, const char *name, unsigned priority,
Affinity::Location, addr_t utcb);
/**
* Constructor used for core-internal threads
*/
Platform_thread(const char *name);
/**
* Destructor
*/
~Platform_thread();
/**
* Start thread
*
* \param ip instruction pointer to start at
* \param sp stack pointer to use
*
* \retval 0 successful
* \retval -1 thread could not be started
*/
int start(void *ip, void *sp);
/**
* Pause this thread
*/
void pause();
/**
* Enable/disable single stepping
*/
void single_step(bool) { }
/**
* Resume this thread
*/
void resume();
/**
* This thread is about to be bound
*
* \param thread_id local thread ID
* \param l4_thread_id final L4 thread ID
* \param pd platform pd, thread is bound to
*/
void bind(int thread_id, Fiasco::l4_threadid_t l4_thread_id,
Platform_pd &pd);
/**
* Unbind this thread
*/
void unbind();
/**
* Override thread state with 's'
*
* \throw Cpu_session::State_access_failed
*/
void state(Thread_state s);
/**
* Read thread state
*
* \throw Cpu_session::State_access_failed
*/
Thread_state state();
/**
* Set the executing CPU for this thread
*
* SMP is not supported on L4/Fiasco.
*/
void affinity(Affinity::Location) { }
/**
* Request the affinity of this thread
*/
Affinity::Location affinity() const { return Affinity::Location(); }
/************************
** Accessor functions **
************************/
/**
* Return/set pager
*/
Pager_object &pager() const
{
if (_pager)
return *_pager;
ASSERT_NEVER_CALLED;
}
void pager(Pager_object &pager) { _pager = &pager; }
/**
* Return identification of thread when faulting
*/
unsigned long pager_object_badge() const {
return convert_native_thread_id_to_badge(_l4_thread_id); }
/**
* Set CPU quota of the thread to 'quota'
*/
void quota(size_t) { /* not supported*/ }
/**
* Return execution time consumed by the thread
*/
Trace::Execution_time execution_time() const { return { 0, 0 }; }
/*******************************
** Fiasco-specific Accessors **
*******************************/
int thread_id() const { return _thread_id; }
Fiasco::l4_threadid_t native_thread_id() const { return _l4_thread_id; }
Name name() const { return _name; }
};
#endif /* _CORE__INCLUDE__PLATFORM_THREAD_H_ */

View File

@@ -14,11 +14,13 @@
#ifndef _CORE__INCLUDE__RPC_CAP_FACTORY_H_
#define _CORE__INCLUDE__RPC_CAP_FACTORY_H_
/* Genode includes */
#include <base/allocator.h>
#include <base/capability.h>
namespace Genode { class Rpc_cap_factory; }
class Genode::Rpc_cap_factory
{
private:

View File

@@ -25,13 +25,8 @@
#include <base/internal/fiasco_thread_helper.h>
#include <base/internal/page_size.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/ipc.h>
#include <l4/sys/kdebug.h>
#include <l4/sys/ktrace.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {

View File

@@ -16,11 +16,8 @@
#include <util.h>
#include <io_mem_session_component.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sigma0/sigma0.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;

View File

@@ -19,15 +19,12 @@
#include <irq_root.h>
#include <util.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
bool Irq_object::_associate()
{
using namespace Fiasco;
@@ -74,7 +71,9 @@ void Irq_object::_wait_for_irq()
L4_IPC_SHORT_MSG, &dw0, &dw1,
L4_IPC_NEVER, &result);
if (L4_IPC_IS_ERROR(result)) error("Ipc error ", L4_IPC_ERROR(result));
if (L4_IPC_IS_ERROR(result))
error("Ipc error ", L4_IPC_ERROR(result));
} while (L4_IPC_IS_ERROR(result));
}
@@ -106,7 +105,7 @@ void Irq_object::entry()
if (!_sig_cap.valid())
continue;
Genode::Signal_transmitter(_sig_cap).submit(1);
Signal_transmitter(_sig_cap).submit(1);
_sync_ack.block();
}
@@ -142,7 +141,7 @@ Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
Irq_session_component::~Irq_session_component()
{
error("Not yet implemented.");
error(__func__, " - not implemented");
}
@@ -152,13 +151,13 @@ void Irq_session_component::ack_irq()
}
void Irq_session_component::sigh(Genode::Signal_context_capability cap)
void Irq_session_component::sigh(Signal_context_capability cap)
{
_irq_object.sigh(cap);
}
Genode::Irq_session::Info Irq_session_component::info()
Irq_session::Info Irq_session_component::info()
{
/* no MSI support */
return { .type = Info::Type::INVALID, .address = 0, .value = 0 };

View File

@@ -22,10 +22,8 @@
#include <base/internal/native_thread.h>
#include <base/internal/capability_space_tpl.h>
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Fiasco;
@@ -37,7 +35,7 @@ using namespace Fiasco;
void Ipc_pager::wait_for_fault()
{
l4_msgdope_t result;
l4_msgdope_t result;
do {
l4_ipc_wait(&_last,
@@ -53,7 +51,7 @@ void Ipc_pager::wait_for_fault()
void Ipc_pager::reply_and_wait_for_fault()
{
l4_msgdope_t result;
l4_msgdope_t result;
l4_ipc_reply_and_wait(_last,
L4_IPC_SHORT_FPAGE, _reply_mapping.dst_addr(),

View File

@@ -17,12 +17,8 @@
/* base-internal includes */
#include <base/internal/capability_space_tpl.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/kdebug.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;

View File

@@ -31,17 +31,11 @@
#include <platform_pd.h>
#include <util.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/ipc.h>
#include <l4/sys/kernel.h>
#include <l4/sys/kip.h>
#include <l4/sigma0/sigma0.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Fiasco;
/***********************************
@@ -54,6 +48,7 @@ static Synced_range_allocator<Allocator_avl> &_core_address_ranges()
return _core_address_ranges;
}
enum { PAGER_STACK_ELEMENTS = 1024 };
static unsigned long _core_pager_stack[PAGER_STACK_ELEMENTS];
static unsigned _core_pager_arg;
@@ -66,8 +61,6 @@ static void _core_pager_loop()
{
unsigned pd_id = _core_pager_arg;
using namespace Fiasco;
l4_threadid_t t;
l4_umword_t dw0, dw1;
l4_msgdope_t r;
@@ -136,7 +129,7 @@ Platform::Sigma0::Sigma0()
0, Affinity::Location(), Session_label(),
Cpu_session::Name("sigma0"))
{
cap(Capability_space::import(Fiasco::sigma0_threadid, Rpc_obj_key()));
cap(Capability_space::import(sigma0_threadid, Rpc_obj_key()));
}
@@ -166,8 +159,6 @@ Platform::Core_pager::Core_pager(Platform_pd &core_pd)
void *sp = (void *)&_core_pager_stack[PAGER_STACK_ELEMENTS - 1];
start((void *)_core_pager_loop, sp);
using namespace Fiasco;
/* pager0 receives pagefaults from me - for NULL pointer detection */
l4_umword_t d;
l4_threadid_t preempter = L4_INVALID_ID;
@@ -236,8 +227,6 @@ static inline void remove_region(Region r, Range_allocator &alloc)
*/
static inline int sigma0_req_region(addr_t *addr, unsigned log2size)
{
using namespace Fiasco;
/* XXX sigma0 always maps pages RW */
l4_umword_t req_fpage = l4_fpage(0, log2size, 0, 0).fpage;
void* rcv_window = L4_IPC_MAPMSG(0, L4_WHOLE_ADDRESS_SPACE);
@@ -246,7 +235,7 @@ static inline int sigma0_req_region(addr_t *addr, unsigned log2size)
l4_msgdope_t result;
l4_msgtag_t tag;
int err = l4_ipc_call_tag(Fiasco::sigma0_threadid,
int err = l4_ipc_call_tag(sigma0_threadid,
L4_IPC_SHORT_MSG, SIGMA0_REQ_FPAGE_ANY, req_fpage,
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
rcv_window, &base, (l4_umword_t *)&rcv_fpage,
@@ -288,8 +277,8 @@ void Platform::_setup_mem_alloc()
if (!err) {
/* XXX do not allocate page0 */
if (addr == 0) {
Fiasco::l4_fpage_unmap(Fiasco::l4_fpage(0, log2_size, 0, 0),
L4_FP_FLUSH_PAGE | L4_FP_ALL_SPACES);
l4_fpage_unmap(l4_fpage(0, log2_size, 0, 0),
L4_FP_FLUSH_PAGE | L4_FP_ALL_SPACES);
continue;
}
@@ -307,14 +296,14 @@ void Platform::_setup_mem_alloc()
}
void Platform::_setup_irq_alloc() {
_irq_alloc.add_range(0, 0x10); }
static Fiasco::l4_kernel_info_t *get_kip()
void Platform::_setup_irq_alloc()
{
using namespace Fiasco;
_irq_alloc.add_range(0, 0x10);
}
static l4_kernel_info_t *get_kip()
{
static l4_kernel_info_t *kip = nullptr;
if (kip) return kip;
@@ -329,7 +318,7 @@ static Fiasco::l4_kernel_info_t *get_kip()
l4_msgdope_t r;
l4_msgtag_t tag;
err = l4_ipc_call_tag(Fiasco::sigma0_threadid,
err = l4_ipc_call_tag(sigma0_threadid,
L4_IPC_SHORT_MSG, SIGMA0_REQ_KIP, 0,
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
fpage, &dw0, &dw1,
@@ -357,10 +346,9 @@ static Fiasco::l4_kernel_info_t *get_kip()
return kip;
}
void Platform::_setup_basics()
{
using namespace Fiasco;
l4_kernel_info_t * kip = get_kip();
/* add KIP as ROM module */
@@ -380,6 +368,7 @@ void Platform::_setup_basics()
break;
}
if (_vm_size == 0)
panic("Virtual memory configuration not found");
@@ -411,7 +400,8 @@ void Platform::_setup_basics()
}
Platform::Platform() :
Platform::Platform()
:
_ram_alloc(nullptr), _io_mem_alloc(&core_mem_alloc()),
_io_port_alloc(&core_mem_alloc()), _irq_alloc(&core_mem_alloc()),
_region_alloc(&core_mem_alloc()),
@@ -432,7 +422,7 @@ Platform::Platform() :
log(_rom_fs);
Fiasco::l4_threadid_t myself = Fiasco::l4_myself();
l4_threadid_t myself = l4_myself();
Platform_pd::init();
@@ -451,8 +441,8 @@ Platform::Platform() :
_core_pd->bind_thread(core_thread);
/* we never call _core_thread.start(), so set name directly */
Fiasco::fiasco_register_thread_name(core_thread.native_thread_id(),
core_thread.name().string());
fiasco_register_thread_name(core_thread.native_thread_id(),
core_thread.name().string());
/* core log as ROM module */
{

View File

@@ -25,19 +25,13 @@
#include <util.h>
#include <platform_pd.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/syscalls.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Fiasco;
using namespace Genode;
/**************************
** Static class members **
**************************/
static bool _init = false;
@@ -64,10 +58,10 @@ void Platform_pd::init()
void Platform_pd::_create_pd(bool syscall)
{
l4_threadid_t l4t = l4_myself();
l4t.id.task = _pd_id;
l4t.id.lthread = 0;
l4t.id.version_low = _version;
l4_threadid_t l4t = l4_myself();
l4t.id.task = _pd_id;
l4t.id.lthread = 0;
l4t.id.version_low = _version;
l4_taskid_t nt;
if (syscall)

View File

@@ -25,13 +25,8 @@
/* base-internal includes */
#include <base/internal/capability_space_tpl.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/utcb.h>
#include <l4/sys/kdebug.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Fiasco;

View File

@@ -14,13 +14,18 @@
* under the terms of the GNU Affero General Public License version 3.
*/
/* core includes */
#include <ram_dataspace_factory.h>
using namespace Genode;
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component &) { }
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component &) { }
void Ram_dataspace_factory::_clear_ds(Dataspace_component &ds)
{
memset((void *)ds.phys_addr(), 0, ds.size());

View File

@@ -11,18 +11,20 @@
* under the terms of the GNU Affero General Public License version 3.
*/
/* base-internal includes */
#include <base/internal/fiasco_thread_helper.h>
#include "platform.h"
#include "util.h"
/* core includes */
#include <platform.h>
#include <util.h>
namespace Fiasco {
#include <l4/sys/ipc.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Fiasco;
void Platform::_setup_io_port_alloc()
{
l4_fpage_t fp;

View File

@@ -14,8 +14,10 @@
#ifndef _INCLUDE__FIASCO__THREAD_HELPER_H_
#define _INCLUDE__FIASCO__THREAD_HELPER_H_
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Fiasco {
#include <l4/sys/types.h>
/**
* Sigma0 thread ID

View File

@@ -22,9 +22,7 @@
#define _INCLUDE__BASE__INTERNAL__LOCK_HELPER_H_
/* L4/Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
}
#include <fiasco/syscall.h>
/**

View File

@@ -17,10 +17,8 @@
/* Genode includes */
#include <base/stdint.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
@@ -28,6 +26,7 @@ namespace Genode {
struct Native_thread;
}
struct Genode::Native_thread
{
Fiasco::l4_threadid_t l4id;

View File

@@ -14,10 +14,8 @@
#ifndef _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_
#define _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/kdebug.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {

View File

@@ -14,10 +14,8 @@
#ifndef _INCLUDE__BASE__INTERNAL__RPC_DESTINATION_H_
#define _INCLUDE__BASE__INTERNAL__RPC_DESTINATION_H_
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {

View File

@@ -0,0 +1,29 @@
/*
* \brief Collection of L4/Fiasco kernel bindings
* \author Norman Feske
* \date 2020-12-06
*/
/*
* Copyright (C) 2020 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__FIASCO__SYSCALL_H_
#define _INCLUDE__FIASCO__SYSCALL_H_
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/kdebug.h>
#include <l4/sys/ipc.h>
#include <l4/sys/kernel.h>
#include <l4/sys/kip.h>
#include <l4/sys/utcb.h>
#include <l4/sys/ktrace.h>
#include <l4/sys/syscalls.h>
#include <l4/sigma0/sigma0.h>
}
#endif /* _INCLUDE__FIASCO__SYSCALL_H_ */

View File

@@ -11,6 +11,7 @@
* under the terms of the GNU Affero General Public License version 3.
*/
/* Genode includes */
#include <base/log.h>
/* base-internal includes */

View File

@@ -20,13 +20,11 @@
#include <base/internal/ipc_server.h>
#include <base/internal/capability_space_tpl.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Fiasco;
class Msg_header
@@ -34,9 +32,9 @@ class Msg_header
private:
/* kernel-defined message header */
Fiasco::l4_fpage_t rcv_fpage; /* unused */
Fiasco::l4_msgdope_t size_dope;
Fiasco::l4_msgdope_t send_dope;
l4_fpage_t rcv_fpage; /* unused */
l4_msgdope_t size_dope;
l4_msgdope_t send_dope;
public:
@@ -47,15 +45,15 @@ class Msg_header
* arguments. The kernel does not fetch these data words from memory
* but transfers them via the short-IPC registers.
*/
Fiasco::l4_umword_t protocol_word;
Fiasco::l4_umword_t num_caps;
l4_umword_t protocol_word;
l4_umword_t num_caps;
private:
enum { MAX_CAPS_PER_MSG = Msgbuf_base::MAX_CAPS_PER_MSG };
Fiasco::l4_threadid_t _cap_tid [MAX_CAPS_PER_MSG];
unsigned long _cap_local_name [MAX_CAPS_PER_MSG];
l4_threadid_t _cap_tid [MAX_CAPS_PER_MSG];
unsigned long _cap_local_name [MAX_CAPS_PER_MSG];
size_t _num_msg_words(size_t num_data_words) const
{
@@ -65,7 +63,7 @@ class Msg_header
* Account for the transfer of the protocol word, capability count,
* and capability arguments in front of the payload.
*/
return 2 + caps_size/sizeof(Fiasco::l4_umword_t) + num_data_words;
return 2 + caps_size/sizeof(l4_umword_t) + num_data_words;
}
public:
@@ -77,8 +75,6 @@ class Msg_header
*/
void prepare_snd_msg(unsigned long protocol, Msgbuf_base const &snd_msg)
{
using namespace Fiasco;
protocol_word = protocol;
num_caps = min((unsigned)MAX_CAPS_PER_MSG, snd_msg.used_caps());
@@ -109,8 +105,6 @@ class Msg_header
*/
void prepare_rcv_msg(Msgbuf_base const &rcv_msg)
{
using namespace Fiasco;
size_t const rcv_max_words = rcv_msg.capacity()/sizeof(l4_umword_t);
size_dope = L4_IPC_DOPE(_num_msg_words(rcv_max_words), 0);
@@ -124,7 +118,7 @@ class Msg_header
for (unsigned i = 0; i < min((unsigned)MAX_CAPS_PER_MSG, num_caps); i++) {
Rpc_obj_key const rpc_obj_key(_cap_local_name[i]);
bool const cap_valid = !Fiasco::l4_is_invalid_id(_cap_tid[i]);
bool const cap_valid = !l4_is_invalid_id(_cap_tid[i]);
Native_capability cap;
if (cap_valid) {
@@ -147,8 +141,6 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
Msgbuf_base &snd_msg, Msgbuf_base &rcv_msg,
size_t)
{
using namespace Fiasco;
Capability_space::Ipc_cap_data const dst_data =
Capability_space::ipc_cap_data(dst);
@@ -190,8 +182,6 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
void Genode::ipc_reply(Native_capability caller, Rpc_exception_code exc,
Msgbuf_base &snd_msg)
{
using namespace Fiasco;
Msg_header &snd_header = snd_msg.header<Msg_header>();
snd_header.prepare_snd_msg(exc.value, snd_msg);
@@ -209,8 +199,6 @@ Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &last_caller,
Msgbuf_base &reply_msg,
Msgbuf_base &request_msg)
{
using namespace Fiasco;
l4_msgdope_t ipc_result;
bool need_to_wait = true;
@@ -276,7 +264,7 @@ Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &last_caller,
Ipc_server::Ipc_server()
:
Native_capability(Capability_space::import(Fiasco::l4_myself(), Rpc_obj_key()))
Native_capability(Capability_space::import(l4_myself(), Rpc_obj_key()))
{ }

View File

@@ -17,15 +17,14 @@
#include <cpu/memory_barrier.h>
/* L4/Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
}
#include <fiasco/syscall.h>
using namespace Genode;
Lock::Lock(Lock::State initial)
: _state(UNLOCKED), _owner(nullptr)
:
_state(UNLOCKED), _owner(nullptr)
{
if (initial == LOCKED)
lock();
@@ -45,7 +44,7 @@ void Lock::lock(Applicant &myself)
* XXX: How to notice cancel-blocking signals issued when being outside the
* 'l4_ipc_sleep' system call?
*/
while (!Genode::cmpxchg(&_state, UNLOCKED, LOCKED))
while (!cmpxchg(&_state, UNLOCKED, LOCKED))
Fiasco::l4_ipc_sleep(Fiasco::l4_ipc_timeout(0, 0, 500, 0));
_owner = myself;
@@ -55,6 +54,6 @@ void Lock::lock(Applicant &myself)
void Lock::unlock()
{
_owner = Applicant(nullptr);
Genode::memory_barrier();
memory_barrier();
_state = UNLOCKED;
}

View File

@@ -16,9 +16,7 @@
#include <base/sleep.h>
/* L4/Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
}
#include <fiasco/syscall.h>
void Genode::sleep_forever()

View File

@@ -1,9 +1,4 @@
This repository contains the port of Genode to the Fiasco.OC microkernel.
For further information, please refer to the following documents:
:[http://genode.org/community/wiki/GenodeOnFiascoOC - Genode on Fiasco.OC Wiki page]:
This Wiki page contains the information on how to build and use
Genode with Fiasco.OC.
:[http://os.inf.tu-dresden.de/fiasco]:
Official website for the Fiasco.OC microkernel.
:[https://os.inf.tu-dresden.de/fiasco]:
Official website for the Fiasco.OC microkernel

View File

@@ -0,0 +1 @@
BOARD ?= unknown

View File

@@ -1,5 +1 @@
SPECS += foc
ifneq ($(filter x86_%,$(SPECS)),)
SPECS += pci acpi ps2 vesa framebuffer
endif

View File

@@ -25,17 +25,17 @@ namespace Genode { namespace Capability_space {
* Allocate kernel capability selector without associating it with a
* Genode capability
*/
Fiasco::l4_cap_idx_t alloc_kcap();
Foc::l4_cap_idx_t alloc_kcap();
/**
* Release kernel capability selector
*/
void free_kcap(Fiasco::l4_cap_idx_t);
void free_kcap(Foc::l4_cap_idx_t);
/**
* Request kernel capability selector associated with Genode capability
*/
Fiasco::l4_cap_idx_t kcap(Native_capability);
Foc::l4_cap_idx_t kcap(Native_capability);
} }

View File

@@ -14,18 +14,16 @@
#ifndef _INCLUDE__FOC__NATIVE_CAPABILITY_H_
#define _INCLUDE__FOC__NATIVE_CAPABILITY_H_
namespace Fiasco {
#include <l4/sys/consts.h>
#include <l4/sys/types.h>
#include <l4/sys/utcb.h>
#include <l4/sys/task.h>
#include <foc/syscall.h>
namespace Foc {
/*********************************************
** Capability selectors controlled by core **
*********************************************/
/* use the same task cap selector like L4Re for compatibility in L4Linux */
static constexpr l4_cap_idx_t TASK_CAP = L4_BASE_TASK_CAP;
static constexpr l4_cap_idx_t TASK_CAP = L4_BASE_TASK_CAP;
static constexpr l4_cap_idx_t DEBUG_CAP = L4_BASE_DEBUGGER_CAP;

View File

@@ -21,23 +21,20 @@
/* Genode includes */
#include <base/stdint.h>
#include <foc/receive_window.h>
/* Fiasco.OC includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
#include <foc/syscall.h>
namespace Genode { struct Native_thread; }
struct Genode::Native_thread
{
Fiasco::l4_cap_idx_t kcap = 0;
Foc::l4_cap_idx_t kcap = 0;
/* receive window for capability selectors received at the server side */
Receive_window rcv_window { };
Native_thread() { }
explicit Native_thread(Fiasco::l4_cap_idx_t kcap) : kcap(kcap) { }
explicit Native_thread(Foc::l4_cap_idx_t kcap) : kcap(kcap) { }
};
#endif /* _INCLUDE__FOC__NATIVE_THREAD_H_ */

View File

@@ -0,0 +1,36 @@
/*
* \brief Collection of Fiasco.OC kernel bindings
* \author Norman Feske
* \date 2020-11-27
*/
/*
* Copyright (C) 2020 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__FOC__SYSCALL_H_
#define _INCLUDE__FOC__SYSCALL_H_
namespace Foc {
#include <l4/sys/types.h>
#include <l4/sys/kip>
#include <l4/sys/kdebug.h>
#include <l4/sys/cache.h>
#include <l4/sys/consts.h>
#include <l4/sys/utcb.h>
#include <l4/sys/task.h>
#include <l4/sys/ipc.h>
#include <l4/sys/thread.h>
#include <l4/sys/factory.h>
#include <l4/sys/irq.h>
#include <l4/sys/debugger.h>
#include <l4/sys/icu.h>
#include <l4/sys/ktrace.h>
#include <l4/sys/scheduler.h>
#include <l4/sigma0/sigma0.h>
}
#endif /* _INCLUDE__FOC__SYSCALL_H_ */

View File

@@ -18,25 +18,21 @@
#include <base/capability.h>
#include <base/thread_state.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
#include <foc/syscall.h>
namespace Genode { struct Foc_thread_state; }
struct Genode::Foc_thread_state : Thread_state
{
Fiasco::l4_cap_idx_t kcap; /* thread's gate cap in its pd */
int id; /* id of gate capability */
addr_t utcb; /* thread's utcb in its pd */
Foc::l4_cap_idx_t kcap; /* thread's gate cap in its PD */
int id; /* ID of gate capability */
addr_t utcb; /* thread's UTCB in its PD */
/**
* Constructor
*/
Foc_thread_state() : kcap(Fiasco::L4_INVALID_CAP), id(0), utcb(0) { }
Foc_thread_state() : kcap(Foc::L4_INVALID_CAP), id(0), utcb(0) { }
};
#endif /* _INCLUDE__FOC__THREAD_STATE_H_ */

View File

@@ -21,10 +21,10 @@
namespace Genode { struct Foc_native_cpu_client; }
struct Genode::Foc_native_cpu_client : Rpc_client<Foc_native_cpu>
struct Genode::Foc_native_cpu_client : Rpc_client<Cpu_session::Native_cpu>
{
explicit Foc_native_cpu_client(Capability<Native_cpu> cap)
: Rpc_client<Foc_native_cpu>(static_cap_cast<Foc_native_cpu>(cap)) { }
: Rpc_client<Cpu_session::Native_cpu>(cap) { }
Native_capability native_cap(Thread_capability cap) override {
return call<Rpc_native_cap>(cap); }

View File

@@ -19,10 +19,8 @@
#include <cpu_session/cpu_session.h>
#include <foc/thread_state.h>
namespace Genode { struct Foc_native_cpu; }
struct Genode::Foc_native_cpu : Cpu_session::Native_cpu
struct Genode::Cpu_session::Native_cpu : Interface
{
virtual Native_capability native_cap(Thread_capability) = 0;
virtual Foc_thread_state thread_state(Thread_capability) = 0;

View File

@@ -1,4 +1,6 @@
L4_INCLUDE_DIR := $(LIB_CACHE_DIR)/syscall-foc/include
include $(call select_from_repositories,etc/board.conf)
L4_INCLUDE_DIR := $(LIB_CACHE_DIR)/syscall-foc-$(BOARD)/build/include
ifeq ($(filter-out $(SPECS),x86_32),)
INC_DIR += $(L4_INCLUDE_DIR)/x86/l4f $(L4_INCLUDE_DIR)/x86

View File

@@ -1,7 +1,6 @@
BOARD ?= unknown
FOC_BUILD_DIR = $(shell pwd)/$(BOARD)-build
FOC = $(FOC_BUILD_DIR)/foc
FOC_SRC := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco
FOC_BUILD_DIR = $(shell pwd)/build
FOC = $(FOC_BUILD_DIR)/foc
FOC_SRC := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco
KERNEL_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [fiasco.oc] /"
@@ -30,7 +29,7 @@ $(FOC): $(FOC_BUILD_DIR)
# library.
#
LIBS += syscall-foc
LIBS += syscall-foc-$(BOARD)
PKGS := l4re-core/crtn \
l4re-core/uclibc-headers \
@@ -42,7 +41,7 @@ PKGS := l4re-core/crtn \
drivers-frst/include drivers-frst/of drivers-frst/uart \
bootstrap
L4_BUILD_DIR := $(LIB_CACHE_DIR)/syscall-foc/$(BOARD)-build
L4_BUILD_DIR := $(LIB_CACHE_DIR)/syscall-foc-$(BOARD)/build
#
# Supress several warnings especially of the uclibc-minimal

View File

@@ -0,0 +1,3 @@
include $(REP_DIR)/etc/board.conf
LIBS += kernel-foc-$(BOARD)

View File

@@ -0,0 +1,4 @@
override BOARD := imx6q_sabrelite
KERNEL_CONFIG := $(REP_DIR)/config/$(BOARD).kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -0,0 +1,4 @@
override BOARD := imx7d_sabre
KERNEL_CONFIG := $(REP_DIR)/config/$(BOARD).kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -0,0 +1,4 @@
override BOARD := pbxa9
KERNEL_CONFIG := $(REP_DIR)/config/$(BOARD).kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -0,0 +1,4 @@
override BOARD := rpi
KERNEL_CONFIG := $(REP_DIR)/config/$(BOARD).kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -0,0 +1,4 @@
override BOARD := imx6q_sabrelite
L4_ARCH := arm_armv7a
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc

View File

@@ -0,0 +1,4 @@
override BOARD := imx7d_sabre
L4_ARCH := arm_armv7a
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc

View File

@@ -0,0 +1,4 @@
override BOARD := pbxa9
L4_ARCH := arm_armv7a
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc

View File

@@ -0,0 +1,4 @@
override BOARD := rpi
L4_ARCH := arm_armv6
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc

View File

@@ -1,6 +1,7 @@
L4_INC_TARGETS = arm/l4/sys \
arm/l4f/l4/sys \
arm/l4/vcpu
L4_CONFIG := $(call select_from_repositories,config/$(BOARD).user)
CC_OPT += -Iinclude/arm

View File

@@ -0,0 +1,4 @@
override BOARD := rpi3
KERNEL_CONFIG := $(REP_DIR)/config/$(BOARD).kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -1,6 +1,6 @@
L4_CONFIG := $(call select_from_repositories,config/rpi3.user)
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/rpi3-build/bin/arm64_armv8a
override BOARD := rpi3
L4_ARCH := arm64_armv8a
L4_CONFIG := $(call select_from_repositories,config/$(BOARD).user)
L4_INC_TARGETS = arm64/l4/sys \
arm64/l4f/l4/sys \

View File

@@ -1,3 +0,0 @@
KERNEL_CONFIG := $(REP_DIR)/config/imx6q_sabrelite.kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -1,5 +0,0 @@
L4_CONFIG := $(call select_from_repositories,config/imx6q_sabrelite.user)
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/imx6q_sabrelite-build/bin/arm_armv7a
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc

View File

@@ -1,3 +0,0 @@
KERNEL_CONFIG := $(REP_DIR)/config/imx7.kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -1,5 +0,0 @@
L4_CONFIG := $(call select_from_repositories,config/imx7.user)
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/imx7d_sabre-build/bin/arm_armv7a
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc

View File

@@ -1,3 +0,0 @@
KERNEL_CONFIG := $(REP_DIR)/config/pbxa9.kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -1,5 +0,0 @@
L4_CONFIG := $(call select_from_repositories,config/pbxa9.user)
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/pbxa9-build/bin/arm_armv7a
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc

View File

@@ -1,3 +0,0 @@
KERNEL_CONFIG := $(REP_DIR)/config/rpi.kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -1,5 +0,0 @@
L4_CONFIG := $(call select_from_repositories,config/rpi.user)
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/rpi-build/bin/arm_armv6
include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc

View File

@@ -1,3 +0,0 @@
KERNEL_CONFIG := $(REP_DIR)/config/rpi3.kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -1,9 +1 @@
#
# \brief Portions of base library shared by core and non-core processes
# \author Norman Feske
# \date 2013-02-14
#
vpath vm_session.cc $(REP_DIR)/src/lib/base/x86
include $(REP_DIR)/lib/mk/base-foc-common.inc

View File

@@ -1,3 +1,5 @@
LIBS += timeout
vpath vm.cc $(REP_DIR)/src/lib/base/x86
include $(REP_DIR)/lib/mk/base-foc.inc

View File

@@ -0,0 +1,4 @@
override BOARD := pc
KERNEL_CONFIG := $(REP_DIR)/config/x86_32.kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -1,3 +0,0 @@
KERNEL_CONFIG := $(REP_DIR)/config/x86_32.kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -1,11 +1,11 @@
L4_CONFIG := $(call select_from_repositories,config/x86_32.user)
override BOARD := pc
L4_ARCH := x86_586
L4_CONFIG := $(call select_from_repositories,config/x86_32.user)
L4_INC_TARGETS := x86/l4/sys x86/l4f/l4/sys x86/l4/vcpu
CC_OPT += -Iinclude/x86
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/pc-build/bin/x86_586
include $(REP_DIR)/lib/mk/spec/x86/syscall-foc.inc
vpath syscalls_direct.S $(L4_PKG_DIR)/l4sys/lib/src/ARCH-x86

View File

@@ -0,0 +1,4 @@
override BOARD := pc
KERNEL_CONFIG := $(REP_DIR)/config/x86_64.kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -1,3 +0,0 @@
KERNEL_CONFIG := $(REP_DIR)/config/x86_64.kernel
include $(REP_DIR)/lib/mk/kernel-foc.inc

View File

@@ -1,9 +1,9 @@
L4_CONFIG := $(call select_from_repositories,config/x86_64.user)
override BOARD := pc
L4_ARCH := amd64_K8
L4_CONFIG := $(call select_from_repositories,config/x86_64.user)
L4_INC_TARGETS := amd64/l4/sys amd64/l4f/l4/sys amd64/l4/vcpu
CC_OPT += -Iinclude/amd64
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/pc-build/bin/amd64_K8
include $(REP_DIR)/lib/mk/spec/x86/syscall-foc.inc

View File

@@ -6,9 +6,9 @@
# userland (L4re) that comes with Fiasco.OC.
#
BOARD ?= unknown
L4_SRC_DIR := $(call select_from_ports,foc)/src/kernel/foc
L4_BUILD_DIR := $(shell pwd)/$(BOARD)-build
L4_BUILD_DIR := $(shell pwd)/build
L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc-$(BOARD)/build/bin/$(L4_ARCH)
#
# Create mirror for architecture-specific L4sys header files

View File

@@ -0,0 +1,4 @@
include $(REP_DIR)/etc/board.conf
LIBS += syscall-foc-$(BOARD)

View File

@@ -1 +1 @@
2020-11-26 a5a99e7f402100f62864609115b680b83099dbbe
2021-03-11 c1f7d1de07d3a55d5e43f6ab5fb67b502ab1d0bb

View File

@@ -1 +1 @@
2020-11-26 32bf527cace92c460fa986ccccbaf79caa2e77cd
2021-03-11 9383498670ce6668c8b99da3e62008b21a5932aa

View File

@@ -1 +1 @@
2020-11-26 841b52ee26b3bdfec31947392906db31e9a9d1c5
2021-03-11 50104241d20d23e928d3b27d0931d14112c68e82

View File

@@ -1 +1 @@
2020-11-26 f6c4252ce98073b3db64e89b9bab0093ee7cd7eb
2021-03-11 43cc39f70c8bfe4df3427c94d096d7e218b7b24c

View File

@@ -1 +1 @@
2020-11-26 ec14f348095651f4cfe30a37a32d1162a73a3a06
2021-03-11 742459157b61720e96c17bb6cfbf7ac085a4df2f

View File

@@ -26,6 +26,14 @@ src/kernel/foc: src/kernel
tar -C $(KERNEL_PORT_DIR)/src/kernel/foc --exclude=.git -cf - . |\
tar -C $@ -xf -
content: etc/board.conf remove_other_board_libs
etc/board.conf:
echo "BOARD = $(BOARD)" > etc/board.conf
remove_other_board_libs: lib/mk
find lib/mk/spec -name kernel-foc-*.mk -o -name syscall-foc-*.mk |\
grep -v "foc-$(BOARD).mk" | xargs rm -rf
content:
for spec in x86_32 x86_64 arm arm_64; do \
@@ -33,11 +41,3 @@ content:
done;
sed -i "s/ld-foc/ld/" src/lib/ld/foc/target.mk
sed -i "s/foc_timer_drv/timer/" src/timer/foc/target.mk
sed -i "s/BOARD.*unknown/BOARD = $(BOARD)/" src/core/foc/target.mk
sed -i "s/BOARD.*unknown/BOARD = $(BOARD)/" src/kernel/foc/target.mk
sed -i "s/BOARD.*unknown/BOARD = $(BOARD)/" lib/mk/syscall-foc.inc
sed -i "s/BOARD.*unknown/BOARD = $(BOARD)/" lib/mk/kernel-foc.inc
content: enable_board_spec
enable_board_spec: etc/specs.conf
echo "SPECS += $(BOARD)" >> etc/specs.conf

View File

@@ -14,7 +14,7 @@ install_config {
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<start name="test-cap_integrity">
<start name="test-cap_integrity" caps="100" ld="no">
<resource name="RAM" quantum="10M"/>
</start>
</config>

View File

@@ -14,7 +14,13 @@
/* core includes */
#include <core_log.h>
namespace Fiasco {
#include <l4/sys/kdebug.h>
/* Fiasco.OC includes */
#include <foc/syscall.h>
using namespace Genode;
void Core_log::out(char const c)
{
Foc::outchar(c);
}
void Genode::Core_log::out(char const c) { Fiasco::outchar(c); }

View File

@@ -1,6 +1,7 @@
BOARD ?= unknown
include $(REP_DIR)/etc/board.conf
TARGET := foc-$(BOARD)
LIBS := core-foc
CORE_OBJ := core-foc-$(BOARD).o
CORE_LIB := core-foc-$(BOARD).a
include $(BASE_DIR)/src/core/target.inc

View File

@@ -20,33 +20,32 @@
#include <base/mutex.h>
#include <synced_range_allocator.h>
namespace Genode {
class Cap_id_allocator
{
private:
enum {
CAP_ID_RANGE = ~0UL,
CAP_ID_MASK = ~3UL,
CAP_ID_NUM_MAX = CAP_ID_MASK >> 2,
CAP_ID_OFFSET = 1 << 2
};
Synced_range_allocator<Allocator_avl> _id_alloc;
Mutex _mutex { };
public:
class Out_of_ids : Exception {};
namespace Genode { class Cap_id_allocator; }
Cap_id_allocator(Allocator &);
class Genode::Cap_id_allocator
{
private:
unsigned long alloc();
void free(unsigned long id);
};
}
enum {
CAP_ID_RANGE = ~0UL,
CAP_ID_MASK = ~3UL,
CAP_ID_NUM_MAX = CAP_ID_MASK >> 2,
CAP_ID_OFFSET = 1 << 2
};
Synced_range_allocator<Allocator_avl> _id_alloc;
Mutex _mutex { };
public:
class Out_of_ids : Exception {};
Cap_id_allocator(Allocator &);
unsigned long alloc();
void free(unsigned long id);
};
#endif /* _CORE__INCLUDE__CAP_ID_ALLOC_H_ */

View File

@@ -45,7 +45,9 @@ class Genode::Core_cap_index : public Native_capability::Data
Core_cap_index(Pd_session_component *session = 0,
Platform_thread *pt = 0,
Native_thread gate = Native_thread() )
: _session(session), _pt(pt), _gate(gate) {}
:
_session(session), _pt(pt), _gate(gate)
{ }
Pd_session_component const *session() const { return _session; }
Platform_thread const *pt() const { return _pt; }

View File

@@ -1,5 +1,5 @@
/*
* \brief Fiasco.OC specific capability mapping.
* \brief Fiasco.OC specific capability mapping
* \author Stefan Kalkowski
* \date 2012-02-22
*/
@@ -18,43 +18,44 @@
#include <cap_index.h>
#include <util/noncopyable.h>
namespace Genode {
namespace Genode { class Cap_mapping; }
/**
* A Cap_mapping embodies a capability of core, and its mapped
* copy in another protection domain.
*/
class Cap_mapping : Noncopyable
{
private:
/**
* Helper function for construction purposes.
*
* Allocates a new capability id and Core_cap_index and inserts
* it in the Cap_map.
*
* \return pointer to newly constructed Core_cap_index object
*/
inline Core_cap_index *_get_cap();
/**
* A Cap_mapping embodies a capability of core, and its mapped
* copy in another protection domain.
*/
class Genode::Cap_mapping : Noncopyable
{
private:
public:
/**
* Helper function for construction purposes.
*
* Allocates a new capability id and Core_cap_index and inserts
* it in the Cap_map.
*
* \return pointer to newly constructed Core_cap_index object
*/
inline Core_cap_index *_get_cap();
Native_capability local; /* reference to cap that is mapped */
Fiasco::l4_cap_idx_t remote; /* index in cap-space of the other pd */
public:
Cap_mapping(bool alloc=false,
Fiasco::l4_cap_idx_t r = Fiasco::L4_INVALID_CAP);
Cap_mapping(Native_capability cap,
Fiasco::l4_cap_idx_t r = Fiasco::L4_INVALID_CAP);
Native_capability local; /* reference to cap that is mapped */
Foc::l4_cap_idx_t remote; /* index in cap-space of the other pd */
/**
* Map the cap in local to corresponding task.
*
* \param task capability of task to map to
*/
void map(Fiasco::l4_cap_idx_t task);
};
}
Cap_mapping(bool alloc=false,
Foc::l4_cap_idx_t r = Foc::L4_INVALID_CAP);
Cap_mapping(Native_capability cap,
Foc::l4_cap_idx_t r = Foc::L4_INVALID_CAP);
/**
* Map the cap in local to corresponding task.
*
* \param task capability of task to map to
*/
void map(Foc::l4_cap_idx_t task);
};
#endif /* _CORE__INCLUDE__CAP_MAPPING_H_ */

View File

@@ -28,22 +28,22 @@
/* base-internal includes */
#include <base/internal/native_thread.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
/* Fiasco.OC includes */
#include <foc/syscall.h>
namespace Genode {
class Mapping;
class Ipc_pager;
}
class Genode::Mapping
{
private:
addr_t _dst_addr;
Fiasco::l4_fpage_t _fpage { };
Foc::l4_fpage_t _fpage { };
Cache_attribute _cacheability;
bool _iomem;
@@ -55,26 +55,27 @@ class Genode::Mapping
Mapping(addr_t dst_addr, addr_t src_addr,
Cache_attribute c, bool io_mem,
unsigned log2size, bool write, bool executable)
: _dst_addr(dst_addr), _cacheability(c), _iomem(io_mem)
:
_dst_addr(dst_addr), _cacheability(c), _iomem(io_mem)
{
typedef Fiasco::L4_fpage_rights Rights;
Rights rights = (write && executable) ? Fiasco::L4_FPAGE_RWX :
(write && !executable) ? Fiasco::L4_FPAGE_RW :
(!write && !executable) ? Fiasco::L4_FPAGE_RO :
Fiasco::L4_FPAGE_RX;
typedef Foc::L4_fpage_rights Rights;
Rights rights = ( write && executable) ? Foc::L4_FPAGE_RWX :
( write && !executable) ? Foc::L4_FPAGE_RW :
(!write && !executable) ? Foc::L4_FPAGE_RO :
Foc::L4_FPAGE_RX;
_fpage = Fiasco::l4_fpage(src_addr, log2size, rights);
_fpage = Foc::l4_fpage(src_addr, log2size, rights);
}
/**
* Construct invalid flexpage
*/
Mapping() : _dst_addr(0), _fpage(Fiasco::l4_fpage_invalid()),
Mapping() : _dst_addr(0), _fpage(Foc::l4_fpage_invalid()),
_cacheability(UNCACHED), _iomem(false) { }
Fiasco::l4_umword_t dst_addr() const { return _dst_addr; }
Foc::l4_umword_t dst_addr() const { return _dst_addr; }
bool grant() const { return false; }
Fiasco::l4_fpage_t fpage() const { return _fpage; }
Foc::l4_fpage_t fpage() const { return _fpage; }
Cache_attribute cacheability() const { return _cacheability; }
bool iomem() const { return _iomem; }
/**
@@ -101,8 +102,8 @@ class Genode::Ipc_pager : public Native_capability
addr_t _pf_ip { 0 }; /* ip of faulter */
Mapping _reply_mapping { }; /* page-fault answer */
unsigned long _badge; /* badge of faulting thread */
Fiasco::l4_msgtag_t _tag { }; /* receive message tag */
Fiasco::l4_exc_regs_t _regs { }; /* exception registers */
Foc::l4_msgtag_t _tag { }; /* receive message tag */
Foc::l4_exc_regs_t _regs { }; /* exception registers */
Msg_type _type { PAGEFAULT };
void _parse_msg_type(void);

View File

@@ -38,12 +38,12 @@ class Genode::Irq_object
Irq_session::Polarity _polarity; /* interrupt polarity */
unsigned _irq;
Genode::addr_t _msi_addr;
Genode::addr_t _msi_data;
addr_t _msi_addr;
addr_t _msi_data;
Signal_context_capability _sig_cap { };
Fiasco::l4_cap_idx_t _capability() const { return _cap->kcap(); }
Foc::l4_cap_idx_t _capability() const { return _cap->kcap(); }
public:

View File

@@ -19,13 +19,8 @@
#include <platform.h>
#include <util.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sigma0/sigma0.h>
#include <l4/sys/task.h>
#include <l4/sys/cache.h>
}
/* Fiasco.OC includes */
#include <foc/syscall.h>
namespace Genode {
@@ -47,7 +42,7 @@ namespace Genode {
size_t page_size_log2 = get_page_size_log2();
for (unsigned i = 0; i < num_pages; i++, offset += page_size) {
using namespace Fiasco;
using namespace Foc;
l4_fpage_t snd_fpage = l4_fpage(from_addr + offset,
page_size_log2, L4_FPAGE_RW);
@@ -84,7 +79,7 @@ namespace Genode {
static inline bool map_local_io(addr_t from_addr, addr_t to_addr,
size_t num_pages)
{
using namespace Fiasco;
using namespace Foc;
size_t size = num_pages << get_page_size_log2();
@@ -129,7 +124,7 @@ namespace Genode {
static inline void unmap_local(addr_t const local_base, size_t const num_pages)
{
using namespace Fiasco;
using namespace Foc;
size_t const size = num_pages << get_page_size_log2();
addr_t addr = local_base;

View File

@@ -25,7 +25,7 @@ namespace Genode {
}
class Genode::Native_cpu_component : public Rpc_object<Foc_native_cpu,
class Genode::Native_cpu_component : public Rpc_object<Cpu_session::Native_cpu,
Native_cpu_component>
{
private:

View File

@@ -19,6 +19,7 @@
namespace Genode { struct Pager_object_exception_state; }
struct Genode::Pager_object_exception_state
{
Mutex mutex { };

Some files were not shown because too many files have changed in this diff Show More