Compare commits

...

310 Commits

Author SHA1 Message Date
Ehmry - c6f3dfc3ec Add some ANSI C procedures to base-common
This is for the convenience of language runtimes.
2020-02-15 16:02:30 +01:00
Ehmry - 11ff9a1dc5 Add base-hw Tup rules 2020-02-13 12:13:16 +01:00
Ehmry - e0b84beafa Tup: LLVM adjustments 2020-02-13 12:13:16 +01:00
Ehmry - da0c9da996 Minor code adjustments for LLVM 2020-02-11 13:47:26 +01:00
Ehmry - fa5b9a9002 Tup: create ld.lib.so libraries when in a Nix build 2020-01-29 21:35:18 +01:00
Ehmry - 71e1a286e5 Nix: update flake 2020-01-29 18:45:57 +01:00
Ehmry - 196c340aa9 Tup: build more of gems 2020-01-29 16:26:29 +01:00
Ehmry - 200d82b4f5 core: simplify unprefixed LOG service
The special "platform" label is now "unlabeled".
2020-01-29 12:29:36 +01:00
Ehmry - 5d4e72c874 core: add platform logging service
If the root child requests a LOG service with the label "platform" then
return a LOG session that logs messages directly to kernel. This is to
allow a remote test controller to recognize messages produced by an
privileged local test harness.
2020-01-22 17:26:28 +01:00
Norman Feske 7c4568fb5a core: avoid use of C array as buffer in Log_root 2020-01-22 17:10:03 +01:00
Ehmry - b20ca5f254 Revert "Core: exit with child exit value"
Not actually useful, and causes a null deference on NOVA.
2020-01-22 17:10:03 +01:00
Ehmry - 4287419392 Add Nix flake for dev-shell 2020-01-21 13:36:05 +01:00
Ehmry - 42f93ce3da Move Nix expressions to genodepkgs 2020-01-17 17:17:34 +01:00
Ehmry - 59caa85840 Tup: mv ld-lova.lib.so from out/bin to out/lib 2020-01-17 17:17:21 +01:00
Ehmry - f902a21213 Remove NOVA submodule 2020-01-17 17:17:21 +01:00
Ehmry - ee7773567a Nix apps moved to genodepkgs 2020-01-17 17:17:21 +01:00
Ehmry - a1e84f0485 Convert README to Markdown 2020-01-17 13:54:46 +01:00
Ehmry - 9e1e1186dc Synchronize NOVA revision with genodelabs/staging
Also make the "makeFlags" attr compatible with dev-shell.
2020-01-16 13:09:56 +01:00
Ehmry - 292bd3f579 Nix: Add nova-image app 2020-01-15 16:42:10 +01:00
Ehmry - 18c0e21996 Remove version information from builds
This causes spurious rebuilds.
2020-01-15 16:42:10 +01:00
Ehmry - e45088704c Restore base tests 2020-01-15 16:42:10 +01:00
Ehmry - 8c8606b375 Skip strip in nova-iso, explicit mkisofs 2020-01-14 15:12:53 +01:00
Ehmry - c812fdf629 Add component exit to tests
This makes it possible to detect successful test runs in a general way.
2020-01-14 11:43:38 +01:00
Ehmry - 6463f84741 Nix flake: use Github url for Nixpkgs 2020-01-14 11:43:38 +01:00
Ehmry - b8e25c82da Nix: source code filtering 2020-01-14 11:43:26 +01:00
Ehmry - 955e95272c Tup: fix base-nova build 2020-01-14 11:33:00 +01:00
Ehmry - 4235b5ab9b Nix app for building NOVA ISOs 2020-01-14 11:33:00 +01:00
Ehmry - 97e01182ca Nix: package NOVA kernel
This package moved here from Genodepkgs.
2020-01-14 11:31:23 +01:00
Ehmry - 90c4d291b4 Nix flake: build packages at Hydra 2020-01-08 14:50:49 +01:00
Ehmry - d8074773d1 Add missing os test Tupfiles 2020-01-08 09:55:01 +01:00
Ehmry - 3fb87d9ea0 base-linux: use pkg-config for libraries from base repo
Tup output groups must not be used across the repositories, they will come
up empty in Nix builds, and libraries will not be fully linked.
2020-01-07 18:19:02 +01:00
Ehmry - 969180525f Use patched binary toolchain from Genode Labs
- Fetch and patch GCC distribution
 - Pass Tup config as a file
 - Fold out and dev outputs
 - Remove shellHook code for compatibility with dev-shell
 - Tweak Tup Nix conditionals
 - Add Tupfile.ini
 - Remove custom setup-hook
2020-01-05 20:32:08 +01:00
Ehmry - bab7a572fe Refactor flake to expose x86_64-linux-x86_64-genode as x86_64-linux 2019-12-26 15:33:09 +05:30
Ehmry - 32f8b603cb Use cross-compile pairs in Flake 2019-12-02 16:30:36 +01:00
Ehmry - 94266a7bb0 Add hydraJobs 2019-11-29 15:50:13 +01:00
Ehmry - 24deef9495 Use #!/usr/bin/env ... shebangs 2019-11-28 15:07:24 +01:00
Ehmry - 54776f36eb VFS/pipe: add Tupfile 2019-11-28 14:04:14 +01:00
Ehmry - 3dc909bb24 nic_stress: do not bind reference to stack allocated parameter 2019-11-28 13:56:20 +01:00
Ehmry - d650a7b0e0 VFS/terminal: variable-sized object may not be initialized 2019-11-28 13:51:21 +01:00
Ehmry - 63c4974587 vfs server: fix File_system namespace warnings 2019-11-28 13:49:20 +01:00
Ehmry - 0797619d29 FetchGit Nixpkgs from nix-shell 2019-11-28 13:38:29 +01:00
Ehmry - 3d68a520cb Tag release 19.11
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEsIWqvdxEKaxX80hspyRgNBfs1rcFAl3fpmAACgkQpyRgNBfs
 1rcezQ//ZoYChufO6m2CByuPUbITql12b6oyOjmvcw16NW+Nsf2EodwMeCk/9yyM
 kWIxqOtXp1yFPGNf8ebEkTu5YXYMkHrUds4V6nQ4nQnyk7VnQmR3XTnqP8Sr27Hp
 fHi7Dddjxufexeyb6bwis04mK4PeFWXk/D6H4nh6ZeaR30g/GQ+Wt4N64a+HcQ1g
 kLMKuLlooOoq0L9q8IVLAtQoKNR1LP6x0FKGH8B6elwns8rXna2fRSlCB+W7qLwl
 K/pQadaIkwQNj8TEXuQxdGOR1GIrTbUz9ExS6U1yPXjqK06CunDZqsn+Cv5G7p+5
 ybMaViXwDGilZjhNLTjAbPhqhoOVu+yDB5gwzKiYt6/gTKP8N+VUpXKhGpzu/0ya
 wEt2b/43vmPm1NsBQQFU6vmjyW0W0iOl+a1tetv/qFo4mzQNesbVlu6t91b0EAjp
 C0JzZj9UHj/QkKgLIPkWMVWyz+VtODUeFhMLV6+86wzFmqSNhbaL0K/1LvX3AHZR
 5M/sjMRdtRL9U7Xv/LTn/Sgisk5wT2wfI9dpkAZALZjm22751mSTv9XhdLC/+XpA
 0F7cfSg36DphYsyPmSQ9+Q79rpU+bvuuTbqAsLdYcflMaW4bsIOd4j5Lk3adIPbN
 EE0uu+CD1GbqpKy+vLr+2EIlYpVNRTQKLklmkmhb+ZBuvUo00cU=
 =4dhl
 -----END PGP SIGNATURE-----

Merge tag '19.11'

Tag release 19.11
2019-11-28 13:21:13 +01:00
Ehmry - dd07e99ef6 Nix flake 2019-11-28 13:17:35 +01:00
Christian Helmuth 8cf7aaad65 version: 19.11 2019-11-28 11:49:10 +01:00
Norman Feske 25a8ef3b7c News item for version 19.11 2019-11-28 11:44:29 +01:00
Norman Feske b18a56c2c4 Release notes for version 19.11 2019-11-28 11:44:29 +01:00
Christian Helmuth 9d42e3f69b release notes: fix example in 19.08 input section 2019-11-28 11:44:29 +01:00
Christian Helmuth 11ef8e1ff2 depot: update recipe hashes 2019-11-28 09:06:39 +01:00
Christian Helmuth 1deab4a67f Disable noux_tool_chain_auto on foc/imx7d_sabre
The bootstrapper always fails with

  fatal: could not find free RAM region for modules

in this scenario.
2019-11-28 09:06:27 +01:00
Christian Helmuth f23c70e068 sculpt_manager: use Codepoint::valid() 2019-11-28 09:06:26 +01:00
Alexander Boettcher f7c818d303 vbox5: add recipe of kernel independent version 2019-11-25 16:02:40 +01:00
Stefan Kalkowski 7996cf06ab os: remove jitterentropy from fs_packet test
Fixes #3562
2019-11-25 15:44:57 +01:00
Stefan Kalkowski 4800bcf5a0 hw: correct the i.MX6 Sabrelite timer settings
Fix #3561
2019-11-25 15:43:59 +01:00
Christian Prochaska 4c74f4792c ahci_drv: set 'Cmd::St' to 1 before writing 'Sact' register
Issue #3058
2019-11-25 14:15:57 +01:00
Christian Prochaska 57d080d4f8 hw: use correct type on IRQ kernel object destruction
Fixes #3560
2019-11-25 14:15:39 +01:00
Alexander Boettcher 2778debc29 ram_fs: close open nodes on session close
Fixes #3559
2019-11-22 15:59:13 +01:00
Martin Stein 7182c10c90 test/nic_stress: test bad session args
Fixes #3525
2019-11-22 14:16:24 +01:00
Christian Prochaska 7309bcf4b5 gdb_monitor: add platform checks in run scripts
Fixes #3558
2019-11-22 14:12:06 +01:00
Sebastian Sumpf 309bc2083e vbox5: raise rrtimer priority
Make sure timers run at the same priority as component threads, otherwise
no timer progress can be made. See 'rtTimeNanoTSInternalRef' (timesupref.h)
and 'rtTimerLRThread' (timerlr-generic.cpp).
2019-11-22 13:33:15 +01:00
Norman Feske 6e098a9d17 ram_fs: apply session policy to write / mtime ops
This patch extends the distinction between read-only and writeable
sessions to packet-stream operations for WRITE and WRITE_TIMESTAMP.
2019-11-21 16:21:19 +01:00
Norman Feske 573b6d3345 noux: fix condition for mtime update
This is a follow-up patch for "noux: don't update mtimes for read-only
files". It eliminates warning messages during Sculpt's prepare step when
'cp' tries to update the mtimes of the source files.
2019-11-21 16:21:19 +01:00
Norman Feske 077fa355ce pkg/wm: increase RAM quota
This patch avoids a warning during the wm startup in Sculpt.
2019-11-21 15:13:20 +01:00
Norman Feske e76ce05844 sculpt manager: ignore empty deploy configs
When copying config/managed/deploy to config/deploy, the latter may
temporarily result in an empty configuration. Such an intermediate
state should be ignored to keep the currently running scenario in tact
instead of restarting it.
2019-11-21 15:07:51 +01:00
Norman Feske 4622ddb46f nitpicker: add version attribute in clicked report
This patch addresses a corner case where the nitpicker focus is not
solely defined by mouse clicks or (exclusively) by a window manager, but
by a policy component that takes mouse clicks and other policy (e.g.,
a lock screen) into account. It ensures that each click that follows a
focus change (however initiated) results in a new "clicked" report even
when the report looks the same. To allow the policy component to
uniquely distiguish subsequent reports, the report features a new
'version' attribute.

Fixes #3493
2019-11-21 14:31:52 +01:00
Stefan Kalkowski 972e1893c9 os: introduce vmm component for ARMv8
Fix #3553
2019-11-21 14:29:36 +01:00
Stefan Kalkowski af29dcf557 hw: introduce virtualization support for ARMv8
Ref #3553
2019-11-21 14:29:36 +01:00
Stefan Kalkowski f82714f341 vm_session: return vcpu id when creating vcpu
Ref #3553
2019-11-21 14:29:36 +01:00
Stefan Kalkowski 02d68fdb97 hw: move arm virtualization to generic place
Ref #3553
2019-11-21 14:29:36 +01:00
Stefan Kalkowski 065b9fdb46 base-hw: extend syscalls to five arguments
Ref #3553
2019-11-21 14:29:36 +01:00
Stefan Kalkowski 18dbd75860 base: explictly target entrypoint in timer session
Fix #3548
2019-11-21 14:29:36 +01:00
Norman Feske 3ac970ac1d Streamline Timestamp::INVALID values
This is a follow-up patch for issue #1784 that solves two
inconsistencies.

- The Vfs::Timestamp::INVALID matches File_system::Timestamp::INVALID
- The Noux libc plugin tests for Timestamp::INVALID instead of a
  positive value.

The patch fixes the mtime info as shown in directory listings in
Sculpt's inspect window.
2019-11-21 14:26:27 +01:00
Norman Feske 3aaed7188f ram_fs: tie writeable bit to session policy
Related to issue #3507
2019-11-21 14:26:01 +01:00
Norman Feske ee64e29e77 vfs server: tie writeable bit to session policy
This patch let the VFS server reflect the session policy via the
writeable bit in directory entries instead of merely forwarding the bit
from the respective VFS plugin. This way, all files originating from a
read-only file-system session automatically appear in directory listings
as read-only files.

Related to issue #3507
2019-11-21 14:25:43 +01:00
Norman Feske cfba429c15 vfs/rump: offer all files as read-writeable
The distinction between read-only and read-writeable is the
responsibility of the front end, i.e., the vfs server.
2019-11-21 14:25:05 +01:00
Ehmry - af9b91e94c Make out and dev output paths more explicit 2019-11-20 20:25:16 +01:00
Josef Söntgen 25aa25c6a0
wifi_drv: enable loading of 9000 series FW
Tested with a 'Intel(R) Wireless-AC 9462' device.

Fixes #3556.
2019-11-20 12:56:10 +01:00
Josef Söntgen 2afc02051c
sculpt_manager: increase Rom_name size
The current value of 32 is too short for accessing the
iwlwifi 9000 ucode ROM.

Issue #3556.
2019-11-20 12:56:03 +01:00
Christian Helmuth ce1b813105 depot: update recipe hashes (vbox, sculpt) 2019-11-19 16:08:19 +01:00
Christian Helmuth 7ed1d7f11d depot: update recipe hashes 2019-11-19 14:54:14 +01:00
Norman Feske 6ccd65bd8e sculpt_manager: invoke mkfs.ext2 with -F
The block-vfs plugin is no longer a special file. So we have to
explicitly discharge the sanity check of the mkfs tool.

Issue #3507
2019-11-19 14:54:14 +01:00
Norman Feske 18b621c2fe sculpt: version 19.11 2019-11-19 14:54:14 +01:00
Alexander Boettcher cb61a28362 vbox5: use with_libc when call-in into vbox code
required due to pthreads becoming/are an integral part of the libc now.
Commit avoids libc error:

Error: libc suspend() called from non-user context (0xaf5c784) - aborting

Issue #3550
2019-11-19 14:54:14 +01:00
Norman Feske 4d7d208940 test-libc_vfs_fs_chained: fix XML validity error
This problem was spotted by the test.run script.
2019-11-19 14:54:14 +01:00
Sebastian Sumpf f7509a5b78 libports: libc: extract file name from path in dlopen
'dlopen' causes the ldso to open ROM connections, right now we only
support single file names for these ROM not paths. Therefore, we extract
the file name from path within libc's 'dlopen'

fixes #3551
2019-11-19 14:54:14 +01:00
Christian Helmuth a54c04d247 libc: return EPIPE on send to shut down sockets
This intermediate fix still lacks the generation of SIGPIPE and return
of EINTR if the MSG_NOSIGNAL flag is not set in the call to send().
2019-11-19 14:54:14 +01:00
Christian Helmuth e70c04ef86 lwip: shut down TCP sockets return WRITE_ERR_IO on write 2019-11-19 14:54:13 +01:00
Christian Helmuth 6410e88698 netperf: handle EPIPE / silence warnings
This is an intermediate fix to handle sends to sockets shut down by the
peer already. A final fix in the libc would add support for the
MSG_NOSIGNAL send flag, generate SIGPIPE, and return the expected EINTR.
Then this patch is no longer required.

This commit also drops the obsolete patch for missing
sysconf(_SC_NPROCESSORS_ONLN), which is now part of libc.
2019-11-19 14:54:13 +01:00
Christian Helmuth a3cb9d9897 lwip: prevent pointer-compare compilation warnings 2019-11-19 14:54:13 +01:00
Alexander Boettcher b2a7ac2996 depot_deploy: support cpu quota configuration
the same as the ram and cap quota
2019-11-19 14:54:13 +01:00
Norman Feske 5f350adb57 vfs/lxip: don't misinterpret EINPROGRESS as error 2019-11-19 14:54:13 +01:00
Norman Feske 1485cd9d24 noux: don't update mtimes for read-only files
The VFS server as reworked in issue #3547 responds to such an attempt
with a failure as acknowledgement, triggering the client-side error
"Error: packet operation=2 failed" at noux.
2019-11-19 14:54:13 +01:00
Norman Feske 65d72fb07a drivers/gpu/intel: upgrade platform session on demand 2019-11-19 14:54:13 +01:00
Norman Feske 4871c7bba0 drivers/gpu/intel: reflect insuff. quota to client
This patch prevents the driver from translating Insufficient_ram_quota
and Insufficient_cap_quota exceptions to Service_denied exceptions at
session-creation time. This enables the client to respond to such a
condition by retrying the session creation with increased session quota.
2019-11-19 14:54:13 +01:00
Norman Feske 97e2968986 pkg/test-tcp_bulk_lwip: remove lwip.lib.so
The lwip library is not shared object.

This change is needed to execute the test with the test.run script.
2019-11-19 14:54:13 +01:00
Norman Feske eb9a9bf23d bash.run: support using pipes 2019-11-19 14:54:13 +01:00
Ehmry - c51b4b5742 New VFS plugin for emulating POSIX pipes
Add a new plugin for creating pipes between pairs of VFS handles. It is
intended to replace the libc_pipe plugin, one of the last remaining libc
plugins.

In contrast to the libc_pipe plugin, this plugin defers cross-handle
notification until I/O signal handling rather than block and unblock
readers using a semaphore. This is a performance regression in the case
of multiple threads blocking on a pipe, but shall be an intermediate
mechanism pending renovations within the libc VFS and threading layers.
As a side effect, threads blocked on a pipe might not be resumed until
the main thread suspends and dispatches I/O signals.

The "test-libc_pipe" test has been adjusted to use the VFS pipe plugin
and tests both local pipes and pipes hosted remotely in the VFS server.

Merge adaptations (such as EOF handling, adjustment to VFS/libc
interface changes) by Norman Feske.

Fix #2303
2019-11-19 14:54:13 +01:00
Norman Feske 9b7915facb vfs server: redesigned internal control flow
This patch reworks the VFS server to become easier to understand.

- The packet-stream handling is hidden from the node types.

- Introduced the notion of a "job" as an abstraction from the raw packet
  stream.

- The processing of requests is split into three phases:
  (1) accepting new jobs,
  (2) the execution of jobs, and
  (3) the delivery of acknowledgements.

- There is no longer a global fifo of pending nodes. Instead, each
  session has a fifo of "active" nodes, which are nodes that wait
  for the completion of jobs.

- The Io_node type no longer uses virtual functions as hooks for
  the derrived classes. Instead, it provides a number of utility
  functions.

- The control flow of the 'Io_progress_handler' is now the same as
  for the session-local packet-stream handler.

- Removed dependency from 'file_system/node.h', which is a relic
  from the ram_fs.

While reworking the code, the following semantic changes were made
additionally.

- The handling of SEEK_TAIL no longer overwrites the file content at the
  end of the file.

- Removed diagnostic message at session-creation time.

- Write loop for continuous files

Issue #3547
Issue #2303
2019-11-19 14:54:13 +01:00
Norman Feske f0de187bbb libc: increase default quota of forked processes
This patch reduces the debug noise for the prominent case of executing
bash with coreutils. Without it, the forked process will always ask for
more RAM immediately when starting up.
2019-11-19 14:54:13 +01:00
Norman Feske 539110c0b1 base: make 'Fifo::Element::enqueued' const
Issue #3547
2019-11-19 14:54:13 +01:00
Norman Feske d7b1a89087 file-system session: use same dirent size as VFS
This change allows for the conversion of directory entries in place
(i.e., in the VFS server) and anticipates the potential future merge of
both types into one.

Issue #3547
2019-11-19 14:54:13 +01:00
Christian Helmuth c50252fb35 libc: suspend/resume in pthread mutex lock/unlock
Issue #3550
2019-11-19 14:54:13 +01:00
Christian Helmuth 54002e6e6b test-pthread: refactor and cleanup test cases
Issue #3550
2019-11-19 14:54:13 +01:00
Sebastian Sumpf 16994d637b libports: update gcov port
removes bogus include from generated file libgcc_tm.h

issue #3537
2019-11-19 14:54:12 +01:00
Martin Stein b541a0d448 smbios.h: move to os/include/smbios
Fixes #3489
2019-11-19 14:54:12 +01:00
Norman Feske d4e0d2f578 libc: defer clone ack after FD initialization
Issue #3478
Issue #2303
2019-11-19 14:54:12 +01:00
Norman Feske fab2fc874f libc: write loop for continuous files
This patch improves the libc's write operation to iterate on partial
writes to continuous files until the original write count is reached.
The split of large write operations into small partial writes as
dictated by the VFS infrastructure (e.g., constained by I/O buffer
sizes) becomes invisible to the libc-using application.

Issue #3507
Issue #2303
2019-11-19 14:54:04 +01:00
Sebastian Sumpf 54643d6878 base: add entry to .dynanmic section in genode_dyn.ld
Make sure that at least entry is present in the .dynamic section, so the
PT_DYNAMIC segment points to something valid in case there are no
dynamic symbols.

issue #3537
2019-11-19 14:45:40 +01:00
Sebastian Sumpf 2653fad0c4 ports: noux_tool_chain_auto for ARMv8
issue #3537
2019-11-19 14:45:40 +01:00
Sebastian Sumpf b752d22a77 libports: checkout ARMv8 version of gcov
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf ad12b42d1c gems: depot autopilot enable gcov for ARMv8
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf c845a2d943 libprots: libgcov ARMv8 support
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf b7e06a0b5b recipe: gmp for ARMv8
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf 417dd59b22 libports: gcov for ARMv8
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf 3024720656 ports: update make to version 4.2.1
Required for ARMv8 support

issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf f23eab735b ports: binutils target for ARMv8
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf 112c32eb54 ports: noux-pkg/gcc_arm_64
Added ARMv8 as a native gcc target. This requires a rebuild of the tool
chain.

issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf 3103ce1fa8 libports: update mpc to 1.1.0
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf db18fc42fe libports: update mpfr to 4.0.2
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf d28fe9e938 libports: enable gmp 6.1.2 for ARMv8
issue #3537
2019-11-19 14:45:39 +01:00
Sebastian Sumpf 31a035a907 libports: update gmp from 4.3.2 to 6.1.2
issue #3537
2019-11-19 14:45:39 +01:00
Norman Feske 91412c6c52 libc: trigger SIGCHLD for when forked child exits 2019-11-19 14:45:39 +01:00
Norman Feske 068324536c libc: eliminate atexit handler for 'Rtc'
We never want to destruct the 'Rtc' because other atexit handlers may
depend on it (e.g., for updating modification times when closing files).
2019-11-19 14:45:38 +01:00
Norman Feske bb6eb0f6ea libc: local signal delivery via 'kill'
This patch adds the ability to call 'kill' with the own PID to trigger
the execution of the handler of the specified POSIX signal. This is used
by 'bash', e.g., when cancelling the input of a command via control-c.

Related to issue #3546
2019-11-19 14:45:38 +01:00
Norman Feske c1012e6a45 libc: translate terminal user interrupts to SIGINT
Issue #3546
2019-11-19 14:45:38 +01:00
Norman Feske 23d21d77e9 vfs/terminal: detect user interrupts (control-c)
This patch equips the VFS terminal file system with the ability to
detect user interrupts in the incoming data stream, and propagate this
information via the new pseudo file '.terminal/interrupts'. Each time,
the user presses control-c in the terminal, the value stored in this
pseudo file is increased. Thereby, a VFS client can watch this file to
get notified about the occurrences of user interrupts.

Fixes #3546
2019-11-19 14:45:38 +01:00
Norman Feske 8c44b17e86 libc: shebang handling for execve
Fixes #3545
2019-11-19 14:45:38 +01:00
Norman Feske 636e0f6444 libc: cancel select when POSIX signal occurs
With this patch, Vim running via the 'bash.run' script becomes able to
adopt itself to changed window dimensions.

Issue #3544
2019-11-19 14:45:36 +01:00
Josef Söntgen fafa409cf9 block_tester: use dynamic shared scratch buffer
The scratch buffer is now allocated from the heap and is shared
between the test as they are executed in a serial fashion. This
change saves memory as the test are constructed at start-up.

Fixes #3539.
2019-11-19 14:44:02 +01:00
Josef Söntgen dbecceec09 expanding_reporter: configure initial buffer size
Fixes #3543.
2019-11-19 14:44:02 +01:00
Josef Söntgen 60f390ddf8 noux: prevent accessing invalid leaf path in open
Fixes #3542.
2019-11-19 14:44:02 +01:00
Josef Söntgen c79ebc93a2 libc_noux: try read again on EAGAIN/EINTR
Issue #3541.
2019-11-19 14:44:02 +01:00
Josef Söntgen 55ab694d79 libc_noux: leave write loop on error
Fixes #3541.
2019-11-19 14:44:02 +01:00
Josef Söntgen f5c5479faa ram_block: use Number_of_bytes to parse block size
Using this helper rather than parsing as size_t directly allows use to
use size suffixes, e.g. K, M, G.

Fixes #3540.
2019-11-19 14:44:02 +01:00
Josef Söntgen ba9b612c4f libc_noux: close fd on failed O_TRUNC attempt
Fixes #3524.
2019-11-19 14:44:02 +01:00
Norman Feske 7b0771659e libc: trigger SIGWINCH by watching .terminal/info
Issue #3544
2019-11-19 14:43:43 +01:00
Norman Feske e9762ee25f vfs: 'Rtc_file_system::close' for watch handle
The default implementation of this method throws an exception.
2019-11-19 14:42:23 +01:00
Norman Feske 7549189f88 vfs: watch support for Readonly_value_file_system
This patch adds support for watch notifications for the
'Readonly_value_file_system', which is often used by VFS plugins to
implement pseudo files. It thereby enables VFS clients to respond to
VFS-plugin events (think of terminal resize) dynamically.

Fixes #3523
2019-11-19 14:42:23 +01:00
Oleg Girko a5bc031cca genode_org: Fix download URL.
As genode.org site is now protected by TLS and unencrypted site
is redirected to enctypted one, download URL should be modified
to reflect this change.

Without this change, wget downloads just index.html file.

Signed-off-by: Oleg Girko <ol@infoserver.lv>

Fixes #3538
2019-11-19 14:42:23 +01:00
Oleg Girko 5cd684997a sntp_client: No need to always limit this scenario to x86.
It runs pretty well on Raspberry Pi, for example.

Leaving this scenario limited to x86 for autopilot runs only.

Signed-off-by: Oleg Girko <ol@infoserver.lv>

Fixes #3536
2019-11-19 14:42:23 +01:00
Christian Helmuth 93d3a0848a Remove unused libm/posix.lib.so from lwip_lx.run
Prevents integration failures like follows if the libraries were not
built already in the build directory.

  Missing boot modules: libm.lib.so posix.lib.so
  Makefile:323: recipe for target 'run/lwip_lx' failed
2019-11-19 14:42:23 +01:00
Christian Helmuth f1b1dd26cf run: tweak CRLF translation in log scripts
Ideally, I'd like to disable expects's translation here, which does not
work. The current setting is the result of testing all combinations.
2019-11-19 14:42:23 +01:00
Christian Helmuth cd5e906bd0 imx: do not convert LF to CRLF in UART driver
This is done on higher level already.
2019-11-19 14:42:23 +01:00
Oleg Girko c589660182 Replace ENV make variable with MKENV.
ENV variable conflicts with Environment Modules.

Signed-off-by: Oleg Girko <ol@infoserver.lv>

Fixes #3535
2019-11-19 14:42:23 +01:00
Stefan Kalkowski 8a8aa85726 hw: initialize iomux, ccm and gpc for i.MX8 EVK
Fix #3534
2019-11-19 14:42:23 +01:00
Stefan Kalkowski 105b2c9b7a hw: fix gicv3 implementation of clear/set regs
In addition use uniformly enums for interupt count in register declarations.

Fix #3532
2019-11-19 14:42:23 +01:00
Stefan Kalkowski f6435d91fc hw: turn Kernel_object into Genode::Constructible
Fix #3531
2019-11-19 14:42:23 +01:00
Stefan Kalkowski 3e3fb63863 hw: enable Genode::raw for bootstrap
Ref #3531
2019-11-19 14:42:23 +01:00
Oleg Girko 4007cee852 Fix MAC address printing in dde_linux USB net drivers.
Passing array of unsigned chars to Genode::log() function
makes it converted to void pointer, resulting in printing its address.

Wrapping this array into Genode::Cstring solves this problem
and makes it being printed properly as zero-terminaled string.

Signed-off-by: Oleg Girko <ol@infoserver.lv>

Fixes #3530
2019-11-19 14:42:23 +01:00
Christian Helmuth b622a5a788 vbox: use RTThreadCreate for periodic_gip thread
This prevents the following error message.

  [init -> vbox1] Error: pthread_self() called from alien thread named 'periodic_gip'
2019-11-19 14:42:23 +01:00
Christian Helmuth ec9e40695d vbox: use PIIX3 instead of ICH9 in VM config
Prevents #3533
2019-11-19 14:42:23 +01:00
Martin Stein 0ad0153626 nic_router: fix broken uplink label on re-config
Uplink labels were stored in the uplink objects as reference. As uplink objects
may be re-used on re-configuration to avoid unnecessary closing and re-opening
of NIC sessions, the label reference could get invalid as the object that
stored the label content didn't get re-used. Thus, the label is now copied to
the uplink object.

Fixes #3529
2019-11-19 14:42:23 +01:00
Martin Stein cd37bff514 nic_router: do not report while re-configuring
Fixes #3528
2019-11-19 14:42:23 +01:00
Martin Stein 27c2a66bbd nic_router: report link state
This adds two new boolean attributes to the <report> tag of the NIC router
configuration 'link_state' and 'link_state_triggers'. The former decides
whether to report the link state of each NIC interface (downlink, uplinks) at
the NIC router. The other decides whether to trigger reporting each time the
link state of an interface changes.

Fixes #3527
2019-11-19 14:42:23 +01:00
Martin Stein 58247737fd nic_router: free MAC on session-creation exception
If a MAC address was once allocated for a downlink and during the further
creation of the downlink an exception caused the creation to be aborted, the
NIC router didn't free the MAC address again.

Ref #3525
2019-11-19 14:42:23 +01:00
Martin Stein ebcca179ed nic_router: fix 'catch' paths in session creation
The handling of exceptions during session creation implies freeing and
detaching the RAM DS behind the session env and session component. But this
was done using the session env located in the same RAM DS, which must
lead to problems. Now, the session env from the RAM DS is copied to the stack
and the operations are done on this temporary instance instead.

Ref #3525
2019-11-19 14:42:22 +01:00
Martin Stein 60d37f690c packet_stream_*: fix missing dissolve on exception
When the construction of a member of Packet_stream_*::Rpc_object after
the _cap member threw an exception, the object was not dissolved from
the entrypoint although the Rpc_object vanished at this point. This was
because the call to 'manage()' happened in the initializer list (for the
_cap member instantiation). The destruction of the _cap member then did
not dissolve the object.

This first fix moves the call to 'manage()' into the constructor body
after the instantiation of all other members. A more sophisticated fix
would use some kind of 'Managed_object' life-time guard that manages an
object on construction and dissolves on destruction.

Ref #3525
2019-11-19 14:42:22 +01:00
Martin Stein 0ed5655086 nic_router: do DHCP when re-config to dynamic IP
When re-configuring a domain from using a static IP config to using a dynamic
IP config, attached interfaces didn't react with doing DHCP discover. This bug
is fixed now and the nic_router_flood test was adapted in a way that it tests
the described behavior.

Fix #3518
2019-11-19 14:42:22 +01:00
Stefan Kalkowski 87a6368ba1 hw: implement multi-processor support for rpi3
Fix #3522
2019-11-19 14:42:22 +01:00
Stefan Kalkowski 1cbd77c806 hw: implement multi-processor support for i.MX8
Fix #3520
2019-11-19 14:42:22 +01:00
Stefan Kalkowski e3f82b09d7 hw: instantiate pic object per cpu
Ref #3520
2019-11-19 14:42:22 +01:00
Christian Helmuth d4a3db22bd solo5: migrate snapshot archive to genode.org 2019-11-19 14:42:22 +01:00
Christian Helmuth 43f28e0451 stdcxx: add more missing symbols to ABI
Fixes #3506
2019-11-19 14:42:22 +01:00
Norman Feske d516515c7a vfs/terminal: provide meta info as pseudo files
Issue #3519
Fixes #3521
2019-11-19 14:39:09 +01:00
Norman Feske 7ac32ea60c libc: support for ioctls via ioctl directory
This patch introduces a new scheme of handling ioctl operations that
maps ioctls to pseudo-file accesses, similar to how the libc maps socket
calls to socket-fs operations.

A device file can be accompanied with a (hidden) directory that is named
after the device file and hosts pseudo files for triggering the various
device operations. For example, for accessing a terminal, the directory
structure looks like this:

  /dev/terminal
  /dev/.terminal/info

The 'info' file contains device information in XML format. The type of
the XML node corresponds to the device type. E.g., If the libc receives
a 'TIOCGWINSZ' ioctl for /dev/terminal, it reads the content of
/dev/.terminal/info to obtain the terminal-size information. In this
case, the 'info' file looks as follows:

  <terminal rows="25" columns="80/>

Following this scheme, VFS plugins can support ioctl operations by
providing an ioctl directory in addition to the actual device file.

Internally, the mechanism uses the 'os/vfs.h' API to access pseudo
files. Hence, we need to propagate the Vfs::Env to 'vfs_plugin.cc' to
create an instance of a 'Directory' for the root for the VFS.

Issue #3519
2019-11-19 14:39:09 +01:00
Christian Prochaska 07a40d028a libc: fix and cleanup pthread mutexes
Issue #3503
Fixes #3504
2019-11-19 14:23:57 +01:00
Christian Prochaska a47adecdcd test-pthread: add mutex tests
Add tests for recursive and errorcheck type mutexes.

Fixes #3503
2019-11-19 14:23:57 +01:00
Christian Helmuth 355d94f5df Use NTP server from pool.ntp.org in sntp_client test 2019-11-19 14:23:57 +01:00
Pirmin Duss c0789a6c0e depot_deploy: status report
The idea is, that other components may know, when a valid
init.config is available.

Issue #3482
2019-11-19 14:23:57 +01:00
Norman Feske 530144b040 doc/challenges.txt: add Puppet topic 2019-11-19 14:23:56 +01:00
Norman Feske c85bc38802 Move include/gems/vfs.h to include/os/vfs.h
Fixes #3515
2019-11-19 14:23:56 +01:00
Norman Feske a8dd7dd2fa Remove rump_fs server component
This patch replaces the use of the rump_fs server by the VFS server with
the Rump VFS plugin.

Issue #3512
2019-11-19 14:23:56 +01:00
Norman Feske 6e86d6d699 Remove server/fatfs_fs and libc_fatfs plugin
Issue #3512
2019-11-19 14:23:56 +01:00
Norman Feske 2954abb58a Simplify qt5_textedit.run
The run script used to be the only user of the fatfs_fs server, which
we're going to remove. This patch removes the components for accessing a
real storage device and file system from the run script. The new version
just uses ram_fs.

Issue #3512
2019-11-19 14:23:56 +01:00
Norman Feske 5bb366513b Remove os/src/app/cli_monitor
Nowadays, we use standard command-line tools like vim to edit init
configurations dynamically, which alleviates the need for a custom CLI.
The CLI-monitor component was too limited for use cases like Sculpt
anyway.

The patch also removes the ancient (and untested for long time)
terminal_mux.run script, which used to be the only remaining user of the
CLI monitor.

Issue #3512
2019-11-19 14:23:56 +01:00
Norman Feske 4bcc75365c Remove gems/src/app/launcher
The graphical launcher remained unused for a few years now. It is not
suitable for systems as flexible as Sculpt OS.

Issue #3512
2019-11-19 14:23:56 +01:00
Ehmry - 288f79270d test/vfs_stress: annotate switch label fall-throughs
This test was written for speed, not correctness.

Fixes #3516
2019-11-19 14:23:56 +01:00
Christian Prochaska 3c62a33a25 qt5: add NEON-related files and symbols to qt5_gui lib
Fixes #3517
2019-11-19 14:23:56 +01:00
Piotr Tworek 80a84bef26 Fix ram session quota accounting in lan9118
This driver manually checks if the RAM quota is big enough for the
Lan9118 nic session component. The problem is Root_component::_create
from which Root_component::_create_session gets called does already
check this. No need to account for it twice.

Fixes #3514
2019-11-19 14:23:56 +01:00
Johannes Kliemann 022fac0d37 dde_zircon: use fork by jklmnn
Fixes #3513
2019-11-19 14:23:56 +01:00
Norman Feske 5ab1505d43 file system: enhanced file status info
This patch extends the 'File_system::Status',
'File_system::Directory_entry', and the related 'Vfs' types with
the following additional information:

- Distinction between continuous and transactional files (Node_type)
  (issue #3507)
- Readable, writeable, and executable attributes (Node_rwx),
  replacing the former 'mode' bits
  (issue #3030)

The types 'Node_rwx', 'Node_type' are defined twice,
once for the VFS (vfs/types.h) and once for the 'File_system'
session (file_system_session/file_system_session.h).
Similarly, there is a direct correspondance between
'Vfs::Directory_service::Dirent' and 'File_system::Directory_entry'.

This duplication of types follows the existing pattern of keeping the
VFS and file-system session independent from each other.
2019-11-19 14:23:56 +01:00
Alexander Boettcher 1297a8fb57 trace: skip subject_id 0 in subject id allocator
Issue #3510
2019-11-19 14:23:55 +01:00
Christian Helmuth 732215a83f libc: limit fcntl(F_SETFL) to file-status flags
This fixes unintended (and unpermitted) changes of O_ACCMODE bits.
2019-11-19 14:23:55 +01:00
Christian Helmuth e11addec7d Cleanup vfs dev directory in vbox5_genode_usb_hid 2019-11-19 14:23:55 +01:00
Christian Helmuth 2166a4b17f dde_linux: prevent warning about 'register' keyword 2019-11-19 14:23:55 +01:00
Christian Helmuth 291587f545 libc: honor poll() event flags POLLRDNORM etc.
Fixes empty read file-descriptor sets in fetchurl_lwip/lxip.

Issue #3499
2019-11-19 14:23:55 +01:00
Christian Helmuth 97df705e53 dde_rump: eliminate global ctors 2019-11-19 14:23:55 +01:00
Josef Söntgen e281174dae libc: bring back old 'poll()' emulation
Issue #3499
2019-11-19 14:23:55 +01:00
Alexander Boettcher ed73feddc5 vbox5: react on host size changes immediately
The guest may take some time to adjust nevertheless.

Fixes #3498
2019-11-19 14:23:55 +01:00
Josef Söntgen c5706e8f4a wifi_drv: enable loading of 5000 series FW
Fixes #3502.
2019-11-19 14:23:55 +01:00
Christian Helmuth 1782c6be79 qt5: rework keyboard handling
Fixes #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth cccfd0719d qt5: prevent deprecated warnings
Issue #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth edc9545229 input: move control-modifier handling into clients
Moving the handling into the input-session clients enables more
sophisticated implementations (like Qt5) to apply key-symbol based
handling of those modifiers like correct CTRL-A with QWERTY and AZERTY
layouts and distinction of CTRL-J and Return.

Issue #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth cc611834c9 input: repeat events require valid codepoints
Issue #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth bbd27a54d3 input_filter: fix de_de/fr_fr character generators
Issue #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth 5a06751242 Increase input_filter RAM quotas to 1280K
Issue #3483
2019-11-19 14:23:54 +01:00
Christian Helmuth 6df8b44616 platform/x86: support 64-bit base address registers
The API still exports 32-bit address and size values only, which works
as the actual MMIO resources are allocated in platform_drv internally.

Fixes #3494
2019-11-19 14:23:54 +01:00
Christian Helmuth e0af9c2d8b platform_drv.inc: reduce acpi_drv caps to 350
This value equals the configuration in drivers_managed-pc, i.e., Sculpt.
2019-11-19 14:23:54 +01:00
Christian Helmuth 11a7ac0536 acpi_drv: reduce capability quota requirements
Map ACPI tables entirely as one dataspaces (not page-by-page). Note, the
current approach does only merge overlapping but not consecutive I/O
memory regions, which would reduce the amount of capabilities required
even further.

Fixes #3495
2019-11-19 14:23:54 +01:00
Christian Prochaska 5c25e0bdb0 heap: fix typo in alloc(0) diagnostic message
Fixes #3501
2019-11-19 14:19:34 +01:00
Norman Feske 222f214341 extract.run: suppress rtc warnings 2019-11-19 14:19:34 +01:00
Norman Feske eefe91ee41 depot_download_manager: no mtime update in extract
With the added modification-time support in the libc, the extract tool
requires a timer session, which is not plausible for the purpose of the
program.

This behavior stems from the fact that the libc implicitly writes the
mtime when closing a written file. For this update, it implicitly calls
'clock_gettime', which in turn initializes the timer subsystem within
the libc (creating a timer session).

For the extract tool, the implicitly updated mtime is useless because
the extract tool overwrites this modification time with the mtime stored
in the archive anyway. However, the dependency from a timer service
remains.

This patch explicitly disables the libc's implicit updating of the
file-modification when closing a written file.

Issue #1784
2019-11-19 14:19:34 +01:00
Norman Feske 979d823d85 libc: make mtime update configurable
By specifying <libc update_mtime="no"...>, the modification-time update
on VFS-sync operations (as issued whenever a written file is closed)
can explicitly be disabled.

Issue #1784
2019-11-19 14:19:34 +01:00
Christian Helmuth 76438a3f85 dde_linux: refactor usb arch-dependent includes
Also added arm_64/arm_v8, which fixes building board-independent usb_hid
etc.
2019-11-19 14:19:34 +01:00
Christian Helmuth b0271ae5e1 Fix hard-disk image creation in vfs server tests
The hard-disk image must be created before boot-image creation as it is
used as boot module by variants of the test (use_ram_block=true).
2019-11-19 14:17:30 +01:00
Norman Feske 6a063364da fs_rom: adaptation to added file-modification time
Issue #1784
2019-11-19 14:17:30 +01:00
Josef Söntgen 99b632f86c server/vfs: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 180f9e6384 libc: handle modified files
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 94b63924ed noux: add time modification
... and set initial time by using RTC session.

Up to now Noux used a monotic clock whose initial start value always
was '0' (which correlates to the start of the UNIX epoch) to provide
a notion of time. In addition it is now possible to use the RTC
session to set the initial value for use cases where having a proper
real-world time matters.

To use the RTC session the 'rtc' attribute of the '<config>' node
must be set to 'yes'. Thereby the session becomes a mandatory
dependency as Noux will not start without it.

Issue #1784
2019-11-19 14:17:30 +01:00
Josef Söntgen d0bf6d2b52 libc: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 9a82bbb54d vfs: add modification time member to directory_service
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 400039e1b6 rump_fs: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 2e5166efd7 lx_fs: add modification time
Issue #1784.
2019-11-19 14:17:30 +01:00
Josef Söntgen 2ec3aaf639 file_system_session: add modification time
* add modification_time member
* add WRITE_TIMESTAMP packet
2019-11-19 14:17:30 +01:00
Norman Feske ab5187d673 libc: resolve symlinks in execve
This patch complements the commit "libc: execve" with the ability to
execute files stored at arbitrary sub directories of the file system.

Issue #3481
Issue #3500
2019-11-19 14:17:29 +01:00
Norman Feske 697d496093 ldso: don't strip leading path from ROM name
This patch removes ldso's builtin policy of removing any path elements
prepending the ROM module name. Instead, the ROM name is used as is.
This clears the way to access different ROM modules that share the same
name but are stored at different directories behind an fs_rom (e.g.,
/bin/bash vs. /usr/local/bin/bash).

Issue #3500
2019-11-19 14:17:29 +01:00
Norman Feske a17c5e30b7 mk/gnu_build.mk: avoid absolute lib paths
This patch changes the way how libraries are specified at the linker
command line from /abs/path/to/library.lib.so

Issue #3500
2019-11-19 14:17:29 +01:00
Christian Helmuth 8d6285927b tools.conf: fix check for arm_64
Before arm matched first resulting in the wrong tool-chain binaries
being used.
2019-11-19 14:17:29 +01:00
Norman Feske 90a91f3536 dde_linux: eliminate global ctors in lx_kit
As the lx_kit library is used by the vfs_lxip plugin, it must not
contain any static global constructor.

Related to issue #3487
2019-11-19 14:17:29 +01:00
Norman Feske c8b7710e5d libc: improve dup/dup2 in vfs_plugin
This patch replaces the naive dup2 implementation (that merely
duplicated the context pointer) by the replication of the original
FD state by re-opening the same file with the same flags and seek
position. This prevents a potential double release of the VFS handle
(the FD context). It also implements 'dup'.

Fixes #3505
Fixes #3477
2019-11-19 14:10:55 +01:00
Norman Feske 59c60b8031 test-libc: test double dup2, dup
Issue #3477
Issue #3505
2019-11-19 14:10:55 +01:00
Norman Feske 9500e8b6e1 lwip: remove use of global constructor
Related to issue #3487
2019-11-19 14:10:55 +01:00
Norman Feske e0ee56275e vfs_lwip: fix switch fall-through
Pointed out by a compiler warning.
2019-11-19 14:10:55 +01:00
Norman Feske 418ac4c560 libc: remove global watch() function
This patch replaces the function with a 'Watch' interface to be
explicitly passed to the caller (currently only time.cc).

Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske 5f5d709c07 libc: remove global libc_config()
Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske 89a38723bd libc: reimplement passwd handling
- Eliminate call of global libc_config()
- Remove dynamic memory allocation, const cast
- Prepare for moving the state from compilation unit to header
- Fix run/libc_getpwent.run

Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske 648bcd1505 libc: unify use of namespaces
This patch unifies the patterns of using the 'Genode' and 'Libc'
namespaces.

Types defined in the 'internal/' headers reside in the 'Libc'
namespace. The code in the headers does not need to use the
'Libc::' prefix.

Compilation units import the 'Libc' namespace after the definition of
local types. Local types reside in the 'Libc' namespace (and should
eventually move to an 'internal/' header).

Since the 'Libc' namespace imports the 'Genode' namespace, there is
no need to use the 'Genode::' prefix. Consequently, code in the
compilation units rarely need to qualify the 'Genode' or 'Libc'
namespaces.

There are a few cases where the 'Libc', the 'Genode', and the global
(libc) namespaces are ambigious. In these cases, an explicit
clarification is needed:

- 'Genode::Allocator' differs from 'Libc::Allocator'.
- 'Genode::Env' differs from 'Libc::Env'.
- Genode's string functions (strcmp, memcpy, strcpy) conflict
  with the names of the (global) libc functions.
- There exist both 'Genode::uint64_t' and the libc'c 'uint64_t'.

Issue #3497
2019-11-19 14:10:55 +01:00
Norman Feske bf92232698 libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.

The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.

The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.

There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.

Issue #3497
2019-11-19 14:10:55 +01:00
Ehmry - c6c7870a29 Fix bad include path in genode-base.pc
Add the top-level of include to the search path, not include/base.
2019-11-14 08:56:19 +01:00
Ehmry - 0b427b65aa Tup: build vfs_import 2019-11-10 13:41:49 +01:00
Ehmry - c2a543ed20 test/log: exit when complete 2019-11-10 13:40:40 +01:00
Ehmry - 1dc25293b8 Startup library header path must be overriden
The startup library might fail at runtime if local headers are included
rather than headers from somewhere else.
2019-10-28 15:25:18 +01:00
Ehmry - 3bf1cc09eb Move startup library to a Tup group 2019-10-28 11:32:29 +01:00
Ehmry - fa0c527732 Revert changes to closing of remote VFS handles 2019-10-28 11:32:29 +01:00
Ehmry - 29613c217b Tup: increase default optimization level to -O2 2019-10-28 11:32:29 +01:00
Ehmry - be04cfe899 Remove spec_includes replacements from pkg-config 2019-10-28 11:32:29 +01:00
Ehmry - f037044ec5 Move Tup rules local to this repo to "repos"
Make the top-level Tuprules.tup generic enough to be shared with other projects.
2019-10-28 11:32:29 +01:00
Ehmry - ecd0252b40 Publish core-nova.o in dev output 2019-10-28 11:32:29 +01:00
Ehmry - 4921168eda test/vfs_stress: annotate switch label fall-throughs
This test was written for speed, not correctness.

Fixes #3516
2019-10-28 11:32:29 +01:00
Ehmry - af52274972 Tup: add x86 drivers from os repo 2019-10-28 11:32:29 +01:00
Ehmry - f931ce2e19 Clang: address of packed member 2019-10-28 11:32:29 +01:00
Ehmry - ac8fb6702a Clang: do not use angle brackets for local includes 2019-10-28 11:32:29 +01:00
Ehmry - c67d81dc99 Tup: rename INCLUDES to CPPFLAGS 2019-10-28 11:32:29 +01:00
Ehmry - 3c8117e555 Clang: uninitialized 2019-10-28 11:32:29 +01:00
Ehmry - a7a0d3fe63 Refactor Tup, flatten output directories
Make no attempt to replicate the depot layout.
2019-10-28 11:32:29 +01:00
Ehmry - d348e96b84 base-common: copy all sparse ELF segments, including read-only 2019-10-28 11:32:29 +01:00
Ehmry - 5e87eee9b8 Genode::Capability_space: bypass static constructor where possible 2019-10-04 00:52:03 +02:00
Ehmry - 6e9f9ce3a8 Core includes untangling
Express convoluted include walks directly in code, do not hide them
in build scripts.
2019-10-04 00:52:02 +02:00
Ehmry - a83ffd4821 Multiple inheritance considered harmful 2019-10-04 00:52:02 +02:00
Ehmry - d07ff84f5c Tup: remove gems 2019-10-04 00:52:02 +02:00
Ehmry - 790b82a88d Tup: reduce output path variables 2019-10-04 00:52:02 +02:00
Ehmry - 65d7eff10f Tup: strip down configuration options
Autodetect x86, remove conditional NOVA builds.
2019-10-04 00:52:02 +02:00
Ehmry - 228bb4f189 Tup: Remove rules for generating Dhall manifest 2019-10-04 00:52:02 +02:00
Ehmry - d0865d365c Tup: do not take local includes from pkg-config 2019-10-04 00:52:02 +02:00
Ehmry - 2d7dff54ec Tup Reorder includes 2019-10-04 00:52:02 +02:00
Ehmry - 5587f0992b Tup: build static libraries into the dev output 2019-10-04 00:52:02 +02:00
Ehmry - 7d7659635c Suffix PKG_CONFIG_PATH with Nix inputs 2019-10-04 00:52:02 +02:00
Ehmry - 5682ad8e2b Add base tests 2019-10-04 00:52:02 +02:00
Ehmry - 7d384bc3e6 Adjust for Nix environment
Use a LIBUNWIND and LIBUNWIND_BAREMETAL, adjust shell.nix to use
"base" from the  new split repository builds.
2019-10-04 00:52:02 +02:00
Ehmry - 5a8686eaf9 Compatibility with LLVM libunwind 2019-10-04 00:52:02 +02:00
Ehmry - 4e94dd4265 Remove dead code 2019-10-04 00:52:02 +02:00
Ehmry - a7f4384b12 Clang: undeclared identifier __UINT64_C 2019-10-04 00:52:02 +02:00
Ehmry - 02365c171e Clang: no reference members to stack parameters 2019-10-04 00:47:17 +02:00
Ehmry - 075ab46d39 Clang: do not use angle brackets for local includes 2019-10-04 00:47:17 +02:00
Ehmry - d52f74c7c2 Clang: remove user of register keyword 2019-10-03 22:07:28 +02:00
Ehmry - 44f2c86a91 Clang: implement memset local to C++ runtime
Using Genode::memset with Clang results in recursion.
2019-10-03 22:06:34 +02:00
Ehmry - f42e7f1ff4 Clang: unused lamba capture 2019-10-03 22:06:34 +02:00
Ehmry - b50d28c3e4 Clang: align after template expansion
Cannot align template structs. Also, cannot cast void* to addr_t in
constexpr function.
2019-10-03 22:06:34 +02:00
Ehmry - d557624469 Clang: need a GCC diagnostic push for every pop 2019-10-03 22:06:34 +02:00
Ehmry - 221320af47 Clang: ignore mismatched struct/class tags 2019-10-03 22:06:34 +02:00
Ehmry - 2d60fc9f65 Clang: do not link with libgcc.a 2019-10-03 21:57:57 +02:00
Ehmry - c39507e591 Clang: tautological-undefined-compare 2019-10-03 21:57:57 +02:00
Ehmry - 77873c7808 Clang: address-of-packed-member 2019-10-03 21:57:57 +02:00
Ehmry - 855a9375ac Clang: tautological-constant-out-of-range-compare 2019-10-03 21:57:57 +02:00
Ehmry - f6553d2872 Clang: pragma GCC compatibility 2019-10-03 21:57:57 +02:00
Ehmry - 54480c1c3d GCC: Ignore Clang pragmas 2019-10-03 21:57:57 +02:00
Ehmry - 2509d95d98 Clang: uninitialized 2019-10-03 21:57:57 +02:00
Ehmry - e3c285ac0c Clang: maybe_unused 2019-10-03 21:57:57 +02:00
Ehmry - ca98ac2a0f Clang: no null references 2019-10-03 21:57:57 +02:00
Ehmry - a3241becf0 Clang: fix type overflow 2019-10-03 21:57:57 +02:00
Ehmry - 8979b7ffbb Clang: more C++ support includes 2019-10-03 21:57:57 +02:00
Ehmry - b7c63e38f7 Clang compatible syntax 2019-10-03 21:57:57 +02:00
Ehmry - 28eb528148 Clang: add [[maybe_unused]] to Lock::Guards 2019-10-03 21:57:57 +02:00
Ehmry - 24f4608ce7 Clang: avoid casting nullptr to reference 2019-10-03 21:57:57 +02:00
Ehmry - 852651b3f2 Move chunk types out of File_system namespace 2019-10-03 21:57:57 +02:00
Ehmry - 69ca5b133b Clang: disambiguate namespaces 2019-10-03 21:57:57 +02:00
Ehmry - e46099e224 Clang: disable some RPC tracing
Clang cannot handle this much template salad.
2019-10-03 21:57:57 +02:00
Ehmry - c770a8b9ec Clang: remove unused 2019-10-03 21:57:57 +02:00
Ehmry - 2dc6ea2042 Clang: do not redeclare __SIZE_TYPE__ 2019-10-03 21:25:37 +02:00
Ehmry - 30700e179a Clang: reconcile struct and class declarations 2019-10-03 21:25:37 +02:00
Ehmry - 829b629a0c Clang: ignore -Wuninitialized 2019-10-03 21:25:36 +02:00
Ehmry - 59ab4ef6bc Tupify
Implement a graph-based build system.
2019-10-03 21:25:36 +02:00
Ehmry - 4952b37e4c Core: exit with child exit value
Effective for base-linux only.
2019-10-03 21:25:36 +02:00
Norman Feske aec1178ab1 libc: simplify initialization sequence
This patch reverts the interim patch "libc: init malloc_heap before
VFS", which is no longer needed with the solved issue #3496 and
issue #3487.
2019-09-20 14:16:07 +02:00
Norman Feske efe7f5172d ldso: prevent premature execution of ctors
Fixes #3487
2019-09-20 14:16:05 +02:00
Norman Feske 0aedabd245 libc: remove global constructors
- readv_writev: move 'rw_lock' instance into a function scope,
  constructing the instance on the first access.
- select: move 'select_cb_list' instance into function scope.
- thread: move 'key_list_lock' and 'keys' into function scope.
- rwlock, semaphore, socket_fs_plugin, thread, thread_create:
  instantiate 'Libc::Allocator' per use, alleviating the need for a
  global instance.

Issue #3496
2019-09-20 14:16:01 +02:00
Christian Helmuth 4a7b0e99a6 depot: update recipe hashes 2019-09-20 14:14:16 +02:00
Norman Feske 614f7fa56a mesa.run: omit depot content from boot modules 2019-09-17 14:38:07 +02:00
Norman Feske 6d230134cb doc: update challenges 2019-09-13 12:14:19 +02:00
Pirmin Duss d953030c0e lx_fs: respect writeable session argument
Fixes #3492
2019-09-12 12:28:41 +02:00
Alexander Boettcher 6fe80c3cc7 sculpt: add lock screen/GUI support
Fixes #3491
2019-09-09 15:25:45 +02:00
Christian Prochaska afa0e26a6a qt5: update virtual keyboard example to Qt 5.13
Fixes #3490
2019-09-09 15:08:13 +02:00
Christian Prochaska 1d3bbde70a qt5: add 'lupdate' and 'lrelease' to host tools
Fixes #1736
2019-09-09 15:05:50 +02:00
Alexander Boettcher 6f0c6501f2 acpica: catch Io_mem exceptions
Issue #2998
2019-09-09 15:04:53 +02:00
Christian Helmuth e448022f23 Fix hard-disk image creation in libc_fatfs
The hard-disk image must be created before boot-image creation as it is
used as boot module by variants of the test (use_ram_block=true).
2019-09-09 14:58:25 +02:00
Christian Helmuth 664d858e63 Fix sntp_client test for hw/muen 2019-09-09 12:15:07 +02:00
Christian Helmuth ede009edf9 Fix expected output in USB HID tests
Invalid characters in press events are no longer 0 but 0xfffe since

  a97b8043b5 utf8: non-character U+fffe as invalid codepoint

Issue #3483
2019-09-09 11:35:42 +02:00
Christian Helmuth 08aa7d310a Increase stack size in thread test for arm_v8a
It seems throwing an exception on arm_v8a needs a significant amount of
stack space (> 2048 bytes).
2019-09-03 12:12:46 +02:00
Christian Helmuth 19bf0fdeb8 xkb2ifcfg: detect and log initialization errors 2019-09-03 09:00:31 +02:00
Ehmry - 36111a2edf Libc: implement getifaddrs
Implement getifaddrs and freeifaddrs within the libc using socket
control files at the VFS. Add an "address" and "netmask" file to the
lwIP plugin.

Only a single IPv4 address is initially supported, and the broadcast
address returned will never be valid.

Fixes #3439
2019-09-02 16:36:07 +02:00
Christian Prochaska ab017607a2 tool chain: TLS support
Fixes #3418
2019-09-02 16:29:33 +02:00
1684 changed files with 27884 additions and 19370 deletions

13
.gitignore vendored
View File

@ -2,10 +2,21 @@
*.orig
*.swp
*.rej
result
result-*
/build
/contrib
/depot
/public
/repos/world
/.tup
/build-*
/configs
##### TUP GITIGNORE #####
##### Lines below automatically generated by Tup.
##### Do not edit.
.tup
/.gitignore
/dev
/out

0
.gitmodules vendored Normal file
View File

View File

@ -1,16 +1,29 @@
**FORK AHEAD**
=================================
Genode Operating System Framework
=================================
This a fork of the Genode OS reference implementation with a replacement
build system that is humane and interoperable.
Changes against [Genode Labs](https://genode-labs.com/) master may be
reviewed with the following commands:
```sh
git remote add genodelabs https://github.com/genodelabs/genode.git
git fetch genodelabs
git diff genodelabs/master
```
---
# Genode Operating System Framework
This is the source tree of the reference implementation of the Genode OS
architecture. For a general overview about the architecture, please refer to
the project's official website:
:Official project website for the Genode OS Framework:
### Official project website for the Genode OS Framework
https://genode.org/documentation/general-overview
[https://genode.org/documentation/general-overview]
The current implementation can be compiled for 8 different kernels: Linux,
L4ka::Pistachio, L4/Fiasco, OKL4, NOVA, Fiasco.OC, seL4, and a custom
@ -33,15 +46,14 @@ the kernel that fits best with the requirements at hand for the particular
usage scenario.
Documentation
#############
## Documentation
The primary documentation is the book "Genode Foundations", which is available
on the front page of Genode website:
:Download the book "Genode Foundations":
### Download the book "Genode Foundations"
[https://genode.org]
https://genode.org
The book describes Genode in a holistic and comprehensive way. It equips you
with a thorough understanding of the architecture, assists developers with the
@ -53,79 +65,75 @@ The project has a quarterly release cycle. Each version is accompanied with
detailed release documentation, which is available at the documentation
section of the project website:
:Release documentation:
### Release documentation
[https://genode.org/documentation/release-notes/]
https://genode.org/documentation/release-notes/
Directory overview
##################
## Directory overview
The source tree is composed of the following subdirectories:
:'doc':
### '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
[doc/getting_started.txt](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
[doc/components.txt](doc/components.txt)
:'repos':
### '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.
:'tool':
### 'tool'
Source-code management tools and scripts. Please refer to the README file
contained in the directory.
:'depot' and 'public':
### 'depot' and 'public'
Local depot and public archive of Genode packages. Please refer to
! doc/depot.txt
[doc/depot.txt](doc/depot.txt)
for more details.
Additional community-maintained components
##########################################
## Additional community-maintained components
The components found within the main source tree are complemented by a growing
library of additional software, which can be seamlessly integrated into Genode
system scenarios.
:Genode-world repository:
### Genode-world repository
[https://github.com/genodelabs/genode-world]
https://github.com/genodelabs/genode-world
Contact
#######
## Contact
The best way to get in touch with Genode developers and users is the project's
mailing list. Please feel welcome to join in!
:Genode Mailing Lists:
### Genode Mailing Lists
[https://genode.org/community/mailing-lists]
https://genode.org/community/mailing-lists
Commercial support
##################
## Commercial support
The driving force behind the Genode OS Framework is the German company Genode
Labs. The company offers commercial licensing, trainings, support, and
contracted development work:
:Genode Labs website:
### Genode Labs website
[https://www.genode-labs.com]
https://www.genode-labs.com

0
Tupfile.ini Normal file
View File

46
Tuprules.gcc Normal file
View File

@ -0,0 +1,46 @@
TOOLCHAIN_CONFIGURED=$(TOOLCHAIN_CONFIGURED)X
ifeq (@(TUP_ARCH),i386)
CC_MARCH = -march=i686 -m32
LD_MARCH = -melf_i386
AS_MARCH = -march=i686 --32
endif
ifeq (@(TUP_ARCH),x86_64)
CC_MARCH = -m64 -mcmodel=large
LD_MARCH = -melf_x86_64
endif
ifeq (@(TUP_ARCH),arm_v8)
CC_MARCH = -march=armv8-a
endif
ifdef CXXFLAGS
CXXFLAGS = @(CXXFLAGS)
endif
CXXFLAGS += -Wno-error=implicit-fallthrough
CXXFLAGS += -Wno-error=unknown-pragmas
CXXFLAGS += -Wextra
CXXFLAGS += -Weffc++
CXXFLAGS += -Werror
CXXFLAGS += -Wsuggest-override
CXXFLAGS += -Wno-unknown-pragmas
LIBGCC = `$(CXX) $(CC_MARCH) -print-libgcc-file-name`
!ir = | $(DEV_DIR)/<pkg-config> |> clang $(OLEVEL) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(CPPFLAGS) -S -emit-llvm %f |> %B.ll
!asm = |> ^ CC %b^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -D__ASSEMBLY__ $(CPPFLAGS) -c %f -o %o |> %B.o
!cc = | $(DEV_DIR)/<pkg-config> |> ^o CC %f^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) $(CPPFLAGS) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` -c -fPIC %f -o %o |> %B.o
!cxx = | $(DEV_DIR)/<pkg-config> |> ^o CXX %b^ @(CC_WRAPPER) $(CXX) $(OLEVEL) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) $(CPPFLAGS) `$(PKG_CONFIG) --cflags $(LIBS)` -c -fPIC %f -o %o |> %B.o
!ld = | $(DEV_DIR)/<lib> $(DEV_DIR)/<pkg-config> |> ^o LD %o^ $(LD) -o %o $(LDFLAGS) `$(PKG_CONFIG) --libs $(LIBS)` %f |>
!incbin = |> ^ incbin %f^ \
export SYM=_binary_`echo %b | sed 's/\./_/g'`; \
echo ".global ${SYM}_start, ${SYM}_end; .data; .align 4; ${SYM}_start:; .incbin \"%f\"; ${SYM}_end:" \
| x86_64-unknown-genode-as $(AS_MARCH) -o %o - \
|> binary_%b.o

40
Tuprules.llvm Normal file
View File

@ -0,0 +1,40 @@
TOOLCHAIN_CONFIGURED=$(TOOLCHAIN_CONFIGURED)X
ifeq (@(TUP_ARCH),i386)
CC_MARCH = -march=i686 -m32
LD_MARCH = -melf_i386
AS_MARCH = -march=i686 --32
endif
ifeq (@(TUP_ARCH),x86_64)
CC_MARCH = -m64 -mcmodel=large
LD_MARCH = -melf_x86_64
endif
ifeq (@(TUP_ARCH),arm_v8)
CC_MARCH = -march=armv8-a
endif
ifdef CXXFLAGS
CXXFLAGS = @(CXXFLAGS)
endif
CXXFLAGS += -Wno-undefined-bool-conversion -Wno-unknown-attributes -Wsystem-headers -Werror -Wno-uninitialized -Wno-mismatched-tags
LIBGCC = `$(CC) $(CC_MARCH) -print-libgcc-file-name`
!ir = | $(DEV_DIR)/<pkg-config> |> clang $(OLEVEL) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(CPPFLAGS) -S -emit-llvm %f |> %B.ll
!asm = |> ^ CC %b^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -D__ASSEMBLY__ $(CPPFLAGS) -c %f -o %o |> %B.o
!cc = | $(DEV_DIR)/<pkg-config> |> ^o CC %f^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) $(CPPFLAGS) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` -c -fPIC %f -o %o |> %B.o
!cxx = | $(DEV_DIR)/<pkg-config> |> ^o CXX %b^ @(CC_WRAPPER) $(CXX) $(OLEVEL) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) $(CPPFLAGS) `$(PKG_CONFIG) --cflags $(LIBS)` -c -fPIC %f -o %o |> %B.o
!ld = | $(DEV_DIR)/<lib> $(DEV_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LDFLAGS) `$(PKG_CONFIG) --libs $(LIBS)` --whole-archive --start-group %f --no-whole-archive --end-group -o %o |>
!incbin = |> ^ incbin %f^ \
export SYM=_binary_`echo %b | sed 's/\./_/g'`; \
echo ".global ${SYM}_start, ${SYM}_end; .data; .align 4; ${SYM}_start:; .incbin \"%f\"; ${SYM}_end:" \
| llvm-mc -filetype=obj - > %o \
|> binary_%b.o

103
Tuprules.tup Normal file
View File

@ -0,0 +1,103 @@
.gitignore
AR = @(AR)
AS = @(AS)
CC = @(CC)
CXX = @(CXX)
LD= @(LD)
OBJCOPY = @(OBJCOPY)
STRIP = @(STRIP)
OUT_DIR=$(TUP_CWD)/out
DEV_DIR = $(TUP_CWD)/dev
DEV_LIB_DIR = $(DEV_DIR)/lib
ifdef IS_GCC
include Tuprules.gcc
endif
ifdef IS_LLVM
include Tuprules.llvm
endif
ifeq ($(TOOLCHAIN_CONFIGURED),)
error no toolchain configuration is active
endif
ifneq ($(TOOLCHAIN_CONFIGURED),X)
error "multiple toolchain configurations are active "
endif
ifeq (@(TUP_ARCH),i386)
X86 = y
endif
ifeq (@(TUP_ARCH),x86_64)
X86 = y
endif
GENODE_DIR = $(TUP_CWD)
!prg = | $(DEV_DIR)/<lib> $(DEV_DIR)/<pkg-config> \
|> ^o LD %o^ $(LD) -o %o $(LD_MARCH) $(LDFLAGS) -L$(DEV_LIB_DIR) %f `$(PKG_CONFIG) --libs $(LIBS) genode-prg` $(LIBGCC) |> %d
!lib = | $(DEV_DIR)/<lib> $(DEV_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LD_MARCH) %f $(LDFLAGS) `$(PKG_CONFIG) --libs genode-lib $(LIBS)` -L$(DEV_LIB_DIR) -o %o |> %d.lib.so
!collect_bin = |> ^ COLLECT %b^ \
$(STRIP) -o %o %f \
|> $(OUT_DIR)/bin/%b $(OUT_DIR)/<bin>
!collect_shared = |> ^ COLLECT %b^ \
cp %f %o \
|> $(OUT_DIR)/lib/%b $(OUT_DIR)/<lib>
!collect_static = |> ^ COLLECT %b^ \
cp %f %o \
|> $(DEV_LIB_DIR)/%b \
$(DEV_DIR)/<lib> \
PKG_CONFIG_DIR = $(DEV_DIR)/lib/pkgconfig
ifdef NIX_OUTPUTS_DEV
export PKG_CONFIG_PATH
PKG_CONFIG = PKG_CONFIG_PATH=$(PKG_CONFIG_DIR):$PKG_CONFIG_PATH @(PKGCONFIG)
else
PKG_CONFIG = PKG_CONFIG_PATH=$(PKG_CONFIG_DIR) @(PKGCONFIG)
endif
CFLAGS += -g
CXXFLAGS += -g
ifdef OLEVEL
OLEVEL = @(OLEVEL)
else
OLEVEL = -O2
endif
!strip = |> $(STRIP) -o %o %f |>
!ln = |> ln -s %f %o |>
!ar = |> $(AR) -rcs %o %f |> %d.a
GIT_VERSION = `git describe || echo @(VERSION)`
SED_PKGCONFIG_FLAGS += -e "s|@VERSION@|$(GIT_VERSION)|"
!sed_pkgconfig_file = |> ^o SED %B^ \
sed $(SED_PKGCONFIG_FLAGS) $(SED_FLAGS) < %f > %o; \
$(PKG_CONFIG) --validate %o; \
|> $(PKG_CONFIG_DIR)/%B $(DEV_DIR)/<pkg-config>
!sed_pkgconfig_flags = |> ^o SED %d.pc^ \
sed $(SED_PKGCONFIG_FLAGS) $(SED_FLAGS) > %o; \
$(PKG_CONFIG) --validate %o; \
|> $(PKG_CONFIG_DIR)/%d.pc $(DEV_DIR)/<pkg-config>
!emit_lib_pkg_config = |> ^ emit %d.a pkg-config^ \
echo Name: %d >> %o; \
echo Description: Genode %d library >> %o; \
echo Version: $(GIT_VERSION) >> %o; \
echo Libs: -l:%d.a >> %o; \
$(PKG_CONFIG) --validate %o; \
|> $(PKG_CONFIG_DIR)/%d.pc $(DEV_DIR)/<pkg-config>

View File

@ -1 +1 @@
19.08
19.11

0
configs/.gitignore vendored Normal file
View File

View File

@ -16,17 +16,6 @@ research projects on Genode.
Applications and library infrastructure
#######################################
:GNU Privacy Guard:
The [https://gnupg.org/ - GNU Privacy Guard] (GNUPG) is the most widely
used Free-Software implementation of the OpenGPG standard. It comprises a
rich set of tools for encryption and key management. For many forthcoming
application scenarios of Genode such as package management and email
communication, GNUPG is crucial. Hence, it should be ported to Genode. Such
a port may leverage Genode's fine-grained component architecture to strongly
separate network-exposed functionality, the storage of key material, and the
cryptographic functions.
:VNC server implementing Genode's framebuffer session interface:
With 'Input' and 'Framebuffer', Genode provides two low-level interfaces
@ -50,24 +39,6 @@ Applications and library infrastructure
integrated in the operating system, i.e., in the form of Genode components
or a set of Genode VFS plugins.
:Tiled window manager:
At Genode Labs, we pursue the goal to shape Genode into an general-purpose
operating system suitable for productive work. The feature set needed to
achieve this goal largely depends on the tools and applications daily used by
the Genode engineers. As one particularly important tool for being highly
productive, we identified a tiled user interface. Currently, all developers
at Genode Labs embrace either the Ion3 window manager or the tiled Terminator
terminal emulator. Hence, we desire to have a similar mode of user
interaction on Genode as well. The goal of this challenge is to identify the
most important usage patters and the implementation of a tiled GUI that
multiplexes the framebuffer into a set of tiled and tabbed virtual
framebuffers.
Related to this work, the low-level 'Framebuffer' and 'Input' interfaces
should be subject to a revision, for example for enabling the flexible change
of framebuffer sizes as needed by a tiled user interface.
:Interactive sound switchbox based on Genode's Audio_out session interface:
Since version 10.05, Genode features a highly flexible configuration concept
@ -116,6 +87,11 @@ Applications and library infrastructure
of communicating threads as captured on the running system. The tool should
work on a selected kernel that provides a facility for tracing IPC messages.
The underlying light-weight tracing infrastructure is
[https://genode.org/documentation/release-notes/19.08#Tracinghttps://genode.org/documentation/release-notes/19.08#Tracing - already in place].
The Qt-based tracing tools would complement this infrastructure with
an interactive front end.
:Ports of popular software:
Genode features a ports mechanism to cleanly integrate 3rd-party software.
@ -127,6 +103,18 @@ Applications and library infrastructure
have available on Genode is available at
[http://usr.sysret.de/jws/genode/porting_wishlist.html].
:Native Open-Street-Maps (OSM) client:
When using Sculpt OS, we regularly need to spawn a fully fledged web
browser in a virtual machine for using OSM or Google maps. The goal
of this project would be a native component that makes maps functionality
directly available on Genode, alleviating the urge to reach for a SaaS
product. The work would include a review of existing OSM clients regarding
their feature sets and the feasibility of porting them to Genode.
Depending on the outcome of this review, an existing application could
be ported or a new component could be developed, e.g., leveraging Genode's
Qt support.
Application frameworks and runtime environments
###############################################
@ -135,18 +123,18 @@ Application frameworks and runtime environments
[http://openjdk.java.net/ - OpenJDK] is the reference implementation of the
Java programming language and hosts an enormous ecosystem of application
software. The goal of this line of work is the ability to run this
software directly on Genode. The centerpiece of OpenJDK is Hotspot - the
Java virtual machine implementation, which must be ported to Genode.
The initial port should suffice to execute simple example programs that
operate on textual input. Since Genode has the FreeBSD libc readily
available, OpenJDK's existing POSIX backends can be reused. The next step
is the creation of Genode-specific native classes that bridge the gap
between the Java world and Genode, in particular the glue code to
run graphical applications as clients of Genode's GUI server. Since
OpenJDK has been ported to numerous platforms (such as Haiku), there
exists a comforting number of implementations that can be taken as
reference.
software.
Since
[https://genode.org/documentation/release-notes/19.02#Showcase_of_a_Java-based_network_appliance - version 19.02],
Genode features a port of OpenJDK that allows the use of Java for networking
applications.
The next step would be the creation of Genode-specific native classes that
bridge the gap between the Java world and Genode, in particular the glue
code to run graphical applications as clients of Genode's GUI server. Since
OpenJDK has been ported to numerous platforms (such as Haiku), there exists
a comforting number of implementations that can be taken as reference.
:Android's ART VM natively on Genode:
@ -155,22 +143,6 @@ Application frameworks and runtime environments
removed from the trusted computing base of Android, facilitating the use of
this mobile OS in high-assurance settings.
:Rust bindings for the Genode API:
Rust is a low-level systems programming language that ensures memory
safety without employing a garbage collector. It thereby challenges C++
as the go-to programming language for high-performance and low-level code.
Since
[http://genode.org/documentation/release-notes/16.05#New_support_for_the_Rust_programming_language - version 16.05],
Genode supports the use of the Rust programming language within
components. However, to unleash the potential of this combination,
Genode's API must become available to native Rust code. The intermediate goal
of this project is the implementation of an example server, e.g., a
component that provides a terminal-session interface. Thereby, we
will encounter the problems of bootstrapping and configuration of the
component, the provisioning of signal handlers and session objects, and
memory management.
:Go language runtime:
Go is a popular language in particular for web applications. In the past,
@ -222,6 +194,33 @@ Application frameworks and runtime environments
development is [http://halvm.org - HalVM] - a light-weight OS runtime for
Xen that is based on Haskell.
:Xlib compatibility:
Developments like Wayland notwithstanding, most application software on
GNU/Linux systems is built on top of the Xlib programming interface.
However, only a few parts of this wide interface are actually used today.
I.e., modern applications generally deal with pixel buffers instead of
relying on graphical drawing primitives of the X protocol. Hence, it seems
feasible to reimplement the most important parts of the Xlib interface to
target Genode's native GUI interfaces (nitpicker) directly. This would
allow us to port popular application software to Sculpt OS without
changing the application code.
:Bump-in-the-wire components for visualizing session interfaces:
Genode's session interfaces bear the potential for monitoring and
visualizing their use by plugging a graphical application
in-between any two components. For example, by intercepting block
requests issued by a block-session client to a block-device driver,
such a bump-in-the-wire component could visualize
the access patterns of a block device. Similar ideas could be pursued for
other session interfaces, like the audio-out (sound visualization) or NIC
session (live visualization of network communication).
The visualization of system behavior would offer valuable insights,
e.g., new opportunities for optimization. But more importantly, they
would be extremely fun to play with.
Virtualization
##############
@ -237,21 +236,6 @@ Virtualization
is normally not possible. Also, complex Genode scenarios (like Turmvilla)
could be prototyped on GNU/Linux.
:VirtualBox on top of seL4:
The [https://sel4.systems - seL4 microkernel] is a modern microkernel that
undergoes formal verification to prove the absence of bugs. Since version
4.0, the kernel supports virtualization support on x86-based hardware.
Genode has experimental support for seL4 that allows almost all Genode
components to be used on top of this kernel. VirtualBox is an exception
because it closely interacts with the underlying kernel (like NOVA) to
attain good performance. We have shown that VirtualBox can be executed
within a protection domain of the NOVA microhypervisor. The goal of this
project is the application of this approach to the virtualization
interface of seL4. The result will be a VM hosting environment that
ensures the separation of virtual machines via the formally verified
seL4 kernel.
:Xen as kernel for Genode:
Using Xen as kernel for Genode would clear the way to remove the
@ -294,22 +278,25 @@ Virtualization
the project bears the opportunity to explore the provisioning of the
KVM interface based on Genode's VFS plugin concept.
:Hardware-accelerated graphics for virtual machines:
In
[https://genode.org/documentation/release-notes/17.08#Hardware-accelerated_graphics_for_Intel_Gen-8_GPUs - Genode 17.08],
we introduced a GPU multiplexer for Intel Broadwell along with support
for Mesa-based 3D-accelerated applications.
While designing Genode's GPU-session interface, we also aimed at supporting
the hardware-accelerated graphics for Genode's virtual machine monitors like
VirtualBox or Seoul, but until now, we did not took the practical steps of
implementing a virtual GPU device model.
The goal of this project is the offering of a virtual GPU to a Linux guest
OS running on top of Genode's existing virtualization and driver
infrastructure.
Device drivers
##############
:Isochronous USB devices:
Genode's USB driver supports bulk and interrupt endpoints. Thereby, most
USB devices like USB storage, user input, printers, and networking devices
can be used. However, multi-media devices such as cameras or audio
equipment use isochronous endpoints, which are not supported. The goal
of this line of work is the support of these devices in Genode. The topic
touches the USB driver, the USB session interface, an example implementation
of a USB client driver (using the session interface) for a device of choice,
and - potentially - the enhancement of Genode's USB-pass-through mechanism
for VirtualBox.
:Sound on the Raspberry Pi:
The goal of this project is a component that uses the Raspberry Pi's
@ -318,18 +305,6 @@ Device drivers
backend, the new driver will make the sound of all SDL-based games
available on the Raspberry Pi.
:Framebuffer for UEFI and Coreboot:
By moving away from the legacy BIOS boot mechanism, it is time to
reconsider closely related traditional approaches such as the use of
the VESA BIOS extensions for accessing the frame buffer. On UEFI or
Coreboot systems, there exist alternative ways to initialize and
access the framebuffer in a hardware-independent way. On the course of
this project, we will explore the available options and create dedicated
Genode driver components that use the modern mechanisms.
For reference, the current state of Genode's UEFI support is documented
in [https://github.com/genodelabs/genode/issues/2242 - Issue 2242].
:Data Plane Development Kit (DPDK):
Genode utilizes the network device drivers of the iPXE project, which
@ -357,8 +332,22 @@ Platforms
Genode functionality such as its native GUI, lwIP, and Noux, many protocol
stacks can effectively be removed from the Linux kernel.
The goal of this project is to evaluate how small the Linux kernel can get
when used as a microkernel.
In 2018, Johannes Kliemann pursued this topic to a state where Genode
could be used as init process atop a customized Linux kernel.
[https://lists.genode.org/pipermail/users/2018-May/006066.html - His work]
included the execution of Genode's regular device drivers for VESA and
PS/2 as regular Genode components so that Genode's interactive demo
scenario ran happily on a laptop. At this time, however, only parts of
his results were merged into Genode's mainline.
The goal of this project is to follow up on Johannes' work, bring the
[https://github.com/genodelabs/genode/pull/2829 - remaining parts] into
shape for the inclusion into Genode, and address outstanding topics, in
particular the handling of DMA by user-level device drivers. Further down
the road, it would be tempting to explore the use of
[https://en.wikipedia.org/wiki/Seccomp - seccomp] as sandboxing mechanism
for Genode on Linux and the improvement of the Linux-specific implementation
of Genode's object-capability model.
:Support for the HelenOS/SPARTAN kernel:
@ -381,34 +370,46 @@ Platforms
kernel is used for Mac OS X, it could represent an industry-strength
base platform for Genode supporting all CPU features as used by Mac OS X.
:Linux process containers for supporting Genode`s resource trading:
:Genode on the Librem5 phone hardware:
Even though the Linux version of Genode is primarily meant as a development
platform, there exist interesting opportunities to explore when combining
Genode with Linux, in particular Linux' process containers.
Linux process containers provide a mechanism to partition physical resources,
foremost CPU time, between Linux processes. This raises the interesting
question of whether this mechanism could be used for a proper implementation
of Genode's resource trading on Linux.
[http://lwn.net/Articles/236038/ - Process containers introduction...]
Even though there exists a great variety of ARM-based SoCs, Genode
primarily focuses on the NXP i.MX family because it is - in contrast
to most SoCs in the consumer space - very liberal in terms of
good-quality public documentation and reference code, and it scales
from industrial to end-user-facing use cases (multi-media).
The [https://puri.sm/products/librem-5/ - Librem5] project - with its
mission to build a trustworthy mobile phone - has chosen the i.MX family as
the basis for their product for likely the same reasons that attract us.
To goal of this work is bringing Genode to the Librem5 hardware.
For the Librem5 project, Genode could pave the ground towards new use cases
like high-security markets where a regular Linux-based OS would not be
accepted. For the Genode community, the Librem5 hardware could become an
attractive mobile platform for everyday use, similar to how we developers
use our Genode-based [https://genode.org/download/sculpt - Sculpt OS] on our
laptops.
System management
#################
:Remote management of Sculpt OS via Puppet:
[https://en.wikipedia.org/wiki/Puppet_(company)#Puppet - Puppet] is a
software-configuration management tool for administering a large amount
of machines from one central place. Genode's
[https://genode.org/download/sculpt - Sculpt OS] lends itself to such
an approach of remote configuration management by the means of the
"config" file system (for configuring components and deployments) and
the "report" file system (for obtaining the runtime state of components).
The project would explore the application of the Puppet approach and tools
to Sculpt OS.
Optimizations
#############
:Low-latency audio streaming:
Genode comes with an audio streaming interface called 'Audio_out' session.
It is based on a shared-memory packet stream accompanied with asynchronous
data-flow signals. For real-time audio processing involving chains of Genode
components, streams of audio data must be carried at low latency, imposing
constraints to buffer sizes and the modes of operation of the audio mixer and
audio drivers. The goal of this project is to create a holistic design of the
whole chain of audio processing, taking thread-scheduling into account. A
particular challenge is the mixed output of real-time (small buffer, low
latency) and non-real-time (larger buffer to compensate jitter, higher
latency) audio sources.
:De-privileging the VESA graphics driver:
The VESA graphics driver executes the graphics initialization code provided

View File

@ -3,6 +3,54 @@
Genode News
===========
Genode OS Framework release 19.11 | 2019-11-28
##############################################
| Following this year's theme of "bridging worlds", Genode 19.11 adds the
| ability to use popular build tools like CMake for application development,
| introduces a new virtual-machine monitor for 64-bit ARM, and enhances
| POSIX compatibility. As another highlight, it features the first version
| of our custom block-device encrypter.
Block-device encryption is a feature often requested by users of our Sculpt OS.
Until now, we deliberately left this topic unaddressed because we felt that a
profound answer was beyond our expertise. However, during the past year, we
dived deep into it. The result is the prototype for a new block encrypter that
encrypts data but also protects integrity and freshness. For us, the
implementation of the encrypter is especially intriguing because - with about
7000 lines of code - it is Genode's first non-trivial component written in the
[https://en.wikipedia.org/wiki/SPARK_(programming_language) - SPARK]
programming language.
The second major addition is a new virtual machine monitor (VMM) for 64-bit
ARM platforms such as the NXP i.MX8. It leverages the
[https://genode.org/documentation/articles/arm_virtualization - proof of concept]
we developed in 2015 for ARMv7, which we pursued as a technology exploration.
In contrast, our aspiration with the new VMM is a product-quality solution.
In our [https://genode.org/about/road-map - road map] for 2019, we stated
the "bridging of worlds" as our overall theme for this year. On that account,
the current release moves the project forward on two levels. First, by
successively increasing the scope of POSIX compatibility, we reduce the
friction when porting existing application software to Genode. We managed
to bridge several gaps in our POSIX support that we considered as impossible
to cover some years ago. In particular, we identified ways to emulate certain
POSIX signals, ioctl calls, and fork/execve semantics. This way, popular
software such as bash, coreutils, or Vim can now be executed as regular
Genode components with no additional runtime environment (like Noux or a VMM)
required.
At a higher level, the current release introduces new tooling especially
geared at the development and porting of application software. Compared to
Genode's regular development tools, which were designed for whole-system
development, the new tool called Goa relieves the developer from the
complexity of Genode's custom build system and instead promotes the use of
popular commodity solutions like CMake.
These and more topics are described in the
[https:/documentation/release-notes/19.11 - release documentation of version 19.11...]
Genode OS Framework release 19.08 | 2019-08-28
##############################################

View File

@ -143,8 +143,8 @@ corresponds to Shift, '<mod2>' to Control, '<mod3>' to AltGr, and '<mod4>' to
Caps Lock.
! <mod1> <key name="KEY_LEFTSHIFT"/> <key name="KEY_RIGHTSHIFT"/> </mod1>
! <mod2> <key name="KEY_LEFTCTRL"/> <key name="KEY_RIGHTCTRL"/> </mod4>
! <mod3> <key name="KEY_RIGHTALT"/> </mod4> <!-- AltGr -->
! <mod2> <key name="KEY_LEFTCTRL"/> <key name="KEY_RIGHTCTRL"/> </mod2>
! <mod3> <key name="KEY_RIGHTALT"/> </mod3> <!-- AltGr -->
! <mod4> <rom name="capslock"/> </mod4>
As outlined above, the '<key>' nodes generated by xkb2ifcfg always use the

815
doc/release_notes-19-11.txt Normal file
View File

@ -0,0 +1,815 @@
===============================================
Release notes for the Genode OS Framework 19.11
===============================================
Genode Labs
On our [https://genode.org/about/road-map - road map] for this year, we stated
"bridging worlds" as our guiding theme of 2019. The current release pays
tribute to this ambition on several accounts.
First, acknowledging the role of POSIX in the real world outside the heavens
of Genode, the release vastly improves our (optional) C runtime with respect
to the emulation of POSIX signals, execve, and ioctl calls. With the line of
work described in Section [C runtime with improved POSIX compatibility], we
hope to greatly reduce the friction when porting and hosting existing
application software directly on Genode.
Second, we identified the process of porting or developing application
software worth improving. Our existing tools were primarily geared to
operating-system development, not application development. Application
developers demand different work flows and tools, including the freedom to use
a build system of their choice.
Section [New tooling for bridging existing build systems with Genode]
introduces our new take on this productivity issue.
Third, in cases where the porting of software to Genode is considered
infeasible, virtualization comes to the rescue. With the current release, a
new virtual machine monitor for the 64-bit ARM architecture enters the
framework. It is presented in Section [Virtualization of 64-bit ARM platforms].
As another goal for 2019, we envisioned a solution for block-level device
encryption, which is a highly anticipated feature among Genode users. We are
proud to present the preliminary result of our year-long development in
Section [Preliminary block-device encrypter].
Preliminary block-device encrypter
##################################
Over the past year, we worked on implementing a block-device encryption
component that makes use of the
[https://en.wikipedia.org/wiki/SPARK_(programming_language) - SPARK]
programming language for its core logic. In contrast to common
block-device encryption techniques where normally is little done besides
the encryption of the on-disk blocks, the _consistent block encrypter (CBE)_
aims for more. It combines multiple techniques to ensure integrity -
the detection of unauthorized modifications of the block-device -
and robustness against data loss. Robustness is achieved by keeping snapshots
of old states of the device that remain unaffected by the further operation of
the device. A copy-on-write mechanism (only the differential changes to the
last snapshot are stored) is employed to maintain this snapshot history with
low overhead. To be able to access all states of the device in the same manner,
some kind of translation from virtual blocks to blocks on the device is needed.
Hash-trees, where each node contains the hash of its sub-nodes, combine the
aspect of translating blocks and ensuring their integrity in an elegant way.
During the tree traversal, the computed hash of each node can be easily checked
against the hash stored in the parent node.
The CBE does not perform any cryptography by itself but delegates
cryptographic operations to another entity. It neither knows nor cares about
the used algorithm. Of all the nodes in the virtual block device (VBD), only
the leaf nodes, which contain the data, are encrypted. All other nodes, which
only contain meta-data, are stored unencrypted.
Design
------
As depicted in Figure [cbe_trees], all information describing the various
parts of the CBE is stored in the superblock. The referenced VBD is a set of
several hash trees, each representing a certain device state including the
current working state. Only the tree of the current working state is used to
write data to the block device. All other trees represent snapshots of older
states and are immutable. Each stored device state has a generation number
that provides the chronological order of the states.
As you can see, in the depicted situation, there exist four device states - the
snapshot with generation 3 is the oldest, followed by two newer snapshots and
generation 6 that marks the working state of the virtual device. The tree with
generation 6 is the current working tree. Each tree contains all changes done
to the VBD since the previous generation (for generation 6 the red nodes). All
parts of a tree that didn't change since the previous generation are references
into older trees (for generation 6 the gray nodes). Note that in the picture,
nodes that are not relevant for generation 6 are omitted to keep it manageable.
The actual data blocks of the virtual device are the leaf nodes of the trees,
shown as squares.
[image cbe_trees]
Whenever a block request from the client would override data blocks in
generation 6 that are still referenced from an older generation, new blocks for
storing the changes are needed. Here is where the so-called _Free Tree_ enters
the picture. This tree contains and manages the spare blocks. Spare blocks are
a certain amount of blocks that the CBE has in addition to the number of blocks
needed for initializing the virtual device. So, after having initialized a
virtual device, they remain unused and are only referenced by the Free Tree.
Therefore, in case the VBD needs new blocks, it consults the Free Tree (red
arrow).
In the depicted situation, writing the first data block (red square) would
require allocating 4 new blocks as all nodes in the branch leading to the
corresponding leaf node - including the leaf node itself - have to be written.
In contrast, writing the second data block would require allocating only one
new block as the inner nodes (red circles) now already exist. Subsequent write
requests affecting only the new blocks will not trigger further block
allocations because they still belong to the current generation and will be
changed in-place. To make them immutable we have to create a new snapshot.
The blocks in generation 5 that were replaced by the change to generation 6
(blue nodes) are not needed for the working state of the virtual device
anymore. They are therefore, in exchange for the allocated blocks, added to
the Free Tree. But don't be fooled by the name, they are not free for
allocation yet, but marked as "reserved" only. This means, they are
potentially still part of a snapshot (as is the case in our example) but the
Free Tree shall keep checking, because once all snapshots that referenced the
blue blocks have disappeared, they become free blocks and can be allocated
again.
To create a new snapshot, we first have to make all changes done to the VBDs
working state as well as the Free Tree persistent by writing all corresponding
blocks to the block-device. After that, the new superblock state is written to
the block-device. To safeguard this operation, the CBE always maintains several
older states of the superblock on the block device. In case writing the new
state of the superblock fails, the CBE could fall back to the last state that,
in our example, would contain only generations 3, 4, and 5. Finally, the
current generation of the superblock in RAM is incremented by one (in the
example to generation 7). Thereby, generation 6 becomes immutable.
A question that remains is when to create snapshots. Triggering a snapshot
according to some heuristics inside the CBE might result in unnecessary
overhead. For instance, the inner nodes of the tree change frequently during a
sequential operation. We might not want them to be re-allocated all the time.
Therefore, the creation of a snapshot must be triggered explicitly from the
outside world. This way, we can accommodate different strategies, for
instance, client-triggered, time-based, or based on the amount of data
written.
When creating a snapshot, it can be specified whether it shall be disposable
or persistent. A disposable snapshot will be removed automatically by the CBE
in two situations, either
* When there are not enough usable nodes in the Free Tree left to
satisfy a write request, or
* When creating a new snapshot and all slots in the superblock that might
reference snapshots are already occupied.
A persistent snapshot, or quarantine snapshot, on the other hand will never be
removed automatically. Its removal must be requested explicitly.
During initialization, the CBE selects the most recent superblock and reads the
last generation value from it. The current generation (or working state
generation) is then set to the value incremented by one. Since all old blocks,
that are still referenced by a snapshot, are never changed again, overall
consistency is guaranteed for every generation whose superblock was stored
safely on disk.
Implementation
--------------
Although we aimed for a SPARK implementation of the CBE, we saw several
obstacles with developing it in SPARK right from the beginning. These obstacles
mainly came from the fact that none of us was experienced in designing
complex software in SPARK. So we started by conducting a rapid design-space
exploration using our mother tongue (C++) while using only language features
that can be mapped 1:1 to SPARK concepts. Additionally, we applied a clear
design methodology that allowed us to keep implementation-to-test cycles
small and perform a seamless and gradual translation into SPARK:
* _Control flow_
The core logic of the CBE is a big state machine that doesn't block. On each
external event, the state machine gets poked to update itself accordingly.
C++ can call SPARK but SPARK never calls C++. The SPARK code therefore
evolves as self-contained library.
* _Modularity_
The complex state machine of the CBE as a whole is split-up into smaller
manageable sub-state-machines, working independently from each other. These
modules don't call each other directly. Instead, an additional superior
module handles the interplay. This is done by constantly iterating over all
modules with the following procedure until no further progress can be made:
# Try to enter requests of other modules into the current one
# Poke the state machine of the current module
# The current module may have generated requests - Try to enter them into
the targeted modules
# The current module may have finished requests - Acknowledge them at the
modules they came from
Each module is represented through a class (C++) respectively a package with
a private state record (SPARK).
* _No global state_
There are no static (C++) or package (SPARK) variables. All state is kept in
members of objects (C++) respectively records (SPARK). All packages are pure
and sub-programs have no side-effects. Therefore, memory management and
communication with other components is left to OS glue-code outside the
core logic.
This approach worked out well. Module by module, we were able to translate the
C++ prototype to SPARK without long untested phases, rendering all regression
bugs manageable. In Genode, the CBE library is currently integrated through
the CBE-VFS plugin. Figure [cbe_modules] depicts its current structure and the
integration via VFS plugin.
[image cbe_modules]
The green and blue boxes each represent an Ada/SPARK package. The translation
to SPARK started at the bottom of the picture moving up to the more abstract
levels until it reached the Library module. This is the module that handles
the interplay of all other modules. Its interface is the front end of the CBE
library. So, all green packages are now completely written in SPARK and
together form the CBE library. Positioned above, the CXX library in blue is
brought in by a separate library and exports the CBE interface to C++. This
way, the CBE can also be used in other environments including pure SPARK
programs. The CXX Library package is not written in SPARK but Ada and performs
all the conversions and checks required to meet the preconditions set by the
SPARK packages below.
At the C++ side, we have the VFS plugin. Even at this level, the already
mentioned procedure applies: The plugin continuously tries to enter requests
coming from the VFS client (above) into the CBE (below), pokes the CBE state
machine, and puts thereby generated block/crypto requests of the CBE into the
corresponding back-ends (left). This process is repeated until there is no
further progress without waiting for an external event.
Current state
-------------
In its current state, the CBE library is still pretty much in flux and is not
meant for productive use.
As the Free Tree does not employ copy-on-write semantics for its meta-data, a
crash, software- or hardware-wise, will corrupt the tree structure and renders
the CBE unusable on the next start.
This issue is subject to ongoing work. That being said, there are
components that, besides being used for testing, show how the interface of the
CBE library lends itself to be integrated in components in different ways. At
the moment, there are two components making use of the CBE library as
block-device provider.
The first one is the aforementioned CBE-VFS plugin. Besides r/w access to the
working tree and r/o access to all persistent snapshots, it also provides a
management interface where persistent snapshots can be created or discarded.
Its current layout is illustrated by Figure [cbe_vfs]. The VFS plugin
generates three top directories in its root directory. The first one is the
_control_ directory. It contains several pseudo files for managing the CBE:
[image cbe_vfs]
:'key': set a key by writing a string into the file.
:'create_snapshot': writing 'true' to this file will attempt to create
a new snapshot. (Eventually the snapshot will
appear in the 'snapshots' directory if it could be
created successfully.)
:'discard_snapshot': writing a snapshot ID into this file will discard
the snapshot
The second is the 'current' directory. It gives access to the current
working tree of the CBE and contains the following file:
:'data': this file represents the virtual block device and gives
read and write access to the data stored by the CBE.
The third and last is the 'snapshots' directory. For each persistent snapshot,
there is a sub-directory named after the ID of the snapshot. This directory,
like the 'current' directory, contains a 'data' file. This file, however,
gives only read access to the data belonging to the snapshot.
The CBE-VFS plugin itself uses the VFS to access the underlying block device.
It utilizes the file specified in its configuration. Here is a '<vfs>'
snippet that shows a configured CBE-VFS plugin where the block device is
provided by the block VFS plugin.
! <vfs>
! <dir name="dev">
! <block name="block"/>
! <cbe name="cbe" block="/dev/block"/>
! </dir>
! </vfs>
An exemplary ready-to-use run script can be found in the CBE repository
at _run/cbe_vfs_snaps.run_. This run script uses a bash script to
automatically perform a few operations on the CBE using the VFS plugin.
Afterwards it will drop the user into a shell where further operations
can be performed manually, e.g.:
! dd if=/dev/zero of=/dev/cbe/current/data bs=4K
The second component is the CBE server. In contrast to the CBE-VFS plugin,
it is just a simple block-session proxy component that uses a block connection
as back end to access a block-device. It provides a front-end block session to
its client, creates disposable snapshots every few seconds, and uses the
'External_Crypto' library to encrypt the data blocks using AES-CBC-ESSIV. The
used key is a plain passphrase. The following snippet illustrates its
configuration:
! <start name="cbe">
! <resource name="RAM" quantum="4M"/>
! <provides><service name="Block"/></provides>
! <config sync_interval="5" passphrase="All your base are belong to us"/>
! </start>
The _run/cbe.run_ run script in the CBE repository showcases the use of the
CBE server.
Both run scripts will create the initial CBE state in a RAM-backed
block device that is then accessed by the CBE server or the CBE-VFS
plugin.
The run-script and the code itself can be found on the
[https://github.com/cnuke/cbe/tree/cbe_19.11 - cbe/cbe_19.11] branch on
GitHub. If you intend to try it out, you have to checkout
the corresponding
[https://github.com/cnuke/genode/tree/cbe_19.11 - genode/cbe_19.11]
branch in the Genode repository as well.
Future plans
------------
Besides addressing the current shortcomings and getting the CBE library
production-ready so that it can be used in Sculpt, there are still
a few features that are currently unimplemented. For one we would like
to add support for making it possible to resize the VBD as well as the
Free Tree. For now the geometry is fixed at initialization time and cannot
be changed afterwards. Furthermore, we would like to enable re-keying,
i.e., changing the used cryptographic key and re-encrypting the tree
set of the VBD afterwards. In addition to implementing those features, the
overall tooling for the CBE needs to be improved. E.g., there is currently
no proper initialization component. For now, we rely on a component
that was built merely as a test vehicle to generate the initial trees.
Virtualization of 64-bit ARM platforms
######################################
Genode has a long history regarding support of all kinds of
virtualization-related techniques including
[https://genode.org/documentation/release-notes/9.11#Paravirtualized_Linux_on_Genode_OKL4 - para-virtualization],
[https://genode.org/documentation/articles/trustzone - TrustZone],
hardware-assisted virtualization on
[https://genode.org/documentation/articles/arm_virtualization - ARM],
[https://genode.org/documentation/release-notes/13.02#Full_virtualization_on_NOVA_x86 - x86],
up to the full virtualization stack of
[https://genode.org/documentation/release-notes/14.02#VirtualBox_on_top_of_the_NOVA_microhypervisor - VirtualBox].
We regard those techniques as welcome stop-gap solutions for using non-trivial
existing software stacks on top of Genode's clean-slate OS architecture. The
[https://genode.org/documentation/release-notes/19.05#Kernel-agnostic_virtual-machine_monitors - recent]
introduction of a kernel-agnostic interface to control virtual machines (VM)
ushered a new level for the construction respectively porting of
virtual-machine monitors (VMM). By introducing a new ARMv8-compliant VMM
developed from scratch, we continue this line of work.
The new VMM builds upon our existing proof-of-concept (PoC) implementation for
ARMv7 as introduced in release
[https://genode.org/documentation/release-notes/15.02#Virtualization_on_ARM - 15.02].
In contrast to the former PoC implementation, however, it aims to be complete
to a greater extent. Currently, it comprises device models for the following
virtual hardware:
* RAM
* System Bus
* CPU
* Generic Interrupt Controller v2 and v3
* Generic Timer
* PL011 UART (limited)
* Pass-through devices
The VMM is able to load diverse 64-bit Linux kernels including
Device-Tree-Binary (DTB) and Initramfs. Currently, the implementation uses a
fixed memory layout for the guest-physical memory view, which needs to be
reflected by the DTB used by the guest OS. An example device-tree source file
can be found at _repos/os/src/server/vmm/spec/arm_v8/virt.dts_. The actual VMM
is located in the same directory.
Although support for multi-core VMs is already considered internally, it is
not yet finished. Further outstanding features that are already in development
are Virtio device model support for networking and console. As the first - and
by now only - back end, we tied the VMM to the ARMv8 broadened Kernel-agnostic
VM-session interface as implemented by Genode's custom base-hw kernel. As a
side effect of this work, we consolidated the generic VM session interface
slightly. The RPC call to create a new virtual-CPU now returns an identifier
for identification.
The VMM has a strict dependency on ARM's hardware virtualization support
(EL2), which comprises extensions for the ARMv8-A CPU, ARM's generic timer,
and ARM's GIC. This rules out the Raspberry Pi 3 board as a base platform
because it does not include a GIC but a custom interrupt-controller without
hardware-assisted virtualization of interrupts. To give the new VMM a try, we
recommend using the run script _repos/os/run/vmm_arm.run_ as a starting point
for executing the VMM on top of the i.MX8 Evaluation Kit board.
New tooling for bridging existing build systems with Genode
###########################################################
Genode's development tools are powerful and intimidating at the same time.
Being designed from the perspective of a whole-systems developer, they put
emphasis on the modularity of the code base (separating concerns like
different kernels or system abstraction levels), transitive dependency
tracking between libraries, scripting of a wide variety of system-integration
tasks, and the continuous integration of complete Genode-based
operating-system scenarios. Those tools are a two-edged sword though.
On the one hand, the tools are key for the productivity of seasoned Genode
developers once the potential of the tools is fully understood and leveraged.
For example, during the development of Sculpt OS, we are able to
change an arbitrary line of code in any system component and can test-drive
the resulting Sculpt system on real hardware within a couple of seconds.
As another example, the almost seamless switching from one OS kernel to
another has become a daily routine that we just take for granted without
even thinking about it.
On the other hand, the sophistication of the tools stands in the way of
application developers who are focused on a particular component instead
of the holistic Genode system. In this case, the powerful system-integration
features remain unused but the complexity of the tools and the build system
prevails. Speaking of build systems, this topic is ripe of emotions
anyway. _Developers use to hate build systems._ Forcing Genode's build
system down the throats of application developers is probably not the best
idea to make Genode popular.
This line of thoughts prompted us to re-approach the tooling for Genode from
the perspective of an application developer. The intermediate result is a new
tool called Goa:
:Goa project at GitHub:
[https://github.com/nfeske/goa]
Unlike Genode's regular tools, Goa's work flow is project-centered. A project
is a directory that may contain source code, data, instructions how to
download source codes from a 3rd party, descriptions of system scenarios, or
combinations thereof. Goa is independent from Genode's regular build system.
It combines Genode's package management (depot) with commodity build systems
such a CMake. In addition to building and test-driving application software
directly on a Linux-based development system, Goa is able to aid the process
of exporting and packaging the software in the format expected by Genode
systems like Sculpt OS.
At the current stage, Goa should be considered as work in progress. It's a new
approach and its success is anything but proven. That said, if you are
interested in developing or porting application software for Genode, your
feedback would be especially valuable. As a starting point, you may find the
following introductory article helpful:
:Goa - streamlining the development of Genode applications:
[https://genodians.org/nfeske/2019-11-25-goa]
Base framework and OS-level infrastructure
##########################################
File-system session
===================
The file-system session interface received a much anticipated update.
Writing modification times
--------------------------
The new operation WRITE_TIMESTAMP allows a client to update the modification
time of a file-system node. The time is defined by the client to keep
file-system servers free from time-related concerns. The VFS server implements
the operation by forwarding it to the VFS plugin interface. At present, this
new interface is implemented by the rump VFS plugin to store modification
times on EXT2 file systems.
Enhanced file-status info
-------------------------
The status of a file-system node as returned by the 'File_system::Status'
operation has been revisited. First, we replaced the fairly opaque "mode" bits -
which were an ad-hoc attempt to stay compatible with Unix - with the explicit
notion of 'readable', 'writeable', and 'executable' attributes. We completely
dropped the notion of users and groups. Second, we added the distinction
between *continuous* and *transactional* files to allow for the robust
implementation of continuous write operations across component boundaries. A
continuous file can be written-to via a sequence of arbitrarily sized chunks
of data. For such files, a client can split a large write operation into any
number of smaller operations in accordance to the size of the used I/O
buffers. In contrast, a write to a transactional file is regarded as a
distinct operation. The canonical example of a transactional file is a
socket-control pseudo file.
Virtual file-system infrastructure
==================================
First fragments of a front-end API
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The VFS is mostly used indirectly via the C runtime. However, it is also
useful for a few components that use the Genode API directly without any
libc. To accommodate such users of the VFS, we introduced the front-end
API at _os/vfs.h_ that covers a variety of current use cases. Currently, those
use cases revolve around the watching, reading, and parsing of files and
file-system structures - as performed by Sculpt's deployment mechanism.
Writing to files is not covered.
Improved file-watching support
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All pseudo files that use the VFS-internal 'Readonly_value_file_system'
utility have become able to deliver watch notifications. This change enables
VFS clients to respond to VFS-plugin events (think of terminal resize)
dynamically.
Speaking of the *terminal VFS plugin*, the current release enhances the plugin
in several respects. First, it now delivers status information such as the
terminal size via pseudo files. Second, we equipped the VFS terminal file
system with the ability to detect user interrupts in the incoming data stream,
and propagate this information via the new pseudo file '.terminal/interrupts'.
Each time, the user presses control-c in the terminal, the value stored in
this pseudo file is increased. Thereby, a VFS client can watch this file to
get notified about the occurrences of user interrupts.
VFS plugin for emulating POSIX pipes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We added a new VFS plugin for emulating POSIX pipes. The new plugin creates
pipes between pairs of VFS handles. It replaces the deprecated libc_pipe
plugin. In contrast to the libc_pipe plugin, which was limited to pipes within
one component, the new VFS plugin can also be used to establish pipes between
different components by mounting the plugin at a shared VFS server.
C runtime with improved POSIX compatibility
===========================================
Within Genode, we used to think of POSIX as a legacy that is best avoided.
In fact, the foundational components of the framework do not depend on a
C runtime at all. However, higher up the software stack - at the latest when
3rd-party libraries enter the picture - a working C runtime is unavoidable. In
this statement, the term "working" is rather muddy though. Since we have never
fully embraced POSIX, we were content with cutting corners here and there. For
example, given Genode's architecture, supporting 'fork' and 'execve' seemed
totally out of question because those mechanisms would go against the grain of
Genode.
However, our growing aspiration to bridge the gap between existing popular
applications and Genode made us re-evaluate our stance towards POSIX.
All technical criticism aside, POSIX is immensely useful because it is
a universally accepted stable interface. To dissolve friction between
Genode and popular application software, we have to satisfy the application's
expectations. This ignited a series of developments, in particular
the added support for 'fork' and 'execve' - of all things - in
[https://genode.org/documentation/release-notes/19.08#Consolidation_of_the_C_runtime_and_Noux - Genode 19.08],
which was nothing short of surprising, even to us.
The current release continues this line of development and brings the
following improvements.
Execve
------
The libc's 'execve' implementation got enhanced to evaluate the path of the
executable binary according to the information found on the VFS, in particular
by traversing directories and following symbolic links. This enables the libc
to execute files stored at sub directories of the file system.
Furthermore, 'execve' received handling for *executing shell scripts* by
parsing the shebang marker at the beginning of the executable file. This way,
the 'execve' mechanism of the libc reaches parity with the feature set of the
Noux runtime that we traditionally used to host Unix software on top of
Genode.
Modification-time handling
--------------------------
By default, the libc uses the just added facility for updating the timestamp
of file-system nodes when closing a written-to file, which clears the path
towards using tools like 'make' that rely on file-modifications times.
The libc's mechanism can be explicitly disabled by specifying
! <libc update_mtime="no"...>
This is useful for applications that have no legitimate access to a time
source.
Emulation of 'ioctl' operations via pseudo files
------------------------------------------------
With the current release, we introduce a new scheme of handling ioctl
operations, which maps 'ioctl' calls to pseudo-file accesses, similar to how
the libc already maps socket calls to socket-fs operations.
A device file can be accompanied with a (hidden) directory that is named after
the device file and hosts pseudo files for triggering the various device
operations. For example, for accessing a terminal, the directory structure
looks like this:
! /dev/terminal
! /dev/.terminal/info
! /dev/.terminal/rows
! /dev/.terminal/columns
! /dev/.terminal/interrupts
The 'info' file contains device information in XML format. The type of the XML
node corresponds to the device type. Whenever the libc receives a TIOCGWINSZ
ioctl for _/dev/terminal_, it reads the content of _/dev/.terminal/info_ to
obtain the terminal-size information. In this case, the _info_ file looks as
follows:
! <terminal rows="25" columns="80/>
Following this scheme, VFS plugins can support ioctl operations by providing
an ioctl directory in addition to the actual device file.
Emulation of POSIX signals
--------------------------
Even though there is no notion of POSIX signals at the Genode level, we
can reasonably emulate certain POSIX signals at the libc level. The current
release introduces the first bunch of such emulated signals:
:SIGWINCH: If 'stdout' is connected to a terminal, the libc watches the
terminal's ioctl pseudo file _.terminal/info_. Whenever the terminal
size changes, the POSIX signal SIGWINCH is delivered to the application.
With this improvement, Vim becomes able to dynamically adjust itself
to changed window dimensions when started as a native Genode component
(w/o the Noux runtime environment).
:SIGINT: If 'stdin' is connected to a terminal, the libc watches the
terminal's pseudo file _.terminal/interrupts_. Since, the terminal VFS
plugin modifies the file for each occurred user interrupt (control-c),
the libc is able to reflect such an event as SIGINT signal to the
application.
:Process-local signal delivery: The libc's implementation of 'kill' got
enhanced with the ability to submit signals to the local process.
Support for arbitrarily large write operations
----------------------------------------------
The number of bytes written by a single 'write' call used to be constrained by
the file's underlying I/O buffer size. Even though our libc correctly returned
this information to the application, we found that real-world applications
rarely check the return value of 'write' because partial writes do usually not
occur on popular POSIX systems. Thanks to the added distinction between
continuous and transactional files as described in Section
[File-system session], we became able to improve the libc's write operation to
iterate on partial writes to continuous files until the original write count
is reached. The split of large write operations into small partial writes as
dictated by the VFS infrastructure becomes invisible to the libc-using
application.
Input-event handling
====================
In Genode 19.08, we undertook a comprehensive rework of our keyboard-event
handling in the light of localization and also promised to tie up remaining
loose ends soon.
First, we again dived into our character generators for a thorough check of
our stack of keyboards and fixed remaining inconsistencies in French and
German layouts. En passant, we also increased the default RAM quotas for
the input filter to 1280K in our recipes to cope with the increased
layout-configuration sizes in corner cases.
Next - and more importantly - we subdued the monsters lurking in our Qt5
keyboard back end and enabled transparent support for system-wide keyboard
layout configuration for Qt5 components. One important change during this work
was to move the handling of control key sequences into the clients. For
example, the graphical terminal and Qt5 interpret key events in combination
with the CTRL modifier based on characters and, thus, support CTRL-A with
AZERTY and QWERTY layouts correctly. As a result we removed all CTRL modifier
(mod2) configurations from our character-generator configurations.
Finally we'd like to point out one important change of our rework that
repeatedly led to surprises: For keys without character mappings the reworked
character-generator mechanism emits invalid codepoints in contrast to
codepoints with value 0. For that reason, components interpreting character
events should check 'Codepoint::valid()' to prevent the processing of invalid
characters (and not the frequent pattern of 'codepoint.value != 0').
NIC router
==========
The NIC router has received the ability to report the link state of its NIC
interfaces (downlinks and uplinks). To control this mechanism, there are two
new boolean attributes 'link_state' and 'link_state_triggers' in the <report>
tag of the NIC router configuration. If the former is set to "true", the report
will contain the current link state for each interface:
! <domain name="domain1">
! <interface label="uplink1" link_state="false"/>
! <interface label="downlink1" link_state="true"/>
! </domain>
! <domain name="domain2">
! <interface label="downlink2" link_state="true"/>
! </domain>
The second attribute decides whether to trigger a report update each time the
link state of an interface changes. By default, both attributes are set to
"false".
Device drivers
==============
Platform driver on x86
~~~~~~~~~~~~~~~~~~~~~~
During our enablement of Genode on a
[https://genodians.org/chelmuth/2019-10-21-sculpt-elitebook - recent notebook],
we spotted some PC platform shortcomings, we address with this release. Most
prominently we added support for
[https://en.wikipedia.org/wiki/PCI_configuration_space#Bus_enumeration - 64-bit PCI base address registers]
to the x86 platform driver. This allows the use of PCI devices that are
assigned to physical I/O-memory regions beyond 4 GiB by the boot firmware.
Wireless driver
~~~~~~~~~~~~~~~
We added the firmware images for the 5000 and 9000 series of Intel wireless
devices to the firmware white-list in the _wifi_drv_ component. Such devices
as 5100AGN, 5300AGN and 5350AGN as well as 9461, 9462 and 9560 should now be
usable on Genode.
Libraries and applications
##########################
VirtualBox improvements
=======================
The GUI handling of our VirtualBox port got improved to react on window-size
changes more instantly. The effect is that an interactive adjustment of the
window size, e.g., on Sculpt, becomes quickly visible to the user. Still, the
VM may take some time to adjust to the resolution change, which ultimately
depends on the behavior of the driver of the VirtualBox guest additions.
Updated 3rd-party software
==========================
With the addition of the 64-bit ARM architecture (AARCH64) with the
[https://genode.org/documentation/release-notes/19.05#Broadened_CPU_architecture_support_and_updated_tool_chain - 19.05]
release, it became necessary to update the libraries the Genode tool chain
(gcc) depends on in order to support AARCH64 properly. This concerns the GNU
multi precision arithmetic library (gmp), which has been updated from version
4.3.2 to 6.1.2, as well as the libraries that depend on it: Multi precision
floating point (mpfr) and multi precision complex arithmetic (mpc). All those
old versions did not offer support for the AARCH64 architecture, which is a
requirement to make Genode self hosting. Targets for building binutils and GCC
within Genode for AARCH64 are in place, GNU make is in place, and even code
coverage (gcov) has been added. This work puts AARCH64 in line with other
supported CPU architectures and emphasizes our interest in the ARM 64-bit
architecture.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
With the previous release, Genode's base-hw kernel got extended to support the
ARMv8-A architecture in principle. The first hardware supported was the
Raspberry Pi 3 as well as the i.MX8 evaluation kit (EVK). But only a single
CPU-core was usable at that time. Now, we lifted this limitation. On both
boards, all four CPU-cores are available henceforth.
Removed components
##################
The current release removes the following components:
:gems/src/app/launcher:
The graphical launcher remained unused for a few years now. It is not
suitable for systems as flexible as Sculpt OS.
:os/src/app/cli_monitor:
CLI monitor was a runtime environment with a custom command-line interface
to start and stop subsystems. It was part of the user interface of our
first take on a Genode-based desktop OS called
[https://genode.org/documentation/release-notes/15.11#Genode_as_desktop_OS - Turmvilla].
Nowadays, we use standard command-line tools like Vim to edit init
configurations dynamically, which is more flexible and - at the same time -
alleviates the need for a custom CLI. The CLI-monitor component was too
limited for use cases like Sculpt anyway.
Along with the CLI monitor, we removed the ancient (and untested for long
time) _terminal_mux.run_ script, which was the only remaining user of the CLI
monitor.
:fatfs_fs, rump_fs, and libc_fatfs plugin:
The stand-alone file-system servers fatfs_fs and rump_fs as well as the
fatfs libc plugin have been superseded by the fatfs and rump VFS plugins.
The stand-alone servers can be replaced by using the VFS server plus the
corresponding VFS plugin as a drop-in replacement.

56
flake.lock Normal file
View File

@ -0,0 +1,56 @@
{
"inputs": {
"genodepkgs": {
"inputs": {
"dhall-haskell": {
"inputs": {
"nixpkgs": {
"inputs": {},
"narHash": "sha256-wJg4DA700SoQbEz61448sR6BgxRa1R92K3vvCV1g+HY=",
"originalUrl": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148",
"url": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148"
},
"nixpkgsStaticLinux": {
"inputs": {},
"narHash": "sha256-famU3pJZ4vkElV9qc71HmyRVSvcrAhfMZ0UJKpmmKP8=",
"originalUrl": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working",
"url": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working&rev=925aac04f4ca58aceb83beef18cb7dae0715421b"
}
},
"narHash": "sha256-KJl9ZLcMcEsLSPcwcWoc0Ac74/6HKC9LkVMeLwhyhlg=",
"originalUrl": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake",
"url": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake&rev=aea28adf3d10ff1982aa4ddd176d1476251b932f"
},
"genode-depot": {
"inputs": {
"nixpkgs": {
"inputs": {},
"narHash": "sha256-NB+H7zK3BB//zM127FqgbG4iAfY+nS/IOyO+uGWA5Ho=",
"originalUrl": "nixpkgs",
"url": "github:edolstra/nixpkgs/7845bf5f4b3013df1cf036e9c9c3a55a30331db9"
}
},
"narHash": "sha256-7eL2MfGgeEaIwJXPc4LQ7pBa4JeGicm9th7onjKgzsE=",
"originalUrl": "git+https://gitea.c3d2.de/ehmry/genode-depot.git",
"url": "git+https://gitea.c3d2.de/ehmry/genode-depot.git?ref=master&rev=8c2aafed45b4075e37f1cd93de0ebf93f38c83c3"
},
"nixpkgs": {
"inputs": {},
"narHash": "sha256-EqxCk6ORqq4fkewWttpvks0VycBec9X9spAZ+Pq/CEI=",
"originalUrl": "github:ehmry/nixpkgs",
"url": "github:ehmry/nixpkgs/cf50f3b8bdc28832249afab6bca68acad832e011"
}
},
"narHash": "sha256-78eloDNkEjWAckNLbfNait0zb6QBG4QxltX6FyV1vAk=",
"originalUrl": "git+https://git.sr.ht/~ehmry/genodepkgs",
"url": "git+https://git.sr.ht/~ehmry/genodepkgs?ref=master&rev=dad28cc17b17542ada59ba2005fbf1af5d5f8209"
},
"nixpkgs": {
"inputs": {},
"narHash": "sha256-NB+H7zK3BB//zM127FqgbG4iAfY+nS/IOyO+uGWA5Ho=",
"originalUrl": "nixpkgs",
"url": "github:edolstra/nixpkgs/7845bf5f4b3013df1cf036e9c9c3a55a30331db9"
}
},
"version": 3
}

14
flake.nix Normal file
View File

@ -0,0 +1,14 @@
{
description = "Genode development flake";
edition = 201909;
inputs.genodepkgs.uri = "git+https://git.sr.ht/~ehmry/genodepkgs";
outputs = { self, nixpkgs, genodepkgs }: {
devShell.x86_64-linux =
genodepkgs.packages.x86_64-linux-x86_64-genode.genode.base;
};
}

50
repos/Tuprules.tup Normal file
View File

@ -0,0 +1,50 @@
# Tup rules that are local to this Git repo and
# should not be shared with other projects.
&LD_SCRIPT_SO = base/src/ld/genode_rel.ld
ifeq (@(TUP_ARCH),x86_64)
ASM_SYM_DEPENDENCY = movq \1@GOTPCREL(%rip), %rax
else
ASM_SYM_DEPENDENCY = .long \1
endif
!abi_stub = |> ^ STUB %o^\
sed \
-e "s/^\(\w\+\) D \(\w\+\)\$/.data; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
-e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%%object; \1:/" \
-e "s/^\(\w\+\) T/.text; .global \1; .type \1,%%function; \1:/" \
-e "s/^\(\w\+\) R \(\w\+\)\$/.section .rodata; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
-e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%%function; \1:/" \
-e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
-e "s/^\(\w\+\) U/.text; .global \1; $(ASM_SYM_DEPENDENCY)/" \
%f > stub.s; \
$(CC) $(CC_MARCH) -x assembler -c stub.s; \
$(LD) -o %o \
-shared \
-T &(LD_SCRIPT_SO) \
stub.o; \
rm -v stub.o stub.s; \
|> $(DEV_LIB_DIR)/%B.lib.so $(DEV_DIR)/<lib>
BASE_DIR = $(GENODE_DIR)/repos/base
&BASE_DIR = base
ifeq (@(TUP_ARCH),i386)
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86_32
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86
CPPFLAGS += -I$(BASE_DIR)/include/spec/32bit
endif
ifeq (@(TUP_ARCH),x86_64)
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86_64
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86
CPPFLAGS += -I$(BASE_DIR)/include/spec/64bit
endif
ifeq (@(TUP_ARCH),arm64)
CPPFLAGS += -I$(BASE_DIR)/include/spec/arm_64
CPPFLAGS += -I$(BASE_DIR)/include/spec/64bit
endif
CPPFLAGS += -I$(BASE_DIR)/include

View File

@ -1 +1 @@
2019-08-27 87228cf07e72e871410818fa83bdeef44c9f5ef8
2019-11-25 c7e2a3eca5820b2304b4520d0fc831ede73691f2

View File

@ -1 +1 @@
2019-08-27 5b6cf80fc675be3f7432434e48f4f1548f55ef41
2019-11-25 9a459c4fd8a907810d91041751affcf3e119fcb1

View File

@ -1 +1 @@
2019-08-27 a867f84460323da4f69d8159ff21200e50a9a2fd
2019-11-25 d8ff4913b8aa117aef77a7918bc82808e38a4ee7

View File

@ -1 +1 @@
2019-08-27 e8b6d91bf19df090192d689a46f34570b43bc1bc
2019-11-25 a750c8988106d5c26e46dcceb1f76bfd7bfa1457

View File

@ -1 +1 @@
2019-08-27 07b6913f38716e380057df3212da94054a359bc8
2019-11-25 0c0a26b6ddb0ee5261f0be30f229e9ce04b61eda

View File

@ -1 +1 @@
2019-08-27 2f2313ed4479d13b9f3964db6f7ceaaf2c12320a
2019-11-25 bce6f0a8f1f46f8edf62ef2180dbfc949123432d

View File

@ -1 +1 @@
2019-08-27 b248520f85bcf3d1dbe68e23ca949f447cd78dbb
2019-11-25 307d01e531dbbcd672463a4ea090f40bb399cae8

View File

@ -108,7 +108,7 @@ class Genode::Vm_session_component
void attach(Dataspace_capability, addr_t, Attach_attr) override;
void attach_pic(addr_t) override { }
void detach(addr_t, size_t) override;
void _create_vcpu(Thread_capability);
Vcpu_id _create_vcpu(Thread_capability);
};
#endif /* _CORE__VM_SESSION_COMPONENT_H_ */

View File

@ -107,10 +107,12 @@ Vcpu::~Vcpu()
_ram_alloc.free(_ds_cap);
}
void Vm_session_component::_create_vcpu(Thread_capability cap)
Vm_session::Vcpu_id Vm_session_component::_create_vcpu(Thread_capability cap)
{
Vcpu_id ret;
if (!cap.valid())
return;
return ret;
auto lambda = [&] (Cpu_thread_component *thread) {
if (!thread)
@ -146,10 +148,11 @@ void Vm_session_component::_create_vcpu(Thread_capability cap)
}
_vcpus.insert(vcpu);
_id_alloc++;
ret.id = _id_alloc++;
};
_ep.apply(cap, lambda);
return ret;
}
Dataspace_capability Vm_session_component::_cpu_state(Vcpu_id const vcpu_id)

View File

@ -50,7 +50,6 @@ static bool svm_np() { return svm_features() & (1U << 0); }
struct Vcpu;
static Genode::Registry<Genode::Registered<Vcpu> > vcpus;
static unsigned vcpu_id = 0;
struct Vcpu : Genode::Thread
{
@ -202,7 +201,7 @@ struct Vcpu : Genode::Thread
Semaphore _wake_up { 0 };
Semaphore &_handler_ready;
Allocator &_alloc;
Vm_session_client::Vcpu_id _id;
Vm_session_client::Vcpu_id _id { Vm_session_client::Vcpu_id::INVALID };
addr_t _state { 0 };
addr_t _task { 0 };
enum Virt const _vm_type;
@ -1184,20 +1183,20 @@ struct Vcpu : Genode::Thread
public:
Vcpu(Env &env, Signal_context_capability &cap,
Semaphore &handler_ready,
Vm_session_client::Vcpu_id &id, enum Virt type,
Semaphore &handler_ready, enum Virt type,
Allocator &alloc, Affinity::Location location)
:
Thread(env, "vcpu_thread", STACK_SIZE, location, Weight(), env.cpu()),
_signal(cap), _handler_ready(handler_ready), _alloc(alloc),
_id(id), _vm_type(type)
_vm_type(type)
{ }
Allocator &allocator() const { return _alloc; }
bool match(Vm_session_client::Vcpu_id id) { return id.id == _id.id; }
Genode::Vm_session_client::Vcpu_id id() const { return _id; }
Genode::Vm_session_client::Vcpu_id id() const { return _id; }
void id(Genode::Vm_session_client::Vcpu_id id) { _id = id; }
void assign_ds_state(Region_map &rm, Dataspace_capability cap)
{
@ -1266,12 +1265,10 @@ Vm_session_client::Vcpu_id
Vm_session_client::create_vcpu(Allocator &alloc, Env &env,
Vm_handler_base &handler)
{
Vm_session_client::Vcpu_id id = { vcpu_id };
enum Virt vm_type = virt_type(env);
if (vm_type == Virt::UNKNOWN) {
Genode::error("unsupported hardware virtualisation");
return id;
return Vm_session::Vcpu_id();
}
Thread * ep = reinterpret_cast<Thread *>(&handler._rpc_ep);
@ -1279,17 +1276,17 @@ Vm_session_client::create_vcpu(Allocator &alloc, Env &env,
/* create thread that switches modes between thread/cpu */
Vcpu * vcpu = new (alloc) Registered<Vcpu>(vcpus, env, handler._cap,
handler._done, id, vm_type,
handler._done, vm_type,
alloc, location);
try {
/* now it gets actually valid - vcpu->cap() becomes valid */
vcpu->start();
call<Rpc_exception_handler>(handler._cap, vcpu->id());
/* instruct core to let it become a vCPU */
call<Rpc_create_vcpu>(vcpu->cap());
vcpu->id(call<Rpc_create_vcpu>(vcpu->cap()));
call<Rpc_exception_handler>(handler._cap, vcpu->id());
vcpu->assign_ds_state(env.rm(), call<Rpc_cpu_state>(vcpu->id()));
} catch (...) {
@ -1299,9 +1296,7 @@ Vm_session_client::create_vcpu(Allocator &alloc, Env &env,
destroy(alloc, vcpu);
throw;
}
vcpu_id ++;
return id;
return vcpu->id();
}
void Vm_session_client::run(Vcpu_id vcpu_id)

View File

@ -0,0 +1,8 @@
ifeq (@(TUP_ARCH),x86_64)
CPPFLAGS += -I$(TUP_CWD)/include/spec/x86_64
endif
CPPFLAGS += -I$(TUP_CWD)/include
include &(BASE_DIR)/Tuprules.tup
REP_DIR = $(TUP_CWD)

View File

@ -0,0 +1,109 @@
/*
* \brief CPU, PIC, and timer context of a virtual machine
* \author Stefan Kalkowski
* \date 2015-02-10
*/
/*
* Copyright (C) 2015-2017 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__SPEC__ARM_64__CPU__VM_STATE_VIRTUALIZATION_H_
#define _INCLUDE__SPEC__ARM_64__CPU__VM_STATE_VIRTUALIZATION_H_
/* Genode includes */
#include <cpu/cpu_state.h>
namespace Genode
{
/**
* CPU context of a virtual machine
*/
struct Vm_state;
using uint128_t = __uint128_t;
}
struct Genode::Vm_state : Genode::Cpu_state
{
Genode::uint64_t pstate { 0 };
Genode::uint64_t exception_type { 0 };
Genode::uint64_t esr_el2 { 0 };
/** Fpu registers **/
Genode::uint128_t q[32] { 0 };
Genode::uint32_t fpcr { 0 };
Genode::uint32_t fpsr { 0 };
Genode::uint64_t elr_el1 { 0 };
Genode::uint64_t sp_el1 { 0 };
Genode::uint32_t spsr_el1 { 0 };
Genode::uint32_t esr_el1 { 0 };
Genode::uint64_t sctlr_el1 { 0 };
Genode::uint64_t actlr_el1 { 0 };
Genode::uint64_t vbar_el1 { 0 };
Genode::uint32_t cpacr_el1 { 0 };
Genode::uint32_t afsr0_el1 { 0 };
Genode::uint32_t afsr1_el1 { 0 };
Genode::uint32_t contextidr_el1 { 0 };
Genode::uint64_t ttbr0_el1 { 0 };
Genode::uint64_t ttbr1_el1 { 0 };
Genode::uint64_t tcr_el1 { 0 };
Genode::uint64_t mair_el1 { 0 };
Genode::uint64_t amair_el1 { 0 };
Genode::uint64_t far_el1 { 0 };
Genode::uint64_t par_el1 { 0 };
Genode::uint64_t tpidrro_el0 { 0 };
Genode::uint64_t tpidr_el0 { 0 };
Genode::uint64_t tpidr_el1 { 0 };
Genode::uint64_t vmpidr_el2 { 0 };
Genode::uint64_t far_el2 { 0 };
Genode::uint64_t hpfar_el2 { 0 };
/**
* Timer related registers
*/
struct Timer {
Genode::uint64_t offset { 0 };
Genode::uint64_t compare { 0 };
Genode::uint32_t control { 0 };
Genode::uint32_t kcontrol { 0 };
bool irq { false };
} timer {};
/**
* Interrupt related values
*/
struct Pic
{
unsigned last_irq { 1023 };
unsigned virtual_irq { 1023 };
} irqs {};
/**************************
** Platform information **
**************************/
Genode::uint64_t id_aa64isar0_el1 { 0 };
Genode::uint64_t id_aa64isar1_el1 { 0 };
Genode::uint64_t id_aa64mmfr0_el1 { 0 };
Genode::uint64_t id_aa64mmfr1_el1 { 0 };
Genode::uint64_t id_aa64mmfr2_el1 { 0 };
Genode::uint64_t id_aa64pfr0_el1 { 0 };
Genode::uint64_t id_aa64pfr1_el1 { 0 };
Genode::uint64_t id_aa64zfr0_el1 { 0 };
Genode::uint32_t ccsidr_inst_el1[7] { 0 };
Genode::uint32_t ccsidr_data_el1[7] { 0 };
Genode::uint64_t clidr_el1 { 0 };
};
#endif /* _INCLUDE__SPEC__ARM_64__CPU__VM_STATE_VIRTUALIZATION_H_ */

View File

@ -17,6 +17,7 @@ SRC_CC += lib/base/heap.cc
SRC_CC += lib/base/registry.cc
SRC_CC += lib/base/log.cc
SRC_CC += lib/base/output.cc
SRC_CC += lib/base/raw_output.cc
SRC_CC += lib/base/slab.cc
SRC_CC += lib/base/sleep.cc
SRC_CC += lib/base/sliced_heap.cc

View File

@ -6,16 +6,16 @@
# add include paths
INC_DIR += $(REP_DIR)/src/core/spec/arndale
INC_DIR += $(REP_DIR)/src/core/spec/arm_v7/virtualization
INC_DIR += $(REP_DIR)/src/core/spec/arm/virtualization
# add C++ sources
SRC_CC += kernel/vm_thread_on.cc
SRC_CC += spec/arm/gicv2.cc
SRC_CC += spec/arm_v7/virtualization/kernel/vm.cc
SRC_CC += spec/arm_v7/virtualization/platform_services.cc
SRC_CC += spec/arm_v7/virtualization/vm_session_component.cc
SRC_CC += spec/arm_v7/vm_session_component.cc
SRC_CC += spec/arm/virtualization/platform_services.cc
SRC_CC += spec/arm/virtualization/vm_session_component.cc
SRC_CC += vm_session_common.cc
SRC_CC += vm_session_component.cc
# add assembly sources
SRC_S += spec/arm_v7/virtualization/exception_vector.s

View File

@ -5,7 +5,8 @@ SRC_CC += kernel/vm_thread_on.cc
SRC_CC += spec/arm_v7/trustzone/kernel/vm.cc
SRC_CC += spec/arm_v7/trustzone/platform_services.cc
SRC_CC += spec/arm_v7/trustzone/vm_session_component.cc
SRC_CC += spec/arm_v7/vm_session_component.cc
SRC_CC += vm_session_common.cc
SRC_CC += vm_session_component.cc
SRC_S += spec/arm_v7/trustzone/exception_vector.s

View File

@ -6,17 +6,18 @@
# add include paths
INC_DIR += $(REP_DIR)/src/core/spec/imx7d_sabre
INC_DIR += $(REP_DIR)/src/core/spec/arm_v7/virtualization
INC_DIR += $(REP_DIR)/src/core/spec/arm/virtualization
# add C++ sources
SRC_CC += kernel/vm_thread_on.cc
SRC_CC += spec/arm/generic_timer.cc
SRC_CC += spec/arm/gicv2.cc
SRC_CC += spec/arm_v7/virtualization/kernel/vm.cc
SRC_CC += spec/arm_v7/virtualization/platform_services.cc
SRC_CC += spec/arm_v7/virtualization/vm_session_component.cc
SRC_CC += spec/arm_v7/vm_session_component.cc
SRC_CC += spec/arm/virtualization/gicv2.cc
SRC_CC += spec/arm/virtualization/platform_services.cc
SRC_CC += spec/arm/virtualization/vm_session_component.cc
SRC_CC += vm_session_common.cc
SRC_CC += vm_session_component.cc
# add assembly sources
SRC_S += spec/arm_v7/virtualization/exception_vector.s

View File

@ -17,7 +17,8 @@ SRC_CC += spec/arm/imx_tzic.cc
SRC_CC += spec/arm_v7/trustzone/kernel/vm.cc
SRC_CC += spec/arm_v7/trustzone/platform_services.cc
SRC_CC += spec/arm_v7/trustzone/vm_session_component.cc
SRC_CC += spec/arm_v7/vm_session_component.cc
SRC_CC += vm_session_common.cc
SRC_CC += vm_session_component.cc
# add assembly sources
SRC_S += spec/arm_v7/trustzone/exception_vector.s

View File

@ -7,6 +7,8 @@ SRC_CC += lib/base/arm_64/kernel/interface.cc
SRC_CC += spec/64bit/memory_map.cc
SRC_S += bootstrap/spec/arm_64/crt0.s
NR_OF_CPUS = 4
vpath spec/64bit/memory_map.cc $(BASE_DIR)/../base-hw/src/lib/hw
include $(BASE_DIR)/../base-hw/lib/mk/bootstrap-hw.inc

View File

@ -8,4 +8,6 @@ SRC_S += bootstrap/spec/arm_64/crt0.s
vpath spec/64bit/memory_map.cc $(BASE_DIR)/../base-hw/src/lib/hw
NR_OF_CPUS = 4
include $(BASE_DIR)/../base-hw/lib/mk/bootstrap-hw.inc

View File

@ -1,24 +1,32 @@
INC_DIR += $(REP_DIR)/src/core/spec/imx8q_evk
INC_DIR += $(REP_DIR)/src/core/spec/arm_v8
INC_DIR += $(REP_DIR)/src/core/spec/arm/virtualization
# add C++ sources
SRC_CC += kernel/cpu_up.cc
SRC_CC += kernel/lock.cc
SRC_CC += kernel/vm_thread_off.cc
SRC_CC += platform_services.cc
SRC_CC += kernel/cpu_mp.cc
SRC_CC += kernel/vm_thread_on.cc
SRC_CC += spec/64bit/memory_map.cc
SRC_CC += spec/arm/generic_timer.cc
SRC_CC += spec/arm/gicv3.cc
SRC_CC += spec/arm/kernel/lock.cc
SRC_CC += spec/arm/platform_support.cc
SRC_CC += spec/arm_v8/cpu.cc
SRC_CC += spec/arm_v8/kernel/cpu.cc
SRC_CC += spec/arm_v8/kernel/thread.cc
SRC_CC += spec/arm_v8/virtualization/kernel/vm.cc
SRC_CC += spec/arm/virtualization/platform_services.cc
SRC_CC += spec/arm/virtualization/vm_session_component.cc
SRC_CC += vm_session_common.cc
SRC_CC += vm_session_component.cc
#add assembly sources
SRC_S += spec/arm_v8/exception_vector.s
SRC_S += spec/arm_v8/crt0.s
SRC_S += spec/arm_v8/virtualization/exception_vector.s
vpath spec/64bit/memory_map.cc $(BASE_DIR)/../base-hw/src/lib/hw
NR_OF_CPUS = 4
# include less specific configuration
include $(REP_DIR)/lib/mk/core-hw.inc

View File

@ -2,17 +2,17 @@ INC_DIR += $(REP_DIR)/src/core/spec/rpi3
INC_DIR += $(REP_DIR)/src/core/spec/arm_v8
# add C++ sources
SRC_CC += platform_services.cc
SRC_CC += kernel/cpu_mp.cc
SRC_CC += kernel/vm_thread_off.cc
SRC_CC += kernel/cpu_up.cc
SRC_CC += kernel/lock.cc
SRC_CC += spec/arm_v8/cpu.cc
SRC_CC += spec/arm_v8/kernel/thread.cc
SRC_CC += spec/arm_v8/kernel/cpu.cc
SRC_CC += spec/arm/platform_support.cc
SRC_CC += platform_services.cc
SRC_CC += spec/64bit/memory_map.cc
SRC_CC += spec/arm/bcm2837_pic.cc
SRC_CC += spec/arm/generic_timer.cc
SRC_CC += spec/64bit/memory_map.cc
SRC_CC += spec/arm/kernel/lock.cc
SRC_CC += spec/arm/platform_support.cc
SRC_CC += spec/arm_v8/cpu.cc
SRC_CC += spec/arm_v8/kernel/cpu.cc
SRC_CC += spec/arm_v8/kernel/thread.cc
#add assembly sources
SRC_S += spec/arm_v8/exception_vector.s
@ -20,5 +20,7 @@ SRC_S += spec/arm_v8/crt0.s
vpath spec/64bit/memory_map.cc $(BASE_DIR)/../base-hw/src/lib/hw
NR_OF_CPUS = 4
# include less specific configuration
include $(REP_DIR)/lib/mk/core-hw.inc

View File

@ -35,7 +35,10 @@ SRC_CC += spec/x86_64/muen/platform_services.cc
SRC_CC += spec/x86_64/muen/platform_support.cc
SRC_CC += spec/x86_64/muen/sinfo_instance.cc
SRC_CC += spec/x86_64/muen/timer.cc
SRC_CC += spec/x86_64/muen/vm_session_component.cc
SRC_CC += spec/x86_64/platform_support_common.cc
SRC_CC += vm_session_common.cc
SRC_CC += vm_session_component.cc
SRC_CC += spec/64bit/memory_map.cc

View File

@ -1 +1 @@
2019-07-08 abc6d82ca4a240319850c788f29cde2655eab1d1
2019-11-25 6593319a4dec74af9dc15554139e4343ef4312a9

View File

@ -1 +1 @@
2019-08-27 d4178964debbd47e4c0d37a127f51662054cd237
2019-11-25 c60d834ce54a46a946c36249784e734e06274d97

View File

@ -1 +1 @@
2019-08-27 5b6d3f57e76de132294eca0418ae63ff18a4d921
2019-11-25 e9232754efd81c14aa65d4852d276852f591f3e5

View File

@ -1 +1 @@
2019-08-27 51d44f6fef88b6cdeba9cfdbab1b170250ed28ad
2019-11-25 2ab0250606cee0da4f08ac08f7f33c743f32c88c

View File

@ -1 +1 @@
2019-08-27 559fcb46116ad7f3234892968271b268295b9296
2019-11-25 7780e0570ac0277d678dee76a579a9d9f9a1a776

View File

@ -1 +1 @@
2019-08-27 f2b8b089ac104f6ac25cbdf7a522f83e761bca86
2019-11-25 2dee497b7892f706236fdbfabae53bbd4e62463b

View File

@ -1 +1 @@
2019-08-27 c4b95a617529b279fb7a681b55cf6861a1cbb8ba
2019-11-25 efd164d66086a998484d7413c5416e3aa128e560

View File

@ -1 +1 @@
2019-08-27 e70d7f749ced55e96ce5486859123db5e9ee596d
2019-11-25 25f54b8744778f0860ac2a93c11ee6b1cd16d0c9

View File

@ -1 +1 @@
2019-08-27 c39e790ba567b102afabd0ae34d2fb4bffebb531
2019-11-25 ceeaef3ad58fc5b88cf4686aa42f50fd254063e3

View File

@ -1 +1 @@
2019-08-27 16dc7287252a28981c894d15465c3ab34a88b91e
2019-11-25 aee36abdef456d2d1c6bba023f16cbca08eceabe

View File

@ -1 +1 @@
2019-08-27 7bf52d5fec332b0d453e2193c32c6c912467f9fa
2019-11-25 ede7ce464c3f4b8486fd93413088a1b83fbf796a

View File

@ -1 +1 @@
2019-08-27 a9ed26560e2da949fd5e54bcba12eee6fdef15e5
2019-11-25 2bea4132b9ab877e802cfb81ad3c62bda0c2bc50

View File

@ -1 +1 @@
2019-08-27 40de2c240789026faa255646fb1063042cb96b0d
2019-11-25 807893480c51457cad7e00e1275eff9749c91c68

View File

@ -1 +1 @@
2019-08-27 d7ae8cddd46c47b43f7f162c07d19e3a6879d0e0
2019-11-25 6a3f12cd6429f5d5bcf617cdd3ea9d345e8614ad

View File

@ -1 +1 @@
2019-08-27 9eda2e18c925c75f60be5267e02c65a96d9d4583
2019-11-25 a318db7d985930e3f58ce3bccce290bc13aaedab

View File

@ -1 +1 @@
2019-08-27 1f55a4206dfd96f36c2bb68598a77b2b1b69d663
2019-11-25 75f1b89ea50fdfd0a69c33dee4ba1e120d49fad5

View File

@ -0,0 +1,2 @@
CPPFLAGS += -I$(TUP_CWD)/include
CPPFLAGS += -I$(BASE_DIR)/src/include

View File

@ -19,6 +19,7 @@
/* base-internal includes */
#include <base/internal/globals.h>
#include <base/internal/output.h>
#include <base/internal/raw_write_string.h>
#include <base/internal/unmanaged_singleton.h>
#include <board.h>
@ -57,3 +58,5 @@ struct Buffer
Genode::Log &Genode::Log::log() {
return unmanaged_singleton<Buffer>()->log; }
void Genode::raw_write_string(char const *str) { log(str); }

View File

@ -47,7 +47,6 @@ class Bootstrap::Platform
Mmio_space const core_mmio;
unsigned cpus { NR_OF_CPUS };
::Board::Boot_info info { };
::Board::Pic pic { };
Board();
};

View File

@ -15,6 +15,7 @@
unsigned Bootstrap::Platform::enable_mmu()
{
::Board::Pic pic { };
::Board::Cpu::Sctlr::init();
::Board::Cpu::enable_mmu_and_caches((addr_t)core_pd->table_base);

View File

@ -118,7 +118,7 @@ unsigned Bootstrap::Platform::enable_mmu()
Actlr::disable_smp();
/* locally initialize interrupt controller */
board.pic.init_cpu_local();
::Board::Pic pic { };
Cpu::invalidate_data_cache();
data_cache_invalidated.inc();

View File

@ -13,8 +13,41 @@
#include <board.h>
void Board::Pic::init_cpu_local()
Hw::Gicv2::Gicv2()
: _distr(Board::Cpu_mmio::IRQ_CONTROLLER_DISTR_BASE),
_cpui (Board::Cpu_mmio::IRQ_CONTROLLER_CPU_BASE),
_last_iar(Cpu_interface::Iar::Irq_id::bits(spurious_id)),
_max_irq(_distr.max_irq())
{
static bool distributor_initialized = false;
if (!distributor_initialized) {
distributor_initialized = true;
/* disable device */
_distr.write<Distributor::Ctlr>(0);
/* configure every shared peripheral interrupt */
for (unsigned i = min_spi; i <= _max_irq; i++) {
if (Board::NON_SECURE) {
_distr.write<Distributor::Igroupr::Group_status>(1, i);
}
_distr.write<Distributor::Icfgr::Edge_triggered>(0, i);
_distr.write<Distributor::Ipriorityr::Priority>(0, i);
_distr.write<Distributor::Icenabler::Clear_enable>(1, i);
}
/* enable device */
Distributor::Ctlr::access_t v = 0;
if (Board::NON_SECURE) {
Distributor::Ctlr::Enable_grp0::set(v, 1);
Distributor::Ctlr::Enable_grp1::set(v, 1);
} else {
Distributor::Ctlr::Enable::set(v, 1);
}
_distr.write<Distributor::Ctlr>(v);
}
if (Board::NON_SECURE) {
_cpui.write<Cpu_interface::Ctlr>(0);
@ -40,34 +73,3 @@ void Board::Pic::init_cpu_local()
}
_cpui.write<Cpu_interface::Ctlr>(v);
}
Hw::Gicv2::Gicv2()
: _distr(Board::Cpu_mmio::IRQ_CONTROLLER_DISTR_BASE),
_cpui (Board::Cpu_mmio::IRQ_CONTROLLER_CPU_BASE),
_last_iar(Cpu_interface::Iar::Irq_id::bits(spurious_id)),
_max_irq(_distr.max_irq())
{
/* disable device */
_distr.write<Distributor::Ctlr>(0);
/* configure every shared peripheral interrupt */
for (unsigned i = min_spi; i <= _max_irq; i++) {
if (Board::NON_SECURE) {
_distr.write<Distributor::Igroupr::Group_status>(1, i);
}
_distr.write<Distributor::Icfgr::Edge_triggered>(0, i);
_distr.write<Distributor::Ipriorityr::Priority>(0, i);
_distr.write<Distributor::Icenabler::Clear_enable>(1, i);
}
/* enable device */
Distributor::Ctlr::access_t v = 0;
if (Board::NON_SECURE) {
Distributor::Ctlr::Enable_grp0::set(v, 1);
Distributor::Ctlr::Enable_grp1::set(v, 1);
} else {
Distributor::Ctlr::Enable::set(v, 1);
}
_distr.write<Distributor::Ctlr>(v);
}

View File

@ -1,26 +0,0 @@
/*
* \brief Interrupt controller definitions for ARM
* \author Stefan Kalkowski
* \date 2017-02-22
*/
/*
* Copyright (C) 2017 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 _SRC__BOOTSTRAP__SPEC__ARM__GICV2_H_
#define _SRC__BOOTSTRAP__SPEC__ARM__GICV2_H_
#include <hw/spec/arm/gicv2.h>
namespace Board { struct Pic; }
struct Board::Pic : Hw::Gicv2
{
void init_cpu_local();
};
#endif /* _SRC__BOOTSTRAP__SPEC__ARM__GICV2_H_ */

View File

@ -11,10 +11,12 @@
* under the terms of the GNU Affero General Public License version 3.
*/
#include <hw/spec/arm_64/memory_map.h>
#include <platform.h>
using Board::Cpu;
extern "C" void * _crt0_enable_fpu;
static inline void prepare_non_secure_world()
{
@ -56,11 +58,54 @@ static inline void prepare_non_secure_world()
}
static inline void prepare_hypervisor()
static inline void prepare_hypervisor(Cpu::Ttbr::access_t const ttbr)
{
Cpu::Hcr::access_t scr = Cpu::Hcr::read();
Cpu::Hcr::Rw::set(scr, 1); /* exec in aarch64 */
Cpu::Hcr::write(scr);
using namespace Hw::Mm;
/* forbid trace access */
Cpu::Cptr_el2::access_t cptr = Cpu::Cptr_el2::read();
Cpu::Cptr_el2::Tta::set(cptr, 1);
Cpu::Cptr_el2::write(cptr);
/* allow physical counter/timer access without trapping */
Cpu::Cnthctl_el2::write(0b111);
/* forbid any 32bit access to coprocessor/sysregs */
Cpu::Hstr_el2::write(0xffff);
Cpu::Hcr_el2::access_t hcr = Cpu::Hcr_el2::read();
Cpu::Hcr_el2::Rw::set(hcr, 1); /* exec in aarch64 */
Cpu::Hcr_el2::write(hcr);
/* set hypervisor exception vector */
Cpu::Vbar_el2::write(el2_addr(hypervisor_exception_vector().base));
Genode::addr_t const stack_el2 = el2_addr(hypervisor_stack().base +
hypervisor_stack().size);
/* set hypervisor's translation table */
Cpu::Ttbr0_el2::write(ttbr);
Cpu::Tcr_el2::access_t tcr_el2 = 0;
Cpu::Tcr_el2::T0sz::set(tcr_el2, 25);
Cpu::Tcr_el2::Irgn0::set(tcr_el2, 1);
Cpu::Tcr_el2::Orgn0::set(tcr_el2, 1);
Cpu::Tcr_el2::Sh0::set(tcr_el2, 0b10);
/* prepare MMU usage by hypervisor code */
Cpu::Tcr_el2::write(tcr_el2);
/* set memory attributes in indirection register */
Cpu::Mair::access_t mair = 0;
Cpu::Mair::Attr0::set(mair, Cpu::Mair::NORMAL_MEMORY_UNCACHED);
Cpu::Mair::Attr1::set(mair, Cpu::Mair::DEVICE_MEMORY);
Cpu::Mair::Attr2::set(mair, Cpu::Mair::NORMAL_MEMORY_CACHED);
Cpu::Mair::Attr3::set(mair, Cpu::Mair::DEVICE_MEMORY);
Cpu::Mair_el2::write(mair);
Cpu::Vtcr_el2::access_t vtcr = 0;
Cpu::Vtcr_el2::T0sz::set(vtcr, 25);
Cpu::Vtcr_el2::Sl0::set(vtcr, 1); /* set to starting level 1 */
Cpu::Vtcr_el2::write(vtcr);
Cpu::Spsr::access_t pstate = 0;
Cpu::Spsr::Sp::set(pstate, 1); /* select non-el0 stack pointer */
@ -71,27 +116,52 @@ static inline void prepare_hypervisor()
Cpu::Spsr::D::set(pstate, 1);
Cpu::Spsr_el2::write(pstate);
Cpu::Sctlr::access_t sctlr = Cpu::Sctlr_el2::read();
Cpu::Sctlr::M::set(sctlr, 1);
Cpu::Sctlr::A::set(sctlr, 0);
Cpu::Sctlr::C::set(sctlr, 1);
Cpu::Sctlr::Sa::set(sctlr, 0);
Cpu::Sctlr::I::set(sctlr, 1);
Cpu::Sctlr::Wxn::set(sctlr, 0);
Cpu::Sctlr_el2::write(sctlr);
asm volatile("mov x0, sp \n"
"msr sp_el1, x0 \n"
"adr x0, 1f \n"
"msr elr_el2, x0 \n"
"mov sp, %0 \n"
"eret \n"
"1:");
"1:": : "r"(stack_el2): "x0");
}
unsigned Bootstrap::Platform::enable_mmu()
{
static volatile bool primary_cpu = true;
bool primary = primary_cpu;
if (primary) primary_cpu = false;
Cpu::Ttbr::access_t ttbr =
Cpu::Ttbr::Baddr::masked((Genode::addr_t)core_pd->table_base);
while (Cpu::current_privilege_level() > Cpu::Current_el::EL1) {
if (Cpu::current_privilege_level() == Cpu::Current_el::EL3)
if (Cpu::current_privilege_level() == Cpu::Current_el::EL3) {
prepare_non_secure_world();
else
prepare_hypervisor();
} else {
::Board::Pic pic __attribute__((unused)) {};
prepare_hypervisor(ttbr);
}
}
/* primary cpu wakes up all others */
if (primary && NR_OF_CPUS > 1) Cpu::wake_up_all_cpus(&_crt0_enable_fpu);
/* enable performance counter for user-land */
Cpu::Pmuserenr_el0::write(0b1111);
/* enable user-level access of physical/virtual counter */
Cpu::Cntkctl_el1::write(0b11);
Cpu::Vbar_el1::write(Hw::Mm::supervisor_exception_vector().base);
/* set memory attributes in indirection register */
@ -100,9 +170,8 @@ unsigned Bootstrap::Platform::enable_mmu()
Cpu::Mair::Attr1::set(mair, Cpu::Mair::DEVICE_MEMORY);
Cpu::Mair::Attr2::set(mair, Cpu::Mair::NORMAL_MEMORY_CACHED);
Cpu::Mair::Attr3::set(mair, Cpu::Mair::DEVICE_MEMORY);
Cpu::Mair::write(mair);
Cpu::Mair_el1::write(mair);
Cpu::Ttbr::access_t ttbr = Cpu::Ttbr::Baddr::masked((Genode::addr_t)core_pd->table_base);
Cpu::Ttbr0_el1::write(ttbr);
Cpu::Ttbr1_el1::write(ttbr);
@ -119,13 +188,14 @@ unsigned Bootstrap::Platform::enable_mmu()
Cpu::Tcr_el1::As::set(tcr, 1);
Cpu::Tcr_el1::write(tcr);
Cpu::Sctlr_el1::access_t sctlr = Cpu::Sctlr_el1::read();
Cpu::Sctlr_el1::C::set(sctlr, 1);
Cpu::Sctlr_el1::I::set(sctlr, 1);
Cpu::Sctlr_el1::A::set(sctlr, 0);
Cpu::Sctlr_el1::M::set(sctlr, 1);
Cpu::Sctlr_el1::Sa0::set(sctlr, 1);
Cpu::Sctlr_el1::Sa::set(sctlr, 0);
Cpu::Sctlr::access_t sctlr = Cpu::Sctlr_el1::read();
Cpu::Sctlr::C::set(sctlr, 1);
Cpu::Sctlr::I::set(sctlr, 1);
Cpu::Sctlr::A::set(sctlr, 0);
Cpu::Sctlr::M::set(sctlr, 1);
Cpu::Sctlr::Sa0::set(sctlr, 1);
Cpu::Sctlr::Sa::set(sctlr, 0);
Cpu::Sctlr::Uct::set(sctlr, 1);
Cpu::Sctlr_el1::write(sctlr);
return 0;

View File

@ -23,8 +23,19 @@
mrs x0, mpidr_el1
and x0, x0, #0b11111111
cbz x0, _crt0_fill_bss_zero
/**
* Hack for Qemu, which starts all cpus at once
*/
1:
ldr x1, =_crt0_qemu_start_secondary_cpus
ldr w1, [x1]
cbnz w1, _crt0_enable_fpu
wfe
b _start
b 1b
.global _crt0_qemu_start_secondary_cpus
_crt0_qemu_start_secondary_cpus:
.long 0
/***************************
@ -32,12 +43,12 @@
***************************/
_crt0_fill_bss_zero:
ldr x0, =_bss_start
ldr x1, =_bss_end
ldr x1, =_bss_start
ldr x2, =_bss_end
1:
cmp x1, x0
cmp x2, x1
b.eq _crt0_enable_fpu
str xzr, [x0], #8
str xzr, [x1], #8
b 1b
@ -45,20 +56,30 @@
** Enable FPU **
****************/
.global _crt0_enable_fpu
_crt0_enable_fpu:
mov x0, #0b11
lsl x0, x0, #20
msr cpacr_el1, x0
mov x1, #0b11
lsl x1, x1, #20
msr cpacr_el1, x1
/**********************
** Initialize stack **
**********************/
ldr x0, =_crt0_start_stack
mov sp, x0
.set STACK_SIZE, 0x2000
ldr x1, =_crt0_start_stack
ldr x2, [x1]
mul x0, x0, x2
add x1, x1, x0
mov sp, x1
bl init
.p2align 4
.space 0x4000
.rept NR_OF_CPUS
.space STACK_SIZE
.endr
_crt0_start_stack:
.long STACK_SIZE

View File

@ -17,11 +17,11 @@
#include <hw/spec/arm/arndale_board.h>
#include <hw/spec/arm/lpae.h>
#include <spec/arm/cpu.h>
#include <spec/arm/gicv2.h>
#include <hw/spec/arm/gicv2.h>
namespace Board {
using namespace Hw::Arndale_board;
using Pic = Hw::Gicv2;
static constexpr bool NON_SECURE = true;
}

View File

@ -155,7 +155,9 @@ unsigned Bootstrap::Platform::enable_mmu()
using namespace ::Board;
static volatile bool primary_cpu = true;
board.pic.init_cpu_local();
/* locally initialize interrupt controller */
::Board::Pic pic { };
prepare_nonsecure_world();
prepare_hypervisor((addr_t)core_pd->table_base);

View File

@ -18,11 +18,11 @@
#include <spec/arm/cortex_a9_actlr.h>
#include <spec/arm/cortex_a9_page_table.h>
#include <spec/arm/cpu.h>
#include <spec/arm/gicv2.h>
#include <hw/spec/arm/gicv2.h>
namespace Board {
using namespace Hw::Imx6q_sabrelite_board;
using Pic = Hw::Gicv2;
struct L2_cache;
static constexpr bool NON_SECURE = false;

View File

@ -17,11 +17,11 @@
#include <hw/spec/arm/imx7d_sabre_board.h>
#include <hw/spec/arm/lpae.h>
#include <spec/arm/cpu.h>
#include <spec/arm/gicv2.h>
#include <hw/spec/arm/gicv2.h>
namespace Board {
using namespace Hw::Imx7d_sabre_board;
using Pic = Hw::Gicv2;
static constexpr bool NON_SECURE = true;
}

View File

@ -287,7 +287,9 @@ unsigned Bootstrap::Platform::enable_mmu()
{
static volatile bool primary_cpu = true;
static unsigned long timer_freq = Cpu::Cntfrq::read();
board.pic.init_cpu_local();
/* locally initialize interrupt controller */
::Board::Pic pic { };
prepare_nonsecure_world(timer_freq);
prepare_hypervisor((addr_t)core_pd->table_base);

View File

@ -21,7 +21,12 @@
namespace Board {
using namespace Hw::Imx8q_evk_board;
using Cpu = Hw::Arm_64_cpu;
struct Cpu : Hw::Arm_64_cpu
{
static void wake_up_all_cpus(void*);
};
using Hw::Pic;
};

View File

@ -24,4 +24,269 @@ Bootstrap::Platform::Board::Board()
Memory_region { ::Board::Cpu_mmio::IRQ_CONTROLLER_DISTR_BASE,
::Board::Cpu_mmio::IRQ_CONTROLLER_DISTR_SIZE },
Memory_region { ::Board::Cpu_mmio::IRQ_CONTROLLER_REDIST_BASE,
::Board::Cpu_mmio::IRQ_CONTROLLER_REDIST_SIZE }) {}
::Board::Cpu_mmio::IRQ_CONTROLLER_REDIST_SIZE })
{
::Board::Pic pic {};
static volatile unsigned long initial_values[][2] {
// GPC values
{ 0x303A0004, 0x5050424 },
{ 0x303A0030, 0xEB22DE22 },
{ 0x303A0034, 0xFFFFF1C7 },
{ 0x303A0038, 0x7BFFBC00 },
{ 0x303A003C, 0xFA3BF12A },
{ 0x303A004C, 0xFFFFDFFF },
{ 0x303A01B4, 0x3980 },
{ 0x303A01CC, 0xFFFFBFFF },
{ 0x303A01D4, 0xFFFF7FFF },
{ 0x303A01DC, 0xFFFF7FFF },
{ 0x303A01FC, 0x107FF9F },
{ 0x303A080C, 0x1 },
{ 0x303A0840, 0x1 },
{ 0x303A084C, 0x1 },
{ 0x303A0880, 0x1 },
{ 0x303A088C, 0x1 },
{ 0x303A08C0, 0x1 },
{ 0x303A08CC, 0x1 },
{ 0x303A0C8C, 0x1 },
{ 0x303A0DCC, 0x1 },
{ 0x303A0E0C, 0x1 },
{ 0x303A0ECC, 0x1 },
{ 0x303A0F00, 0x1 },
{ 0x303A0F0C, 0x1 },
// CCM values
{ 0x303840B0, 0x2 },
{ 0x303840B4, 0x2 },
{ 0x303840B8, 0x2 },
{ 0x303840BC, 0x2 },
{ 0x303840C0, 0x2 },
{ 0x303840C4, 0x2 },
{ 0x303840C8, 0x2 },
{ 0x303840CC, 0x2 },
{ 0x303840D0, 0x2 },
{ 0x303840D4, 0x2 },
{ 0x303840D8, 0x2 },
{ 0x303840DC, 0x2 },
{ 0x303840E0, 0x2 },
{ 0x303840E4, 0x2 },
{ 0x303840E8, 0x2 },
{ 0x303840EC, 0x2 },
{ 0x303840F0, 0x2 },
{ 0x303840F4, 0x2 },
{ 0x303840F8, 0x2 },
{ 0x303840FC, 0x2 },
{ 0x30384250, 0x3 },
{ 0x30384254, 0x3 },
{ 0x30384258, 0x3 },
{ 0x3038425C, 0x3 },
{ 0x303843A0, 0x3 },
{ 0x303843A4, 0x3 },
{ 0x303843A8, 0x3 },
{ 0x303843AC, 0x3 },
{ 0x303844D0, 0x3 },
{ 0x303844D4, 0x3 },
{ 0x303844D8, 0x3 },
{ 0x303844DC, 0x3 },
{ 0x303844F0, 0x3 },
{ 0x303844F4, 0x3 },
{ 0x303844F8, 0x3 },
{ 0x303844FC, 0x3 },
{ 0x30384560, 0x0 },
{ 0x30384564, 0x0 },
{ 0x30384568, 0x0 },
{ 0x3038456C, 0x0 },
{ 0x303845D0, 0x3 },
{ 0x303845D4, 0x3 },
{ 0x303845D8, 0x3 },
{ 0x303845DC, 0x3 },
{ 0x30388010, 0x0 },
{ 0x30388014, 0x0 },
{ 0x30388018, 0x0 },
{ 0x3038801C, 0x0 },
{ 0x30388020, 0x0 },
{ 0x30388024, 0x0 },
{ 0x30388028, 0x0 },
{ 0x3038802C, 0x0 },
{ 0x30388030, 0x11000400 },
{ 0x30388034, 0x11000400 },
{ 0x30388038, 0x11000400 },
{ 0x3038803C, 0x11000400 },
{ 0x30388080, 0x11000000 },
{ 0x30388084, 0x11000000 },
{ 0x30388088, 0x11000000 },
{ 0x3038808C, 0x11000000 },
{ 0x30388090, 0x0 },
{ 0x30388094, 0x0 },
{ 0x30388098, 0x0 },
{ 0x3038809C, 0x0 },
{ 0x303880B0, 0x1100 },
{ 0x303880B4, 0x1100 },
{ 0x303880B8, 0x1100 },
{ 0x303880BC, 0x1100 },
{ 0x30388110, 0x0 },
{ 0x30388114, 0x0 },
{ 0x30388118, 0x0 },
{ 0x3038811C, 0x0 },
{ 0x30388180, 0x1000000 },
{ 0x30388184, 0x1000000 },
{ 0x30388188, 0x1000000 },
{ 0x3038818C, 0x1000000 },
{ 0x303881A0, 0x10000000 },
{ 0x303881A4, 0x10000000 },
{ 0x303881A8, 0x10000000 },
{ 0x303881AC, 0x10000000 },
{ 0x303881B0, 0x1000100 },
{ 0x303881B4, 0x1000100 },
{ 0x303881B8, 0x1000100 },
{ 0x303881BC, 0x1000100 },
{ 0x30388200, 0x1000000 },
{ 0x30388204, 0x1000000 },
{ 0x30388208, 0x1000000 },
{ 0x3038820C, 0x1000000 },
{ 0x30388220, 0x10000000 },
{ 0x30388224, 0x10000000 },
{ 0x30388228, 0x10000000 },
{ 0x3038822C, 0x10000000 },
{ 0x30388230, 0x1000100 },
{ 0x30388234, 0x1000100 },
{ 0x30388238, 0x1000100 },
{ 0x3038823C, 0x1000100 },
// CCMA values
{ 0x30360000, 0x88080 },
{ 0x30360004, 0x292A2FA6 },
{ 0x30360004, 0x292A2FA6 },
{ 0x30360008, 0x88080 },
{ 0x30360008, 0x88080 },
{ 0x3036000C, 0x10385BA3 },
{ 0x3036000C, 0x10385BA3 },
{ 0x30360010, 0x98080 },
{ 0x30360010, 0x98080 },
{ 0x30360014, 0x3FFFFF1A },
{ 0x30360014, 0x3FFFFF1A },
{ 0x30360018, 0x88081 },
{ 0x30360054, 0x2B9 },
// IOMUXC
{ 0x30330064, 0x6 },
{ 0x30330140, 0x0 },
{ 0x30330144, 0x0 },
{ 0x30330148, 0x0 },
{ 0x3033014C, 0x0 },
{ 0x30330150, 0x0 },
{ 0x30330154, 0x0 },
{ 0x30330158, 0x0 },
{ 0x30330180, 0x2 },
{ 0x30330184, 0x0 },
{ 0x30330188, 0x0 },
{ 0x3033018C, 0x0 },
{ 0x30330190, 0x0 },
{ 0x30330194, 0x0 },
{ 0x30330198, 0x0 },
{ 0x3033019C, 0x0 },
{ 0x303301A0, 0x0 },
{ 0x303301A4, 0x0 },
{ 0x303301A8, 0x0 },
{ 0x303301AC, 0x0 },
{ 0x303301BC, 0x0 },
{ 0x303301C0, 0x0 },
{ 0x303301C4, 0x0 },
{ 0x303301C8, 0x0 },
{ 0x303301E8, 0x0 },
{ 0x303301EC, 0x0 },
{ 0x303301FC, 0x1 },
{ 0x30330200, 0x1 },
{ 0x3033021C, 0x10 },
{ 0x30330220, 0x10 },
{ 0x30330224, 0x10 },
{ 0x30330228, 0x10 },
{ 0x3033022C, 0x12 },
{ 0x30330230, 0x12 },
{ 0x30330244, 0x0 },
{ 0x30330248, 0x0 },
{ 0x3033029C, 0x19 },
{ 0x303302A4, 0x19 },
{ 0x303302A8, 0x19 },
{ 0x303302B0, 0xD6 },
{ 0x303302C0, 0x4F },
{ 0x303302C4, 0x16 },
{ 0x303302CC, 0x59 },
{ 0x3033033C, 0x9F },
{ 0x30330340, 0xDF },
{ 0x30330344, 0xDF },
{ 0x30330348, 0xDF },
{ 0x3033034C, 0xDF },
{ 0x30330350, 0xDF },
{ 0x30330368, 0x59 },
{ 0x30330370, 0x19 },
{ 0x3033039C, 0x19 },
{ 0x303303A0, 0x19 },
{ 0x303303A4, 0x19 },
{ 0x303303A8, 0xD6 },
{ 0x303303AC, 0xD6 },
{ 0x303303B0, 0xD6 },
{ 0x303303B4, 0xD6 },
{ 0x303303B8, 0xD6 },
{ 0x303303BC, 0xD6 },
{ 0x303303C0, 0xD6 },
{ 0x303303E8, 0xD6 },
{ 0x303303EC, 0xD6 },
{ 0x303303F0, 0xD6 },
{ 0x303303F4, 0xD6 },
{ 0x303303F8, 0xD6 },
{ 0x303303FC, 0xD6 },
{ 0x30330400, 0xD6 },
{ 0x30330404, 0xD6 },
{ 0x30330408, 0xD6 },
{ 0x3033040C, 0xD6 },
{ 0x30330410, 0xD6 },
{ 0x30330414, 0xD6 },
{ 0x30330424, 0xD6 },
{ 0x30330428, 0xD6 },
{ 0x3033042C, 0xD6 },
{ 0x30330430, 0xD6 },
{ 0x30330450, 0xD6 },
{ 0x30330454, 0xD6 },
{ 0x30330464, 0x49 },
{ 0x30330468, 0x49 },
{ 0x3033046C, 0x16 },
{ 0x30330484, 0x67 },
{ 0x30330488, 0x67 },
{ 0x3033048C, 0x67 },
{ 0x30330490, 0x67 },
{ 0x30330494, 0x76 },
{ 0x30330498, 0x76 },
{ 0x303304AC, 0x49 },
{ 0x303304B0, 0x49 },
{ 0x303304C8, 0x1 },
{ 0x303304CC, 0x4 },
{ 0x30330500, 0x1 },
{ 0x30330504, 0x2 },
{ 0x30340038, 0x49409600 },
{ 0x30340040, 0x49409200 }
};
unsigned num_values = sizeof(initial_values) / (2*sizeof(unsigned long));
for (unsigned i = 0; i < num_values; i++)
*((volatile Genode::uint32_t*)initial_values[i][0]) = (Genode::uint32_t)initial_values[i][1];
}
void Board::Cpu::wake_up_all_cpus(void * ip)
{
enum Function_id { CPU_ON = 0xC4000003 };
unsigned long result = 0;
for (unsigned i = 1; i < NR_OF_CPUS; i++) {
asm volatile("mov x0, %1 \n"
"mov x1, %2 \n"
"mov x2, %3 \n"
"mov x3, %2 \n"
"smc #0 \n"
"mov %0, x0 \n"
: "=r" (result) : "r" (CPU_ON), "r" (i), "r" (ip)
: "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7",
"x8", "x9", "x10", "x11", "x12", "x13", "x14");
}
}

View File

@ -18,11 +18,11 @@
#include <spec/arm/cortex_a9_actlr.h>
#include <spec/arm/cortex_a9_page_table.h>
#include <spec/arm/cpu.h>
#include <spec/arm/gicv2.h>
#include <hw/spec/arm/gicv2.h>
namespace Board {
using namespace Hw::Nit6_solox_board;
using Pic = Hw::Gicv2;
struct L2_cache;
static constexpr bool NON_SECURE = false;

View File

@ -17,10 +17,11 @@
#include <hw/spec/arm/odroid_xu_board.h>
#include <hw/spec/arm/lpae.h>
#include <spec/arm/cpu.h>
#include <spec/arm/gicv2.h>
#include <hw/spec/arm/gicv2.h>
namespace Board {
using namespace Hw::Odroid_xu_board;
using Pic = Hw::Gicv2;
static constexpr bool NON_SECURE = false;
}

View File

@ -25,7 +25,9 @@ Bootstrap::Platform::Board::Board()
unsigned Bootstrap::Platform::enable_mmu()
{
board.pic.init_cpu_local();
/* locally initialize interrupt controller */
::Board::Pic pic { };
Cpu::Sctlr::init();
Cpu::Cpsr::init();
Cpu::invalidate_data_cache();

View File

@ -17,11 +17,11 @@
#include <hw/spec/arm/panda_board.h>
#include <spec/arm/cortex_a9_page_table.h>
#include <spec/arm/cpu.h>
#include <spec/arm/gicv2.h>
#include <hw/spec/arm/gicv2.h>
namespace Board {
using namespace Hw::Panda_board;
using Pic = Hw::Gicv2;
static constexpr bool NON_SECURE = false;
class L2_cache;

View File

@ -19,11 +19,13 @@
#include <spec/arm/cortex_a9_actlr.h>
#include <spec/arm/cortex_a9_page_table.h>
#include <spec/arm/cpu.h>
#include <spec/arm/gicv2.h>
#include <hw/spec/arm/gicv2.h>
namespace Board {
using namespace Hw::Pbxa9_board;
using Pic = Hw::Gicv2;
static constexpr bool NON_SECURE = false;
}

View File

@ -16,10 +16,7 @@
#include <hw/spec/riscv/board.h>
namespace Board {
using namespace Hw::Riscv_board;
struct Pic {};
}
namespace Board { using namespace Hw::Riscv_board; }
template <typename E, unsigned B, unsigned S>
void Sv39::Level_x_translation_table<E, B, S>::_translation_added(addr_t, size_t)

View File

@ -18,11 +18,7 @@
#include <hw/spec/arm/page_table.h>
#include <spec/arm/cpu.h>
namespace Board {
using namespace Hw::Rpi_board;
struct Pic {};
}
namespace Board { using namespace Hw::Rpi_board; }
constexpr unsigned Hw::Page_table::Descriptor_base::_device_tex() {

View File

@ -20,8 +20,13 @@
namespace Board {
using namespace Hw::Rpi3_board;
using Cpu = Hw::Arm_64_cpu;
struct Pic {};
struct Cpu : Hw::Arm_64_cpu
{
static void wake_up_all_cpus(void*);
};
struct Pic { }; /* dummy object */
};
#endif /* _BOOTSTRAP__SPEC__RPI3__BOARD_H_ */

View File

@ -26,3 +26,12 @@ Bootstrap::Platform::Board::Board()
::Board::LOCAL_IRQ_CONTROLLER_SIZE },
Memory_region { ::Board::IRQ_CONTROLLER_BASE,
::Board::IRQ_CONTROLLER_SIZE }) {}
extern unsigned int _crt0_qemu_start_secondary_cpus;
void Board::Cpu::wake_up_all_cpus(void *)
{
_crt0_qemu_start_secondary_cpus = 1;
asm volatile("dsb #0; sev");
}

View File

@ -38,6 +38,8 @@ Bootstrap::Platform::Board::Board()
Aipstz aipstz_1(AIPS_1_MMIO_BASE);
Aipstz aipstz_2(AIPS_2_MMIO_BASE);
Pic pic {};
/* set monitor mode exception vector entry */
Cpu::Mvbar::write(Hw::Mm::system_exception_vector().base);

View File

@ -18,11 +18,13 @@
#include <spec/arm/cortex_a9_actlr.h>
#include <spec/arm/cortex_a9_page_table.h>
#include <spec/arm/cpu.h>
#include <spec/arm/gicv2.h>
#include <hw/spec/arm/gicv2.h>
namespace Board {
using namespace Hw::Wand_quad_board;
using Pic = Hw::Gicv2;
struct L2_cache;
static constexpr bool NON_SECURE = false;

View File

@ -22,7 +22,6 @@
namespace Board {
using namespace Hw::Pc_board;
using Cpu = Hw::X86_64_cpu;
struct Pic {};
}
#endif /* _SRC__BOOTSTRAP__SPEC__X86_64__BOARD_H_ */

View File

@ -18,10 +18,11 @@
#include <spec/arm/cortex_a9_actlr.h>
#include <spec/arm/cortex_a9_page_table.h>
#include <spec/arm/cpu.h>
#include <spec/arm/gicv2.h>
#include <hw/spec/arm/gicv2.h>
namespace Board {
using namespace Hw::Zynq_qemu_board;
using Pic = Hw::Gicv2;
static constexpr bool NON_SECURE = false;
}

View File

@ -0,0 +1,71 @@
ifeq (@(TUP_ARCH),x86_64)
CPPFLAGS += -I$(TUP_CWD)/spec/x86_64
NR_OF_CPUS = 32
CPPFLAGS += -DNR_OF_CPUS=$(NR_OF_CPUS)
LDFLAGS += --defsym NR_OF_CPUS=$(NR_OF_CPUS)
endif
GEN_CORE_DIR = $(BASE_DIR)/src/core
# add include paths
CPPFLAGS += -I$(BASE_DIR)/../base-hw/src/core
CPPFLAGS += -I$(GEN_CORE_DIR)/include
CPPFLAGS += -I$(BASE_DIR)/../base-hw/src/include
CPPFLAGS += -I$(BASE_DIR)/src/include
# add C++ sources
SRC_CC += $(GEN_CORE_DIR)/core_log.cc
SRC_CC += $(GEN_CORE_DIR)/core_mem_alloc.cc
SRC_CC += $(GEN_CORE_DIR)/core_rpc_cap_alloc.cc
SRC_CC += $(GEN_CORE_DIR)/cpu_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/cpu_thread_component.cc
SRC_CC += $(GEN_CORE_DIR)/dataspace_component.cc
SRC_CC += $(GEN_CORE_DIR)/default_log.cc
SRC_CC += $(GEN_CORE_DIR)/dump_alloc.cc
SRC_CC += $(GEN_CORE_DIR)/heartbeat.cc
SRC_CC += $(GEN_CORE_DIR)/io_mem_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/main.cc
SRC_CC += $(GEN_CORE_DIR)/pd_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/pd_session_support.cc
SRC_CC += $(GEN_CORE_DIR)/platform_rom_modules.cc
SRC_CC += $(GEN_CORE_DIR)/ram_dataspace_factory.cc
SRC_CC += $(GEN_CORE_DIR)/region_map_component.cc
SRC_CC += $(GEN_CORE_DIR)/rom_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/signal_receiver.cc
SRC_CC += $(GEN_CORE_DIR)/signal_transmitter_noinit.cc
SRC_CC += $(GEN_CORE_DIR)/stack_area.cc
SRC_CC += $(GEN_CORE_DIR)/trace_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/version.cc
CXXFLAGS_$(GEN_CORE_DIR)/version.cc += -DGENODE_VERSION=\"`git describe`\"
SRC_CC += $(TUP_CWD)/capability.cc
SRC_CC += $(TUP_CWD)/core_log_out.cc
SRC_CC += $(TUP_CWD)/core_region_map.cc
SRC_CC += $(TUP_CWD)/cpu_session_support.cc
SRC_CC += $(TUP_CWD)/env.cc
SRC_CC += $(TUP_CWD)/io_mem_session_support.cc
SRC_CC += $(TUP_CWD)/irq_session_component.cc
SRC_CC += $(TUP_CWD)/kernel_log.cc
SRC_CC += $(TUP_CWD)/native_pd_component.cc
SRC_CC += $(TUP_CWD)/native_utcb.cc
SRC_CC += $(TUP_CWD)/pager.cc
SRC_CC += $(TUP_CWD)/platform.cc
SRC_CC += $(TUP_CWD)/platform_pd.cc
SRC_CC += $(TUP_CWD)/platform_thread.cc
SRC_CC += $(TUP_CWD)/ram_dataspace_support.cc
SRC_CC += $(TUP_CWD)/region_map_support.cc
SRC_CC += $(TUP_CWD)/stack_area_addr.cc
SRC_CC += $(TUP_CWD)/thread_start.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/cpu.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/cpu_scheduler.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/double_list.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/init.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/ipc_node.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/irq.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/kernel.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/object.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/signal_receiver.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/thread.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/timer.cc

View File

@ -17,7 +17,7 @@
#include <base/internal/raw_write_string.h>
#include <core_log.h>
#include <kernel/log.h>
#include "kernel/log.h"
void Genode::Core_log::out(char const c) { Kernel::log(c); }

View File

@ -17,7 +17,7 @@
/* core includes */
#include <platform.h>
#include <core_region_map.h>
#include <map_local.h>
#include "map_local.h"
#include <util.h>
#include <base/heap.h>

View File

@ -16,7 +16,7 @@
/* core includes */
#include <cpu_session_component.h>
#include <kernel/configuration.h>
#include "kernel/configuration.h"
using namespace Genode;

View File

@ -13,12 +13,11 @@
*/
/* base-hw includes */
#include <kernel/core_interface.h>
#include "kernel/core_interface.h"
/* core includes */
#include <kernel/irq.h>
#include "kernel/irq.h"
#include <irq_root.h>
#include <irq_args.h>
#include <core_env.h>
/* base-internal includes */
@ -35,10 +34,7 @@ unsigned Irq_session_component::_find_irq_number(const char * const args)
void Irq_session_component::ack_irq()
{
using Kernel::User_irq;
if (!_sig_cap.valid()) { return; }
User_irq * const kirq = reinterpret_cast<User_irq*>(&_kernel_object);
Kernel::ack_irq(kirq);
if (_kobj.constructed()) Kernel::ack_irq(*_kobj);
}
@ -51,8 +47,8 @@ void Irq_session_component::sigh(Signal_context_capability cap)
_sig_cap = cap;
if (Kernel::new_irq((addr_t)&_kernel_object, _irq_number,
Capability_space::capid(_sig_cap)))
if (!_kobj.create(_irq_number, _irq_args.trigger(), _irq_args.polarity(),
Capability_space::capid(_sig_cap)))
warning("invalid signal handler for IRQ ", _irq_number);
}
@ -61,18 +57,16 @@ Irq_session_component::~Irq_session_component()
{
using namespace Kernel;
User_irq * kirq = reinterpret_cast<User_irq*>(&_kernel_object);
_irq_alloc.free((void *)(addr_t)_irq_number);
if (_sig_cap.valid())
Kernel::delete_irq(kirq);
}
Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
const char * const args)
:
_irq_number(Platform::irq(_find_irq_number(args))), _irq_alloc(irq_alloc),
_is_msi(false), _address(0), _value(0)
: _irq_args(args),
_irq_number(Platform::irq(_irq_args.irq_number())),
_irq_alloc(irq_alloc),
_kobj(), _is_msi(false), _address(0), _value(0)
{
const long mmconf =
Arg_string::find_arg(args, "device_config_phys").long_value(0);
@ -89,8 +83,4 @@ Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
error("unavailable interrupt ", _irq_number, " requested");
throw Service_denied();
}
Irq_args const irq_args(args);
Kernel::irq_mode(_irq_number, irq_args.trigger(), irq_args.polarity());
}

View File

@ -31,6 +31,7 @@ namespace Kernel
class Vm;
class User_irq;
using Native_utcb = Genode::Native_utcb;
template <typename T> class Core_object_identity;
/**
* Kernel names of the kernel calls
@ -60,15 +61,14 @@ namespace Kernel
constexpr Call_arg call_id_delete_obj() { return 122; }
constexpr Call_arg call_id_cancel_thread_blocking() { return 123; }
constexpr Call_arg call_id_new_core_thread() { return 124; }
constexpr Call_arg call_id_irq_mode() { return 125; }
/**
* Invalidate TLB entries for the `pd` in region `addr`, `sz`
*/
inline void invalidate_tlb(Pd * const pd, addr_t const addr,
inline void invalidate_tlb(Pd & pd, addr_t const addr,
size_t const sz)
{
call(call_id_invalidate_tlb(), (Call_arg)pd, (Call_arg)addr,
call(call_id_invalidate_tlb(), (Call_arg)&pd, (Call_arg)addr,
(Call_arg)sz);
}
@ -79,9 +79,9 @@ namespace Kernel
* \param thread kernel object of the targeted thread
* \param quota new CPU quota value
*/
inline void thread_quota(Kernel::Thread * const thread, size_t const quota)
inline void thread_quota(Kernel::Thread & thread, size_t const quota)
{
call(call_id_thread_quota(), (Call_arg)thread, (Call_arg)quota);
call(call_id_thread_quota(), (Call_arg)&thread, (Call_arg)quota);
}
@ -104,9 +104,9 @@ namespace Kernel
* continue the execution of a thread no matter what state the thread is
* in.
*/
inline void pause_thread(Thread * const thread)
inline void pause_thread(Thread & thread)
{
call(call_id_pause_thread(), (Call_arg)thread);
call(call_id_pause_thread(), (Call_arg)&thread);
}
@ -115,9 +115,9 @@ namespace Kernel
*
* \param thread pointer to thread kernel object
*/
inline void resume_thread(Thread * const thread)
inline void resume_thread(Thread & thread)
{
call(call_id_resume_thread(), (Call_arg)thread);
call(call_id_resume_thread(), (Call_arg)&thread);
}
@ -132,11 +132,11 @@ namespace Kernel
* \retval 0 suceeded
* \retval !=0 failed
*/
inline int start_thread(Thread * const thread, unsigned const cpu_id,
Pd * const pd, Native_utcb * const utcb)
inline int start_thread(Thread & thread, unsigned const cpu_id,
Pd & pd, Native_utcb & utcb)
{
return call(call_id_start_thread(), (Call_arg)thread, cpu_id,
(Call_arg)pd, (Call_arg)utcb);
return call(call_id_start_thread(), (Call_arg)&thread, cpu_id,
(Call_arg)&pd, (Call_arg)&utcb);
}
@ -155,9 +155,9 @@ namespace Kernel
* limit the time a parent waits for a server when closing a session
* of one of its children.
*/
inline void cancel_thread_blocking(Thread * const thread)
inline void cancel_thread_blocking(Thread & thread)
{
call(call_id_cancel_thread_blocking(), (Call_arg)thread);
call(call_id_cancel_thread_blocking(), (Call_arg)&thread);
}
@ -167,10 +167,10 @@ namespace Kernel
* \param thread pointer to thread kernel object
* \param signal_context_id capability id of the page-fault handler
*/
inline void thread_pager(Thread * const thread,
capid_t const signal_context_id)
inline void thread_pager(Thread & thread,
capid_t const signal_context_id)
{
call(call_id_thread_pager(), (Call_arg)thread, signal_context_id);
call(call_id_thread_pager(), (Call_arg)&thread, signal_context_id);
}
@ -179,9 +179,9 @@ namespace Kernel
*
* \param vm pointer to vm kernel object
*/
inline void run_vm(Vm * const vm)
inline void run_vm(Vm & vm)
{
call(call_id_run_vm(), (Call_arg) vm);
call(call_id_run_vm(), (Call_arg) &vm);
}
@ -190,33 +190,9 @@ namespace Kernel
*
* \param vm pointer to vm kernel object
*/
inline void pause_vm(Vm * const vm)
inline void pause_vm(Vm & vm)
{
call(call_id_pause_vm(), (Call_arg) vm);
}
/**
* Create an interrupt object
*
* \param p memory donation for the irq object
* \param irq_nr interrupt number
* \param signal_context_id capability id of the signal context
*/
inline int new_irq(addr_t const p, unsigned irq_nr,
capid_t signal_context_id)
{
return call(call_id_new_irq(), (Call_arg) p, irq_nr, signal_context_id);
}
/**
* Set trigger/polaruty of IRQ
* \param irq_nr interrupt number
* \param trigger low or edge
* \param polarity low or high
*/
inline void irq_mode(unsigned irq_nr, unsigned trigger, unsigned polarity)
{
call(call_id_irq_mode(), irq_nr, trigger, polarity);
call(call_id_pause_vm(), (Call_arg) &vm);
}
/**
@ -224,40 +200,9 @@ namespace Kernel
*
* \param irq pointer to interrupt kernel object
*/
inline void ack_irq(User_irq * const irq)
inline void ack_irq(User_irq & irq)
{
call(call_id_ack_irq(), (Call_arg) irq);
}
/**
* Destruct an interrupt object
*
* \param irq pointer to interrupt kernel object
*/
inline void delete_irq(User_irq * const irq)
{
call(call_id_delete_irq(), (Call_arg) irq);
}
/**
* Create a new object identity for a thread
*
* \param dst memory donation for the new object
* \param cap capability id of the targeted thread
*/
inline capid_t new_obj(void * const dst, capid_t const cap)
{
return call(call_id_new_obj(), (Call_arg)dst, (Call_arg)cap);
}
/**
* Destroy an object identity
*
* \param dst pointer to the object identity object
*/
inline void delete_obj(void * const dst)
{
call(call_id_delete_obj(), (Call_arg)dst);
call(call_id_ack_irq(), (Call_arg) &irq);
}
}

View File

@ -13,11 +13,11 @@
*/
/* core includes */
#include <kernel/cpu.h>
#include <kernel/kernel.h>
#include <kernel/thread.h>
#include <kernel/irq.h>
#include <kernel/pd.h>
#include "cpu.h"
#include "kernel.h"
#include "thread.h"
#include "irq.h"
#include "pd.h"
#include <board.h>
#include <hw/assert.h>
#include <hw/boot_info.h>
@ -157,10 +157,10 @@ addr_t Cpu::stack_start() {
return (addr_t)&kernel_stack + KERNEL_STACK_SIZE * (_id+1); }
Cpu::Cpu(unsigned const id, Board::Pic & pic,
Cpu::Cpu(unsigned const id,
Inter_processor_work_list & global_work_list)
:
_id(id), _pic(pic), _timer(*this),
_id(id), _timer(*this),
_scheduler(&_idle, _quota(), _fill()), _idle(*this),
_ipi_irq(*this),
_global_work_list(global_work_list)
@ -174,7 +174,7 @@ Cpu::Cpu(unsigned const id, Board::Pic & pic,
bool Cpu_pool::initialize()
{
unsigned id = Cpu::executing_id();
_cpus[id].construct(id, _pic, _global_work_list);
_cpus[id].construct(id, _global_work_list);
return --_initialized == 0;
}

View File

@ -19,10 +19,10 @@
/* core includes */
#include <board.h>
#include <kernel/cpu_context.h>
#include <kernel/irq.h>
#include <kernel/inter_processor_work.h>
#include <kernel/thread.h>
#include "cpu_context.h"
#include "irq.h"
#include "inter_processor_work.h"
#include "thread.h"
namespace Kernel
{
@ -69,6 +69,7 @@ namespace Kernel
* publicly provide via a 'typedef Genode::Cpu::Arch_regs Arch_regs'.
* Then, the 'Genode::Cpu' could be inherited privately.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
class Kernel::Cpu : public Genode::Cpu, private Irq::Pool, private Timeout
@ -112,7 +113,7 @@ class Kernel::Cpu : public Genode::Cpu, private Irq::Pool, private Timeout
unsigned const _id;
Board::Pic &_pic;
Board::Pic _pic {};
Timer _timer;
Cpu_scheduler _scheduler;
Idle_thread _idle;
@ -132,7 +133,7 @@ class Kernel::Cpu : public Genode::Cpu, private Irq::Pool, private Timeout
/**
* Construct object for CPU 'id'
*/
Cpu(unsigned const id, Board::Pic & pic,
Cpu(unsigned const id,
Inter_processor_work_list & global_work_list);
static inline unsigned primary_id() { return 0; }
@ -191,7 +192,6 @@ class Kernel::Cpu_pool
{
private:
Board::Pic _pic {};
Inter_processor_work_list _global_work_list {};
unsigned _count;
unsigned _initialized { _count };

View File

@ -16,8 +16,8 @@
#define _CORE__KERNEL__CPU_CONTEXT_H_
/* core includes */
#include <kernel/cpu_scheduler.h>
#include <kernel/timer.h>
#include "cpu_scheduler.h"
#include "timer.h"
namespace Kernel
{

View File

@ -11,7 +11,7 @@
* under the terms of the GNU Affero General Public License version 3.
*/
#include <kernel/cpu.h>
#include "cpu.h"
using namespace Kernel;
@ -46,4 +46,6 @@ void Cpu::trigger_ip_interrupt()
}
Cpu::Ipi::Ipi(Cpu & cpu) : Irq(Board::Pic::IPI, cpu), cpu(cpu) { }
Cpu::Ipi::Ipi(Cpu & cpu)
: Irq(Board::Pic::IPI, cpu), cpu(cpu) {
cpu.pic().unmask(Board::Pic::IPI, cpu.id()); }

View File

@ -13,7 +13,7 @@
#include <base/log.h>
#include <hw/assert.h>
#include <kernel/cpu_scheduler.h>
#include "cpu_scheduler.h"
using namespace Kernel;

View File

@ -17,8 +17,8 @@
/* core includes */
#include <util.h>
#include <util/misc_math.h>
#include <kernel/configuration.h>
#include <kernel/double_list.h>
#include "configuration.h"
#include "double_list.h"
namespace Kernel
{

View File

@ -11,7 +11,7 @@
* under the terms of the GNU Affero General Public License version 3.
*/
#include <kernel/cpu.h>
#include "cpu.h"
void Kernel::Cpu::Ipi::occurred() { }

View File

@ -12,7 +12,7 @@
*/
/* core includes */
#include <kernel/double_list.h>
#include "double_list.h"
using namespace Kernel;

View File

@ -13,10 +13,10 @@
*/
/* core includes */
#include <kernel/pd.h>
#include <kernel/cpu.h>
#include <kernel/kernel.h>
#include <kernel/lock.h>
#include "pd.h"
#include "cpu.h"
#include "kernel.h"
#include "lock.h"
#include <platform_pd.h>
#include <board.h>
#include <platform_thread.h>

View File

@ -20,10 +20,10 @@
/* core includes */
#include <platform_pd.h>
#include <kernel/ipc_node.h>
#include <kernel/pd.h>
#include <kernel/kernel.h>
#include <kernel/thread.h>
#include "ipc_node.h"
#include "pd.h"
#include "kernel.h"
#include "thread.h"
using namespace Kernel;

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