Compare commits

...

766 Commits
14.08 ... 15.05

Author SHA1 Message Date
Christian Helmuth
03bf8edb91 version: 15.05 2015-05-26 10:33:44 +02:00
Norman Feske
f0e9cead0c News item for Genode 15.05 2015-05-26 10:33:02 +02:00
Norman Feske
a26d4827eb Release notes for version 15.05 2015-05-26 10:33:02 +02:00
Christian Helmuth
aef593b57f doc: update of doc/components.txt 2015-05-26 10:33:02 +02:00
Norman Feske
bf031b174a demo.run: start scout at startup
To be consistent with the documentation, we have to start scout instead
of launchpad right at the start of the default demo scenario.
2015-05-26 09:40:05 +02:00
Christian Helmuth
3384d3d23c linux: fix issue with pointer to rvalue struct member 2015-05-26 09:40:05 +02:00
Christian Prochaska
918895a4f4 vfs: increment 'seek_offset' in block file system
Fixes #1535
2015-05-26 09:40:04 +02:00
Martin Stein
8a99c08ae4 hw: always panic on removal of scheduler head
Because of helping, it is possible that a core thread that wants to
destroy another thread at the kernel is using the scheduling context of
the thread that shall be destroyed at this point in time. When building
without GENODE_RELEASE defined, this always triggers an assertion in the
kernel. But when building with GENODE_RELEASE defined, this might silently
lead to kernel-memory corruption. This commit eliminates the latter case.
Should be reverted as soon as the scheduler is able to remove its head.

Ref #1537
2015-05-26 09:40:04 +02:00
Stefan Kalkowski
28804e2bfb base: remove cap_integrity test (fix #1536) 2015-05-26 09:40:04 +02:00
Emery Hemingway
5fc8ed3e6b file system servers must not use null tx buffers
Fixes #1534
2015-05-26 09:40:04 +02:00
Stefan Kalkowski
e081554731 hw: kernel backed capabilities (Fix #1443) 2015-05-26 09:40:04 +02:00
Stefan Kalkowski
4431ab7354 hw_x86_64: fix kernel stack initialization
Fix #1533
2015-05-26 09:40:04 +02:00
Christian Prochaska
197be2602f Check if the required GCC version is used
Fixes #1531
2015-05-26 09:40:03 +02:00
Stefan Kalkowski
db5e4f70f1 hw: replace 'placement new' with 'construct_at<>'
Placement new can be misleading, as we already overload the new operator
to construct objects via pointers to allocators. To prohibit any problems here,
and to use one consistent approach, we can explicitely construct the object
with the already available 'construct_at' template function.

Ref #1443
2015-05-26 09:40:03 +02:00
Stefan Kalkowski
b8f178e647 hw: move MMU-related functions into Address_space
* Introduce a hw specific Address_space interface for protection
  domains, which combines all memory-virtualization related functionality
* Introduce a core-specific Platform_pd object that solves all the hen-egg
  problems formerly distributed in kernel and core-platform code

Ref #595
Ref #1443
2015-05-26 09:40:03 +02:00
Stefan Kalkowski
d4c55bec2a hw: implement 'Address_space' interface
Ref #595
Ref #1443
2015-05-26 09:40:03 +02:00
Stefan Kalkowski
554146d39c base: enforce ram_quota donations to be consistent
For several basic sessions that core provides default ram quota values
exist in the form of enum values. They are used e.g. by init to deduce
session costs. Unfortunately they were not used when actually establishing
the session, which lead to inconsistencies.

Ref #1443
2015-05-26 09:40:03 +02:00
Stefan Kalkowski
a93266548f base: remove unused enum from object pool
Ref #1443
2015-05-26 09:40:03 +02:00
Stefan Kalkowski
217f62b89d base: move retry template function to util header
Ref #1443
2015-05-26 09:40:03 +02:00
Stefan Kalkowski
64bfe233d7 base: make CAP session upgradeable
* Introduce 'Out_of_metadata' exception for capability allocation

Ref #1443
2015-05-26 09:40:02 +02:00
Stefan Kalkowski
73c3a81e0b base: make PD session upgradeable
Ref #1443
2015-05-26 09:40:02 +02:00
Sebastian Sumpf
2d41f13229 base-foc: update commit and hash 2015-05-26 09:40:02 +02:00
Christian Prochaska
a30e29b9c2 ports-foc: remove balloon server
Fixes #1514
2015-05-26 09:40:02 +02:00
Christian Prochaska
caa61c268b seoul: adapt port files to the updated repository
Fixes #1526
2015-05-26 09:40:02 +02:00
Norman Feske
da0ee84a7d sel4: 3rd article - porting core to seL4 2015-05-26 09:40:02 +02:00
Norman Feske
cada11b553 Add sel4_x86_32 to create_builddir tool 2015-05-26 09:40:01 +02:00
Norman Feske
66dd065163 sel4: use LOG console for non-core components 2015-05-26 09:40:01 +02:00
Norman Feske
a748dfbc5c sel4: implementation of Rm_client::unmap 2015-05-26 09:40:01 +02:00
Norman Feske
da2db02ebd sel4: disable page-fault logging 2015-05-26 09:40:01 +02:00
Norman Feske
84c5437437 sel4: initialization of non-main threads 2015-05-26 09:40:01 +02:00
Norman Feske
06d143d51f sel4: receive-sel handling for early IPC 2015-05-26 09:40:01 +02:00
Norman Feske
3259185bfc sel4: import parent cap into non-core components 2015-05-26 09:40:01 +02:00
Norman Feske
1ea22f82fa sel4: core support for IPC of non-core PDs
This patch installs the parent endpoint selector and the PD's CNode into
a PD at its creation time. Furthermore, it initializes the IPC buffer
for the main thread of the new component.
2015-05-26 09:40:00 +02:00
Norman Feske
acd7a2f1c4 sel4: reserve virt page for main-thread IPC buffer 2015-05-26 09:40:00 +02:00
Norman Feske
38db52e7f5 sel4: non-core capability-space implementation 2015-05-26 09:40:00 +02:00
Norman Feske
d6e3e47348 sel4: use core_printf for non-core components
This allows us to see debug messages printed at the eary initialization
of init (before init is able to obtain the regular LOG session). This
will be reverted as soon as the initialziation of the non-core base
environment works.
2015-05-26 09:40:00 +02:00
Norman Feske
5a05521e0f sel4: bootstrap of init and page-fault handling 2015-05-26 09:40:00 +02:00
Norman Feske
691f0eaae7 sel4: link core to different address
This enables us to debug core and non-core using Qemu's GDB stub.
2015-05-26 09:40:00 +02:00
Norman Feske
11b9a0f376 sel4: definition of non-core cap-space parameters 2015-05-26 09:39:59 +02:00
Norman Feske
f19f454ae5 sel4: move core to a libaray, add boot_modules.s 2015-05-26 09:39:59 +02:00
Norman Feske
51f02340b6 sel4: avoid superfluous header re-generation 2015-05-26 09:39:59 +02:00
Norman Feske
56ec0ad172 sel4: add base.mk lib to build and link init 2015-05-26 09:39:59 +02:00
Norman Feske
6ffba0e473 sel4: IPC implementation 2015-05-26 09:39:59 +02:00
Norman Feske
ff46d02c48 sel4: capability lifetime management 2015-05-26 09:39:59 +02:00
Norman Feske
595e86ca2e sel4: assert macro 2015-05-26 09:39:59 +02:00
Norman Feske
95c3e896dd sel4: add include/kernel_object.h utilties 2015-05-26 09:39:58 +02:00
Norman Feske
0a32bc845f sel4: RAM-session supplements 2015-05-26 09:39:58 +02:00
Norman Feske
bf4b260ce1 sel4: unmapping of virtual memory 2015-05-26 09:39:58 +02:00
Norman Feske
262f52723b sel4: block on first call if Ipc_istream::_wait 2015-05-26 09:39:58 +02:00
Norman Feske
8f535d5371 sel4: enter real thread function 2015-05-26 09:39:58 +02:00
Norman Feske
41b99a6b51 sel4: use yielding spinlock for 'Genode::Lock' 2015-05-26 09:39:58 +02:00
Norman Feske
f24b212e47 sel4: core-local thread creation 2015-05-26 09:39:58 +02:00
Norman Feske
e6ad346e24 sel4: management of core's virtual memory 2015-05-26 09:39:57 +02:00
Norman Feske
1f5cfef64e sel4: switch to core's custom cspace layout 2015-05-26 09:39:57 +02:00
Norman Feske
de8bfb37f9 sel4: initialization of core's allocators 2015-05-26 09:39:57 +02:00
Norman Feske
633f335171 sel4: core skeleton 2015-05-26 09:39:57 +02:00
Norman Feske
b8c107ceb2 sel4: let run tool support core and non-core tests 2015-05-26 09:39:57 +02:00
Norman Feske
65a74cf5e0 sel4: complement base-common.mk
This patch extends the base-common library with the symbols needed to
link core.
2015-05-26 09:39:57 +02:00
Norman Feske
885e9333ac sel4: don't use base-common.mk in test roottask
To build core and other Genode components, we will need to extend the
base-common.mk library with additions that conflict with the
minimalistic root-task environment of test/sel4. To preserve the
minimalistic root task, we need to decouple it from the base-common
library.
2015-05-26 09:39:56 +02:00
Norman Feske
c73b6e9c0d sel4: move core console to core_printf library 2015-05-26 09:39:56 +02:00
Norman Feske
e3cb8d48f7 sel4: never compile syscall-using code with -fPIC 2015-05-26 09:39:56 +02:00
Norman Feske
1314bd3b2a sel4: notes about virtual memory management 2015-05-26 09:39:56 +02:00
Norman Feske
9bf7a240fc sel4: test the use of memory mappings 2015-05-26 09:39:56 +02:00
Norman Feske
58481fe35d sel4: use largest untyped range 2015-05-26 09:39:56 +02:00
Norman Feske
37c266327f sel4: capability overmap test 2015-05-26 09:39:56 +02:00
Norman Feske
418f2ab119 sel4: testing the unwrapping of capabilities 2015-05-26 09:39:55 +02:00
Norman Feske
33c2bc3bf2 sel4: capability delegation test 2015-05-26 09:39:55 +02:00
Norman Feske
03010831cd sel4: adapt article to new version of run tool 2015-05-26 09:39:55 +02:00
Norman Feske
1fdf36efed sel4: IPC between two threads 2015-05-26 09:39:55 +02:00
Norman Feske
45b90aa898 sel4: review of the first article 2015-05-26 09:39:55 +02:00
Norman Feske
68671dbc2f sel4: preemptive scheduling 2015-05-26 09:39:55 +02:00
Norman Feske
40c48c4538 sel4: thread creation 2015-05-26 09:39:54 +02:00
Norman Feske
9bf7568909 sel4: replace syscalls.patch by macros.patch 2015-05-26 09:39:54 +02:00
Norman Feske
52c4dc8ec8 sel4: print boot info 2015-05-26 09:39:54 +02:00
Norman Feske
6b9185ab34 sel4: enable core console 2015-05-26 09:39:54 +02:00
Norman Feske
666c74345f sel4: add patch for sel4/syscalls.h 2015-05-26 09:39:54 +02:00
Norman Feske
29f58dbd70 sel4: first syscall invokation 2015-05-26 09:39:54 +02:00
Norman Feske
2b24593758 sel4: minimalistic roottask 2015-05-26 09:39:54 +02:00
Norman Feske
456d81f517 New base-sel4 repository 2015-05-26 09:39:53 +02:00
Norman Feske
a96243eebf News item for third seL4 article 2015-05-26 09:39:53 +02:00
Norman Feske
35a52f0282 base: const qualifiers in base/trace/types.h
This patch adds missing const qualifiers to the == operators of
'Subject_id' and 'Policy_id'. Thanks to Pirmin Duss for reporting.
2015-05-26 09:39:53 +02:00
Christian Helmuth
8990346c6c mmio: fix compiler warnings
We implicitly know that the value range will not exceed access_t despite
the integer-based arithmetics, i.e., negation and shift operations.

Fixes #1524
2015-05-26 09:39:53 +02:00
Christian Helmuth
140ecb1238 linux: prevent hybrid-mode compiler warnings 2015-05-26 09:39:53 +02:00
Christian Helmuth
c934ee1650 libc: remove debugging artifact from exit() 2015-05-26 09:39:53 +02:00
Christian Helmuth
b5b9b1789d libcrypto: remove redundant ) from .mk 2015-05-26 09:39:52 +02:00
Christian Helmuth
05dc764935 qt5: prevent compiler warnings 2015-05-26 09:39:52 +02:00
Christian Helmuth
97889935cf pci: fix compiler warning 2015-05-26 09:39:52 +02:00
Christian Helmuth
e9652d765d foc: increase stack size for IRQ handler 2015-05-26 09:39:52 +02:00
Alexander Boettcher
869fac8f76 pci: print irq/msi vector when a device gets used 2015-05-26 09:39:52 +02:00
Alexander Boettcher
dd7ddae0e9 pci: add readme to pci_drv, adjust acpi_drv README 2015-05-26 09:39:52 +02:00
Alexander Boettcher
51b79d7da6 pci: support disabling msis 2015-05-26 09:39:52 +02:00
Christian Prochaska
d9825cd708 codezero: move first container to higher address
Fixes #1525
2015-05-26 09:39:51 +02:00
Christian Helmuth
7d39304050 rpi: fix response initialization in platform_drv
GCC 4.9 legitimately whines that const members of responses must be
initialized on construction.
2015-05-26 09:39:51 +02:00
Christian Helmuth
4dad09203a input_merger: fix compiler warning 2015-05-26 09:39:51 +02:00
Alexander Boettcher
3e90542559 nova: use signals with irqs in core
Avoids the need to have per IRQ a thread that blocks synchronously for next
interrupt. Now a thread may wait for multiple IRQs as other signals
simultaneously.

In core no threads are required anymore for IRQs/MSI - the clients (either
the pci_drv or in case of MSI the driver) gets the IRQ delivered directly as
a ordinary Genode signal.

Useful since #1216 and #1487 is now available.
Commit applies feature of #1446 also to IRQ/MSIs.
2015-05-26 09:39:51 +02:00
Christian Prochaska
d554200e5a x86emu: prevent warnings about uninitialized vars
Fixes #1522
2015-05-26 09:39:51 +02:00
Christian Prochaska
526d6eed1c libc: fix compiler warning
Fixes #1523
2015-05-26 09:39:51 +02:00
Alexander Boettcher
e5930105bb tool_chain: symlink fix
If contrib is a symbolic link using ".." leads to wrong directories.
2015-05-26 09:39:51 +02:00
Christian Helmuth
1ff8a55d7c create_builddir: use acpi spec on hw_x86_64 2015-05-26 09:39:51 +02:00
Norman Feske
e2fe071871 Minor comment refinements for the manual 2015-05-26 09:39:50 +02:00
Reto Buerki
f02c92598b run: Use -m 512 for hw_x86_64 on qemu
The base-hw kernel on x86_64 currently assumes 254 MiB of RAM. The RAM
region is subtracted from the I/O mem allocator and therefore this range
is not available for device I/O.

If qemu is started with -m 128, the region for (emulated) PCI config
space access lies within this region and I/O mem allocation in the
pci_drv will fail. Giving qemu more RAM moves the PCI config space out
of the 254 MiB region, making the run/libc_ffat scenario with acpi work.
2015-05-26 09:39:50 +02:00
Reto Buerki
58178949ef hw_x86_64: Make AHCI driver work
The assumption that IRQs in the legacy ISA range are always
edge-triggered is wrong. For the free-for-use IRQs it depends on the
actual device which uses the specific IRQ. Therefore, treat IRQs 9, 10
and 11 as level-triggered.
2015-05-26 09:39:50 +02:00
Reto Buerki
afec233f50 hw_x86_64: Use _edge_triggered() in _create_irt_entry() 2015-05-26 09:39:50 +02:00
Reto Buerki
5eed6de910 hw_x86_64: Let _edge_triggered() operate on IRQ
Use the base IRQ in the _edge_triggered() utility function, not the
remapped vector.
2015-05-26 09:39:50 +02:00
Reto Buerki
6af893123e hw_x86_64: Only block masking of legacy IRQs
Allow legacy IRQ unmasking. Initially, all IRQs are masked and must be
explicitly unmasked by a driver.
2015-05-26 09:39:50 +02:00
Reto Buerki
e034846f32 hw_x86_64: Initially mask IRQs in _create_irt_entry 2015-05-26 09:39:50 +02:00
Christian Prochaska
e0dbf67e1d tool_chain: enable x86_64 target support in GDB
Fixes #1521
2015-05-26 09:39:49 +02:00
Christian Prochaska
72e31090ee tool_chain: update GCC to version 4.9.2
Fixes #1520
2015-05-26 09:39:49 +02:00
Christian Prochaska
7709059245 tool_chain: update GCC to version 4.8.4
Fixes #1519
2015-05-26 09:39:49 +02:00
Christian Prochaska
b704944d4d tool_chain: update binutils to version 2.25
Fixes #1518
2015-05-26 09:39:49 +02:00
Christian Prochaska
2706e4cd75 tool_chain: cleanup
Fixes #1517
2015-05-26 09:39:49 +02:00
Christian Prochaska
ebcfc28a5b qt5: GCC 4.9 compile fix
Fixes #1515
2015-05-26 09:39:49 +02:00
Emery Hemingway
ed4a821891 jitterentropy: update 20140411 to 1.2.0
Issue #1416
2015-05-26 09:39:48 +02:00
Alexander Boettcher
1f4c8ae92d run: support specifying on/off of softreset tool
With it all relays can be geared.

Fixes #1516
2015-05-26 09:39:48 +02:00
Alexander Boettcher
93c1ef0309 run: build nova kernel on every run invocation
Compared to some other kernels checking the nova source and building is way
faster - so we can spend on each run/* invocation the extra time.
2015-05-26 09:39:48 +02:00
Alexander Boettcher
8fa802815d pci: fix wrong warning about multiple usage
Issue #1487
2015-05-26 09:39:48 +02:00
Alexander Boettcher
ccc0f4c2ec usb: handle quota_exceed exception of pci_drv
Issue #755
2015-05-26 09:39:48 +02:00
Christian Prochaska
493bcc80df dde_rump: don't build non-Genode shared libraries
Fixes #1512
2015-05-26 09:39:48 +02:00
Christian Prochaska
5bf538de0c Noux: implement the 'F_GETFL' 'fcntl()' command for pipes
Fixes #1513
2015-05-26 09:39:48 +02:00
Christian Prochaska
e7f869611c hw: static constexpr function when reinterpret cast is used
Issue #1511
2015-05-26 09:39:47 +02:00
Alexander Boettcher
e84284c0cd base: remove shared irq from core
Cleanup commit after all relevant drivers got adapted to use the x86 platform
driver (pci_drv).

Issue #1471
2015-05-26 09:39:47 +02:00
Alexander Boettcher
3783db66e2 base: implement detach for core context_area
Required to destroy threads within in core. Used when IRQs get reused on
platforms where every IRQ needs a thread in core.

Issue #1471
2015-05-26 09:39:47 +02:00
Christian Prochaska
3a378bb970 libc_noux: remove dependency on 'platform_env.h'
Currently, libc_noux includes the 'base/src/base/env/platform_env.h' file
to be able to reinitialize the environment using the 'Platform_env'
interface. For base-linux, a special version of this file exists and the
inclusion of the generic version in libc_noux causes GCC 4.9 to make wrong
assumptions about the memory layout of the 'Env' object returned by
'Genode::env()'.

This commit moves the reinitialization functions to the 'Env' interface to
avoid the need to include the 'platform_env.h' file in libc_noux.

Fixes #1510
2015-05-26 09:39:47 +02:00
Christian Prochaska
1207a4cecd fiasco: remove 'const' GCC attribute from some functions
Some functions in the kernel, which create a static object and return its
address, are declared with a GCC 'const' attribute, which can cause GCC
4.9 to optimize the function call out and use the static object's address
without calling the constructor.

Fixes #1509
2015-05-26 09:39:47 +02:00
Norman Feske
57c9f2aa43 Fix comment 2015-05-26 09:39:47 +02:00
Norman Feske
33c2bc8ad0 Fix comment 2015-05-26 09:39:46 +02:00
Sebastian Sumpf
bd2e15aeb0 foc: update hash for gcc-4.9 support
see: https://github.com/ssumpf/foc/issues/10
2015-05-26 09:39:46 +02:00
Sebastian Sumpf
8eb2286f60 part_blk: propagate back end information
Propagate supported device operations and read/write errors from back end to
client.
2015-05-26 09:39:46 +02:00
Christian Prochaska
88034ef836 vbox: enable USB (OHCI) pass-through support
The information about connected devices is obtained from a ROM file named
'usb_devices', which is supposed to contain a device list as in the device
report generated by the USB driver (see issue #1506).

A policy for 'report_rom' would look like:

<policy label="vbox -> usb_devices" report="usb_drv -> devices"/>

If the 'usb_devices' ROM file is not available, a warning message gets
printed and VirtualBox continues without USB pass-through support.

The devices to be passed-through need to have a matching device filter in
the '.vbox' file. Example:

<USB>
    <DeviceFilters>
        <DeviceFilter name="USB Scanner" active="true" vendorId="04a9"
                      productId="2220" remote="0"/>
    </DeviceFilters>
</USB>

The feature was tested with HID devices (mouse, keyboard) and a flatbed
scanner. Mass storage devices didn't work correctly (they also didn't work
with VirtualBox on Linux without the closed-source extension pack).

It should be made sure that the USB driver does not try to control the
devices to be passed-through itself, for example, when passing-through
a HID device, the '<hid/>' config option should not be set.

Fixes #1507
2015-05-26 09:39:46 +02:00
Christian Prochaska
2d869dd15e usb_drv: generate a device list report
The report lists all connected devices and gets updated when devices are
added or removed.

Example report:

<devices>
    <device vendor_id="0x17ef" product_id="0x4816"/>
    <device vendor_id="0x0a5c" product_id="0x217f"/>
    <device vendor_id="0x8087" product_id="0x0020"/>
    <device vendor_id="0x8087" product_id="0x0020"/>
    <device vendor_id="0x1d6b" product_id="0x0002"/>
    <device vendor_id="0x1d6b" product_id="0x0002"/>
</devices>

There is no distinction yet for multiple devices of the same type.

The report is named "devices" and an example policy for 'report_rom' would
look like:

<policy label="vbox -> usb_devices" report="usb_drv -> devices"/>

The report only gets generated if enabled in the 'usb_drv' configuration:

<config>
    <raw>
        <report devices="yes"/>
    </raw>
</config>

Fixes #1506
2015-05-26 09:39:46 +02:00
Christian Prochaska
e8f82a1da3 nova: delay UTCB revocation on thread destruction
On NOVA, a Genode thread currently cannot destroy itself by destroying its
own 'Thread' object, because in 'Thread_base::_deinit_platform_thread()'
it cannot call 'Cpu_session::kill_thread()' anymore after it has revoked
its own UTCB.

As solution, the revocation of the UTCB can be delayed until its location
in the context area is needed by a new thread.

Fixes #1505
2015-05-26 09:39:46 +02:00
Christian Prochaska
65d8d4461f vbox: adapt run scripts to new AHCI driver
Fixes #1503
2015-05-26 09:39:46 +02:00
Alexander Boettcher
24a4e486c4 nova: adjust phys and io_mem allocator
Add comments about the way the allocator are filled and make solely acpi
related memory as io_mem available to platform.
2015-05-26 09:39:45 +02:00
Martin Stein
c6417051ce hw & x86: Use register framework for IRTEs
Ref #1494
2015-05-26 09:39:45 +02:00
Martin Stein
6ec39d8df5 hw & x86: Style fixes for cpu_support.h
Ref #1494
2015-05-26 09:39:45 +02:00
Adrian-Ken Rueegsegger
f99fab544a hw_x86_64: Add x86-specific I/O mem allocator init
Enable a platform to specify how the MMIO memory allocator is to be
initialized. On ARM the existing behavior is kept while on x86 the I/O
memory is defined as the entire address space excluding the core only
RAM regions. This aligns the hw_x86_64 I/O memory allocator
initialization with how it is done for other x86 kernels such as NOVA or
Fiasco.
2015-05-26 09:39:45 +02:00
Adrian-Ken Rueegsegger
36b2cf932b hw_x86_64: Initialize complete I/O APIC IRT entries
Also set high 32 bits of I/O APIC redirection table entries.
2015-05-20 17:53:00 +02:00
Adrian-Ken Rueegsegger
f2fe0eccb8 hw_x86_64: Explicitly initialize MXCSR
The assures that the MXCSR is initialized to the recommended value.
2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger
ded302c61c hw_x86_64: Perform lazy FPU state initialization
Perform lazy-initialization of FPU state when it is enabled for the
first time. This assures that the FXSAVE area (including the stored
MXCSR) is always properly setup and initialized to the platform default
values.
2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger
a0ec317753 hw_x86_64: Explicitly set all FPU-related CR flags
Perform all FPU-related setup in the Cpu class' init_fpu function instead of
the general system bring-up assembly code.

Set all required control register 0 and 4 flags according to Intel SDM Vol. 3A,
sections 9.2 and 9.6 instead of only enabling FPU error reporting and OSFXSR.
2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger
5eb75e9e81 hw_x86_64: Add control register 4 to Cpu class 2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger
fdbb073414 hw_x86_64: Log ip on unknown exception 2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger
4d700fe2ae hw_x86_64: Emit debug message on #UD
Print information when handling an undefined instruction exception.
2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger
96149db858 base: Add #UD exception to x86_64 Cpu_state 2015-05-20 17:52:59 +02:00
Adrian-Ken Rueegsegger
370271324e hw_x86_64: Simplify kernel physical init
Merge finish_init_phys_kernel into init_phys_kernel function.
2015-05-20 17:52:58 +02:00
Reto Buerki
bb06826c95 hw_x86_64: Factor out initial PT to separate file
This allows the specification of different initial pagetables for a
platform based on x86_64 (e.g. Muen).
2015-05-20 17:52:58 +02:00
Sebastian Sumpf
9d4f410988 test: block benchmarking 2015-05-20 17:52:58 +02:00
Sebastian Sumpf
ff12ea01d5 blk_cli: add support for test size
'test_size' can be set as parameter in <config> node.
2015-05-20 17:52:58 +02:00
Sebastian Sumpf
7910b5146f ahci: new AHCI driver implementation
Supports native command queueing and multiple ports.
2015-05-20 17:52:58 +02:00
Sebastian Sumpf
33bc63e7c3 os: rename 'bswap' to 'host_to_big_endian' 2015-05-20 17:52:58 +02:00
Josef Söntgen
6a89bd15fd dde_bsd: prefix audio library name
Issue #1498.
2015-05-20 17:52:58 +02:00
Josef Söntgen
11d5f07862 dde_bsd: remove disabling of MSIs
Issue #1498.
2015-05-20 17:52:57 +02:00
Norman Feske
4736488d99 core: change order of _export_ds and _clear_ds
On seL4, we need to convert untyped memory to page frames before being
able to use it as normal memory. There already exists the hook function
'_export_ds' that is principally suitable for such tasks. It is
currently solely used on Linux where we have to create a file for each
dataspace. To make the hook useful also for seL4, we need to call
_export_ds prior _clear_ds. Otherwise, we would try to clear memory that
is still untyped.
2015-05-20 17:52:57 +02:00
Alexander Boettcher
a312d440c8 acpi: use local irq service for pci slave
Fixes base-foc issue on qemu caused by wrong set irq polarity and trigger mode.

Bug introduced in #1471

Issue #1216
2015-05-20 17:52:57 +02:00
Alexander Boettcher
2ceecd44f9 pci: assign device during pci config cmd write
Issue #1216
2015-05-20 17:52:57 +02:00
Alexander Boettcher
3eed3ad329 ahci: use MSIs on x86
- remove code for disabling MSIs

Issue #1216
2015-05-20 17:52:57 +02:00
Alexander Boettcher
b3964f4af1 netperf: test usb30 also for x86
On our test machine the xhci controller has a usb3.0 network adapter attached
and the xhci controller is the only usb controller which has MSI support,
so let us use and test it.

Issue #1216
2015-05-20 17:52:57 +02:00
Alexander Boettcher
ecc9007e84 pci: add msi support to platform driver
Fixes #1216
2015-05-20 17:52:56 +02:00
Alexander Boettcher
d998df3b7f base: extend irq session to support MSIs
Works on base-nova and base-foc, the other kernels have no MSI support.

Issue #1216
2015-05-20 17:39:14 +02:00
Josef Söntgen
b0f900b32b adapt run scripts to new audio_out_drv
Issue #1498.
2015-05-06 16:18:53 +02:00
Josef Söntgen
27e5d48fd0 dde_oss: remove repository
This repository is superseded by the 'dde_bsd' repository.  Though
OSSv4 served us well, its future is uncertain and having active
upstream development is preferable. In addition the ported Intel
HD Audio driver did not work on any Thinpad model newer than T60.

Issue #1498.
2015-05-06 16:18:42 +02:00
Josef Söntgen
49dd9242f7 dde_bsd: add audio drivers ported from OpenBSD
These audio drivers enable support for Intel HD Audio (Azalia) and
Ensoniq AudioPCI (ES1370) compatible soundcards. They are ported
from OpenBSD 5.7.

Fixes #1498.
2015-05-06 16:18:36 +02:00
Josef Söntgen
df04b17594 os: show played times in Audio_out test
The message may be used by a run script to signal successfull testing.

Issue #1498.
2015-05-06 16:18:31 +02:00
Josef Söntgen
4b687f4b1a pci: add AUDIO to alias list
Strictly speaking we make AUDIO an alias for PCI_CLASS_MULTIMEDIA
and ignore any sub class.

Issue #1498.
2015-05-06 16:18:20 +02:00
Christian Helmuth
dcd589d113 l4linux: platform_drv may provide platform session
This is especially true for i.MX53 but is not needed on Arndale
currently.

@skalk the test will still fail each night as we do not have a nic_drv
for imx53...
2015-05-06 12:46:25 +02:00
Christian Prochaska
a4868f8d1d vbox: use interface declarations from 'VirtualBox_XPCOM.h'
Fixes #1499
2015-05-06 12:06:23 +02:00
Christian Prochaska
1001a04883 usb_drv improvements
- send a 'state_change' signal on session creation if the device is
  already attached
- evaluate the status code of a finished asynchronous operation
- return the number of actually transferred bytes for control transfers,
  too

Fixes #1490
2015-05-06 12:01:30 +02:00
Norman Feske
c1cb3a6642 Increase initial block for cxx malloc
This patch avoids the attempt to extend the cxx-local heap during the
startup phase of an application. Originally, the static part of the cxx
was merely 100 bytes, which did not suffice to run the minimalistic test
roottask on seL4.
2015-05-06 11:32:06 +02:00
Norman Feske
89e987b22e base/x86_32: preserve EBX value in crt0 2015-05-06 11:32:06 +02:00
Christian Helmuth
ec954a2278 base-foc: comply with thread limit in core
Fiasco.OC limits the UTCB area for roottask to 16K. Therefore, the
number of threads is limited to 16K / L4_UTCB_OFFSET. (see
kernel/fiasco/src/kern/kernel_thread-std.cpp:94)
2015-05-06 10:55:24 +02:00
Christian Helmuth
6b0723b3bb libc: provide C99 API functions
At least stdcxx needs some C99 functions and depends on _GLIBCXX_USE_C99
for C++11 compatibility.
2015-05-06 10:55:24 +02:00
Christian Helmuth
c6857b3019 thread: remove weak implementation of myself() 2015-05-06 10:55:24 +02:00
Christian Helmuth
2f14f57735 stdcxx: add dependency to libm 2015-05-06 10:55:24 +02:00
Christian Helmuth
5d18e0f23b linux_drivers is obsolete 2015-05-06 10:55:23 +02:00
Martin Stein
7c133add52 hw: acknowledge IRQs via Kernel::ack_irq
In the past, when the user blocked for an IRQ signal, the last signal was
acknowledged automatically thereby unmasking the IRQ. Now, the signal session
got a dedicated RPC for acknowledging IRQs and the HW back-end of that RPC
acknowledged the IRQ signal too. This led to the situation that IRQs were
unmasked twice. However, drivers expect an interrupt to be unmasked only on
the Irq_session::ack_irq and thus IRQ unmasking was moved from
Kernel::ack_signal to a dedicated kernel call.

Fixes #1493
2015-05-06 10:55:23 +02:00
Stefan Kalkowski
e61a3db30d hw: separate function declaration/implementation
Move kernel object functions from its headers to compilation units,
thereby reducing the kernel's text section, cache, and TLB footprint.

Fix #1492
2015-05-06 10:55:23 +02:00
Alexander Boettcher
bc3ba380ae nova: fix check in irq_session destruction
Issue #1456
2015-05-06 10:55:22 +02:00
Alexander Boettcher
b7f2b92dbc pci: restrict usage of pci config space
White list access to ports we actually need for our drivers so far and
deny everything else by default. The extend pci config space dataspace is
currently not used and exposes a potential risk (BAR rewrite) - so deny.

Related to #1487
2015-05-06 10:55:22 +02:00
Alexander Boettcher
729ae0a838 pci: track usage of pci devices by drivers
Warn about if more than one driver uses the same device.

Issue #1487
2015-05-06 10:55:22 +02:00
Alexander Boettcher
6c65e436bf usb: use io_mem on x86 via platform driver
Issue #1487
2015-05-06 10:55:22 +02:00
Alexander Boettcher
a4d6be1b3d wifi: use io mem via device interface
Issue #1487
2015-05-06 10:55:22 +02:00
Alexander Boettcher
b9379a10e7 dde_ipxe: use io mem via device interface
Issue #1487
2015-05-06 10:55:21 +02:00
Alexander Boettcher
65a3be856f pci: provide io mem via device interface
Fixes #1487
2015-05-06 10:55:21 +02:00
Alexander Boettcher
f265b64d6d ps2: use io port via device interface
Issue #1487
2015-05-06 10:55:21 +02:00
Alexander Boettcher
e8854cd998 dde_ipxe: use io ports via device interface
Issue #1487
2015-05-06 10:55:21 +02:00
Alexander Boettcher
b7ca04ddde dde_kit: use io ports via device interface
Issue #1487
2015-05-06 10:55:21 +02:00
Alexander Boettcher
c84817dd7b pci_device:: add convenience phys to virt bar method 2015-05-06 10:55:21 +02:00
Alexander Boettcher
1006571c85 pci: provide io_ports via device interface
Issue #1487
2015-05-06 10:55:20 +02:00
Alexander Boettcher
4e99925c7c vesa: upgrade memory for pci device iteration
Issue #755
2015-05-06 10:55:20 +02:00
Alexander Boettcher
6fa85dfd45 ahci: upgrade memory 2015-05-06 10:55:20 +02:00
Alexander Boettcher
4ead4484ec dde_linux: upgrade quota for wifi
Issue #755
2015-05-06 10:55:20 +02:00
Alexander Boettcher
d37d2bd737 dde_linux: upgrade quota for usb_drv
Issue #755
2015-05-06 10:55:20 +02:00
Alexander Boettcher
828ae3800d dde_ipxe: upgrade quota for nic_drv
Issue #755
2015-05-06 10:55:20 +02:00
Alexander Boettcher
0cf8d75346 dde_kit: upgrade ram support for device iteration
Issue #755
2015-05-06 10:55:20 +02:00
Alexander Boettcher
06e7c947bc pci: use ram quota upgrade mechanism
Fixes #755
2015-05-06 10:55:19 +02:00
Alexander Boettcher
df50d1b29d run: adjust autopilot run scripts to pci changes
Issue #1486
2015-05-06 10:55:19 +02:00
Alexander Boettcher
18b36fb339 acpi: provide pci policy to pci driver
Issue #1486
2015-05-06 10:55:19 +02:00
Alexander Boettcher
e527f6e5ac ps2: use irqs via device interface
Issue #1486 and #1471
2015-05-06 10:55:19 +02:00
Alexander Boettcher
7770a0fbbe pci: enforce policy on device discovery
Fixes #1486
2015-05-06 10:55:19 +02:00
Alexander Boettcher
8743575dcf pci: support discovery of non pci devices
Issue #1486
2015-05-06 10:55:19 +02:00
Alexander Boettcher
e4d663cf41 pci: remove device_cap from dma calls
Issue #1486
2015-05-06 10:55:18 +02:00
Alexander Boettcher
0ed45d92ff base: string length handling fix in Rpc_in_buffer
If a null-terminated string exactly of length MAX (0 byte included) is
provided, it will be handled as invalid because of wrong string size length
checks.

Commit fixes this.

Discovered during #1486 development.
2015-05-06 10:55:18 +02:00
Alexander Boettcher
3c5fb420ca dde_ipxe: use irq via device interface
Issue #1471
2015-05-06 10:55:18 +02:00
Alexander Boettcher
5c1504fd8f wifi: use irq via device interface
Issue #1471
2015-05-06 10:55:18 +02:00
Alexander Boettcher
a58bc84d3e usb: use irq via platform driver or directly
Issue #1471
2015-05-06 10:55:18 +02:00
Alexander Boettcher
6dd9d349fc pci: support shared irqs (x86)
Step to move shared irq handling out of core in the long run. So, use
irq_proxy implementation from base in os and implement shared irq handling
in platform driver of x86 (pci_drv).

Fixes #1471
2015-05-06 10:55:18 +02:00
Alexander Boettcher
31faee3b5c pci: provide irq capability via device interface
Issue #1471
2015-05-06 10:55:17 +02:00
Christian Helmuth
f20b6bdc88 Prevent overlap of stack and thread-context members
Now, Thread::Context provides the first word of the stack to prevent the
overlapping of stack top and the 'stack_base' member.

Fixes #1491
2015-05-06 10:55:17 +02:00
Christian Helmuth
ae61e520d7 run: fail if boot_dir module was not declared 2015-05-06 10:55:17 +02:00
Christian Helmuth
98def2488a thread: move Thread_base::myself() to separate file
The thread library (thread.cc) in base-foc shared 95% of the code with
the generic implementation except myself(). Therefore, its
implementation is now separated from the other generic sources into
myself.cc, which allows base-foc to use a foc-specific primitive to
enable our base libraries in L4Linux.

Issue #1491
2015-05-06 10:55:17 +02:00
Emery Hemingway
55c0a947e4 Move generic fs helpers to os/include/file_system
Fixes #1488
2015-05-06 10:55:17 +02:00
Norman Feske
eecb5cc300 Move OKL4 source code on genode.org
The original download location at wiki.ok-labs.com went down.

Fixes #1489
2015-05-06 10:55:16 +02:00
Alexander Boettcher
50d6d2e922 okl4: fix return value if IPC failed
Otherwise RPC calls to dead/invalid destinations are rated as successful,
which leads to wrong execution paths later on. Triggered by bomb.run where
rm_session.attach() returned as successful with local address set to 0, which
causes un-handled page-faults later on.

Fixes #1480
2015-05-06 10:55:16 +02:00
Christian Helmuth
eee0bf5ab2 init: abort request on invalid route
Fixes #1423
2015-05-06 10:55:16 +02:00
Martin Stein
c9272937e7 CPU session: apply quota via relative weightings
Physical CPU quota was previously given to a thread on construction only
by directly specifying a percentage of the quota of the according CPU
session. Now, a new thread is given a weighting that can be any value.
The physical counter-value of such a weighting depends on the weightings
of the other threads at the CPU session. Thus, the physical quota of all
threads of a CPU session must be updated when a weighting is added or
removed. This is each time the session creates or destroys a thread.

This commit also adapts the "cpu_quota" test in base-hw accordingly.

Ref #1464
2015-05-06 10:55:16 +02:00
Martin Stein
955977b516 hw: syscall for changing a threads physical quota
This commit also extends the "cpu_scheduler" test to test the back-end of the
new syscall.

Ref #1464
2015-04-23 16:51:33 +02:00
Martin Stein
e4f560f39b hw: change round-robin scheduling slice to 10 ms
Previously, it was set to 100 ms which caused a remarkable disadvantage
in reactivity.

Ref #1464
2015-04-23 16:51:33 +02:00
Martin Stein
de9d69a6d7 hw: re-enable kernel tests with the new run env
The new run env doesn't pass the "core_type" parameter at one point
which is why we have to pass it through a global HW-specific variable.

Ref #1464
2015-04-23 16:51:33 +02:00
Josef Söntgen
7a8c088fc6 gems: remove d3m
D3m is superseded by now. Altough there is no direct replacement
combining various other components is equal to its functionality.

Issue #1456.
2015-04-23 16:48:00 +02:00
Josef Söntgen
2c39c75e1c base: remove Irq_connection::wait_for_irq() 2015-04-23 16:48:00 +02:00
Josef Söntgen
0383c68bf6 os: use async IRQ interface in Irq_activation
Issue #1456.
2015-04-23 16:48:00 +02:00
Josef Söntgen
85599c072f os: use async IRQ and server lib in drivers
Use the new asynchronous IRQ interface in the mostly used drivers, e.g.:

* ahci_drv: x86/exynos5
* gpio_drv: imx53/omap4
* input_drv: imx53/dummy
* ps2_drv: x86/pl050
* timer_drv

Now, the Irq_session is requested from Gpio::Session:

From now on we use an asynchronous IRQ interface. To prevent triggering
another GPIO IRQ while currently handling the former one, IRQs must
now by acknowledged explicitly. While here, we also changed the GPIO
session interface regarding IRQ management. The generic GPIO component
now wraps the Irq_session managed by the backend instead of using the
GPIO backend methods directly. A client using the GPIO session may
request the Irq_session_capability by calling
'Gpio::Session::irq_session()' and can use this capability when using
a local Irq_session_client.

Issue #1456.
2015-04-23 16:47:59 +02:00
Josef Söntgen
bfb47cfd4e wifi_drv: use asynchronous IRQ session interface
Issue #1456.
2015-04-23 16:47:59 +02:00
Josef Söntgen
9606abc146 dde_ipxe: remove dde_kit
A long long time ago, in a galaxy^W^W^W we used DDE kit to ease the
porting of purely C based drivers. By now it became clear, that we
do not gain that much by following this approach. DDE kit contains
much generic functionality, which is not used or rather not needed
by most ported drivers. Hence, we implement a slim C wrapper on top
of Genode's C++ APIs, that is especially tailored to the driver.

In addition to removing the dependency on DDE kit, the iPXE driver
now uses the server framework and the newly introduced signal based
IRQ handling.

Issue #1456.
2015-04-23 16:47:58 +02:00
Josef Söntgen
09e96dfdcd dde_kit: use async IRQ session interface
Up to now, dde_kit used the synchronous IRQ session interface. This
interface is going to get deprectated very soon.

Issue #1456.
2015-04-23 16:47:58 +02:00
Alexander Boettcher
faa25e1df6 base: make irq_session asynchronous
second step

options: factor out common parts of irq_session_component.cc
options: use on foc arm no proxy threads

Fixes #1456
2015-04-23 16:47:58 +02:00
Alexander Boettcher
e2cbc7c5b3 base: unify some irq_session headers
remove repos/base-*/include/irq_session headers and use only a unification
from   repos/base/include/irq_session

first step

Issue #1456
2015-04-23 16:47:57 +02:00
Josef Söntgen
2002e1ccba os: remove ATAPI driver
The driver will be superseeded soon by a new AHCI driver that supports
ATAPI devices. There is no IDE support in Gende anymore, however.

Issue #1456.
2015-04-23 16:47:57 +02:00
Norman Feske
97dc9664fe base: move flex_iterator.h to include/util
Fixes #1482
2015-04-17 16:13:22 +02:00
Norman Feske
eaab23c012 base: const-correctness of Allocator interface
This patch adds const qualifiers to the functions Allocator::consumed,
Allocator::overhead, Allocator::avail, and Range_allocator::valid_addr.

Fixes #1481
2015-04-17 16:13:22 +02:00
Norman Feske
847ddbf72e os: Remove new operator from packet_stream.h 2015-04-17 16:13:22 +02:00
Norman Feske
c4dea1057b Document empty Pd_session_client::assign_pci 2015-04-17 16:13:22 +02:00
Norman Feske
e4906ef777 Remove unused GTA01 platform support
This platform (originally added to support the GP2X handheld console)
remains untouched since half a decade.
2015-04-17 16:13:21 +02:00
Norman Feske
270f1068cb os: Move Ring_buffer to Genode namespace
Fixes #1479
2015-04-17 16:13:21 +02:00
Stefan Kalkowski
146292dba9 base-host: remove platform template completely
Fix #1476
2015-04-17 16:13:21 +02:00
Stefan Kalkowski
0188b08f6a hw: construct kernel irq objects on demand
Ref #1443
2015-04-17 16:13:21 +02:00
Stefan Kalkowski
b32af4e0a4 hw: directly reference kernel objects from core
Instead of handing over object ids to the kernel, which has to find them
in object pools then, core can simply use object pointers to reference
kernel objects.

Ref #1443
2015-04-17 16:13:20 +02:00
Stefan Kalkowski
c850462f43 hw: replace kernel's object id allocators
Instead of having an ID allocator per object class use one global allocator for
all. Thereby artificial limitations for the different object types are
superfluent. Moreover, replace the base-hw specific id allocator implementation
with the generic Bit_allocator, which is also memory saving.

Ref #1443
2015-04-17 16:13:20 +02:00
Stefan Kalkowski
2df86cd34b hw: rename bin_* syscalls with delete_*
The verb "bin" in the context of destroying kernel objects seems pretty
unusual in contrast to "delete". When reading "bin" in the context of
systems software an association to something like "binary" is more likely.

Ref #1443
2015-04-17 16:13:20 +02:00
Stefan Kalkowski
b949489641 base: remove local capability from generic base
* Instead of using local capabilities within core's context area implementation
  for stack allocation/attachment, simply do both operations while stack gets
  attached, thereby getting rid of the local capabilities in generic code
* In base-hw the UTCB of core's main thread gets mapped directly instead of
  constructing a dataspace component out of it and hand over its local
  capability
* Remove local capability implementation from all platforms except Linux

Ref #1443
2015-04-17 16:13:20 +02:00
Stefan Kalkowski
a168c9d6ce core: remove global capability id counter
The global capability ID counter is not used by NOVA and Fiasco.OC
and in the future not needed by base-hw too. Thereby, remove the static
counter variable from the generic code base and add it where appropriated.

Ref #1443
2015-04-17 16:13:19 +02:00
Stefan Kalkowski
358380046c base: assign allocator and quota to platform pd
Enable platform specific allocations and ram quota accounting for
protection domains. Needed to allocate object identity references
in the base-hw kernel when delegating capabilities via IPC.
Moreover, it can be used to account translation table entries in the
future.

Ref #1443
2015-04-17 16:13:19 +02:00
Norman Feske
d9d65aa86b base: use reference for ascii_to output argument
Issue #1477
2015-04-17 16:13:19 +02:00
Norman Feske
d884cf1a9a base: unify ascii_to conversion functions
This patch addresses the first point of the issue #1477, namely
replacing the function-template magic by plain function overloads.

Issue #1477
2015-04-13 14:18:16 +02:00
Alexander Boettcher
84a98e18ad tool: add bomb to autopilot list 2015-04-13 14:18:16 +02:00
Christian Helmuth
95c651b4aa Enable drivers for hw_x86_64 in create_builddir 2015-04-13 14:18:16 +02:00
Christian Prochaska
63ebebcfa4 nitpicker: update the 'pointed session' more often
Currently, the 'pointed session' gets updated only when an input event
occurs, but an update is also needed in other situations, for example
when the view under the current mouse position was moved.

With this commit, the 'pointed session' gets updated whenever the
timer-triggered 'handle_input()' function is called.

Fixes #1473
2015-04-13 14:18:15 +02:00
Christian Prochaska
0fd53c7fe4 Extract numeric string arguments with the correct signedness
There are lots of places where a numeric argument of an argument string
gets extraced as signed long value and then assigned to an unsigned long
variable. If the value in the string was negative, it would not be
detected as invalid (and replaced by the default value), but become a
positive bogus value.

With this patch, numeric values which are supposed to be unsigned get
extracted with the 'ulong_value()' function, which returns the default
value for negative numbers.

Fixes #1472
2015-04-13 14:18:15 +02:00
Christian Prochaska
af2cd7175c vbox: enable video acceleration (VBVA)
This commit enables the VirtualBox graphics adapter, provides guest mouse
pointer integration with Nitpicker using the 'vbox_pointer' application
and enhances the VirtualBox run scripts with the configuration of
Nitpicker, input merger and network driver.

Fixes #1474
2015-04-13 14:18:15 +02:00
Christian Helmuth
0ef20f7ece tool/ports: curl timeout and retry in check.mk 2015-04-09 16:04:47 +02:00
Christian Helmuth
0fb5ce0918 base: run mp_server on hw_x86_64 as single core 2015-04-09 16:04:47 +02:00
Norman Feske
8fd30b13ac Consider Raspberry Pi in sd_card.run
Issue #1475
2015-04-09 16:04:47 +02:00
Norman Feske
91e0a5d5dd SD-card driver for the Raspberry Pi
The driver operates in PIO mode only. Depending on the block size (512
bytes versus 128 KiB), it has a troughput of 2 MiB/sec - 10 MiB/sec for
reading and 173 KiB/sec - 8 MiB/sec for writing.

Fixes #1475
2015-04-09 16:04:47 +02:00
Norman Feske
87f13d77c0 Omit timer RPC calls for usleep(0) 2015-04-09 16:04:46 +02:00
Norman Feske
77cba65b7a os: detection of standard-capacity SD cards
This patch enhances the generic SD-card protocol implementation in
sd-card.h with the ability to handle the version 1.0 of the CSD register
(containing the capacity information of older SD cards).
2015-04-09 16:04:46 +02:00
Norman Feske
26442f782b os: add 'clock_rate' to Rpi platform driver 2015-04-09 16:04:46 +02:00
Norman Feske
ea9c2199e8 base: extend emergency dataspace size
The emergency dataspace is used to accommodate the corner case where
a signal context capability is created while issuing the first
resource request. Normally, the attempt to upgrade the signal-session
quota under such a constrained situation would fail. By freeing the
emergency dataspace in this situation, we regain enough quota to
upgrade the signal session.

This is a follow up commit for "base: Raise RAM quota of signal session
to 16K" and fixes the resource_request test on 64-bit platforms.
2015-04-09 16:04:46 +02:00
Norman Feske
eaac3cc1bd Revised API documentation
This patch curates the API documentation to become suitable for the
functional specificaton, which is partially generated from the header
files.
2015-04-09 16:04:46 +02:00
Norman Feske
7441df33c9 Improvements of parse_cxx tool
This patch improves the C++ parser to accommodate the tools for
generating the functional specification from source code:

* Added support for class definitions prefixed with a
  namespace as promoted by Genode's coding style.
* Improves robustness of the parsing of function arguments by
  considering nameless arguments in function declarations, default
  values, varargs.
* Consider const qualfiers in return types.
* Added support for the override, constexpr keywords.
* Parsing of overloaded operators.
* Improved handling of type definitions.
* Added parsing of template arguments.
* Handling of template constructors.
2015-04-09 16:04:45 +02:00
Norman Feske
e1b4408090 os: turn Xml_node::Attribute to Xml_attribute
Moving the XML attribute class to the Genode namespace simplifies the
API.
2015-04-09 16:04:45 +02:00
Norman Feske
394fce110e base: coding style 2015-04-09 16:04:45 +02:00
Norman Feske
13a0c336d9 base: separate the API's 'Thread_base' constructor
The 'Thread_base' class is constructed differently in some special cases
like the main thread or a thread that use a distinct CPU session. The
official API, however, should be clean from such artifacts. Hence, I
separated the official constructor from the other cases.
2015-04-09 16:04:45 +02:00
Norman Feske
0d74435448 base: remove Genode::parent_cap from the API
Components interact with their environments using the Genode::Env class
instead of directly using the parent capability.
2015-04-09 16:04:45 +02:00
Norman Feske
695ac957f4 base: add missing override annotations 2015-04-09 16:04:44 +02:00
Norman Feske
6fc372bcf4 base: add const qualifiers 2015-04-09 16:04:44 +02:00
Christian Prochaska
0e344c9830 vbox: support more mouse event combinations
VirtualBox can receive absolute or relative mouse motion events from the
'Input' service and the VM can support either or both of them. With this
patch, more of the possible combinations are handled.

Fixes #1470
2015-04-09 16:04:44 +02:00
Martin Stein
70aa98d837 hw: fix bug in cancellation of 'await_signal'
There were two bugs. First, the caller of Kernel::await_signal wasn't
re-activated for scheduling. Second, the caller did not memorize that he
doesn't wait on a receiver anymore which had bad side effects on further
signal handling.

Fix #1459
2015-04-09 16:04:44 +02:00
Martin Stein
60e392f0c0 hw: support Wandboard Quad (i.MX6)
The port uses the Cortex-A9 private timer for the kernel and an EPIT as
user timer. It was successfully tested on the Wandboard Quad and the CuBox-i
with the signal test. It lacks L2-cache and Trustzone support by now.

Thanks to Praveen Srinivas (IIT Madras, India) and  Nikolay Golikov (Ksys Labs
LLC, Russia). This work is partially based on their contributions.

Fix #1467
2015-04-09 16:04:43 +02:00
Martin Stein
4f887448c3 hw & cortex_a9: clean-up board_support.h
Change class name according to our common naming scheme and remove unnecessary
'using' directive.

Ref #1467
2015-03-27 12:20:07 +01:00
Norman Feske
9fcce49548 doc: improve coding-style descriptipn, fix #1468
This patch removes a broken link to an external blog posting and adds
an example for the proper use of tabs and spaces instead.
2015-03-27 11:53:35 +01:00
Sebastian Sumpf
1b155dbaa6 libssh: git repo for source retrieval
We now use 'http://git.libssh.org/projects/libssh.git'

Fix #1428
2015-03-27 11:53:35 +01:00
Reto Buerki
c82f5e9269 hw_x86_64: Do not mask edge-triggered interrupts
Do not mask edge-triggered interrupts to avoid losing them while masked,
see Intel 82093AA I/O Advanced Programmable Interrupt Controller
(IOAPIC) specification, section 3.4.2, "Interrupt Mask":

"When this bit is 1, the interrupt signal is masked. Edge-sensitive
interrupts signaled on a masked interrupt pin are ignored (i.e., not
delivered or held pending)"

Or to quote Linus Torvalds on the subject:

"Now, edge-triggered interrupts are a _lot_ harder to mask, because the
Intel APIC is an unbelievable piece of sh*t, and has the edge-detect
logic _before_ the mask logic, so if a edge happens _while_ the device
is masked, you'll never ever see the edge ever again (unmasking will not
cause a new edge, so you simply lost the interrupt)."

So when you "mask" an edge-triggered IRQ, you can't really mask it at
all, because if you did that, you'd lose it forever if the IRQ comes in
while you masked it. Instead, we're supposed to leave it active, and set
a flag, and IF the IRQ comes in, we just remember it, and mask it at
that point instead, and then on unmasking, we have to replay it by
sending a self-IPI." [1]

[1] - http://yarchive.net/comp/linux/edge_triggered_interrupts.html

Ref #1448
2015-03-27 11:53:34 +01:00
Martin Stein
bfe1fac37c hw_x86_64: style fixes
Ref #1448
2015-03-27 11:53:34 +01:00
Stefan Kalkowski
49bffbfe7e os: enable PIT timer for hw_x86_64 platform 2015-03-27 11:53:34 +01:00
Adrian-Ken Rueegsegger
f4cb9101a4 hw: Fix format string for 64 bit platforms
Use the format specifier of the largest possible type and cast the value
to the chosen type. This avoids compiler warnings on x86_64.
2015-03-27 11:53:33 +01:00
Reto Buerki
92efc13a17 hw_x86_64: Add x86-specific IRQ session component
In order to match the I/O APIC configuration, a request for user timer
IRQ 0 is remapped to vector 50 (Board::TIMER_VECTOR_USER), all other
requests are transposed by adding the vector offset 48
(Board::VECTOR_REMAP_BASE).
2015-03-27 11:53:33 +01:00
Adrian-Ken Rueegsegger
f9f74d2930 hw_x86_64: Add VESA resources to x86 MMIO regions
The additional MMIO regions are necessary for emulated graphics devices
of QEMU and Bochs.
2015-03-27 11:53:33 +01:00
Adrian-Ken Rueegsegger
8b8e8c8270 hw_x86_64: Add various drivers to x86
Include PCI, PS2, VESA and Framebuffer drivers on x86_64 platform.
2015-03-27 11:53:33 +01:00
Adrian-Ken Rueegsegger
e5f26fa8db base: Raise RAM quota of signal session to 16K
On base-hw/x86_64 the quota of the signal session is not sufficient due to
the large size of the Signal_session_component. Increasing the quota to
16K avoids signal-context resource exhaustion messages as emmitted by the
run/launcher scenario:

  ...
  Quota exceeded! amount=4096, size=4096, consumed=4096
  failed to allocate signal-context resources
  upgrading quota donation for signal session
  C++ runtime: Genode::Parent::Quota_exceeded
  void* abort(): abort called
  ...

Note: This change increases the quota for all kernels even though it is
      strictly only required for base-hw/x86_64.
2015-03-27 11:53:33 +01:00
Adrian-Ken Rueegsegger
96a3eabe16 hw_x86_64: Log additional information on unknown exception
Provide more information in the log message when an unknown exception
occurs.
2015-03-27 11:53:32 +01:00
Adrian-Ken Rueegsegger
544148bc24 hw_x86_64: Add I/O port allocator to platform
Add the entire I/O port range to the I/O port allocator on x86. Do nothing
on ARM platforms since there are no I/O port resources.
2015-03-27 11:53:32 +01:00
Reto Buerki
5765398741 hw_x86_64: Add x86 platform services to core
Use the x86-specific platform_services.cc file and register the I/O port
session component.
2015-03-27 11:53:32 +01:00
Reto Buerki
28b5e67a8c Update or add hw_x86_64 copyright headers 2015-03-27 11:53:32 +01:00
Adrian-Ken Rueegsegger
ace61c54d6 hw_x86_64: Zero-fill BSS segment in x86_64 crt0.s
Make sure all content of the BSS segment is initialized to zero.
2015-03-27 11:53:32 +01:00
Reto Buerki
69a58c4bd5 hw_x86_64: Set EFLAGS IF, IOPL bits in Cpu::init_thread
Enable interrupts for all threads, set I/O privilege level (IOPL) to 3
for core threads to allow UART access.
2015-03-27 11:53:32 +01:00
Adrian-Ken Rueegsegger
7ce8464b3a hw_x86_64: Enable FPU support
* Enable the use of the FXSAVE and FXRSTOR instructions, see Intel SDM
  Vol. 3C, section 2.5.
* The state of the x87 floating point unit (FPU) is loaded and saved on
  demand.
* Make the cr0 control register accessible in the Cpu class. This is in
  preparation of the upcoming FPU management.
* Access to the FPU is disabled by setting the Task Switch flag in the cr0
  register.
* Access to the FPU is enabled by clearing the Task Switch flag in the cr0
  register.
* Implement FPU initialization
* Add is_fpu_enabled helper function
* Add pointer to CPU lazy state to CPU class
* Init FPU when finishing kernel initialization
* Add function to retry FPU instruction:
    Similar to the ARM mechanism to retry undefined instructions, implement a
    function for retrying an FPU instruction. If a floating-point instruction
    causes an #NM exception due to the FPU being disabled, it can be retried
    after the correct FPU state is restored, saving the current state and
    enabling the FPU in the process.
* Disable FPU when switching to different user context:
    This enables lazy save/restore of the FPU since trying to execute a
    floating point instruction when the FPU is disabled will cause a #NM
    exception.
* Declare constant for #NM exception
* Retry FPU instruction on #NM exception
* Assure alignment of FXSAVE area:
    The FXSAVE area is 512-byte memory region that must be 16-byte aligned. As
    it turns out the alignment attribute is not honored in all cases so add a
    workaround to assure the alignment constraint is met by manually rounding
    the start of the FXSAVE area to the next 16-byte boundary if necessary.
2015-03-27 11:53:31 +01:00
Reto Buerki
c14898703d hw_x86_64: Implement Cpu_idle::exception function
Forward external interrupts during the CPU idle thread to the
_interrupt function.
2015-03-27 11:53:31 +01:00
Reto Buerki
e443b859e6 base: Add x86 RESET pseudo-exception
Define RESET as exception 0xfe. The reset state is only used initially
in the CPU idle exception function.
2015-03-27 11:53:31 +01:00
Reto Buerki
c9c84dd751 base: Move Cpu_exception enum to x86_64 cpu_state.h 2015-03-27 11:53:31 +01:00
Reto Buerki
4e259f7b1e hw_x86_64: Implement LAPIC-based kernel timer
The LAPIC timer is programmed in one-shot mode with vector 32
(Board::TIMER_VECTOR_KERNEL). The timer frequency is measured using PIT
channel 2 as reference (50ms delay).

Disable PIT timer channel 0 since BIOS programs it to fire periodically.
This avoids potential spurious timer interrupts.
2015-03-27 11:53:31 +01:00
Reto Buerki
a21959fc26 hw_x86_64: Implement APIC-based PIC driver
The implementation initializes the Local APIC (LAPIC) of CPU 0 in xapic
mode (mmio register access) and uses the I/O APIC to remap, mask and
unmask hardware IRQs. The remapping offset of IRQs is 48.

Also initialize the legacy PIC and mask all interrupts in order to
disable it.

For more information about LAPIC and I/O APIC see Intel SDM Vol. 3A,
chapter 10 and the Intel 82093AA I/O Advanced Programmable Interrupt
Controller (IOAPIC) specification

Set bit 9 in the RFLAGS register of user CPU context to enable
interrupts on kernel- to usermode switch.
2015-03-27 11:53:31 +01:00
Reto Buerki
557c96a9cb hw_x86_64: Add APIC MMIO to native regions 2015-03-27 11:53:30 +01:00
Reto Buerki
cf100f96af hw_x86_64: Add x86-specific board.h file
The file specifies constants for the LAPIC, I/O APIC MMIO regions plus
the interrupt remapping offset and timer vectors.
2015-03-27 11:53:30 +01:00
Adrian-Ken Rueegsegger
42987a7b2f hw_x86_64: Add mapping for I/O APIC MMIO to initial pt
Make the I/O APIC accessible via its MMIO region by adding a 2 MB large
page mapping at 0xfec00000 with memory type UC.
2015-03-27 11:53:30 +01:00
Adrian-Ken Rueegsegger
c06c21e472 hw_x86_64: Add mapping for APIC MMIO to initial pt
Make the local APIC accessible via its MMIO region by adding a 2 MB
large page mapping at 0xfee00000 with memory type UC.

Note: The mapping is added to the initial page tables to make the APIC
      usable prior to the activation of core's page tables, e.g. in the
      constructor of the timer class.
2015-03-27 11:53:30 +01:00
Reto Buerki
b75b1902f2 hw_x86_64: Provide inb and outb functions for port I/O
The port_io.h file provides the inb and outb functions to perform port
I/O operations.
2015-03-27 11:53:30 +01:00
Reto Buerki
1b3871a3f0 hw_x86_64: Move exception_entry to 0xffff0000
The location in memory is arbitrary but we use the same address as the
ARM architecture. Adjust references to virtual addresses in the mode
transition pages to cope with 64-bit values.
2015-03-27 11:53:30 +01:00
Reto Buerki
147b1ec2b1 hw_x86_64: Adjust parameter type of Message_tpl::prepare_send
Change the type of the local name parameter from unsigned to unsigned
long. Otherwise only 4 bytes are copied on x86_64, leaving 4 bytes of
garbage.
2015-03-27 11:53:29 +01:00
Reto Buerki
16a51b317a hw_x86_64: Implement Cpu_idle::Cpu_idle function
The function is a copy of the ARM version.
2015-03-27 11:53:29 +01:00
Reto Buerki
2ecdf4f729 hw_x86_64: Forward interrupts to _interrupt function
Extend the Thread::exception function to forward external interrupts to
the _interrupt function for processing.
2015-03-27 11:53:29 +01:00
Reto Buerki
d0024e1893 hw_x86_64: Fill _fault_addr from cr2 in _mmu_exception
Use the Cpu::Cr2 register to read the linear page fault address in the
Thread::_mmu_exception function.
2015-03-27 11:53:29 +01:00
Reto Buerki
d553d38ecf hw_x86_64: Model cr2 register in CPU state
Make the cr2 control register accessible in the Cpu class. The register
is needed to retrieve the linear address that caused a page fault.
2015-03-27 11:53:29 +01:00
Reto Buerki
466ad3aed4 hw_x86_64: Implement Thread::_mmu_exception() for x86_64
The function is a copy of the ARM version minus the in_fault
distinction.
2015-03-27 11:53:29 +01:00
Reto Buerki
0992c233bd hw_x86_64: Forward page faults to the _mmu_exception function 2015-03-27 11:53:28 +01:00
Reto Buerki
112ff2609a hw_x86_64: Add Thread::_event implementation
It is an exact copy of the ARM version.
2015-03-27 11:53:28 +01:00
Reto Buerki
83a1b826a3 hw_x86_64: Add supervisor call handling to Thread::exception
Forward supervisor calls to the Thread::_call function for dispatching.
2015-03-27 11:53:28 +01:00
Reto Buerki
0568dcc875 hw_x86_64: Implement Thread::_reg function 2015-03-27 11:53:28 +01:00
Reto Buerki
e5be376f57 hw_x86_64: Declare Thread_reg_id enum for x86_64
Only define IDs of registers which are actually accessed by threads.
2015-03-27 11:53:28 +01:00
Reto Buerki
472c3b6502 hw_x86_64: Use mtc relative addressing for master context 2015-03-27 11:53:28 +01:00
Reto Buerki
080d7d5f8b hw_x86_64: Use mtc relative addressing for _mt_buffer in crt0.s
Until the kernel page tables are active, labels can't be used directly
because the associated pages are not mapped for non-core threads.
2015-03-27 11:53:28 +01:00
Reto Buerki
09c90e5751 hw_x86_64: Set interrupt stack in Tss::Setup 2015-03-27 11:53:27 +01:00
Reto Buerki
9af9dcc02c hw_x86_64: Reserve space for interrupt stack in mtc region
The interrupt stack must reside in the mtc region in order to use it for
non-core threads. The size of the stack is set to 56 bytes in order to
hold the interrupt stack frame plus the additional vector number that is
pushed onto the stack by the ISR.
2015-03-27 11:53:27 +01:00
Reto Buerki
9c44d32dd9 hw_x86_64: Add virt_base paramater to Tss::setup function
The stack pointers (RSP) for privilege levels 0-2 must be setup using an
address in the mtc region to make stack switching work for non-core
threads.
2015-03-27 11:53:27 +01:00
Reto Buerki
15d131b723 hw_x86_64: Use _virt_mtc_addr to calculate ISR base
Call the _virt_mtc_addr function with the _mt_isrs label to calculate
the ISR base address in Idt::setup. Again, assume the address to be
below 0x10000.
2015-03-27 11:53:27 +01:00
Reto Buerki
a5efe04656 hw_x86_64: Add virt_base paramater to Idt::setup function
Use parameter instead of class member variable because it would get
stored into the mtc region otherwise. In a further iteration only the
actual IDT should be saved into the mtc, not the complete class
instance. Currently the class instance size is equal to the IDT table
size.
2015-03-27 11:53:27 +01:00
Reto Buerki
1102b2b562 hw_x86_64: Calculate limit using _mt_gdt_end in Gdt::load 2015-03-27 11:53:27 +01:00
Reto Buerki
6f5ea78a51 hw_x86_64: Prefix gdt labels with _mt
Streamline the naming by prepending the _mt prefix to the gdt labels.
2015-03-27 11:53:26 +01:00
Reto Buerki
69e820e4e3 hw_x86_64: Reload GDTR in Genode::Cpu::init_thread
The GDT reload must happen after the page tables mapping the mtc region
is active, that's why it cannot be done in the Genode::Cpu ctor.
2015-03-27 11:53:26 +01:00
Reto Buerki
968ab15bbb hw_x86_64: Add Genode::Gdt class
The class provides the load() function which reloads the GDTR with the
GDT address in the mtc region. This is needed to make the segments
accessible to non-core threads.

Make the _gdt_start label global to use it in the call to
_virt_mtc_addr().
2015-03-27 11:53:26 +01:00
Reto Buerki
251b270e4b hw_x86_64: Factor out _virt_mtc_addr to mtc_util.h header 2015-03-27 11:53:26 +01:00
Reto Buerki
cfe89996e8 hw_x86_64: Factor out pseudo descriptor class to own header 2015-03-27 11:53:26 +01:00
Reto Buerki
d0f14cb941 hw_x86_64: Use _mt_tss and _mt_begin labels to set TSS base
The TSS descriptor base address is assumed to be below the 0x10000 mark
(only bits 0-15 used) for now.
2015-03-27 11:53:26 +01:00
Reto Buerki
00921e4a5c hw_x86_64: Create Tss instance in mtc region
Use the _mt_tss label and the placement new operator to create the
Tss class instance in the mtc region. Update the hard-coded
TSS base address to use the virtual mtc address.
2015-03-27 11:53:25 +01:00
Reto Buerki
b9fe4a8d48 hw_x86_64: Reserve space for TSS in mtc region 2015-03-27 11:53:25 +01:00
Reto Buerki
34a25d3160 hw_x86_64: Make Tss member functions non-static
Add appropriate Tss object to Genode::Cpu class.
2015-03-27 11:53:25 +01:00
Reto Buerki
ec028ea06f hw_x86_64: Move GDT into mtc region
The GDT must be visible for non-core threads too.
2015-03-27 11:53:25 +01:00
Reto Buerki
bf5118fe54 hw_x86_64: Make _virt_idt_addr member more generic
Add label argument to function and rename it to _virt_mtc_addr. It can
be used to retrieve the virtual mtc address of any given label.
2015-03-27 11:53:25 +01:00
Reto Buerki
b8e2249f51 hw_x86_64: Use _virt_idt_addr member in Idt::load
Load the virtual address in the mode transition pages into Interrupt
Descriptor Table Register (IDTR).
2015-03-27 11:53:25 +01:00
Reto Buerki
9c2d071654 hw_x86_64: Add virt_base argument to Idt::load
The argument specifies the virtual base address of the mode transition
pages.
2015-03-27 11:53:24 +01:00
Reto Buerki
ecaad9ecce hw_x86_64: Add private _virt_idt_address member to Idt class
This function calculates the address of the IDT for a given virtual
mode transition base address.
2015-03-27 11:53:24 +01:00
Reto Buerki
89add00518 hw_x86_64: Create Idt instance in mtc region
Use the _mt_idt label and the placement new operator to create the Idt
instance in the mtc region.
2015-03-27 11:53:24 +01:00
Reto Buerki
9c8109c276 hw_x86_64: Reserve space for IDT on mode transition pages
On exception, the CPU first checks the IDT in order to find the
associated ISR. The IDT must therefore be placed in the mode transition
pages to make them available for non-core threads.
2015-03-27 11:53:24 +01:00
Reto Buerki
d8a10448bb hw_x86_64: Make Idt member functions non-static
Add appropriate Idt object to Genode::Cpu class. Update the hard-coded
TSS base address.
2015-03-27 11:53:24 +01:00
Reto Buerki
e3332c6c53 hw_x86_64: Drop obsolete isr.s assembly file 2015-03-27 11:53:24 +01:00
Reto Buerki
a361fbd2bc hw_x86_64: Move ISR entries to mode transition page
This is needed to make them available for non-core threads which
initially only have the mode transition page mapped.
2015-03-27 11:53:23 +01:00
Reto Buerki
d1a4eaed0d hw_x86_64: Add fake Timer::ms_to_tics implementation
This makes the scheduler happy and it starts scheduling threads.
2015-03-27 11:53:23 +01:00
Adrian-Ken Rueegsegger
4946f21302 hw_x86_64: Set base address and limit of TSS descriptor
The limit is set to match the TSS size - 1 and the base address is
hardcoded to the *current* address of the TSS instance (0x3a1100).

TODO: Set the base address using the 'tss' label. If the TSS descriptor
      format were not so utterly unusable this would be straightforward.
      Changes to the code that indirectly lead to a different location
      of the tss result in #GP since the base address will be invalid.
2015-03-27 11:53:23 +01:00
Adrian-Ken Rueegsegger
58e5f9b2fe hw_x86_64: Jump to actual kernel entry on interrupt 2015-03-27 11:53:23 +01:00
Adrian-Ken Rueegsegger
9f825ffb17 hw_x86_64: Setup and load Task State Segment 2015-03-27 11:53:23 +01:00
Adrian-Ken Rueegsegger
2af5aaa54d hw_x86_64: Add Tss class
The class Genode::Tss represents a 64-bit Task State Segment (TSS) as
specified by Intel SDM Vol. 3A, section 7.7.

The setup function sets the stack pointers for privilege levels 0-2 to
the kernel stack address. The load function loads the TSS segment
selector into the task register.
2015-03-27 11:53:23 +01:00
Adrian-Ken Rueegsegger
793b5264e3 hw_x86_64: Set dpl of syscall IDT entry to 3
Since this IDT entry is called from usermode the descriptor privilege
level must be 3.
2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger
ed06c46233 hw_x86_64: Specify user argument to register mapping
Implement user argument setter and getter support functions. The mapping of
the state registers corresponds to the system call parameter passing
convention.
2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger
16a15237a4 hw_x86_64: Continue execution of the kernel
The instruction pointer is the first field of the master context and can
directly be used as a jump argument, which avoids additional register
copy operations.
2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger
ecfb954eb9 hw_x86_64: Restore kernel stack pointer 2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger
c62b4ea36a hw_x86_64: Restore kernel register values from master context
Set stack pointer to master context and restore kernel register by popping
the values from the master context.
2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger
7b051c0531 hw_x86_64: Restore kernel segment registers
The segment registers are set to reference the kernel data segments of
the GDT.
2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger
fb5946b69c hw_x86_64: Save client register values to context
Point stack to client context region and save registers using push
instructions.

Note that since the push instruction first increments the stack pointer
and then stores the value on the stack, the RSP has to point one field
past RBP before pushing the first register value.
2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger
1035efcf3f hw_x86_64: Save info on interrupt stack to client context
As the kernel entry is called from the interrupt handler the stack
layout is as specified by Intel SDM Vol. 3A, figure 6-8. An additional
vector number is stored at the top of the stack.

Gather the necessary client information from the interrupt stack frame
and store it in the client context.
2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger
3d782282db hw_x86_64: Switch to kernel page tables
After switching to the kernel address space the client context region is
accessible to store the client register values.
2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger
16496af371 hw_x86_64: Create temporary copy of client RAX in kernel entry
Copy client context RAX value to buffer to enable use of RAX as scratch
register.
2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger
43bd925c7f hw_x86_64: Add offset constant for Cpu_state.trapno field 2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger
408cec32f5 base: Add errcode to x86_64 Cpu_state
The new errcode field is used to store the error code that some
interrupts provide (e.g. #PF). Rework mode transition reserved space and
offset constants to match the new CPU_state layout.
2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger
1d762ca254 hw_x86_64: Implement syscall with one to six arguments 2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger
04ad1340d5 hw_x86_64: Add syscall helper macros
The macros are used to assign syscall arguments to specific registers.
Using the AMD64 parameter passing convention avoids additional copying of
variables since the C++ function parameters are already in the right
registers.
2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger
3e779e3ca1 hw_x86_64: Perform the user entry mode transition
The interrupt return instruction in IA-32e mode applies the prepared
interrupt stack frame to set the RFLAGS, CS and SS segment as well as
the RIP and RSP registers. It then continues execution of the user code.

For detailed information refer to Intel SDM Vol. 3A, section 6.14.3.
2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger
ab9d7afa45 hw_x86_64: Finally restore RAX client register value
Set the stack to the mode transition buffer and pop the temporary copy
of the RAX client value into the register.
2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger
1fc867f1d7 hw_x86_64: Switch to client page tables
After activating the client page tables the client context cannot be
accessed any longer. The mode transition buffer however is globally
mapped and can be used to restore the remaining register values.
2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger
172dec209b hw_x86_64: Restore registers to client context values
Set the stack pointer to the R8 field in the client context to enable
restoring registers by popping values of the stack.

After this step the only remaining registers that do not contain client
values are RAX, RSP and RIP.

Note that the client value of RAX is pop'd to the global buffer region as
the register will still be used by subsequent steps. It will be restored to
the value in the buffer area just prior to resuming client code execution.
2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger
60e799f7b4 hw_x86_64: Set segment registers prior to mode transition
The registers for the ds, es, fs and gs segments are hardcoded to GDT
index 4 with requested privilege level set to 3.
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger
fe22858550 hw_x86_64: Adjust EFLAGS of prepared interrupt stack frame
Set I/O privilege level to 3 to allow core to perform port I/O from
userspace. Also make sure the IF flag is cleared for now until interrupt
handling is implemented.
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger
40862a81eb hw_x86_64: Prepare interrupt stack frame in mode transition buffer
Setup an IA-32e interrupt stack frame in the mode transition buffer region.
It will be used to perform the mode switch to userspace using the iret
instruction.

For detailed information about the IA-32e interrupt stack frame refer to
Intel SDM Vol. 3A, figure 6-8.
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger
4b7a5ced3b hw_x86_64: Declare CPU context offset constants
The constants specify offset values of CPU context member variables as
specified by Genode::Cpu_state [1] and Genode::Cpu::Context [2].

[1] - repos/base/include/x86_64/cpu/cpu_state.h
[2] - repos/base-hw/src/core/include/spec/x86/cpu.h
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger
e3f10b5ce2 hw_x86_64: Reserve space for mode transition buffer
Since the buffer stores an IA-32e interrupt stack frame, its size must
be 6 * 8 bytes.
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger
03929b3cc9 hw_x86_64: Add 64-bit user code and data segments to GDT
The new entries specify a 64-bit code segment with DPL 3 at index 3 and a
64-bit data segment with DPL 3 at index 4.

These segments are needed for transitioning to user mode.
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger
51d515c77f hw_x86_64: Explicitly set up segment selectors during boot 2015-03-27 11:53:18 +01:00
Adrian-Ken Rueegsegger
65de09c7a6 hw_x86_64: Reserve space for client context pointer
A pointer to the client context is placed in the mt_client_context_ptr area.
It is used to pass the current client context to the lowlevel mode-switching
assembly code.
2015-03-27 11:53:18 +01:00
Adrian-Ken Rueegsegger
4417fe6201 hw_x86_64: Implementation of IA-32e paging
IA-32e paging translates 48-bit linear addresses to 52-bit physical
addresses. Translation structures are hierarchical and four levels deep.
The current implementation supports regular 4KB and 1 GB and 2 MB large
page mappings.

Memory typing is not yet implemented since the encoded type bits depend
on the active page attribute table (PAT)*.

For detailed information refer to Intel SDM Vol. 3A, section 4.5.

* The default PAT after power up does not allow the encoding of the
  write-combining memory type, see Intel SDM Vol. 3A, section 11.12.4.
* Add common IA-32e paging descriptor type:
    The type represents a table entry and encompasses all fields shared by
    paging structure entries of all four levels (PML4, PDPT, PD and PT).
* Simplify PT entry type by using common descriptor:
    Differing fields are the physical address, the global flag and the memory
    type flags.
* Simplify directory entry type by using common descriptor:
    Page directory entries (PDPT and PD) have an additional 'page size' field
    that specifies if the entry references a next level paging structure or
    represents a large page mapping.
* Simplify PML4 entry type by using common descriptor
    Top-level paging structure entries (PML4) do not have a 'pat' flag and the
    memory type is specified by the 'pwt' and 'pcd' fields only.
* Implement access right merging for directory paging entries
    The access rights for translations are determined by the U/S, R/W and XD
    flags. Paging structure entries that reference other tables must provide
    the superset of rights required for all entries of the referenced table.
    Thus merge access rights of new mappings into existing directory entries to
    grant additional rights if needed.
* Add cr3 register definition:
    The control register 3 is used to set the current page-directory base
    register.
* Add cr3 variable to x86_64 Cpu Context
    The variable designates the address of the top-level paging structure.
* Return current cr3 value as translation table base
* Set context cr3 value on translation table assignment
* Implement switch to virtual mode in kernel
    Activate translation table in init_virt_kernel function by updating the
    cr3 register.
* Ignore accessed and dirty flags when comparing existing table entries
    These flags can be set by the MMU and must be disregarded.
2015-03-27 11:53:18 +01:00
Reto Buerki
c7cadf52a6 hw_x86_64: setup ISR and IDT
* Add isr.s assembler file:
    The file declares an array of Interrupt Service Routines (ISR) to handle
    the exception vectors from 0 to 19, see Intel SDM Vol. 3A, section
    6.3.1.
* Add Idt class:
  * The class Genode::Idt represents an Interrupt Descriptor Table as
    specified by Intel SDM Vol. 3A, section 6.10.
  * The setup function initializes the IDT with 20 entries using the ISR
    array defined in the isr.s assembly file.
* Setup and load IDT in Genode::Cpu ctor:
    The Idt::setup function is only executed once on the BSP.
* Declare ISRs for interrupts 20-255
* Set IDT size to 256
2015-03-27 11:53:18 +01:00
Reto Buerki
6e0f1a4466 hw_x86_64: Adjust size of _mt_master_context
The CPU state in IA-32e mode consists of 20 64-bit registers.
2015-03-27 11:53:18 +01:00
Reto Buerki
0f624cdde7 hw_x86_64: Perform indirect long jump to 64-bit code 2015-03-27 11:53:18 +01:00
Reto Buerki
15d0e86592 hw_x86_64: Load Global Descriptor Table register 2015-03-27 11:53:17 +01:00
Reto Buerki
27191b17ce hw_x86_64: Declare Global Descriptor Table (GDT) in .data
The table specifies a 64-bit code segment descriptor at index 1, a
64-bit data segment descriptor at index 2 and a task segment descriptor
at index 3.
2015-03-27 11:53:17 +01:00
Reto Buerki
59bba7624f hw_x86_64: Set system control flags of cr0 register
Enable paging, write protection, caching and native FPU error reporting,
see Intel SDM Vol. 3A, section 2.5.
2015-03-27 11:53:17 +01:00
Reto Buerki
032fc3b190 hw_x86_64: Enable IA-32e mode and execute-disable
Set bits 8 (LME) and 11 (NXE) in the IA32_EFER MSR to enable IA-32e mode
and execute-disable.
2015-03-27 11:53:17 +01:00
Reto Buerki
d23cd7e5ff hw_x86_64: Load initial pagetable address into cr3 2015-03-27 11:53:17 +01:00
Reto Buerki
bafb893a70 hw_x86_64: Declare initial pagetables in .data segment
The table specifies the initial identity mapping for the memory region
from 2 MiB to 4 MiB using one 2 MiB mapping.
2015-03-27 11:53:17 +01:00
Reto Buerki
be430b9648 hw_x86_64: Enable Physical Address Extension (PAE)
This is a prerequisite for IA-32e mode.
2015-03-27 11:53:16 +01:00
Adrian-Ken Rueegsegger
8c9b79fab0 hw: Use properly sized asm type in boot_modules.s
The boot modules assembled by the generated boot_modules.s file is
accessed from core using struct Bm_header. Unfortunately the assembler
.long directive is synonym to .int [1] and thus has the same size as the
C++ int type and *not* long. Use the matching assembly type .quad in
boot_modules.s when generating the file for 64-bit platforms such as
x86_64.

[1] - https://sourceware.org/binutils/docs/as/Long.html
2015-03-27 11:53:16 +01:00
Adrian-Ken Rueegsegger
3ad0f06b06 hw: Drop unnecessary include in pd.h 2015-03-27 11:53:16 +01:00
Norman Feske
a974726e26 hw: skeleton for building on x86_64
This patch contains the initial code needed to build and bootstrap the
base-hw kernel on x86 64-bit platforms. It gets stuck earlier
because the binary contains 64-bit instructions, but it is started in
32-bit mode. The initial setup of page tables and switch to long mode is
still missing from the crt0 code.
2015-03-27 11:53:16 +01:00
Norman Feske
cc00af85bf Add hw_x86_64 to create_builddir tool 2015-03-27 11:53:16 +01:00
Alexander Boettcher
97758f8468 libc: use correct type for dummy libc functions
as far as possible. Some functions are internal to libc and no public
header are available.

Fixes #1466
2015-03-27 11:53:16 +01:00
Josef Söntgen
e53e6b0c5c vbox: rework network backend
* Handle signals and thereby work asynchronously
* Forward link-state changes to the attached AboveNetwork

Fixes #1465.
2015-03-27 11:53:15 +01:00
Josef Söntgen
19f8666170 vbox_auto_win7_share: adapt to new DHCP behavior
Issue #1327.
2015-03-27 11:53:15 +01:00
Josef Söntgen
be6d8db491 noux_net_netcat: adapt to new DHCP behavior
Issue #1327.
2015-03-27 11:53:15 +01:00
Josef Söntgen
e6cf426d72 run: always append to output buffer
On each execution the output buffer is overriden when run_genode_until
is executed multiple times. Run scripts, that depend on extracting
information after several execution steps, e.g. noux_net_netcat, will
fail to do so. Therefore, we append the newly captured log output to
the old output buffer.

Issue #1327.
2015-03-27 11:53:15 +01:00
Josef Söntgen
88c1ca8e9c lwip: adapt run script to new DHCP behavior
We will always get an IP after the server was started. Therefore, we
have to wait until we see the "got IP" message.

Issue #1327.
2015-03-27 11:53:14 +01:00
Josef Söntgen
c6f33fc0d2 netperf: adapt to link-state change changes
Change the matching mechanism because the IP address message may appear
at any time after starting the netserver when using lwip.

Issue #1327.
2015-03-27 11:53:14 +01:00
Josef Söntgen
2d469cb35c lwip: packet-stream/link-state signals in recv thread
Issue #1327
2015-03-27 11:53:14 +01:00
Josef Söntgen
6c6375aa83 lwip: use netifapi
The netifapi makes sure, that all operations are done in the context of
the tcpip-thread.

Issue #1327.
2015-03-27 11:53:14 +01:00
Josef Söntgen
5518a21692 lwip: clean up patches
Issue #1327.
2015-03-27 11:53:13 +01:00
Josef Söntgen
dd47129bef nic session: link-state change handling
A Nic::Session client can install a signal handler that is used to
propagate changes of the link-state by calling 'link_state_sigh()'.
The actual link state is queried via 'link_state()'.

The nic-driver interface now provides a Driver_notification callback,
which is used to forward link-state changes from the driver to the
Nic::Session_component.

The following drivers now provide real link state: dde_ipxe, nic_bridge,
and usb_drv. Currently, OpenVPN, Linux nic_drv, and lan9118 do not
support link state and always report link up.

Fixes #1327
2015-03-27 11:53:13 +01:00
Josef Söntgen
e4f6fca355 packet_allocator: catch expection when calling free()
If a client acknowledges the same packet more than once, the packet also
gets freed more than once. At the second attempt the underlaying
Bit_array will throw an 'Invalid_clear' exception, which results in an
uncaught exception that leads to an abort() call in the freeing
component.

Fixes #1462.
2015-03-27 11:53:13 +01:00
Stefan Kalkowski
381711dbea hw: extend warning messages to ease debugging
To ease debugging without the need to tweak the kernel every time, and to
support userland developers with useful information this commit extends several
warnings and errors printed by the kernel/core by which thread/application
caused the problem, and what exactly failed.

Fix #1382
Fix #1406
2015-03-27 11:53:13 +01:00
Martin Stein
ff6595f150 hw: enable destruction of IRQ sessions
Implement the missing Irq_session_component destructor.

Fix #1460
2015-03-27 11:53:13 +01:00
Martin Stein
98616a1812 i.MX53: SD-card driver and bench
The driver for the Freescale eSDHCv2 doesn't support the highest
available bus frequency by now and also the bus width may be set to a
higher value but that needs further checks on the capabilities of the
inserted card.

The commits provide a benchmark as it exists for the OMAP4 SDHC driver.

Fix #1458
2015-03-27 11:53:12 +01:00
Martin Stein
c52bf757f0 register: make bitfield-mask methods constexpr
Ref #1458
2015-03-27 11:53:12 +01:00
Alexander Boettcher
7f0460c6a5 launchpad: handle case running out of threads
Fixes #111
2015-03-27 11:53:12 +01:00
Alexander Boettcher
30094ecd48 okl4: check result of bind_thread
Related to #1418
Issue #111
2015-03-27 11:53:12 +01:00
Alexander Boettcher
096d72de90 base: check result of bind_thread
Related to #1418
Issue #111
2015-03-27 11:53:12 +01:00
Alexander Boettcher
c76de84f0a gems: let run decorator-stress on 64bit
Fixes #1247
2015-03-27 11:53:12 +01:00
Alexander Boettcher
b50d707d5b nova: leverage kernel to implement Genode signals
Fixes #1446
2015-03-27 11:53:11 +01:00
Alexander Boettcher
f5329c23b7 nova: update to kernel branch introducing signals
+ adjust syscall headers accordingly

Issue #1446
2015-03-27 11:53:11 +01:00
Alexander Boettcher
1f8fad8fa1 base: refactor signal_transmitter::submit
Move it to platform specific .cc file, so that it may get re-implemented
platform specifically if needed.

Issue #1446
2015-03-19 09:32:52 +01:00
Christian Prochaska
dac3efcc02 vbox: replace too strict assertion with debug message
The 'continue_hw_accelerated' assertion at the end of the recall handler
can fail in situations which are not problematic, for example if the
'Timer' thread has set the 'VMCPU_FF_TIMER' flag in the meantime and
requested a recall afterwards. Since we don't know for sure if a recall is
requested for the other flags as well, the assertion gets replaced by a
debug message, which gets printed if any of the 'not yet verified as safe'
flags is set.

Fixes #1426
2015-03-19 09:25:04 +01:00
Josef Söntgen
9b7e0ce0a5 part_blk: add GPT support
The GUID partition table (GPT) is primarily used by systems using
(U)EFI and is a replacement for the legacy MBR. For now, the current
implementation is able to address up to 128 GUID partition entries
(GPE).

To enable the GPT support in 'part_blk' it has to be configured
accrodingly:

! <start name="part_blk">
! [...]
!   <config use_gpt="yes">
! [...]
! </start>

If 'part_blk' is not able to find a valid GPT header it falls back
to using the MBR.

Current limitations:

Since no endian conversion takes place it only works on LE platforms
and of all characters in the UTF-16 encoded name field of an entry
only the ones included in the ASCII encoding are printed. It also
ignores all GPE attributes.

Issue #1429.
2015-03-19 09:22:37 +01:00
Christian Helmuth
2694b5f9c6 nitpicker: fix refresh of pointer view on stacking
Fixes #1441
2015-03-19 09:17:54 +01:00
Christian Helmuth
d8e50dd366 nitpicker: add hover report
The hover reports provides information about the session currently
pointed-to, i.e., hovered session. It can be enabled by the 'hover'
attribute of nitpicker's 'report' configuration element

  <report hover="yes" />

Fixes #1442
2015-03-19 09:17:36 +01:00
Alexander Boettcher
2a4b67f90b nova: fix syscall bindings for 32bit
The bindings for 32bit did not consider that in the syscall_3 function
edx changes due to the assembly instructions and that in the syscall_4
function edx and ecx change. So, the compiler wrongly assumed that the
content of these registers stayed unchanged.

Fixes #1447
2015-03-19 09:13:32 +01:00
Alexander Boettcher
e664c979b2 base: adjust 'affinity.run' time for vea9x4
remove imx53 since it has a single CPU
2015-03-19 08:57:22 +01:00
Sebastian Sumpf
36e01b720e ldso: Refactor dynamic linker
Issue #1349
2015-03-19 08:57:22 +01:00
Alexander Boettcher
c94145f74d base: run mp_server also on single core setups 2015-03-19 08:57:22 +01:00
Christian Helmuth
5c728cf0c4 linux: log diagnostic message on exceptions
Log the fact that a software exception will terminate the process and
hint about more information available from the Linux kernel log.

Fixes #1457
2015-03-19 08:57:22 +01:00
Norman Feske
560a58e5c6 Move packet stream to Genode namespace, fix #1455 2015-03-19 08:57:22 +01:00
Norman Feske
001b069509 Simplify base/semaphore.h, fix #1453 2015-03-19 08:57:21 +01:00
Norman Feske
d841fbb82e Add missing header in base/signal.h 2015-03-19 08:57:20 +01:00
Norman Feske
45c9739fe7 Remove repos/qt4, fix #1451 2015-03-19 08:57:20 +01:00
Norman Feske
99e7f26b99 Remove base/include/base/errno.h, fix #1450 2015-03-19 08:57:20 +01:00
Norman Feske
2ddf941660 Abandon Init::Traditional_child_policy, fix #1449 2015-03-19 08:57:20 +01:00
Martin Stein
d312f840bd hw: error message on unmap on broken RM clients
In the past, unmap sometimes occured on RM clients that have no thread,
PD, or translation table assigned. However, this shouldn't be the
case anymore.

Fixes #504
2015-03-19 08:57:20 +01:00
Stefan Kalkowski
657646e76e hw: adjust core bootstrap to fit generic process
* Introduce hw-specific crt0 for core that calls e.g.: init_main_thread
* re-map core's main thread UTCB to fit the right context area location
* switch core's main thread's stack to fit the right context area location

Fix #1440
2015-03-19 08:57:19 +01:00
Alexander Boettcher
2ad6a3b934 vbox: support multi touch input events
Fixes #1444
2015-03-19 08:57:19 +01:00
Alexander Boettcher
c745f9b48c nitpicker: forward touch events
Issue #1444
2015-03-19 08:57:19 +01:00
Alexander Boettcher
cd764a6aa6 usb: support multi touch devices
Issue #1444
2015-03-19 08:57:18 +01:00
Alexander Boettcher
71c3fa53da os: add input touch event type
Issue #1444
2015-03-19 08:57:18 +01:00
Stefan Kalkowski
684ce272e6 tool/ports: add tool to check source availability
The 'check_port_source' checks whether all remote sources defined for a given
port are currently available. It returns zero, when all remote resources are
available.

Fix #1430
2015-03-19 08:57:18 +01:00
Reto Buerki
ebfe3d8ff0 hw: Use mtc_size from Cpu class for mtc::SIZE
This decouples the size of the mode transition control region from the
minimal mapping size of the page tables implementation. Rather, the CPU
architecture is able to specify the actual size.

Rationale: For x86_64, we need the mtc region to span two pages in order
to store all the tables required to perform the mode switch.
2015-03-13 12:17:28 +01:00
Reto Buerki
32521cfd71 hw: Declare mtc_size constant in arm/cpu_support.h
This constant specifies the size of the mode transition control region.
2015-03-13 12:17:28 +01:00
Norman Feske
174fdb162f News item for ARM virtualization article 2015-03-13 12:17:28 +01:00
Josef Söntgen
47b0aea30d wifi_drv: use report mechanism in wifi.run
Update the wifi run script to reflect the current configuration
mechanism used by the wifi driver.

Issue #1439.
2015-03-13 12:17:28 +01:00
Josef Söntgen
9d5b119186 wifi_drv: add dummy member to empty structs
The size of empty structs differs in C (0 byte) and C++ (1 byte), which
leads to different offsets in compound structures. This fixes the driver
on 32Bit platforms.

Issue #1439.
2015-03-13 12:17:27 +01:00
Josef Söntgen
36bcc69faf wifi_drv: on timeout return correct remaining time
Issue #1439.
2015-03-13 12:17:27 +01:00
Josef Söntgen
7e69013e0c wifi_drv: store timeout also in timer_list.expires
The wireless stack calls timer_before(foo, timer.expires) and up to now
it was always 0. Let's be save and set this field when scheduling the
timer, although it worked fine so far.

Issue #1439.
2015-03-13 12:17:27 +01:00
Josef Söntgen
88fc1eee61 wifi_drv: add verbose attribute in config node
Among others, the driver will now print the MAC address of the wireless
device when 'verbose="yes"' is added to <config>.

Issue #1439.
2015-03-13 12:17:27 +01:00
Josef Söntgen
c46e3db4d5 wifi_drv: silence 'Slab too large' error
We will always see this error message when the driver is started. It
is expected and not an actual error. When the driver is running it will
not allocate larger chunks than the Slab provides. Therefore, we can
safely ignore this message.

Issue #1439.
2015-03-13 12:17:27 +01:00
Norman Feske
862251fa8e News item about the second seL4 article 2015-03-13 12:17:27 +01:00
Christian Prochaska
c11b02dfd4 gdb: save generated files in the build directory
Fixes #1435
2015-03-13 12:17:26 +01:00
Christian Prochaska
1f7fd647da vbox: wait longer for stable timer state
Some functions in the time manager, for example 'TMTimerSet()' and
'TMTimerStop()' let VirtualBox abort with a failed assertion if the timer
does not change to a 'stable' state after 1000 calls of a mixture of
'yield' and 'sleep'. On Genode, this happens sometimes when the 'EMT'
thread is executing 'TMTimerSet()' and gets interrupted by the 'TAP'
thread, which calls 'TMTimerStop()' and waits for the 'EMT' thread to
finish setting the timer. Since the 'EMT' thread has the lowest priority,
1000 retries can be too few. Without the assertion, these functions would
return an error code, which is often ignored by the caller, so it seems
safer to keep retrying until the function can return successfully.

Fixes #1437
2015-03-13 12:17:26 +01:00
Christian Helmuth
143c703669 vbox: prevent warning 2015-03-13 12:17:26 +01:00
Christian Helmuth
da21a3c338 create_grub2: ext2 default parameters for image
The mkfs.ext2 heuristics select the "small" ext2 usage type, which does
not fit well with GiB-sized pen drives. For example, the block size is
just 1024 bytes compared to 4096 for "default". Therefore, we enforce
the default usage type as this fits our use case of dumping the image to
USB sticks better.
2015-03-13 12:17:26 +01:00
Christian Helmuth
86c0656de0 vbox: cleanup device registration
Patch got lost on win8 merge ;-)
2015-03-13 12:17:25 +01:00
Martin Stein
a5d043443d run/signal: abort "many contexts" if manage fails
Previously, in the manage-many-contexts test we didn't test wether the manage
operations succeed.

Ref #1433
2015-03-13 12:17:25 +01:00
Martin Stein
726e6b3e5d signal: fix infinite loop
Fixes #1433
2015-03-13 12:17:25 +01:00
Josef Söntgen
7923b287d9 wifi_drv: fix find_next_bit function
Among others, this function is used in the for_each_set_big() macro,
which is used when configuring the data rate tables. Therefore, this
fixes observed performance issues.

Fixes #1439.
2015-03-13 12:17:25 +01:00
Josef Söntgen
f94176af3f wifi_drv: handle invalid config_rom and psk
* Only attach the config_rom dataspace if it is valid.
* Check if PSK has a valid length.

Issue #1439.
2015-03-13 12:17:25 +01:00
Josef Söntgen
d443c136ed wpa_supplicant: report quality value
Issue #1439.
2015-03-13 12:17:25 +01:00
Alexander Boettcher
3279346f80 nova: update kernel (fixes endless loop)
If running multiple VBox VMMs with Windows as guest concurrently then it may
happen that the system seem to hang. It turned out that actually
a VM-exit storm (vmx_exception->handle_exc_nm) causes a endless loop between
kernel and vCPU. Nothing gets scheduled nor interrupts are received anymore.
The referenced kernel commit fixes this issue.

Issue #1343
2015-03-13 12:17:24 +01:00
Christian Helmuth
d6f9725548 libc: fix compiler warning (issue #1434) 2015-03-13 12:17:24 +01:00
Emery Hemingway
f2d6e38cb4 fb_sdl: set size from config
Issue #1414
2015-03-13 12:17:24 +01:00
Christian Prochaska
c68828519e vbox: revert 'PGMR3Phys{Read,Write}External'
Fixes #1417
2015-03-13 12:17:24 +01:00
Alexander Boettcher
d303a25489 foc: increase maximal supported threads
Fixes #1418
2015-03-13 12:17:24 +01:00
Alexander Boettcher
75ab803ea2 foc: check result of bind_thread
Issue #1418
2015-03-13 12:17:24 +01:00
Alexander Boettcher
d7b88afb68 base: propagate bind_thread result of pd_session
Issue #1418
2015-03-13 12:17:23 +01:00
Stefan Kalkowski
679f66667c l4lx: don't request framebuffer dataspace twice
Fixes #1427
2015-03-13 12:17:23 +01:00
Alexander Boettcher
e5b187ce16 vbox: support wheel input events
Issue #1438
2015-03-13 12:17:23 +01:00
Alexander Boettcher
c8a9b1802e vbox: enable usb support for guests
Fixes #1438
2015-03-13 12:17:23 +01:00
Christian Prochaska
d76220d6a9 qt5: save generated source files in the contrib directory
Fixes #1436
2015-03-13 12:17:23 +01:00
Norman Feske
e8336acafc base,os: Coding-style unification
Fixes #1432
2015-03-13 12:17:23 +01:00
Norman Feske
56ed7addbc base: fix misleading ROM-connection error message 2015-03-04 17:32:20 +01:00
Norman Feske
f9269f5cb1 Adapt base-codezero to new ports mechanism
Fixes #1425
2015-03-02 12:19:12 +01:00
Christian Helmuth
54ef87c979 version: 15.02 2015-02-27 11:57:59 +01:00
Norman Feske
0bbad0f5d4 News item for Genode 15.02 2015-02-27 11:52:17 +01:00
Norman Feske
2392700c79 Release notes for version 15.02 2015-02-27 11:52:17 +01:00
Sebastian Sumpf
e866bf3fa3 l4linux: Adapt netperf run script to new run tool
With the new run tool, we net to use the 'serial_id' when using the 'send'
command.
2015-02-27 11:48:36 +01:00
Alexander Boettcher
d68c7d1d10 usb: rename coordinates to width/height for touch 2015-02-27 11:48:36 +01:00
Sebastian Sumpf
89dbc10334 L4Linux: Update hash and revision (eager FPU)
The corresponding L4Linux fix:

25aa4a5f25
2015-02-27 11:48:36 +01:00
Martin Stein
c78efd4428 odroid_xu: prevent tests with sd/platform/ahci/fb
Drivers like SD-Card, platform, AHCI, and framebuffer are specified as Exynos5
compliant. But they are at least not compliant with Odroid-XU although this is
Exynos5. Thus, prevent tests that rely on such drivers when building for
hw_odoid_xu. Furthermore, make previous Arndale regulator/consts.h,
uart_defs.h, and some Board_base enums available to all Exynos5 builds to
enable at least building the drivers.

Fixes #1419
2015-02-27 11:48:36 +01:00
Martin Stein
9737b5d966 tz_vmm: support USB-Armory board
For the USB-Armory, we use a newer version of Linux (3.18) as for the
i.MX53-QSB. The main difference is, that the newer Linux uses a DTB instead of
ATAGs.

Fixes #1422
2015-02-27 11:48:35 +01:00
Martin Stein
be392b3bf9 hw: support USB-Armory board
The USB Armory is almost the same as the i.MX53-QSB but it uses only
one of the two RAM banks available in i.MX53. Furthermore we use the USB
Armory only with Trustzone enabled.

Ref #1422
2015-02-27 11:48:35 +01:00
Sebastian Sumpf
2b87628b3c base-foc: Update hash/revision for cli patch.
Issue #1420
2015-02-27 11:48:08 +01:00
Sebastian Sumpf
76d38a8c76 L4Linux: Update hash and revision (SMEP patch)
The corresponding L4Linux fix:

  7f2ab08eb6
2015-02-27 11:48:08 +01:00
Stefan Kalkowski
c176fc24a1 tz_vmm: make script success detection more robust 2015-02-27 11:48:08 +01:00
Christian Prochaska
70540e6f8e Improve 'Timed_semaphore' accuracy
Fixes #1421
2015-02-27 11:48:07 +01:00
Martin Stein
d2b82274db run scripts: don't use is_qemu_available anymore
With the new run tool, there is no more is_qemu_available function. However,
some scripts still try to use it because only frequently used scripts were
updated by now. The commit replaces the function calls with the new
'have_include power_on/qemu' check.

Ref #1419
2015-02-27 11:48:07 +01:00
Josef Söntgen
8d9561595c netperf: add wifi test
Enables testing of the wifi_drv with netperf.

Fixes #1415.
2015-02-27 11:48:07 +01:00
Josef Söntgen
894974f73b wifi_drv: copy firmware images to build directory
Always copy the firmware images to the bin directory within the
build directyry when building the wifi_drv binary.

Issue #1415.
2015-02-27 11:48:06 +01:00
Josef Söntgen
818dad72d0 dde_linux: download firmware for iwlwifi driver
Also download firmware images needed by the wifi_drv when preparing
the dde_linux port. The images are placed in 'firmware' directory.

Issue #1415.
2015-02-27 11:48:06 +01:00
Josef Söntgen
85031f1c1a wifi: report wlan networks
The wifi_drv now provides two reports. The first one contains all
accesspoints that were found while scanning the supported frequencies.
The second one reports the state of the driver, i.e., if it is
conntected to an accesspoint or not. In addition to that, the driver
now gets its configuration via a ROM session.

More detailed information are available in 'repos/dde_linux/README'.

Issue #1415.
2015-02-27 11:48:06 +01:00
Alexander Boettcher
c578a455ba vbox: adapt auto run scripts for win8
Issue #1413
2015-02-27 11:48:06 +01:00
Christian Helmuth
417199ea64 vbox: enable support for Windows 8
Fixes #1413
2015-02-27 11:48:05 +01:00
Alexander Boettcher
d86380d744 nova: provide assessors in utcb for efer register
Issue #1413
2015-02-27 11:48:05 +01:00
Sebastian Sumpf
e4194b4f44 base-foc: Remove 'modaddr' from bootstrap
Let bender relocate the boot modules. Skip relocation strep in bootstrap (only
the kernel, sigma0, and roottask will be loaded).
2015-02-27 11:48:05 +01:00
Stefan Kalkowski
7582396e9c hw_arndale: enable ARM virtualization extensions
* enables world-switch using ARM virtualization extensions
* split TrustZone and virtualization extensions hardly from platforms,
  where it is not used
* extend 'Vm_session' interface to enable configuration of guest-physical memory
* introduce VM destruction syscall
* add virtual machine monitor for hw_arndale that emulates a simplified version
  of ARM's Versatile Express Cortex A15 board for a Linux guest OS

Fixes #1405
2015-02-27 11:48:05 +01:00
Stefan Kalkowski
07c8d1652e hw_arndale: setup ARM hypervisor mode
To enable support of hardware virtualization for ARM on the Arndale board,
the cpu needs to be prepared to enter the non-secure mode, as long as it does
not already run in it. Therefore, especially the interrupt controller and
some TrustZone specific system registers need to be prepared. Moreover,
the exception vector for the hypervisor needs to be set up properly, before
booting normally in the supervisor mode of the non-secure world.

Ref #1405
2015-02-27 11:48:05 +01:00
Stefan Kalkowski
e7dad39016 uart_drv: enable RX channel for exynos5 driver
This is useful for automated tests on this platform, where the run script
wants to interact with some component via terminal

Ref #1405
2015-02-27 11:48:05 +01:00
Stefan Kalkowski
1e3c80ff5b arm: enable cpu cortex_a15 compiler flag
To enable the usage of virtualization extension related instructions
there is the need to enable the '-mcpu=cortex_a15' compiler flag on
those cpus. To not conflict with other compiler flags (Ref #810) we've
to disable the '-march=arm_v7a' flag.

Ref #1405
2015-02-27 11:48:04 +01:00
Stefan Kalkowski
8e2b4d6f45 hw: extend kernel interrupt class
The generalization of interrupt objects in the kernel and the use of
C++ polymorphism instead of explicitely checking for special interrupts
within generic code (Cpu_job::_interrupt) enables the registration of
additional interrupts used by the kernel, which are needed for specific
aspects added to the kernel, like ARM hardware virtualization interrupts.

* Introduce generic base class for interrupt objects handled by the kernel
* Derive an interrupt class for those handled by the user-land
* Implement IPI-specific interrupt class
* Implement timer interrupts using the new generic base class

Ref #1405
2015-02-27 11:43:56 +01:00
Stefan Kalkowski
0836726df2 hw: use one IRQ for all cpus to send IPIs
Until now, one distinct software generated IRQ per cpu was used to
send signals between cpus. As ARM's GIC has 16 software generated
IRQs only, and they need to be partitioned between secure/non-secure
TrustZone world as well as virtual and non-virtual worlds, we should
save them.

Ref #1405
2015-02-27 11:43:56 +01:00
Stefan Kalkowski
a40932a324 hw: refactor irq controllers
* name irq controller memory mapped I/O regions consistently
  in board descriptions
* move irq controller and timer memory mapped I/O region descriptions
  from cpu class to board class
* eliminate artificial distinction between flavors of ARM's GIC
* factor cpu local initialization out of ARM's GIC interface description,
  which is needed if the GIC is initialized differently e.g. for TrustZone

Ref #1405
2015-02-27 11:43:56 +01:00
Sebastian Sumpf
c13fbff8c1 rump: Silence build process
The 'dest' target is renamed in the updated rump version  to 'dest.stage'. This
triggered some building steps, even when the targets already existed.

Issue #1409
2015-02-27 11:43:56 +01:00
Sebastian Sumpf
47b0b9b689 rump: Enable single CPU lock semantics
* Compile in single CPU support only
* Fix 'try_enter' semtantic for mutexes
* Unschedule when entering RW locks

Issue #1409
2015-02-27 11:43:56 +01:00
Sebastian Sumpf
422923cc95 rump: Add 'get_random_backend' function
A rump server may now implement its own random number generator, the default
impelementation will not generate random number.

Issue #1409
2015-02-27 11:43:55 +01:00
Alexander Boettcher
a594ae703d base: fix location_of_index affinity calculation
Take care that ypos parameter is smaller than height().
If it is not - wrap around.

Issue #1412.
2015-02-27 11:43:55 +01:00
Alexander Boettcher
babe1d1026 acpi: amend handling MMIO regions for ACPI tables
The handling of MMIO regions now supports more pathological cases with
weird cross references. Also, MMIO regions are releases after the
parsing is done.

Fixes #998
2015-02-27 11:40:59 +01:00
Christian Prochaska
679ae1dd14 vbox: improve virtual time accuracy
Fixes #1411
2015-02-27 11:40:58 +01:00
Alexander Boettcher
a31378476d nova: use in core one pager per CPU
Fixes #1394
2015-02-27 11:40:58 +01:00
Josef Söntgen
0f47ac958b log/serial: handle spurious EOF
While booting up, some devices send garbage over the serial connection.
This can result in an unexpected EOF event within expect(1). A filter
program may be specified with '--log-serial-filter' to circumvent this
problem. Then, the output of the serial program is piped through
the filter, which may sanitize the character stream.

Fixes #1395.
2015-02-17 16:01:37 +01:00
Alexander Boettcher
6329395026 run: remove upgrade messages in mp_server script 2015-02-17 14:18:16 +01:00
Martin Stein
3a40c27c26 hw_vea9x4: quickfix slow RAM access
Setting the ACTLR.SMP bit also without SMP support fastens RAM access
significantly. A proper solution would implement SMP support which must enable
the bit anyway.

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

Issue #1395.
2015-02-16 14:01:45 +01:00
Alexander Boettcher
2b69310adf nova: detect overlapping module regions
Detect overlapping regions which should not overlap and print some meaningful
message instead of dying with some mysterious page fault.

Issue #1402
2015-02-16 14:01:45 +01:00
Martin Stein
00167aec14 hw: activate perf-counter by default
This is needed at least by rump_ext2.run as it uses the perf-counter
in the jitterentropy-lib. On other platforms the perf-counter gets enabled
by the kernel by default. However, on HW, we keep the specifier to allow users
to disable it easily (e.g. for security reasons).

Ref #1393
2015-02-16 14:01:45 +01:00
Sebastian Sumpf
b4a880ca54 bender: restrict relocation below 2G physical
Fixes #1402
2015-02-16 14:01:24 +01:00
Alexander Boettcher
2e1686558c run: constrain physical memory for pci/acpi driver
Permit pci/acpi driver to constrain physical memory allocation to needs of
the driver it serves.

Fixes #1045
2015-02-16 13:40:38 +01:00
Alexander Boettcher
34719c4589 pci: allocate below 3G physical for 32bit & iommu
Related to #696.

Issue #1045
2015-02-16 13:40:38 +01:00
Alexander Boettcher
8c66a4b1be base: support phys range specifier in ram_session
Fixes #696
2015-02-16 13:40:38 +01:00
Alexander Boettcher
95ff5ba11d base: support range restriction in allocator
Issue #696
2015-02-16 13:40:38 +01:00
Alexander Boettcher
57c4678aa1 gdb: adapt gdb_monitor run scripts
Adjustment are required due to changes of the new run tool and the new shared
library implementation.

Issue #1192
2015-02-16 13:40:37 +01:00
Stefan Kalkowski
322be1b4fb hw: LPAE for Cortex a15 (fix #1387) 2015-02-16 13:40:37 +01:00
Stefan Kalkowski
21fd2fc582 hw: introduce ARM LPAE extension (ref #1387)
This patch adds support for the Large Physical Address Space Extension
for ARM v7.
2015-02-16 13:40:37 +01:00
Stefan Kalkowski
102444b82b hw: remove pointless, wasted memory in pd object
(ref #1387)
2015-02-16 13:40:37 +01:00
Stefan Kalkowski
34f169293f hw: fix page table handling of core (ref #1387)
There might be more then one nested slab allocation.
2015-02-16 13:40:37 +01:00
Josef Söntgen
4ca1284e0e vfs: do not return early on directory operations
When returning early on directory operations, file systems that might
be able to handle the request but come after the current one are not
tried.

Fixes #1400.
2015-02-16 13:40:36 +01:00
Sebastian Sumpf
c2c8483293 usb_drv: Fix controller initialization on RPI
Execute high priority tasklets immediately, these tasklets need to be processed
before any other work.

Issue #1401
2015-02-16 13:40:36 +01:00
Martin Stein
5dea0b40aa hw: don't use ARM CPU-state stuff in generic code
Fixes #1404
2015-02-16 13:40:36 +01:00
Martin Stein
63f8a38b5a hw: default boot-modules vpath is generic
Ref #1404
2015-02-16 13:40:36 +01:00
Norman Feske
cb579ec8d7 hw: minor 64-bit fixes 2015-02-16 13:40:36 +01:00
Stefan Kalkowski
7cb4d7bf41 run: support fastboot tool to load images
Fixes #1397
2015-02-16 13:40:36 +01:00
Stefan Kalkowski
a3abf74d1e hw: remove code duplication related to Exynos5 SoC
Fixes #1396
2015-02-16 13:40:36 +01:00
Josef Söntgen
4caf12cd16 tool/run: decrease timeout in log/serial
Set the timeout to 60s. The original value of 210s is too long and
delays the testing process unnecessarily.

Fixes #1395.
2015-02-16 13:40:35 +01:00
Josef Söntgen
a838b6a657 noux: add local nanosleep(2) and sleep(3)
Up to now Noux used the libc sleep functions, which actually is not
possible because the _nanosleep() function implemented by our libc
creates a new thread to handle the timeout. Noux childs may have
only one thread, e.g., the main thread, though. To fix this issue
sleeping is now handled directly by Noux. It is implemented by calling
select(2) with a timeout. This fix is needed for mutt(1), which calls
sleep when it prints a notification for the user.

Fixes #1374.
2015-02-16 13:40:35 +01:00
Sebastian Sumpf
7ecd83373c rump: Reduce startup latency
Since rump now requires large buffers of random numbers (>= 512 bytes), use the
jitterentropy library instead of the slow timer pseudo random number generation.

Fixes #1393
2015-02-16 13:40:35 +01:00
Sebastian Sumpf
ab0fd6510f jitterentropy: Fix foreign import
Make the jitterentropy library accessible from other repositories.

Noticed while working on issue #1393
2015-02-16 13:40:35 +01:00
Stefan Kalkowski
b69deec067 autopilot: adapt runscripts to run new tool
Related to #1372.
2015-02-16 13:40:35 +01:00
Stefan Kalkowski
0ac039fad7 L4Linux: make ballooning driver configureable
To circumvent compilation errors with the older L4Android Linux kernel
version, the ballooning driver is included in the more recent L4Linux
kernel only. Moreover, to be able to maintain L4Android / L4Linux in a more
convenient way, e.g. to apply patches valid for both versions, we use
the same git clone that is used for L4Linux instead of using the upstream
L4Android version by applying patches.

Fixes #1390
2015-02-16 13:40:35 +01:00
Josef Söntgen
78e8e04b88 tool/run/README: fix wrong examples
Fixes #1392.
2015-02-16 13:40:34 +01:00
Josef Söntgen
863b6fef80 noux: prevent override in SYSCALL_STAT
Fixes #1386.
2015-02-16 13:40:34 +01:00
Josef Söntgen
0a835e4ce9 os: structured timestamp in Rtc session
Instead of returning an uint64_t value, return a structured time stamp.
This change is only visible to components using Rtc_session directly.

Fixes #1381.
2015-02-16 13:40:34 +01:00
Sebastian Sumpf
6d2c697da1 lxip: Fix timeout handling for 'schedule_timeout'
Up until now 'schedule_timeout' did only wait for the next signal to occur.
However, we might run into situations where there won't occur signals for longer
periods of time. Therefore, we took care of the respective timeout handling.

This commit also adds Genode's tracing support

Issue #1310
2015-02-16 13:40:34 +01:00
Sebastian Sumpf
8843564850 usb_drv: USB terminal driver
Issue #1329
2015-02-16 13:40:34 +01:00
Sebastian Sumpf
3fd561aab6 terminal_echo: Add line feed end carriage return
Issue #1329
2015-02-16 13:40:33 +01:00
Sebastian Sumpf
0c2bdf9edd usb_drv: Remote USB driver interface
Issue #1329
2015-02-16 13:40:33 +01:00
Christian Helmuth
e479b9e8e8 ports: also hash patches with absolute path names
Fixes #1305
2015-01-27 12:17:53 +01:00
Norman Feske
1717d11742 doc: mention packages needed for using the ports
Fixes #1383
2015-01-27 10:09:19 +01:00
Sebastian Sumpf
15a379894a lxip: Fix on OKL4
This has been broken for a while now. Use correct (global) signal transmission,
do not use local signal transmission, as signals seems to get lost.

Issue #1310
2015-01-26 12:28:42 +01:00
Wolfgang Faust
b2947d2187 Add filenames to code snippets in hello_tutorial
Fixes #1369
2015-01-26 12:28:42 +01:00
Norman Feske
671682cb6a base: use reinterpret_cast for symbol lookup
This patch changes the Shared_object::lookup function to use a
reinterpret_cast instead of a static_cast to allow the conversion
from symbol addresses to arbitrary pointers.
2015-01-26 12:28:42 +01:00
Norman Feske
f68889ea0a arora: fix domain config in plugin demo
Fixes #1375
2015-01-26 12:28:42 +01:00
Norman Feske
cb4302d06a loader: make CPU session upgradable
Fixes #1379
2015-01-26 12:28:42 +01:00
Norman Feske
623bc82e07 fs_rom: realloc only when dataspace grew
Fixes #1377
2015-01-26 12:28:42 +01:00
Norman Feske
ff422ccc6e backdrop: respond to config changes
Fixes #1376
2015-01-26 12:28:42 +01:00
Norman Feske
db56946ba9 rom_prefetcher: Yield CPU after each request
By blocking on a timeout, we yield the CPU in order to give a
concurrently running sporadic process a chance to obtain ROM modules.
Otherwise, such requests would be deferred until the ROM prefetcher
completes its operation or in the unlikely event that the prefetcher
gets preempted.

Fixes #1378
2015-01-26 12:28:41 +01:00
Christian Helmuth
86eb3f4a0d rtc: rename get_current_time() to current_time()
Issue #1344
2015-01-26 12:28:41 +01:00
Josef Söntgen
026b5a66c9 autopilot: get settings via RUN_OPT_AUTOPILOT
If the variable RUN_OPT_AUTOPILOT is set the autopilot will override
the default RUN_OPT settings provided in build.conf.

Related to #1355.
2015-01-26 12:28:41 +01:00
Josef Söntgen
55bf0bb294 run: add power_on/softreset
The softreset module resets the target system by triggering a software
reset.

Fixes #1355.
2015-01-26 12:28:41 +01:00
Josef Söntgen
88f62b0988 autopilot: adapt runscripts to new run tool
Related to #1372.
2015-01-26 12:28:41 +01:00
Josef Söntgen
e3c37f43a0 build.mk: remove RUN_ENV usage 2015-01-26 12:28:41 +01:00
Josef Söntgen
ce24547eea create_builddir: add default RUN_OPT configuration 2015-01-26 12:28:40 +01:00
Josef Söntgen
c706b1c0a7 run: modularize run tool 2015-01-26 12:28:40 +01:00
Christian Helmuth
febca1b827 rtc: pseudo driver for linux + server framework
The commit also includes a test program incl. run script.

Fixes #1344.
2015-01-26 12:28:40 +01:00
Josef Söntgen
a36d0ec83a lxip: provide struct file pointer for udp_poll
Lxip may deference the file pointer in 'udp_poll()'. So we provide a
valid dummy object.

Fixes #1371.
2015-01-20 12:05:54 +01:00
Norman Feske
363fd6065d Init: support for aliases for child names
Fixes #1373
2015-01-20 11:25:59 +01:00
Norman Feske
a0abb093ed Remove output-section fill from linker scripts
The linker scripts use to fill alignment gaps within the text section
with the magic value 0x90909090, which correponds to the opcodes of four
nop instructions on x86. This patch removes this value because it
apparently solves no problem. If, for some reason (e.g., due to a dangling
pointer) a thread executes instructions within alignment paddings, NOP
instructions are not any better than any other instruction. The program
will eventually execute the instructions after the padding, which is
most likely fatal. It would be more reasonable to fill the padding with
the opcode of an illegal instruction so that such an error can be
immediately detected. That said, I cannot remember a single instance,
where the fill value has helped us during debugging.

Even if the mechanism served a purpose on x86, it is still better to
remove it because it does not equally work on the other architectures
where the linker scripts are used. I.e., on ARM, the opcode 0x90909090
is not a NOP instruction.
2015-01-20 11:25:59 +01:00
Emery Hemingway
e1667e61cc libports: sqlite
Issue #1357
2015-01-20 11:25:58 +01:00
Emery Hemingway
e4ac1f99ed tool/ports: run unzip with UNZIP_OPT
The patch supports both, a download-specific UNZIP_OPT(download) and a
general UNZIP_OPT that can be defined across downloads.
UNZIP_OPT(download) overrides UNZIP_OPT.

Note, the `--strip-components=1` argument is not required for unzip.

Issue #1357
2015-01-20 11:23:52 +01:00
Emery Hemingway
b5f1af6af0 libports: libbz2 (Bzip2)
Issue #1357
2015-01-20 11:23:52 +01:00
Norman Feske
cfea0ea97d News items for FOSDEM and roadmap 2015 2015-01-20 11:23:51 +01:00
Norman Feske
cbe835f2c8 Roadmap 2015 2015-01-20 11:23:51 +01:00
Christian Helmuth
ce15800beb vbox: loosen boot heuristics in auto-disk test 2015-01-20 11:23:51 +01:00
Alexander Boettcher
9262629a86 vbox: fix interrupt injection in recompiler mode
Fixes #1365
2015-01-20 11:23:51 +01:00
Christian Prochaska
50950ec248 vbox: 'poke' fixes
Fixes #1364
2015-01-20 11:23:51 +01:00
Alexander Boettcher
336018b493 base: append label per line properly (log service)
If newlines are in the string send to the core log service, they don't get
the label properly appended before each output. The messages then look like
they are coming from core.

Fixes #1368
2015-01-20 11:23:51 +01:00
Alexander Boettcher
25eec75ad8 vbox: be less verbose in vmx_invalid exit cases
Be less verbose regards warnings caused by vmx_invalid exits - which triggers
on T400 more often because it has no Unrestricted Guest support. This leads
to lot of log messages so that the test does not succeed in time. Additionally,
the virtualbox_auto_disk.run script is adjusted to check for some output to
exit earlier if something went wrong.

Fixes #1367
2015-01-20 11:23:51 +01:00
Alexander Boettcher
988a7962a8 nova: disable vpid feature
Workaround for issue #1343. By disabling the 'vpid' feature of the nova
kernel several VMs can be used concurrently. Applies for Seoul and VirtualBox.

Issue #1343
2015-01-20 11:23:50 +01:00
Alexander Boettcher
ee996d2280 vbox: enable dumping GuruMeditations messages
This typically is a sign that something went terribly wrong. The information
may help to debug issues.

Issue #1343
2015-01-20 11:23:50 +01:00
Stefan Kalkowski
e8d1d6e87c rpi: add missing drivers in run-scripts (Fix #1366)
Add platform driver and usb-network driver for platform_rpi where appropriated.
2015-01-20 11:23:50 +01:00
Stefan Kalkowski
28112d1ff9 rump: exclude ARM architectures apart from v7
Ref #1366
2015-01-20 11:23:50 +01:00
Stefan Kalkowski
df8bdaaf79 run: increase JTAG load timeout (Ref #1366) 2015-01-20 11:23:50 +01:00
Christian Helmuth
f99ca9e372 Tools for convenient handling of port contrib dirs
tool/ports/shortcut

  create symbolic link from 'contrib/<port-name>-<hash>' to
  contrib/<port-name>

tool/ports/current

  print current contrib directory of port

Fixes #1345.
2015-01-20 11:23:50 +01:00
Christian Prochaska
6791fd18cc vbox: use libc's 'gettimeofday()' function
Fixes #1363
2015-01-20 11:23:50 +01:00
Alexander Boettcher
4be7b3c3ad seoul: exclude 64bit guest in seoul-genode.run
Fixes #1358
2015-01-20 11:23:49 +01:00
Josef Söntgen
d58509f446 libc: create poll.h symlink
Since user-land tools tend to look for <poll.h> instead of <sys/poll.h>
make them happy like w/o resorting to patch the source.

Fixes #1356.
2015-01-20 11:23:49 +01:00
Josef Söntgen
f01472b308 dde_rump: Update to current version
Issue #1361
2015-01-20 11:23:49 +01:00
Stefan Kalkowski
2380fc442f ahci: avoid to reinstantiate backend driver
Instead of fixing the missing dynamic facilities of the AHCI driver
backends for x86 and Exynos5, just avoid to create/destroy the backend
for every new connection, but always use one and the same object.
The AHCI drivers need to be re-written anyway, see issue #1352 for instance,
we can make it more robust for the dynamic case then.

Fixes #786
Fixes #1133
2015-01-12 14:24:55 +01:00
Stefan Kalkowski
901bff813d imx31: remove platform completely (fix #1360) 2015-01-12 14:24:15 +01:00
Alexander Boettcher
0f18ecc142 base: handle input overflow exception
Fixes #1348
2015-01-09 11:52:06 +01:00
Sebastian Sumpf
1a26f33469 ldso: shared-object lock and ctor test
This has to be used during shared object creation and destruction because global
lists are manipulated. We cannot use the 'Elf_object::lock' here because there
may be jump-slot relocations during object initialization.

Fixes #1350
2015-01-09 11:31:21 +01:00
Alexander Boettcher
e5b509cabb nova: breakpoint handling
If no one is registered for a breakpoint trap - stop the thread. E.g. used
by virtualbox assertion implementation.
2015-01-09 11:03:29 +01:00
Martin Stein
9a4a0448be hw vea9x4: remove trustzone support
When building Genode for VEA9X4 as micro-hypervisor protected by the ARM
TrustZone hardware we ran into limitations regarding our basic daily
testing routines. The most significant is that, when speaking about RAM
partitioning, the only available options are to configure the whole SRAM
to be secure and the whole DDR-RAM to be non-secure or vice versa. The
SRAM however provides only 32 MB which isn't enough for both a
representative non-secure guest OS or a secure Genode that is still
capable of passing our basic tests. This initiated our decision to
remove the VEA9X4 TrustZone-support.

Fixes #1351
2015-01-08 13:28:42 +01:00
Alexander Boettcher
91daf433c5 seoul: transform absolute events to relative (PS2)
Fixes #1346
2015-01-07 15:17:51 +01:00
Martin Stein
be7d5b4827 hw: use context-area base that is ok for VEA9X4-TZ
On VEA9X4-TZ, the context-area overlaps with the virtual area of the
text, data and bss. However, we can't simply change the link address as
the core image (used physically respectively 1:1 mapped) needs to be in
this particular RAM-region as it is the only one that can be protected
against a VM. Thus I've moved the context area to a place where it
shouldn't disturb any HW-platform.

Fixes #1337
2015-01-07 10:41:22 +01:00
Martin Stein
e63092f1dd hw & cortex_a9: fix scheduling-timer speed
The estimation of the input clock of the Cortex A9 Private Timer module
was pretty miserable at every Cortex A9 board.

Fixes #1341
2015-01-06 15:22:07 +01:00
Martin Stein
ba321c20d1 hw vea9x4: let userland timer SP804 0/1 be secure
Declaring the SP804 0/1 module and its interrupt to be non-secure prevents the
secure Genode from receiving the interrupt and hence the timer driver in the
secure Genode doesn't work.

Fixes #1340
2015-01-06 15:16:02 +01:00
Sebastian Sumpf
6f8f9085f3 os: Add virtual destructor to block driver
Fixes #1339.
2015-01-06 15:10:17 +01:00
Christian Helmuth
11a513ac63 prepare_port: disable certificate checking in wget
Some downloads are available via HTTPS only, but wget < 3.14 does not
support server-name identification, which is used by some sites. So, we
disable certificate checking in wget and check the validity of the
download via SIG or SHA.

Fixes #1334.
2015-01-06 12:39:11 +01:00
Alexander Boettcher
8842ba2e1c nova: remove timer delay heuristic
The commit uses a fixed kernel branch (r8), which fixes a caching bug
observable in the Genode host. The quirk detecting the circumstance in the
timer service is obsolete now and is removed.

Fixes #1338
2015-01-06 12:39:11 +01:00
Alexander Boettcher
1d920fa1b5 nova: fix usage of portal permission
The commit
- fixes the syscall bindings for using portal permissions
- revokes PT_CTRL permission after pager in core set local badge name
- revokes PT_CTRL permission after server entrypoint code set local badge name

Fixes #1335
2015-01-06 12:39:11 +01:00
Christian Helmuth
2cd902f09f libc: warn on configuration errors in rtc wrapper
Fixes #1336.
2015-01-06 12:39:11 +01:00
Alexander Boettcher
bfa2ad7d47 nova: platform test for portal permission usage
Test and run script showcasing issue #1335.

The test mainly tries out syscalls which should not succeed.
2015-01-06 12:39:11 +01:00
Christian Helmuth
77410a08a8 libc: remove debug messages from vfs plugin 2015-01-06 12:39:10 +01:00
Martin Stein
659f6ff5c8 hw_vea9x4: quickfix for missing SMP awareness
This fix configures TTBRs and translation-table descriptors as if we would use
SMP although we don't to circumvent problems with UP-configurations.
This fix should be superseded later by full SMP support for the VEA9X4.

ref #1312
2014-12-19 13:58:49 +01:00
Christian Helmuth
59d26e040e ahci: enable benchmark on x86 2014-12-19 13:58:48 +01:00
Martin Stein
5783ba4b1f base: let context area RM session be expanding
Fixes #1331.
2014-12-19 13:58:48 +01:00
Martin Stein
d31492040c hw: fix race on pager-object dissolve
The HW-kernel, in contrast to other kernels, provides a direct reference
to the pager object with the fault signal that is send to the pager
activation. When accessing this reference directly we may fall into the
time span where the root parent-entrypoint of the faulter has alredy
dissolved the pager object from the pager entrypoint, but not yet
silenced the according signal context.  To avoid this we issue an
additional 'lookup_and_lock' with the received pager object. This isn't
optimal as we don't need the potentially cost-intensive lookup but only the
synchronization.

Fixes #1311.
Fixes #1332.
2014-12-19 13:58:48 +01:00
Alexander Boettcher
a59cf9f557 usb: wacom touchscreen support 2014-12-19 13:58:48 +01:00
Christian Helmuth
6344ab94b2 run: use predefined name for wsman script
"file tempfile" is not available in tcl versions below 8.6, which are
still wide spread, for example, in Ubuntu 12.04.5 LTS.

Fixes #1328.
2014-12-19 13:58:48 +01:00
Christian Helmuth
22db466194 wifi_drv: adapt wifi.run for iwl7260
Fixes #1317.
2014-12-19 13:58:48 +01:00
Christian Menard
fa0f7c0d6d wifi_drv: enable support for iwl7260
- essential support for 7260 chipset and DMA fixes
- assign mvm->pm_ops at beginning of function iwl_op_mode_mvm_start.
  iwl_mvm_mac_setup_register() uses mvm->pm_ops, but it is called
  before this field is set to a valid value.
- disable call to function iwl_mvm_prepare_multicast.
  This function leads to a pagefault, as it aspects a list of multicast
  addresses, but the list is empty as it is not generated by this port.
2014-12-19 13:58:48 +01:00
Christian Helmuth
727ac4bc0c Put entry point at start of binary on x86 platforms
Related to #881.
2014-12-19 13:58:47 +01:00
Martin Stein
d704563453 hw: helping on IPC
On base-hw, each thread owns exactly one scheduling context for its
whole lifetime. However, introducing helping on IPC, a thread might get
executed on scheduling contexts that it doesn't own. Figuratively
spoken, the IPC-helping relation spans trees between threads. These
trees are identical to those of the IPC relation between threads. The
root of such a tree is executed on all scheduling contexts in the tree.
All other threads in the tree are not executed on any scheduling context
as long as they remain in this position. Consequently, the ready-state
of all scheduling contexts in an IPC-helping tree always equals the
state of the root context.

fix #1102
2014-12-19 13:58:47 +01:00
Martin Stein
6370b6880a hw: rename Thread::State SCHEDULED in ACTIVE
As soon as helping is used, a thread may also be in a blocking state when its
scheduling context is ready. Hence, the state designation SCHEDULED for an active
thread would be pretty misleading.

ref #1102
2014-12-19 13:58:47 +01:00
Martin Stein
6f377ec4c5 hw: add FIFO variant with for_each() method
ref #1102
2014-12-19 13:58:47 +01:00
Martin Stein
9c027fd9bd hw: remove deprecated TLB declaration
fix #1320
2014-12-19 13:58:47 +01:00
Alexander Boettcher
cdaf6a502d vbox: support absolute mouse input events
Got broken during upgrade from 4.2 to 4.3.

Fixes #1321
2014-12-19 13:58:47 +01:00
Alexander Boettcher
6d02c4c89f vbox: use power of two priority levels
Avoids warnings of init in form of

"priority band too small, losing least-significant priority bits"

when virtualbox starts threads.

Fixes #1323
2014-12-19 13:58:47 +01:00
Alexander Boettcher
51489e2f82 vmm: fix overmap attempts by seoul and vbox
If the debug branch of the nova kernel is used, following messages are printed
by the kernel during vCPU setup phase:

[0] overmap attempt OBJ - tree - ...

Fixes #1324
2014-12-19 13:58:46 +01:00
Alexander Boettcher
f36c0f150f demo: support launchpad entries with mem >= 2048M
Fixes #1325
2014-12-19 13:58:46 +01:00
Josef Söntgen
b557fb13f9 wifi_drv: fix timer scheduling
The context of timer are now inserted correctly and the actual timer
triggering the exection of each context is always programmed if the
head of the timer list changes.

Fixes #1326.
2014-12-19 13:58:46 +01:00
Josef Söntgen
4c7a5bb388 wifi_drv: call schedule() in sleep functions
The jiffies are only updated on each round of scheduling the runnable
tasks. We have to schedule the current task that executes the sleep
call to update the jiffies count and thereby preventing the task from
entering an endless loop when using a statement like
'while (!time_after(jiffies, now + timeout)) { msleep(1); }'.

Related to #1326.
2014-12-16 15:08:07 +01:00
Josef Söntgen
9ed935ff2a wifi_drv: look for PCI_CLASS_NETWORK_OTHER only
Instead of probing all device on the PCI bus just look for devices
matching PCI_CLASS_NETWORK_OTHER. This fixes issues with other devices
on the PCI bus, e.g. the GPU, when access their extended config space.

Related to #1326.
2014-12-16 15:07:56 +01:00
Alexander Boettcher
183a2c1be6 vbox: support more graphic modes
Fixes #1319
2014-12-09 18:21:09 +01:00
Christian Prochaska
b4f41aecad vbox: enable 1-byte MMIO writes at 4-/8-byte aligned address
Fixes #1318
2014-12-08 17:39:23 +01:00
Stefan Kalkowski
3367fd27e4 run: avoid buffering of output for expect
Due to commit "run: relax IP power plug recognition + serial EOF",
when piping the serial command through 'tr', some characters might
get buffered, thereby preventing some run scripts to finish correctly.
This commit removes the 'tr' hack. Instead, to circumvent the 'expect'
problem, which kills under special conditions spawned childs used to
obtain serial line content, whenever EOF of the serial command is
recognized during the boot phase, the child process gets re-spawned.
2014-12-08 13:53:17 +01:00
Alexander Boettcher
68abf0616a dde_ipxe: enable Intel I218-LM/I218-V PCI ID
Commit inspired by patch from @alex-ab/@cnuke but uses only one patch
file for all added NICs.

Issue #1220
2014-12-05 15:17:00 +01:00
Christian Helmuth
cf358b5db1 Revert "foc: relax parsing of boot process termination"
This reverts commit a9a6e8df89.

Setting correct UART parameters in U-Boot also fixes the issue and
reenables us to observe L4 bootstrapper startup.
2014-12-05 15:16:47 +01:00
Alexander Boettcher
513be78c05 seoul: adapt to nitpicker and use fixed seoul repo
Fixes #1307
2014-12-05 11:01:24 +01:00
Christian Helmuth
9996acf091 dde_linux: check tools needed for libnl 2014-12-05 11:00:15 +01:00
Christian Prochaska
36ca0497de qt5: set explicit routes for Nitpicker's 'Framebuffer' and 'Input' sessions
Setting explicit routes for Nitpicker's 'Framebuffer' and 'Input' sessionsi
avoids ambiguities if a Qt application provides these services, too.

Fixes #1316
2014-12-04 17:17:23 +01:00
Christian Prochaska
136d87bd9a qt5: fix include dir of 'qt5_qpa_nitpicker' library
Fixes #1315
2014-12-04 17:17:23 +01:00
Christian Prochaska
21154d6866 qt5: let QNitpickerViewWidget react to focus event
With this patch, when calling 'setFocus()' on a QNitpickerViewWidget, the
Nitpicker view gets the input focus (provided that the parent Qt window
already had it).

Fixes #1314
2014-12-04 16:26:22 +01:00
Stefan Kalkowski
a9a6e8df89 foc: relax parsing of boot process termination
Until now, the successful termination of the boot process was recognized
when 'expect' saw the first L4 bootstrapper output on serial line. On sytems
with initially shaky serial connection like Versatile Express, where the serial
line baudrate changes with the bootstrapper initialization, the first expected
line might be missing. Therefore, change the expected line to the first
Fiasco.OC kernel output.
2014-12-03 11:41:47 +01:00
Stefan Kalkowski
726c32e5f6 run: relax IP power plug recognition + serial EOF
* To communicate with IP power plug devices from Koukaam, to remote
  control power supply of test boards, don't parse minor versions, but
  support different IP power plugs
* TCL's expect may report an EOF when reading from the spawned serial
  terminal, especially when using 'socat' to stream serial over TCP/IP,
  although the spawned child is still running and delivering content.
  This problem is clearly not dependent on the characters send, but
  possibly due to strange pipe signals. When piping the serial output
  through 'tr' the problem vanishs.
2014-12-03 11:41:13 +01:00
Alexander Boettcher
6d391aae10 vbox: support routing serial output to Genode
Fixes #1308
2014-12-01 17:29:17 +01:00
Alexander Boettcher
f970e4a71b libc: support F_SETFD && FD_CLOEXEC ioctl
Issue #1308
2014-12-01 17:29:17 +01:00
Christian Helmuth
f9422b241f Fix compiler warning about uninitialized variable
Fixes #1051
2014-12-01 17:29:17 +01:00
Alexander Boettcher
9c0ced0a85 ldso: add __L4_ThreadSwitch to ldso symbol.map
This wasn't necessary before because we built an l4 library for
Pistachio and linked it against each application. With the new linker,
we compile the required files from within Genode and create a syscall
library that is only linked to ldso. If a program uses system calls
directly, for example, DDE kit's spinlock implementation, the required
symbols must be made globally accessible.

Fixes #1306
2014-12-01 16:32:35 +01:00
Christian Helmuth
510efce3a1 version: 14.11 2014-11-28 12:56:08 +01:00
Norman Feske
0e20daacde News item for Genode 14.11 2014-11-28 12:58:04 +01:00
Norman Feske
a7c38b8f81 Release notes for version 14.11 2014-11-28 12:58:04 +01:00
Norman Feske
4b117d4a66 doc: update of doc/components.txt 2014-11-28 12:58:04 +01:00
Stefan Kalkowski
4d3fa001e0 hw: remove memory region duplicate (fix #1304)
On the Versatile Express Cortex A9x4 platform the first memory region
0x0 - 0x4000000 is a hardware remapped memory area, containing flash
and DDR RAM copies and thus should not be added in addition to all
DDR RAM regions and the SRAM region.
2014-11-28 12:02:40 +01:00
Alexander Boettcher
604b831e1e vbox: update to virtualbox 4.3.16
Fixes #1296
2014-11-28 12:02:40 +01:00
Alexander Boettcher
c40aa45d86 pthread: support pthread_key_delete
Issue #1296
2014-11-28 12:02:39 +01:00
Sebastian Sumpf
a4f7800bf0 lxip: signal NETDEV_TX_BUSY if tx queue is full 2014-11-28 12:02:38 +01:00
Martin Stein
16b4e7d73a os: add missing include in vea9x4/pl011_defs.h
fix #1303
2014-11-28 12:02:38 +01:00
Christian Helmuth
dfe95b26c8 Fix handling of cache attribute with RAM
Adapt drivers for Exynos5 and PandaBoard to cache attribute changes in
786fe80.

Fixes #1301.
2014-11-28 12:02:38 +01:00
Martin Stein
8f9355b360 thread API & CPU session: accounting of CPU quota
In the init configuration one can configure the donation of CPU time via
'resource' tags that have the attribute 'name' set to "CPU" and the
attribute 'quantum' set to the percentage of CPU quota that init shall
donate. The pattern is the same as when donating RAM quota.

! <start name="test">
!   <resource name="CPU" quantum="75"/>
! </start>

This would cause init to try donating 75% of its CPU quota to the child
"test".  Init and core do not preserve CPU quota for their own
requirements by default as it is done with RAM quota.

The CPU quota that a process owns can be applied through the thread
constructor. The constructor has been enhanced by an argument that
indicates the percentage of the programs CPU quota that shall be granted
to the new thread. So 'Thread(33, "test")' would cause the backing CPU
session to try to grant 33% of the programs CPU quota to the thread
"test". By now, the CPU quota of a thread can't be altered after
construction. Constructing a thread with CPU quota 0 doesn't mean the
thread gets never scheduled but that the thread has no guaranty to receive
CPU time. Such threads have to live with excess CPU time.

Threads that already existed in the official repositories of Genode were
adapted in the way that they receive a quota of 0.

This commit also provides a run test 'cpu_quota' in base-hw (the only
kernel that applies the CPU-quota scheme currently). The test basically
runs three threads with different physical CPU quota. The threads simply
count for 30 seconds each and the test then checks wether the counter
values relate to the CPU-quota distribution.

fix #1275
2014-11-28 12:02:37 +01:00
Christian Helmuth
f60e2af21f dde_oss: use dde_kit_timer_ticks
The Linux-specific 'jiffies' symbol was removed from dde_kit in 35239b8.

Fixes #1302.
2014-11-28 12:02:37 +01:00
Sebastian Sumpf
038a7999bf ldso: Disallow recursive initialization
Do not support the global construction from of objects from within a global
constructor of another object. This can happen if, for example, dlopen is called
from a global constructor. The construction will be post-boned until the current
constructor has finished.
2014-11-28 12:02:37 +01:00
Martin Stein
09e6c3457f hw_arndale: consider timer resets
On Arndale, the kernel timer resets to the initial value of the last
count-down and continues as soon as it reaches zero. We must check this
via the interrupt status when we read out the timer value and in case
return 0 instead of the real value.

fix #1299
2014-11-28 12:02:37 +01:00
Christian Prochaska
2f5fbe73d3 q5: 'QTime::currentTime()' fix
Fixes #1298
2014-11-28 12:02:37 +01:00
Josef Söntgen
703e3622ff wifi_drv: Port of the Linux wireless stack 2014-11-28 12:02:36 +01:00
Josef Söntgen
2eaa55e6b1 dde_linux: remove base cxx from lxip.mk 2014-11-28 12:02:36 +01:00
Josef Söntgen
f127f5c7fc dde_linux: remove base cxx dep from usb.inc 2014-11-28 12:02:36 +01:00
Josef Söntgen
8870539904 dde_linux: clean up lxip patches 2014-11-28 12:02:36 +01:00
Josef Söntgen
338cfaaf9f dde_linux: clean up usb patches 2014-11-28 12:02:36 +01:00
Josef Söntgen
4eda2deeb1 ddekit: remove sleep_forever in dde_kit_debug
The way this function is currently used in dde_linux expects this
function to return. Since there is dde_kit_panic it should better
be used in such a case the output should block.
2014-11-28 12:02:35 +01:00
Josef Söntgen
969cebc659 dde_linux: remove bogus semicolon 2014-11-28 12:02:35 +01:00
Christian Helmuth
58b6c88301 rpi: remove spec for pl011
The Raspberry Pi has only one UART, which is used by core exclusively.
Therefore, the driver server for pl011 should not be built.
2014-11-28 12:02:35 +01:00
Martin Stein
b8ba3a7a22 hw: rename Kernel::Processor Kernel::Cpu
Kernel::Processor was a confusing remnant from the old scheme where we had a
Processor_driver (now Genode::Cpu) and a Processor (now Kernel::Cpu).
This commit also updates the in-code documentation and the variable and
function naming accordingly.

fix #1274
2014-11-28 12:02:35 +01:00
Martin Stein
b3655902ed hw & arm_v7: provide run/hw_info
The run test 'hw_info' prints the content of the basic ARMv7 identification and
feature registers in a pretty readable format. It is a kernel-internal test
because many of these registers are restricted to privilege level 1 or higher.

fix #1278
2014-11-28 12:02:35 +01:00
Martin Stein
1b1fd1e1f9 hw: add and test totally sophisticated scheduler
The new scheduler serves the orthogonal requirements of both
high-throughput-oriented scheduling contexts (shortly called fill in the
scheduler) and low-latency-oriented scheduling contexts (shortly called
claim in the scheduler). Thus it knows two scheduling modes. Every claim
owns a CPU-time-quota expressed as percentage of a super period
(currently 1 second) and a priority that is absolute as long as the
claim has quota left for the current super period. At the end of a super
period the quota of all claims gets refreshed. During a super period,
the claim mode is dominant as long as any active claim has quota left.
Every time this isn't the case, the scheduler switches to scheduling of
fills. Fills are scheduled in a simple round robin with identical time
slices. Order and time-slices of the fill scheduling are not affected by
the super period. Now on thread creation, two arguments, priority and
quota are needed. If quota is 0, the new thread participates in CPU
scheduling with a fill only.  Otherwise he participates with both a
claim and a fill. This concept dovetails nicely with Genodes quota based
resource management as any process can grant subsets of its own
CPU-time and priorities to its child without knowing the global means of
CPU-time and priority.

The commit also adds a run script that enables an automated unit test of the
scheduler implementation.

fix #1225
2014-11-28 12:02:35 +01:00
Martin Stein
a00eb9a66a hw: enhance and test double-list data-structure
To serve the needs of the coming CPU scheduler, the double list needs
additional methods such as 'to_tail' and 'insert_head'.

The commit also adds a run script that enables an automated unit test
of the list implementation.

ref #1225
2014-11-28 12:02:35 +01:00
Martin Stein
0ab5310b8a hw: enable kernel-internal tests via run tool
Kernel tests are done by replacing the implementation of an otherwise
empty function 'Kernel::test' that gets called once at the primary CPU
as soon as all kernel initialization is done. To achieve this, the test
binary that implements 'Kernel::test' must be linked against the core
lib and must then replace the core binary when composing the boot image.
The latter can be done conveniently in a run script by setting the new
argument 'core_type' of the function 'build_boot_image' to the falue
'test'. If no kernel test is needed the argument does not have to be
given - it is set to 'core' by default which results in a "normal"
Genode image.

ref #1225
2014-11-28 12:02:34 +01:00
Martin Stein
b3bc9bd549 hw: idle execution context is no thread anymore
Previously, Idle_thread inherited from Thread which caused an extra
processor_pool.h and processor_pool.cc and also made class models for
processor and scheduling more complex. However, this inheritance makes
not much sense anyway as an idle context doesn't trigger most of the code
in Thread.

ref #1225
2014-11-28 12:02:34 +01:00
Martin Stein
ec6c19a487 base: memory barriers in lock implementations
The memory barrier prevents the compiler from changing the program order
of memory accesses in such a way that accesses to the guarded resource
get outside the guarded stage. As cmpxchg() defines the start of the
guarded stage it also represents an effective memory barrier.

On x86, the architecture ensures to not reorder writes with older reads,
writes to memory with other writes (except in cases that are not
relevant for our locks), or read/write instructions with I/O
instructions, locked instructions, and serializing instructions.

However on ARM, the architectural memory model allows not only that
memory accesses take local effect in another order as their program
order but also that different observers (components that can access
memory like data-busses, TLBs and branch predictors) observe these
effects each in another order. Thus, a correct program order isn't
sufficient for a correct observation order. An additional architectural
preservation of the memory barrier is needed to achieve this.

Fixes #692
2014-11-28 12:02:34 +01:00
Stefan Kalkowski
d452f37c25 hw: print page faults of core (fix #1286) 2014-11-28 12:00:44 +01:00
Alexander Boettcher
eedf3fa413 nova: update to r7 branch
Fixes #1297
2014-11-28 12:00:44 +01:00
Alexander Boettcher
4de6d54e50 vmm: tag printf with compiler "printf" attribute
Issue #1296
2014-11-20 17:10:18 +01:00
Alexander Boettcher
cdcc4ee60f pthread: support pthread_once
Issue #1296
2014-11-20 17:10:07 +01:00
Alexander Boettcher
e6850359e1 rtc: be less verbose
Issue #1296
2014-11-20 17:09:42 +01:00
Christian Helmuth
1a718a7770 prepare_port: log download errors explicitly 2014-11-20 17:06:41 +01:00
Christian Helmuth
c3ce1887a2 openssl: fix download location
Issue #1295
2014-11-20 17:05:59 +01:00
Christian Prochaska
ac6c4682f3 okl4: declare read-write-lock as volatile
GCC 4.7.4 and newer seems to optimize the lock-variable accesses more
radically, which uncovered the missing volatile qualifier and resulted
in:

Assertion "(int)locked >= 0" failed in file '.../okl4_x86/kernel/include/kernel/read_write_lock.h', line 151 (fn=f0104771)
--- "KD# assert" ---
2014-11-20 16:39:16 +01:00
Sebastian Sumpf
97d117c89d noux: reinitialize Genode::config 2014-11-20 16:39:16 +01:00
Martin Stein
635de1791f hw: fix panda instability on kernel exits
Invalidating all branch predictors before switching the PD
fixes instability problems on Panda and has not much effect
on the performance of other boards. However, we neither know why
this is a fix nor wether it fixes the real cause of the problem.

fix #1294
2014-11-20 16:39:16 +01:00
Stefan Kalkowski
0ffc89ee30 hw: clrex during context switch (Fixes #1196) 2014-11-20 16:39:16 +01:00
Christian Menard
eedddeced1 dde_linux: fix bug in find_next_zero_bit_le
value '1' has a default type of int, but long is needed to cover all 64 bits
2014-11-20 16:39:16 +01:00
Christian Prochaska
2583aa2ab4 tool_chain: update GCC to version 4.7.4
Fixes #1051.
2014-11-20 16:39:16 +01:00
Alexander Boettcher
0b194c9689 init: restrict cpu_sessions to configured affinity
Fixes #1289
2014-11-14 12:01:45 +01:00
Martin Stein
8dad54c914 hw: fix scheduler timing on prio preemption
Previously, the timer was used to remember the state of the time slices.
This was sufficient before priorities entered the scene as a thread always
received a fresh time slice when he was scheduled away. However, with
priorities this isn't always the case. A thread can be preempted by another
thread due to a higher priority. In this case the low-priority thread must
remember how much time he has consumed from its current time slice because
the timer gets re-programmed. Otherwise, if we have high-priority threads
that block and unblock with high frequency, the head of the next lower
priority would start with a fresh time slice all the time and is never
superseded.

fix #1287
2014-11-14 12:00:45 +01:00
Christian Prochaska
dda8044183 nova: refine the timer delay heuristic
Fixes #1291
2014-11-12 14:49:42 +01:00
Alexander Boettcher
3babee4e19 vbox: support resetting of a VM
Fixes #1290
2014-11-12 14:47:47 +01:00
Christian Prochaska
cb51d67c8d vbox: don't enforce instruction emulation after recall event
Fixes #1284
2014-11-12 14:44:17 +01:00
Sebastian Sumpf
bc4eab430a lxip: Add loopback device
Fixes #1204
2014-11-12 14:44:17 +01:00
Norman Feske
21f013d2c4 libports/sdl: fix keycode for return key 2014-11-12 14:44:17 +01:00
Norman Feske
620d6c8ab2 rpi: add buffered mode to framebuffer driver 2014-11-12 14:44:17 +01:00
Norman Feske
50ea944789 libports/sdl_image: enable XPM, add include/SDL
Some SDL applications expect the SDL_image headers in include/SDL to be
reachable without the SDL/ prefix. This patch adds the corresponding
search path. Furthermore it enables support for XPM images.
2014-11-12 14:44:17 +01:00
Sebastian Sumpf
d426c5e6c2 dde_linux: make drivers self containing
Ported drivers list and extract all needed source files. This decouples
ports according to contrib sources and also enables us to revert lxip to
Linux version 3.9, while staying with 3.14 for usb.

Fixes #1285
2014-11-12 14:44:17 +01:00
Christian Helmuth
2eca4ec98b base: document specifics of Slab::alloc()
Also removed unimplemented overload of alloc() with no parameters.
2014-11-12 14:44:16 +01:00
Christian Helmuth
e708bbe2c6 libc: do not zero errno on success in vfs plugin
The manpage to errno tells the following story:

The <errno.h> header file defines the integer variable errno, which is
set by system calls and some library functions in the event of an error
to indicate what went wrong. Its value is significant only when the
return value of the call indicated an error (i.e., -1 from most system
calls; -1 or NULL from most library functions); a function that
succeeds is allowed to change errno.

Valid error numbers are all nonzero; errno is never set to zero by any
system call or library function.
2014-11-12 14:44:16 +01:00
Christian Helmuth
20afccf6ed vfs: use 256-byte buffer in log file system
128 bytes is not much for logging-output line length esp. when also
counting the color sequences of PDBG() and friends.
2014-11-12 14:44:16 +01:00
Christian Helmuth
f8dcf76480 dde_kit: panic does not return
The attributes enables to use panic as final statement in branches of
functions declared to return.
2014-11-12 14:44:16 +01:00
Christian Prochaska
ac47053b2f vbox: set the 'CPUM_CHANGED_GLOBAL_TLB_FLUSH' flag
Fixes #1281
2014-11-12 14:44:16 +01:00
Christian Prochaska
d65826a85d vbox: always transfer FPU ownership back to the VM
When the 'Mtd::FPU' flag is set during the registration of a
virtualization event handler, it must also be set whenever the event
handler returns.

Fixes #1283
2014-11-12 14:44:16 +01:00
Christian Prochaska
e3fa8c9f22 vbox: save the guest FPU state before 'longjmp()'
'longjmp()' restores the (partial) FPU state saved by 'setjmp()', so it's
necessary to save the guest FPU state before calling 'longjmp()'.

Fixes #1282
2014-11-12 14:44:16 +01:00
Norman Feske
6afba00ad6 okl4: fix success condition in priority test 2014-11-12 14:44:16 +01:00
Norman Feske
e4c636b0a0 init: clamp priority values to valid range
This patch ensures that priority values passed as session arguments
are within the valid range of priorities. Without the clamping, a child
could specify a priority of a lower priority band than the one assigned
to the subsystem. Thanks to Johannes Schlatow for reporting this issue.

Fixes #1279
2014-11-12 14:44:15 +01:00
Sebastian Sumpf
8b0f9fd82a rump: Use shared library interface
Remove DL-interface

Fixes #1280
2014-11-12 14:44:15 +01:00
Sebastian Sumpf
5a821d4c92 base: Genode's dynamic linker
Issue #1280
2014-11-12 14:44:15 +01:00
Sebastian Sumpf
8738673625 base-codezero: Add dummy functions to syscall library
Issue #1280
2014-10-30 13:36:14 +01:00
Sebastian Sumpf
e0ed7c3cd0 base-pistachio: Add syscall library support
Makes old l4 library obsolete

Issue #1280
2014-10-30 13:36:13 +01:00
Norman Feske
c6fdc2923f News item about the first seL4 article 2014-10-30 13:17:37 +01:00
Christian Helmuth
351dad80af noux: increase timeout for tool-chain test
This is just a quick fix to calm down the buildbot - a revised
implementation is needed according to issue #1277. Further, the reason
for the increased test duration on several platforms must be
investigated.
2014-10-21 11:05:15 +02:00
Christian Helmuth
6e166d01bb autopilot: detect missing run script with timestamps 2014-10-21 11:05:15 +02:00
Josef Söntgen
35239b84df dde_kit: remove jiffies alias
The alias is rather Linux-specific and also prevents particularly
tailored jiffies implementations. For the existing dde_linux ports (usb
and lxip) we just define jiffies to be dde_kit_timer_ticks with a
preprocessor macro.
2014-10-21 11:05:15 +02:00
Norman Feske
6244c6ec97 gems: launcher application 2014-10-13 15:21:55 +02:00
Norman Feske
cc303c4671 gems: new menu-view application
The menu view generates a simple dialog of widgets and reports the
hovered element. It is meant to be embedded into applications that
require simple GUIs but don't want to deal with the pecularities of
a full-blown widget set.
2014-10-13 15:21:54 +02:00
Norman Feske
40aadb8601 gems: add gems/wrapped_nitpicker_session.h
The 'Wrapped_nitpicker_session' contains the boiler-plate code that is
needed when virtualizing the nitpicker session interface.
2014-10-13 15:21:54 +02:00
Norman Feske
ece64db196 gems: move reusable wm headers to include/gems 2014-10-13 15:21:54 +02:00
Norman Feske
ec565c1ded gems: add include/gems/animator.h
The utility for animating GUI elements was formerly private to
'app/decorator'.
2014-10-13 15:21:54 +02:00
Norman Feske
9129db03c4 gems: nit_fader 2014-10-13 15:21:54 +02:00
Norman Feske
08d28e9b94 nitpicker: add 'session_control' RPC function
The new 'session_control' function can be used to perform operations on
the global view stack that span one or multiple sessions, e.g., bringing
all views of specific sessions to the front, or hiding them.
2014-10-13 15:21:54 +02:00
Norman Feske
5af830c0de demo/scout: alpha-surface support for icon_painter 2014-10-13 15:21:54 +02:00
Norman Feske
94f9e989df wm: invalidate dataspaces on model updates
If the Rom_session::update function returns false, the ROM dataspace may
have been physically destructed (and core has removed all mappings).
In this case, we have to omit the detach operation in the destructor
of 'Attached_dataspace' to avoid detaching the same region twice.
2014-10-13 15:21:54 +02:00
Norman Feske
2f5cff5347 os: add 'Attached_dataspace::invalidate' 2014-10-13 15:21:54 +02:00
Norman Feske
b2b5d1b2d2 os: make reusable cli_monitor headers public
The child handling as done by CLI monitor is worth reusing. Hence, this
patch moves the corresponding headers to 'os/include/cli_monitor/'.
2014-10-13 15:21:54 +02:00
Norman Feske
28119e3536 os: add 'Reporter::name' accessor 2014-10-13 15:21:54 +02:00
Norman Feske
13bce287ad os: add 'Xml_node::for_each_sub_node'
The new function template simplifies the common case of iterating
through the sub nodes of an XML node.
2014-10-13 15:21:53 +02:00
Norman Feske
3a1ecdd5a7 os: fix race in 'os/child_policy_dynamic_rom.h' 2014-10-13 15:21:53 +02:00
Norman Feske
c48a4ebce8 os: add texture_rgb888.h and texture_rgb565.h
The headers 'texture_rgb565.h' and 'texture_rgb888' contain
template specializations needed for using the 'Texture::rgba' function
for the respective pixel formats. The specializations were formerly
contained in application-local code.
2014-10-13 15:21:53 +02:00
Norman Feske
0b3efa90c9 gems: move reusable code to include/gems
This patch makes various utilities that were originally developed for
the backdrop application publicly available.
2014-10-13 15:21:53 +02:00
Norman Feske
40d92b7cec os: improve alpha-channel support for Pixel_rgba
This patch add an optional alpha argument to the constructor, which may
be passed to a pixel type representing an alpha channel. Furthermore,
a new overload of the mix function has been added to accommodate use
cases where one texture is applied to both a pixel surface and an alpha
channel.
2014-10-13 15:21:53 +02:00
Norman Feske
b01c74ae12 os: define ALPHA8 pixel format 2014-10-13 15:21:53 +02:00
Norman Feske
a7fa0ccd06 base: add 'String::operator!=' 2014-10-13 15:21:53 +02:00
Norman Feske
46968c0015 nitpicker: motion events for non-xray clients
When X-ray mode is active, nitpicker filters motion events that are not
referring to the currently focused domain. However, domains configured
as xray="no" (such as a panel) need to obtain motion events regardless
of the xray mode. This patch relaxes the motion-event filtering to
accommodate such clients.
2014-10-13 15:21:53 +02:00
Norman Feske
2ef0b0796c nitpicker: report xray mode 2014-10-13 15:21:53 +02:00
Norman Feske
a00f9bcf99 nitpicker: disable reports by default
Prior this change, a config update would not disable reports if the
report node disappeared during the update.
2014-10-13 15:21:53 +02:00
Norman Feske
83705d3c78 nitpicker: fix input-mask offset calculation
The buffer offset was wrongly accounted for. The miscalculation went
unnoticed until now because the buffer offset was apparently never used
in combination with alpha-channels.
2014-10-13 15:21:53 +02:00
Norman Feske
23c22f52b3 nitpicker: consider xray config in find_view
If a domain is configured as xray="no", we want to let the views of the
domain respond to input events like in flat mode, even if xray mode is
active. Normally, the input mask of views with an alpha channel is
disregarded in X-ray mode. However, for non-ray views, the input mask
should always be considered.
2014-10-13 15:21:53 +02:00
Norman Feske
3113aac2c0 dynamic_rom: remove superfluous sigh dissolve
The 'Signal_rpc_member' takes care about dissolving its signal context
from the receiver. So we don't need to manually perform this operation
in the session destructor.
2014-10-13 15:21:52 +02:00
Norman Feske
e20c27c9ab init: use file name as label for redirected ROMs 2014-10-13 15:21:52 +02:00
Norman Feske
a3985f3d04 ports: rpi support in netperf run scripts 2014-10-13 14:53:36 +02:00
Norman Feske
181d507cf8 libports: rpi support in lwip.run 2014-10-13 14:53:20 +02:00
Norman Feske
85362ba0b9 dde_linux: USB SOF IRQ filter for Raspberry Pi 2014-10-13 14:53:00 +02:00
Norman Feske
58a1e42201 hw/rpi: USB SOF interrupt filtering 2014-10-13 14:52:43 +02:00
Norman Feske
d59d3c684f hw: don't preserve mmio of core devices
Fixes #1269
2014-10-13 14:51:55 +02:00
Christian Prochaska
d7c2a5cd7f VFS: acquire tar dataspace only once
Fixes #1271
2014-10-13 08:43:55 +02:00
Sebastian Sumpf
0b0074d2ff seoul: update pae branch
Fixes #1262
2014-10-10 14:46:14 +02:00
Alexander Boettcher
a48efd0a9d seoul: enable -Wall and fix warnings
Issue #1262
2014-10-10 14:46:02 +02:00
Christian Prochaska
443dc1f71d sdl: evaluate the motion event type
Fixes #1272
2014-10-10 13:02:46 +02:00
Christian Prochaska
2db563ebdd libc_lwip: 'fcntl()' fix
Fixes #1273
2014-10-10 13:02:46 +02:00
Christian Prochaska
1e424a6fd2 run: mark ext2 partition as bootable
When building for the 'disk' run target, the ext2 partition needs to be
marked as bootable to be booted from on some hardware.

Fixes #1270
2014-10-10 13:02:46 +02:00
Christian Helmuth
2350eac251 xml_generator: timer not needed for test 2014-10-10 13:02:45 +02:00
Christian Prochaska
363ffe40a0 qt5: support window resizing by window manager
Fixes #1268
2014-10-10 13:02:38 +02:00
Christian Prochaska
4539eb7512 heap: release some memory to the RAM session
With this patch, allocations >= 64K are fulfilled by dedicated
dataspaces, which are released to the RAM session when not needed
anymore.

Fixes #1267
2014-10-10 13:02:38 +02:00
Alexander Boettcher
53d471aa22 nova: handle race during signal setup phase
Fixes #1266
2014-10-10 13:02:32 +02:00
Christian Prochaska
0252d47f28 VESA driver: typo fix
Fixes #1265.
2014-10-10 13:02:32 +02:00
Christian Prochaska
4d4d3cb9bb VESA driver: choose highest resolution video mode
With this patch, the VESA driver chooses the video mode with the highest
resolution from the list of available modes if no resolution is
explicitly configured.

Fixes #1263.
2014-10-10 13:02:31 +02:00
Sebastian Sumpf
b32b6948c7 seoul: use pae branch of seoul
Fixes #1262
2014-10-10 13:02:31 +02:00
Alexander Boettcher
d006185d90 seoul: add script turning Genode scenario into VM
Related to issue #1261
2014-10-10 13:02:31 +02:00
Alexander Boettcher
9f8c87f2ed ahci: ignore spurious interrupts
Qemu 2.0 makes trouble when using seoul-disc.run - related to #1261
2014-10-10 13:02:31 +02:00
Norman Feske
ba34bc32c2 iso9660: remove on-demand paging
Required to run a Genode VM provided as ISO - issue #1261
2014-10-10 13:02:31 +02:00
Bernhard Kauer
27d76f77d1 seoul: update branch to using vbios emulators
* use seoul branch containing vbios emulator

* report the memory model in the VBE mode info as otherwise the
  Genode framebuffer driver will ignore this mode

Fixes #1261
2014-10-10 13:02:31 +02:00
Christian Prochaska
0be264d7d2 ps2_drv: read configuration before self tests
It turned out that the controller configuration can change during the self
tests, so now it is read before running the tests and restored afterwards.

Fixes #1260.
2014-10-10 13:02:30 +02:00
Christian Prochaska
81af714949 Input merger
This component merges the input events of multiple sources.

Example configuration:

<start name="input_merger">
	<resource name="RAM" quantum="1M" />
	<provides>
		<service name="Input" />
	</provides>
	<config>
		<input label="ps2" />
		<input label="usb_hid" />
	</config>
	<route>
		<service name="Input">
			<if-arg key="label" value="ps2" /> <child name="ps2_drv" />
		</service>
		<service name="Input">
			<if-arg key="label" value="usb_hid" /> <child name="usb_drv" />
		</service>
		<any-service> <parent /> <any-child /> </any-service>
	</route>
</start>

For each 'input' config node, the component opens an 'Input' session with the
configured label. This label is then evaluated by 'init' to route the session
request to a specific input source component.

Fixes #1259.
2014-10-10 13:02:30 +02:00
Stefan Kalkowski
3befb64afe hw: correctly flush cache on ARM (fix #1257)
* When flushing the data and unified cache on ARM, clean and invalidate
  instead of just cleaning the corresponding cache lines
* After zero-ing a freshly constructed dataspace in core, invalidate
  corresponding cache lines from the instruction cache
2014-10-10 13:02:30 +02:00
Josef Söntgen
23dcbff998 libports: fix sdl_mixer include paths
Fixes #1255.
2014-10-10 13:02:30 +02:00
Christian Prochaska
c41a102bc4 Add 'check_tool' function to new ports mechanism
Fixes #1254.
2014-10-10 13:02:30 +02:00
Stefan Kalkowski
f0fae2a5f2 hw: set TTBR0 according to CPU facilities
Fixes #1195
2014-10-10 13:02:30 +02:00
Christian Helmuth
e9032904a3 Increase slab-block size in signal component
The backend allocator for the slab is a sliced heap, which hands out
allocations with page-size granularity (4096 bytes). Therefore, the
slab-block size should also be about a multiple of the page size minus
some bytes of overhead.

Additional adjustments:

- The slab-block size and the default quota-upgrade amount for SIGNAL
  sessions depends on the platform bit width now.
- The signal test also stresses the case of many managed context in one
  session including creation and destruction of the used signal receiver
  in repeated rounds.
2014-10-10 13:02:29 +02:00
Christian Helmuth
aea35ee7d2 lx_fs: improve root directory handling
- correctly catch and report non-existing root directories
- remove *all* leading slashes from root-directory attributes and
  sanitize empty declarations to current working directory
2014-10-10 13:02:29 +02:00
Alexander Boettcher
96d9e442f5 vbox: enable auto test for 32bit Genode host
Issue #1246
2014-10-10 13:02:28 +02:00
Alexander Boettcher
8b8c2713ae vfs: use 64bit for file offset and size
Fixes #1246
2014-10-10 13:02:28 +02:00
Christian Helmuth
289cfa5fcf terminal: fix warning about uninitialized variable
In fact the struct member `value` was not initialized for Invalid_entry.
2014-09-11 10:23:39 +02:00
Christian Helmuth
0b5f901e58 Log name of exiting child from Child::exit()
Fixes #1243.
2014-09-11 10:23:39 +02:00
Stefan Kalkowski
53a7b4ca66 blk_cache: don't try to sync 'zero' chunks
Invalid cache entries called 'zero chunks' shouldn't be synced.

Fix #1249
2014-09-11 10:23:38 +02:00
Stefan Kalkowski
41b62e50bb blk_cache: correctly examine return value in write
Ref #1249
2014-09-11 10:23:38 +02:00
Alexander Boettcher
1add912df2 acpi: fix skipping over parameters of devices
Fixes lookup of pci GSI IRQ re-routing tables seen on Ultrabook Fujitsu t904.

Fixes #1250
2014-09-11 10:23:38 +02:00
Alexander Boettcher
cc2f173ca3 run: support Intel AMT wsman protocol
The older SOAP EOI protocol is not supported with AMT version 9+. By default
the wsman tool will be used if installed.

RUN_OPT examples to enforce amtool or wsman:

--target amt --amt-tool wsman
--target amt --amt-tool amttool

Fixes #1251
2014-09-11 10:23:38 +02:00
Christian Helmuth
976d669253 base-nova: remove special Thread_base::myself()
The weak implementation was added for quite special purposes years ago
and is no longer needed. On the other hand, the weak attribute does not
help if the implementation ends up in a shared library, which first
resolves symbols locally before asking ldso (that includes the acutal
thread library) *shiver*
2014-09-04 14:45:39 +02:00
Norman Feske
be4971eb0a libports: fix VFS config of sdl.run 2014-09-02 18:06:38 +02:00
Christian Helmuth
7394f0c306 nitpicker: fix warning about truncated integer
warning: large integer implicitly truncated to unsigned type [-Woverflow]
2014-09-01 18:16:07 +02:00
Norman Feske
3cbbf8aa60 libports: download location of jbig2dec
The original git:// URL produced the following error:

Cloning into 'jbig2dec'...
fatal: remote error: access denied or repository not exported: /jbig2dec.git
2014-09-01 13:17:24 +02:00
Norman Feske
e7ebfb6874 qt4: change download URL for qscriptclassic
The archive vanished from the previously used mirror.
2014-09-01 11:00:38 +02:00
2325 changed files with 117307 additions and 87056 deletions

5
.gitignore vendored
View File

@@ -19,16 +19,12 @@
/repos/dde_rump/include/rump
/repos/libports/contrib
/repos/libports/download
/repos/libports/src/lib/qt5/qtjsbackend
/repos/libports/src/lib/qt5/qtwebkit/Source/JavaScriptCore
/repos/libports/src/lib/qt5/qtwebkit/Source/WebCore/generated
/repos/ports-foc/contrib
/repos/ports-okl4/contrib
/repos/ports-okl4/download
/repos/ports/contrib
/repos/ports/download
/repos/ports/src/app/arora/html
/repos/ports/src/lib/gdbserver_platform/generated
/repos/qt4/contrib
/repos/qt4/download
/repos/qt4/tool/bootstrap
@@ -39,5 +35,4 @@
/repos/qt4/tool/qmake/qmake
/repos/qt4/tool/rcc
/repos/qt4/tool/uic
/repos/linux_drivers

View File

@@ -1 +1 @@
14.08
15.05

View File

@@ -107,7 +107,7 @@ Applications and library infrastructure
independent trusted component facilitating Genode secure GUI server
(Nitpicker).
:Graphical on-target IPC tracing tool using Qt4:
:Graphical on-target IPC tracing tool using Qt:
Analysing the interaction of components of a multi-server operating system
such as Genode is important to discover bottlenecks of the system and for
@@ -130,7 +130,7 @@ Applications and library infrastructure
communication and control flows between those processes, and to visualize the
interaction of threads with the kernel's scheduler.
Since Qt4 is available natively on Genode, the creation of both offline and
Since Qt is available natively on Genode, the creation of both offline and
on-target analysis tools has become feasible. The first step of this project
is creating an interactive on-target tool, that displays the interaction
of communicating threads as captured on the running system. The tool should
@@ -140,9 +140,9 @@ Applications and library infrastructure
Application frameworks
######################
:Running the Meego application stack on Genode using Qt4:
:Running the Meego application stack on Genode using Qt:
With Genode 11.02, Qt4 4.7.1 has become available. The most prominent feature
With Genode 11.02, Qt has become available. The most prominent feature
of this version is the new QML language to design GUIs using a declarative
language. This technique is targeted specifically to mobile applications and
other touch-based devices. The goal of this project is to run the Meego
@@ -152,18 +152,18 @@ Application frameworks
interface. The immediate goal of the first step is running one Meego example
application natively on Genode.
:Python Qt4 bindings:
:Python Qt bindings:
With the Python interpreter and the port of the Qt4 framework, the principle
With the Python interpreter and the port of the Qt framework, the principle
components for Python-based GUIs on Genode are available. However, the glue
between both components is missing. The incentive of this work is supplementing
our Python port with the modules needed for real applications and porting the
Qt4 bindings to Genode. This would bring Genode one step closer to executing
Qt bindings to Genode. This would bring Genode one step closer to executing
modern Python-based GUI applications (in particular KDE4 applications).
:Evaluation of porting GTK+ to Genode:
With Qt4, we have demonstrated the feasibility to run a highly-complex
With Qt, we have demonstrated the feasibility to run a highly-complex
application framework via Genode on a wide range of microkernels. That leaves
the question of looking into the other major toolkit in town, namely GTK+ as
used by Firefox and the Gnome desktop.
@@ -243,7 +243,7 @@ Device drivers
The efforts towards enabling mobile application stacks such as Meego and
Android on Genode must be accompanied by a revision of Genode's 'Input'
session interface to accommodate multi-touch input devices. First, existing
APIs such as multi-touch support in X11, Qt4, and Android should be analysed.
APIs such as multi-touch support in X11, Qt, and Android should be analysed.
Based on these findings, we expect a proposal for changing Genode's input
interface. The interface extension should be validated by a example driver
implementing the interface as well as an example applications.

View File

@@ -18,16 +18,15 @@ macros.
! COLOR_GREEN = 3
! };
:Meta-programming:
:Meta programming:
Use templates instead of pre-processor macros.
In contrast to macros, templates are type-safe
and fit well with the implementation syntax.
Use templates instead of pre-processor macros. In contrast to macros,
templates are type-safe and fit well with the implementation syntax.
:Conditional-code inclusion:
Please avoid C-hacker style '#ifdef CONFIG_PLATFROM' - '#endif'
constructs but instead, factor-out the encapsulated code into a
constructs. Instead, factor-out the encapsulated code into a
separate file and introduce a proper function interface.
The build process should then be used to select the appropriate
platform-specific files at compile time. Keep platform dependent
@@ -50,17 +49,18 @@ Header of each file
Identifiers
===========
* First character of class names uppercase, any other characters lowercase
* Function and variable names lower case
* 'Multi_word_identifiers' via underline
* 'CONSTANTS' upper case
* Private and protected members of a class begin with an '_'-character
* The first character of class names are uppercase, any other characters are
lowercase.
* Function and variable names are lower case.
* 'Multi_word_identifiers' use underline to separate words.
* 'CONSTANTS' and template arguments are upper case.
* Private and protected members of a class begin with an '_'-character.
* Accessor functions are named after their corresponding attributes:
! /**
! * Request private member variable
! */
! int value() { return _value; }
! int value() const { return _value; }
!
! /**
! * Set the private member variable
@@ -73,14 +73,22 @@ Indentation
* Use one tab per indentation step. *Do not mix tabs and spaces!*
* Use no tabs except at the beginning of a line.
* Use spaces for alignment
* Use spaces for the alignment of continuation lines such as function
arguments that span multiple lines. The alignment spaces of such lines
should start after the (tab-indented) indentation level. For example:
! {
! <tab>function_with_many_arguments(arg1,
! <tab><--- spaces for aligment --->arg2,
! ...
! }
* Remove trailing spaces at the end of lines
See [http://web.archive.org/web/20050311153439/http://electroly.com/mt/archives/000002.html]
for a more detailed description.
This way, everyone can set his preferred tabsize in his editor
This way, each developer can set his preferred tab size in his editor
and the source code always looks good.
_Hint:_ In VIM, use the 'set list' and 'set listchars' commands to make tabs
and spaces visible.
Switch statements
~~~~~~~~~~~~~~~~~
@@ -165,12 +173,13 @@ prepended by a header as follows:
! /**
! * Short description
! *
! * \param a meaning of parameter a
! * \param b meaning of parameter b
! * \param c,d meaning of parameters c and d
! * \param a meaning of parameter a
! * \param b meaning of parameter b
! * \param c,d meaning of parameters c and d
! *
! * \return meaning of return value
! * \retval 0 meaning of the return value 0
! * \throw Exception_type meaning of the exception
! *
! * \return meaning of return value
! *
! * More detailed information about the function. This is optional.
! */

View File

@@ -61,7 +61,7 @@ Device drivers
Device drivers usually reside in the 'src/drivers' subdirectory of source-code
repositories. The most predominant repositories hosting device drivers are
'os', 'linux_drivers', 'dde_ipxe', 'dde_linux'.
'os', 'dde_ipxe', 'dde_linux'.
Platform devices
@@ -73,8 +73,14 @@ Platform devices
Implements the PCI-session interface using the PCI controller as found on
x86 PC hardware. Using this interface, a client can probe for a particular
device and request information about physical device resources (using the
'pci_device' interface). These information are subsequently used to request
respective IO_MEM, IRQ, and IO_PORT sessions at core.
'pci_device' interface). I/O resources for MMIO regions, I/O ports, and
interrupts can be requested by the provided PCI device abstraction.
:'os/src/drivers/acpi':
On x86 platforms that use the APIC (namely Fiasco.OC, NOVA, and hw_x86_64)
this simple ACPI parser traverses the ACPI tables and updates interrupt line
information of PCI devices within the PCI config space. It uses the pci_drv as
a utility started as a child and exports its interface.
UART devices
@@ -167,7 +173,6 @@ provided by the kernel, or a pseudo time source (busy):
:'nova': NOVA kernel semaphores as time source
:'codezero': busy time source
:'okl4_arm': busy time source
:'okl4_x86': PIT as time source
:'foc': IPC timeout as time source
:'fiasco': IPC timeout as time source
@@ -184,13 +189,10 @@ All audio-output drivers implement the audio session interface defined at
:'os/src/drivers/audio_out/linux':
Uses ALSA as back-end on the Linux base platform.
:'dde_oss/src/drivers/oss':
Sound drivers for the most common PC sound hardware, ported from the
Open Sound System project.
:'linux_drivers/src/drivers/audio_out':
Sound drivers for the most common PC sound hardware, ported from the Linux
kernel.
:'dde_bsd/src/drivers/audio_out':
Sound drivers ported from OpenBSD. Currently, the repository
includes support for Intel HD Audio as well as for Ensoniq AudioPCI
(ES1370) compatible sound cards.
Block drivers
@@ -199,9 +201,6 @@ Block drivers
All block drivers implement the block-session interface defined at
'os/include/block_session/'.
:'os/src/drivers/atapi':
Driver for ATAPI CD-ROM devices on x86 PCs.
:'os/src/drivers/sd_card/pl180':
Driver for SD-cards connected via the PL180 device as found on the PBX-A9
platform.
@@ -212,13 +211,20 @@ All block drivers implement the block-session interface defined at
:'os/src/drivers/sd_card/exynos5':
Driver for SD-cards and eMMC connected to Exynos-5-based platforms.
:'linux_drivers/src/drivers/usb':
:'os/src/drivers/sd_card/imx53':
Driver for SD-cards connected to the Freescale i.MX53 platform like the
Quick Start Board or the USB armory device.
:'os/src/drivers/sd_card/rpi':
Driver for SD-cards connected to the Raspberry Pi.
:'dde_linux/src/drivers/usb':
USB driver that makes USB storage devices available as block sessions.
For an example of using this driver, refer to the run script at
'linux_drivers/run/usb_storage'.
'dde_linux/run/usb_storage'.
:'os/src/drivers/ahci':
Driver for SATA disks on x86 PCs.
Driver for SATA disks and CD-ROMs on x86 PCs.
Network interface drivers
@@ -239,8 +245,9 @@ defined at 'os/include/nic_session'.
Device drivers ported from the iPXE project. Supported devices are Intel
E1000 and pcnet32.
:'linux_drivers/src/drivers/madwifi':
The MadWifi wireless stack ported from the Linux kernel.
:'dde_linux/src/drivers/wifi':
The wifi_drv component is a port of the Linux mac802.11 stack, including the
iwlwifi driver. It enables the use of Intel Wireless 6xxx and 7xxx cards.
:'dde_linux/src/drivers/usb':
For the OMAP4 platform, the USB driver contains the networking driver.
@@ -324,10 +331,6 @@ Separate components:
Provides each file contained in a tar file obtained via Genode's ROM session
as separate ROM session.
:'os/src/server/fs_rom':
Provides files stored in a file system as individual ROM sessions. Please
refer to 'os/src/server/fs_rom' for more information.
:'os/src/server/iso9660':
Provides each file of an ISO9660 file system accessed via a block session as
separate ROM session.
@@ -398,6 +401,7 @@ Separate components:
A ROM service that translates the 'File_system' session interface to the
'ROM' session' interface. Each request for a ROM file is handled by looking
up an equally named file on the file system.
Please refer to 'os/src/server/fs_rom' for more information.
:'os/src/server/dynamic_rom':
A simple ROM service that provides ROM modules that change in time according
@@ -412,6 +416,14 @@ Separate components:
by providing an encrypted connection to a remote host. It is plugged between
NIC server (such as a network driver) and NIC client.
:'os/src/server/input_merger':
A component that merges input events from multiple sources into a single
stream.
:'gems/src/server/nit_fader':
A wrapper for nitpicker's session interface that applies alpha-blending to
the of views a nitpicker client.
Libraries:
:'libports/lib/mk/libc':
@@ -449,9 +461,9 @@ Libraries:
:'libports/lib/mk/stdcxx':
Standard C++ library
:'libports/lib/mk/gallium' + 'linux_drivers/lib/mk/gpu_i915_drv':
:'libports/lib/mk/gallium':
Translates the OpenGL API to a framebuffer session using the MESA OpenGL
stack and the Intel GEM GPU driver.
stack
:'libports/lib/mk/pthread':
Subset of the POSIX thread and semaphore API.
@@ -475,9 +487,6 @@ Libraries:
:'libports/lib/mk/lua':
Runtime for the Lua scripting language.
:'qt4':
Qt4 framework, using nitpicker session and NIC session as back end.
:'libports/lib/mk/qt5_*':
Qt5 framework, using nitpicker session and NIC session as back end.
@@ -501,6 +510,10 @@ located in their respective directory.
:'demo/src/app/launchpad':
Graphical application for interactively starting and killing subsystems.
:'gems/app/launcher': Graphical launcher of Genode subsystems.
:'os/app/cli_monitor': Command-line-based launcher of Genode subsystems.
:'demo/src/app/scout':
Graphical hypertext browser used for Genode's default demonstration scenario.
@@ -508,20 +521,17 @@ located in their respective directory.
Example program for using OpenGL via the Gallium3D graphics stack.
:'ports/src/app/arora':
Arora is a Qt4-based web browser using the Webkit engine.
Arora is a Qt-based web browser using the Webkit engine.
:'ports/src/app/gdb_monitor':
Application that allows the debugging of a process via GDB over a remote
connection.
:'qt4/src/app/qt_launchpad':
Graphical application starter implemented using Qt4.
:'libports/src/app/qt5/qt_launchpad':
Graphical application starter implemented using Qt.
:'qt4/src/app/examples/':
Several example applications that come with Qt4.
:'libports/src/app/qt5':
Qt5 examples including qt_launchpad and qt_avplay.
:'libports/src/app/qt5/examples/':
Several example applications that come with Qt.
:'os/src/app/xvfb':
Is a proxy application that enables the integration of a virtual X server
@@ -552,7 +562,7 @@ Runtime environments
:'ports-foc/src/l4android': L4Android is a variant of L4Linux that is able
to execute the Android software stack on top of the Fiasco.OC kernel.
:'ports/src/vancouver': Vancouver is a virtual-machine monitor developed for
:'ports/src/app/seoul': Seoul is a virtual-machine monitor developed for
the use with the NOVA platform. It virtualizes 32bit x86 PC hardware
including various peripherals.
@@ -562,3 +572,5 @@ Runtime environments
:'ports/src/app/dosbox': A port of DosBox for executing DOS software.
:'ports/src/virtualbox': VirtualBox running on top of the NOVA hypervisor.

View File

@@ -21,12 +21,16 @@ Quick start to build Genode for Linux
The best starting point for exploring Genode is to run it on Linux. Make sure
that your system satisfies the following requirements:
* GNU 'Make' version 3.81 or newer
* GNU Make version 3.81 or newer
* 'libSDL-dev'
* 'tclsh' and 'expect'
* 'byacc' (only needed for the L4/Fiasco kernel)
* 'qemu' and 'genisoimage' (for testing non-Linux platforms via Qemu)
For using the entire collection of ported 3rd-party software, the following
packages should be installed additionally: 'autoconf2.64', 'autogen', 'bison',
'flex', 'g++', 'git', 'gperf', 'libxml2-utils', 'subversion', and 'xsltproc'.
Furthermore, you will need to install the official Genode toolchain, which
you can download at [http://genode.org/download/tool-chain].

View File

@@ -4,6 +4,245 @@
===========
Genode OS Framework release 15.05 | 2015-05-26
##############################################
| For the first time, a Genode release is accompanied by a book.
| Further highlights of the current release are vast improvements of our
| base-hw kernel, preliminary support for the seL4 microkernel, new
| device-driver infrastructure, and plenty of new device drivers.
With version 15.05, we equip Genode users with comprehensive documentation
in the form of the free book "Genode Foundations". The book covers the
architecture in great detail, assists developers with the explanation of the
development environment and system configuration, and provides insights behind
the scenes of the framework. Furthermore, the book contains the specification
of the framework's programming interfaces.
Besides the documentation, the second highlight of the release is the base-hw
kernel, which enables the execution of Genode without a 3rd-party microkernel.
Our kernel, originally designed for the ARM architecture, has become able
to run on the 64-bit x86 architecture, it received support for
kernel-protected capabilities, and its scheduler got much more flexible.
Even though we invest a lot of work in our custom kernel, the biggest
strength of Genode is its ability to leverage the benefits of different
kernels. With the current release, we introduce preliminary support to run
simple system scenarios on top of the seL4 microkernel. With seL4, there
is now the prospect of running Genode on top of a formally verified kernel.
At the framework's architectural level, we took the opportunity to
redesign the infrastructure for user-level device drivers. With this
release, device drivers become subjected to rigid access control with respect
to hardware resources. Along with this architectural change, there are
massive improvements of the device driver support. There is a new AHCI
driver, new audio drivers ported from OpenBSD, new SD-card drivers,
added platform support for i.MX6, and support for message-signalled interrupts
on x86-based machines.
A detailed description of all the improvements is provided by the
[http:/documentation/release-notes/15.05 - release documentation of version 15.05...]
Genode's core running on the seL4 kernel | 2015-05-18
#####################################################
| In the third part of our seL4 article series, we describe the steps
| taken to run Genode's fundamental components on seL4.
The article "Porting the core component" builds upon the experience gained
from the first two articles to execute Genode-based systems on
top of seL4. As for the previous articles, it is full of technical insights
into both seL4 and Genode. Among the many challenges that had to be overcome
are the management of capabilities and memory, the synchronous RPC
communication between components, and the handling of page faults. As result,
simple Genode system scenarios can be readily executed on top of the seL4 kernel.
[http://genode.org/documentation/articles/sel4_part_3 - Read the article...]
All the steps described in the article can be followed in the
topic branch [http://github.com/nfeske/genode/commits/sel4] of the ongoing
development. Furthermore, the principle support for seL4 will be featured
in the upcoming Genode release 15.05.
An in-depth look into the ARM virtualization extensions | 2015-03-12
####################################################################
| Our new article explores the mechanisms of the ARM virtualization extensions
| and describes how Genode's custom base-hw kernel was turned into
| a microhypervisor.
With the recently published
[http:/documentation/release-notes/15.02 - version 15.02], Genode received
support for ARM's virtualization extensions. While conducting this line
of work during the year of 2014, we took the chance to thoroughly document
the experience. The article "An in-depth look into the ARM virtualization
extensions" presents the overall virtualization architecture and goes into
detail about the virtualization of memory, CPU, interrupts, and time.
Furthermore, it covers a series of experiments with I/O protection mechanisms.
[http:/documentation/articles/arm_virtualization - Read the article...]
Exercising the seL4 kernel interface | 2015-03-10
#################################################
| The second part of the article series about Genode on seL4 goes into
| detail about the kernel mechanisms for synchronous inter-process
| communication and the management of virtual memory.
The article "Genode on seL4 - IPC and virtual memory" examines the most
important mechanisms of the seL4 kernel.
It covers synchronous inter-process communication between threads, the
delegation of capabilities, and the management of virtual memory.
Apart from presenting hands-on experience with using the kernel, it identifies
potential challenges for using it as Genode base platform.
[http://genode.org/documentation/articles/sel4_part_2 - Read the article...]
All the steps described in the article can be followed in the
topic branch [http://github.com/nfeske/genode/commits/sel4] of the ongoing
development.
Genode OS Framework release 15.02 | 2015-02-27
##############################################
| Version 15.02 extends the base-hw kernel with ARM-virtualization support,
| introduces a highly modularized tool kit for automated testing, adds
| support for the USB Armory platform, and improves the performance and
| stability of VirtualBox on Genode/NOVA.
Most of the previous releases were motivated by our desire for features that
we deemed as fundamentally important to use Genode as a general-purpose
system. Now that we have reached most of the feature set that we longed after,
the project adjusts its focus. According to our recently published
[http://genode.org/about/road-map - roadmap], the underlying theme of the
current development shifted towards the cultivation of the existing feature
set rather than the introduction of new functionality. The current release
perfectly reflects this change. It introduces a highly modular tool kit for
scaling up the project's automated testing efforts and comes with stability
and performance improvements all over the place. In particular, we are happy
to report substantial performance gains of our version of VirtualBox running
on NOVA.
As a second focus of the version 15.02, our custom base-hw kernel platform
received a lot of attention. The most prominent news is the added support
for virtualization on ARM. This line of work has been conducted and refined over
the time span of more than a year and took much of our prior experience with
the NOVA virtualization architecture and ARM TrustZone into account. This
experience resulted in a novel microhypervisor design with an extremely
tiny foot print with respect to the added complexity on the account of
virtualization support. In fact, less than 1000 lines of code had to be added
to the root of the trusted computing base. Besides virtualization
support, our kernel's scheduler got refined to take IPC relationships into
account while additionally gaining support for the USB Armory hardware platform.
These and many more improvements are covered in more detail by the
[http:/documentation/release-notes/15.02 - release documentation of version 15.02...]
Road Map for 2015 | 2015-01-14
##############################
| After brainstorming Genode's mid-term future on our mailing list,
| we finalized our road map for this year.
The development during the past years was primarily driven by our desire for
features. With respect to the feature set, we have eventually reached a state
where Genode becomes viable as general-purpose computing platform.
That said, we are still not there yet, because apart from a list
of features, it is important how those features fit together and
how easy it is to use them. Therefore, the focus for 2015 will be
the consolidation and cultivation of the existing feature set.
Still, there will be room for new developments, i.e., the use of
Genode on the seL4 kernel.
The new road map is available at [http://genode.org/about/road-map].
Genode at FOSDEM 2015 | 2015-01-14
##################################
| With three talks, Genode will show a strong presence at this year's FOSDEM.
| The talks will cover an introduction of Genode, our line of work
| regarding VirtualBox on NOVA, and Genode's evolving GUI architecture.
Keeping up with our tradition to participate in the worlds largest
gathering of the open-source and free-software community, we are happy
to announce three talks to be held by Norman Feske at FOSDEM 2015:
Sunday 12:00 - 12:25 *Genode - OS security by design*
_Security devroom (AW1.120)_
Sunday 14:20 - 15:00 *Transplantation of VirtualBox to the NOVA microhypervisor*
_Virtualization devroom (UD2.120)_
Sunday 15:30 - 16:15 *Introducing a radically componentized GUI architecture*
_Microkernel devroom (K.3.201)_
More information about the talks (including abstracts) are
available at the [https://fosdem.org/2015/schedule/speaker/norman_feske/ - FOSDEM website].
Genode OS Framework release 14.11 | 2014-11-28
##############################################
| With the availability of the Intel wireless stack in version 14.11,
| we close one of the last functional gaps to use Genode on modern laptops.
| Further highlights of the new version are the trading of CPU resources
| between subsystems on top of our custom HW kernel, VirtualBox 4.3.16,
| a new dynamic linker, and networking on the Raspberry Pi.
Early on our long way towards the use of Genode as a general-purpose OS, we
identified wireless networking as a crucial functionality. For a long time,
however, we feared the topic because WiFi driver stacks are known to be
extremely complex. In spring this year, we have finally started to port the
Intel wireless stack from Linux to Genode. With the current release, we are
proud to present the outcome of this activity as a new component on Genode.
As the second major improvement of the new version, we added a new scheduler
to our custom HW kernel that allows us to trade CPU resources between Genode
subsystems, similarly to how memory is managed on Genode. Furthermore, the new
version comes with an upgrade of VirtualBox on NOVA to version 4.3.16 along
with profound stability improvements, a new dynamic linker with a complexity
of less than 20% of the old one, added networking support for the Raspberry
Pi, and new GUI components.
The story behind our work on the WiFi stack as well as detailed information
about all the other improvements are provided by the
[http:/documentation/release-notes/14.11 - release documentation of version 14.11...]
Article about building a simple seL4 root task | 2014-10-30
###########################################################
| As we have just kicked off our work on porting Genode to the seL4
| microkernel, we took the chance to document the process in the form
| of a series of articles. The first part covers the steps of creating
| a minimalistic root task.
The seL4 kernel is a modern microkernel jointly developed by NICTA and
General Dynamics. This summer, it was released under GPL, which makes it
intriguing as a potential base platform for Genode. Its biggest appeal
stems from the fact that there exists a formal proof of correctness of the
kernel code. But besides this assuring attribute, with solid kernel resource
management, support for capability-based security, and good performance, it is
attractive on technical merits too.
The article "Genode on seL4 - Building a simple root task from scratch" covers
the first steps of enabling Genode to run on seL4. It describes the
integration of the kernel code with Genode's source tree and the steps taken
to create a minimalistic root task that runs on the kernel. It is full of
hands-on information about the methodology of such a porting effort and
describes the experience with using the kernel from the perspective of
someone with no prior association with the seL4 project.
[http://genode.org/documentation/articles/sel4_part_1 - Read the article...]
All the steps described in the article can be followed in the
topic branch [http://github.com/nfeske/genode/commits/sel4] of the current
development.
Genode OS Framework release 14.08 | 2014-08-28
##############################################

1047
doc/release_notes-14-11.txt Normal file

File diff suppressed because it is too large Load Diff

899
doc/release_notes-15-02.txt Normal file
View File

@@ -0,0 +1,899 @@
===============================================
Release notes for the Genode OS Framework 15.02
===============================================
Genode Labs
Genode's [http://genode.org/about/road-map - roadmap] for this year puts a
strong emphasis on the consolidation and cultivation of the existing feature
set. With the first release of the year, version 15.02 pays tribute to this
mission by stepping up to extensive and systematic automated testing. As
a precondition for scaling up Genode's test infrastructure, the release
features a highly modular tool kit for exercising system scenarios on a growing zoo
of test machines. Section [Modular tool kit for automated testing] explains
the new tools in detail. In the spirit of improving the existing feature
set, Genode 15.02 vastly improves the performance and stability of our version of
VirtualBox running on the NOVA microhypervisor, solves long-standing shortcomings
of memory management on machines with a lot of RAM, addresses NOVA-related
scalability limitations, stabilizes our Rump-kernel-based file-system server,
and refines the configuration interface of the Intel wireless driver.
As the most significant new feature, the new version introduces virtualization
support for ARM to our custom base-hw kernel. Section [Virtualization on ARM]
outlines the design and implementation of this feature, which was greatly
inspired by NOVA's virtualization architecture and has been developed over the
time span of more than a year.
With respect to platform support, we are happy to accommodate the upcoming
USB-Armory board, which is a computer in the form factor of a USB
stick especially geared towards security applications. Section
[Support for the USB-Armory board] covers the background and the current
state of this line of work.
Virtualization on ARM
#####################
The ARMv7 architecture of recent processors like Cortex-A7, Cortex-A15, or
Cortex-A17 CPUs support hardware extensions to facilitate virtualization of
guest operating systems. With the current release, we enable the use of these
virtualization extensions in our custom base-hw kernel when running on the
Cortex-A15-based Arndale board.
While integrating ARM's virtualization extension, we aimed to strictly follow
microkernel-construction principles. The primary design is inspired by the
[http://hypervisor.org/ - NOVA OS Virtualization Architecture]. It is based on a
microhypervisor that provides essential microkernel mechanisms along with
basic primitives to switch between virtual machines (VMs). On top of the
microhypervisor, classical OS services are implemented as
ordinary, unprivileged user-level components. Those services can be used by other
applications. Services may be shared between applications or instantiated
separately, according to security and safety needs. Correspondingly,
following the NOVA principles, each VM has its own associated virtual-machine
monitor (VMM) that runs as an unprivileged user-level component. VMM implementations
can range from simple ones that just emulate primary device requirements to highly
complex monitors including sophisticated device models, like VirtualBox. The
NOVA approach allows to decouple the TCB complexity of one VM with respect to
another, as well as with respect to all components not related to
virtualization at all.
Along those lines, we extended the base-hw kernel/core conglomerate with API
extensions that enable user-level VMM components to create and control virtual
machines.
Design
======
The ARM virtualization extensions are based on the so-called security
extensions, commonly known as
[http://genode.org/documentation/articles/trustzone - TrustZone].
The ARM designers did not follow the
Intel approach to split the CPU into a "root" and a "guest" world while having all prior
existing CPU modes available in both worlds. Instead, ARM added a new privilege level
to the non-secure side of TrustZone that sits underneath the ordinary kernel
and userland privilege levels. It is subjected to a hypervisor-like kernel. All
instructions used to prepare a VM's environment have to be executed in this so
called "hyp" mode. In hyp mode, some instructions
differ from their regular behaviour on the kernel-privilege level.
For this reason, prior-existing kernel code cannot simply be reused in
hyp mode without modifications.
The base-hw kernel is meant to execute Genode's core component on bare hardware.
Core, which is an ordinary user-level component, is
linked together with a slim kernel library that is executed in privileged kernel
mode. To enable ARM hardware virtualization, we pushed this approach
even further by executing core in three different privilege levels. Thereby,
core shares the same view on hardware resources and virtual memory across all
levels. A code path is executed on a higher privilege level only if the code
would fail to execute on a lower privilege level.
Following this approach, we were able to keep most of the existing kernel code
with no modifications.
[image avirt_overview]
Genode's ARM kernel (core) runs across all privilege levels
The hypervisor part of core is solely responsible to switch between VMs and the
host system. Therefore, it needs to load/store additional CPU state that
normally remains untouched during context switches of ordinary tasks. It also needs to
configure the VM's guest-physical to host-physical memory translations. Moreover, the
virtualization extensions of the ARMv7 architecture are not related to the CPU
cores only. The interrupt controller and the CPU-local timers are also
virtualization-aware. Therefore, the hypervisor has to load/store state specific
to those devices, too. Nevertheless, the hypervisor merely reloads those
devices. It does not interpret their state.
In contrast to the low-complexity hypervisor, a user-level VMM can be complex
without putting the system's security at risk. It contains potentially complex
device-emulation code and assigns hardware resources such as memory and
interrupts to the VM. The VMM is an ordinary user-level component running
unprivileged. Of course, as a plain user-level component, it is not able to
directly access hardware resources. Hence an interface between VMMs and the
kernel is needed to share the state of a virtual machine. In the past, we faced a similar
problem when building a VMM for our former TrustZone experiments. It was natural
to build upon the available solution and to extend it where necessary. Core
provides a so-called VM service. Each VM corresponds to a session of this
service. The session provides the following extended interface:
:CPU state:
The CPU-state function returns a dataspace containing the virtual machine's
state. The state is initialized by the VMM before bootstrapping the VM, gets updated
by the hypervisor whenever it switches away from the VM, and can be used by
the VMM to interpret the behavior of the guest OS. Moreover, the CPU state can be
updated after the virtual machine monitor emulated instructions
for the VM.
:Exception handler:
The second function is used to register a signal handler that gets informed
whenever the VM produces a virtualization fault.
:Run:
The run function starts or resumes the execution of the VM.
:Pause:
The pause function removes the VM from the kernel's scheduler.
:Attach:
This function attaches a given RAM dataspace to a designated area of the
guest-physical address space.
:Detach:
The detach function invalidates a designated area of the guest-physical
address space.
:Attach_pic: Tells the hypervisor to attach the CPU's virtual interface of the
virtualization-aware interrupt controller to a designated area of the
guest-physical address space.
Implementation
==============
By strictly following the micro-kernel construction principles when integrating the
hypervisor into the base-hw kernel, we reached a minimally invasive solution. In
doing so, we took the time to separate TrustZone-specific code that was formerly
an inherent part of the kernel on ARMv7 platforms. Now, TrustZone- and
virtualization-specific aspects are incorporated into the kernel only if
actually used. The change in complexity of the whole core component expressed in
lines of code is shown in the table below. As can be seen, the additional code in
the root of the trusted computing base when using virtualization is about 700-800
LOC.
Platform | with TrustZone, no VT | TrustZone/VT optional
-----------------------------------------------------------------
hw_arndale | 17970 LOC | 18730 LOC
----------------------------------------------------------------
hw_imx53_qsb | 17900 LOC | 17760 LOC
----------------------------------------------------------------
hw_imx53_qsb_tz | 18260 LOC | 18320 LOC
----------------------------------------------------------------
hw_rpi | 17500 LOC | 17430 LOC
----------------------------------------------------------------
hw_panda | 18040 LOC | 17880 LOC
----------------------------------------------------------------
hw_odroid_xu | 17980 LOC | 18050 LOC
Besides the VM world switch, we enabled support for the so-called "large
physical address extension" (LPAE), which is obligatory when using
virtualization. It allows for addressing a 40-bit instead of only 32-bit physical
address space. Moreover, to execute in hypervisor mode, the bootstrap code of
the kernel had to be set up properly. Hence, when booting on the Arndale board,
the kernel now prepares the non-secure TrustZone world first, and finally leaves the
secure world forever.
To test and showcase the ARM virtualization features integrated in base-hw, we
implemented a minimal, exemplary VMM. It can be found in
_repos/os/src/server/vmm_. The VMM emulates a simplified variant of ARM's
Versatile Express Cortex-A15 development platform. Currently, it only comprises
support for the CPU, the timer, the interrupt controller, and a UART device. It is
written in 1100 lines of C++ in addition to the base Genode libraries. The VMM
is able to boot a vanilla Linux kernel compiled with a slightly modified
standard configuration (no-SMP), and a device tree description stripped down to
the devices provided by the VMM. This release includes an automated run test that
executes the Linux kernel on top of the VMM on Genode. It can be started via:
! make run/vmm
[image avirt_screen]
Three Linux serial consoles running in parallel on top of Genode
Modular tool kit for automated testing
######################################
In
[http://genode.org/documentation/release-notes/13.05#Automated_quality-assurance_testing - Genode version 13.05],
we already introduced comprehensive support for the automated testing of
Genode scenarios. Since then, Genode Labs has significantly widened the scope
of its internal test infrastructure, both in terms of the coverage of the test
scenarios as well as the variety of the used hardware platforms.
The centerpiece of our test infrastructure is the so-called run tool. Steered
by a script (run script), it performs all the steps necessary to test drive
a Genode system scenario. Those steps are:
# *Building* the components of a scenario
# *Configuration* of the init component
# Assembly of the *boot directory*
# Creation of the *boot image*
# *Powering-on* the test machine
# *Loading* of the boot image
# Capturing the *LOG output*
# *Validation* of the scenario behavior
# *Powering-off* the test machine
Each of those steps depends on various parameters such as the
used kernel, the hardware platform used to run the scenario, the
way the test hardware is connected to the test infrastructure
(e.g., UART, AMT, JTAG, network), the way the test hardware is powered or
reseted, or the way of how the scenario is loaded into the test hardware.
Naturally, to accommodate the growing variety of combinations of those
parameters, the complexity of the run tool increased over time.
This growth of complexity prompted us to eventually turn the run tool into a
highly modular and extensible tool kit.
Originally, the run tool consisted of built-in rules that could be
extended and tweaked by a kernel-specific supplement called run environment.
The execution of a run script used to depend on the policies built into
the run tool, the used run environment, and optional configuration
parameters (run opts).
The new run tool kit replaces most of the formerly built-in policies by the
ability to select and configure different modules for the various steps.
The selection and configuration of the modules is expressed in the run-tool
configuration. There exist the following types of modules:
:boot-dir modules:
These modules contain the functionality to populate the boot directory
and are specific to each kernel. It is mandatory to always include the
module corresponding to the used kernel.
_(the available modules are: linux, hw, okl4, fiasco, pistachio, nova,_
_codezero, foc)_
:image modules:
These modules are used to wrap up all components used by the run script
in a specific format and thereby prepare them for execution.
Depending on the used kernel, different formats can be used. With these
modules, the creation of ISO and disk images is also handled.
_(the available modules are: uboot, disk, iso)_
:load modules:
These modules handle the way the components are transfered to the
target system. Depending on the used kernel there are various options
to pass on the components. For example, loading from TFTP or via JTAG is handled
by the modules of this category.
_(the available modules are: tftp, jtag, fastboot)_
:log modules:
These modules handle how the output of a currently executed run script
is captured.
_(the available modules are: qemu, linux, serial, amt)_
:power_on modules:
These modules are used for bringing the target system into a defined
state, e.g., by starting or rebooting the system.
_(the available modules are: qemu, linux, softreset, powerplug, amt)_
:power_off modules:
These modules are used for turning the target system off after the
execution of a run script.
_(the available modules are: powerplug)_
When executing a run script, only one module of each category must be used.
Each module has the form of a script snippet located under the
_tool/run/<step>/_
directory where _<step>_ is a subdirectory named after the module type.
Further instructions about the use of each module (e.g., additional
configuration arguments) can be found in the form of comments inside the
respective script snippets.
Thanks to this modular structure,
the extension of the tool kit comes down to adding a file at the corresponding
module-type subdirectory. This way, custom work flows (such as tunneling JTAG
over SSH) can be accommodated fairly easily.
Usage examples
==============
To execute a run script, a combination of modules may be used. The combination
is controlled via the RUN_OPT variable used by the build framework. Here are a
few common exemplary combinations:
Executing NOVA in Qemu:
!RUN_OPT = --include boot_dir/nova \
! --include power_on/qemu --include log/qemu --include image/iso
Executing NOVA on a real x86 machine using AMT for resetting the target system
and for capturing the serial output while loading the files via TFTP:
!RUN_OPT = --include boot_dir/nova \
! --include power_on/amt --power-on-amt-host 10.23.42.13 \
! --power-on-amt-password 'foo!' \
! --include load/tftp --load-tftp-base-dir /var/lib/tftpboot \
! --load-tftp-offset-dir /x86 \
! --include log/amt --log-amt-host 10.23.42.13 \
! --log-amt-password 'foo!'
Executing Fiasco.OC on a real x86 machine using AMT for resetting, USB serial
for output while loading the files via TFTP:
!RUN_OPT = --include boot_dir/foc \
! --include power_on/amt --amt-host 10.23.42.13 --amt-password 'foo!' \
! --include load/tftp --tftp-base-dir /var/lib/tftpboot \
! --tftp-offset-dir /x86 \
! --include log/serial --log-serial-cmd 'picocom -b 115200 /dev/ttyUSB0'
Executing base-hw on a Raspberry Pi using powerplug to reset the hardware,
JTAG to load the image and USB serial to capture the output:
!RUN_OPT = --include boot_dir/hw \
! --include power_on/powerplug --power-on-powerplug-ip 10.23.42.5 \
! --power-on-powerplug-user admin \
! --power-on-powerplug-password secret \
! --power-on-powerplug-port 1
! --include power_off/powerplug --power-off-powerplug-ip 10.23.42.5 \
! --power-off-powerplug-user admin \
! --power-off-powerplug-password secret \
! --power-off-powerplug-port 1
! --include load/jtag \
! --load-jtag-debugger /usr/share/openocd/scripts/interface/flyswatter2.cfg \
! --load-jtag-board /usr/share/openocd/scripts/interface/raspberrypi.cfg \
! --include log/serial --log-serial-cmd 'picocom -b 115200 /dev/ttyUSB0'
After the run script was executed successfully, the run tool will print the
string 'Run script execution successful.". This message can be used to check
for the successful completion of the run script when doing automated testing.
Meaningful default behaviour
============================
To maintain the ease of use of creating and using a build directory, the
'create_builddir' tool equips a freshly created build directory with a meaningful
default configuration that depends on the selected platform. For example, if
creating a build directory for the Linux base platform, RUN_OPT
is initially defined as
! RUN_OPT = --include boot_dir/linux \
! --include power_on/linux --include log/linux
Low-level OS infrastructure
###########################
Improved management of physical memory
======================================
On machines with a lot of memory, there exist constraints with regard to
the physical address ranges of memory:
* On platforms with a non-uniform memory architecture, subsystems should
preferably use memory that is local to the CPU cores the subsystem is using.
Otherwise the performance is impeded by costly memory accesses to
the memory of remote computing nodes.
* Unless an IOMMU is used, device drivers program physical addresses
into device registers to perform DMA operations. Legacy devices such as
USB UHCI controllers expect a 32-bit address. Consequently, the memory
used as DMA buffers for those devices must not be allocated above 4 GiB.
* When using an IOMMU on NOVA, Genode represents the address space
accessible by devices (by the means of DMA) using a so-called device PD
([http://genode.org/documentation/release-notes/13.02#DMA_protection_via_IOMMU]).
DMA transactions originating from PCI devices are subjected to the virtual
address space of the device PD.
All DMA buffers are identity-mapped with their physical addresses within
the device PD. On 32-bit systems with more than 3 GiB of memory, this
creates a problem. Because the device PD is a regular user-level component, the
upper 1 GiB of its virtual address space is preserved for the kernel. Since
no user-level memory objects can be attached to this
area, the physical address range to be used for DMA buffers is limited
to the lower 3 GiB.
Up to now, Genode components had no way to influence the allocation of
memory with respect to physical address ranges. To solve the problems outlined
above, we extended core's RAM services to take allocation constraints
as session arguments when a RAM session is created. All dataspaces created
from such a session are subjected to the specified constraints. In particular,
this change enables the AHCI/PCI driver to allocate DMA buffers at suitable
physical address ranges.
This innocent looking feature to constrain RAM allocations raises a problem
though: If any component is able to constrain RAM allocations in
arbitrary ways, it would become able to scan the physical address space for
allocated memory by successively opening RAM sessions with the constraints set
to an individual page and observe whether an allocation succeeds or not. Two
conspiring components could use this information to construct a covert storage
channel.
To prevent such an abuse, the init component filters out allocations
constrains from RAM-session requests unless explicitly permitted. The
permission is granted by supplementing the RAM resource assignment of
a component with a new 'constrain_phys' attribute. For example:
! <resource name="RAM" quantum="3M" constrain_phys="yes"/>
Init component
==============
Most of Genode's example scenarios in the form of run scripts support
different platforms. However, as the platform details vary, the run scripts
have to tweak the configuration of the init component according to the
features of the platform.
For example, when declaring an explicit route to a framebuffer driver named
"fb_drv", the run script won't work on Linux because on this platform, the
framebuffer driver is called "fb_sdl".
Another example is the role of the USB driver. Depending on the platform, the
USB driver is an input driver, a block driver, a networking driver, or a
combination of those.
Consequently, run scripts with support
for a great variety of platforms tend to become convoluted with
platform-specific conditionals.
To counter this problem, we enhanced init to support aliases for component
names. By defining the following aliases in the init configuration
! <alias name="nic_drv" child="usb_drv"/>
! <alias name="input_drv" child="usb_drv"/>
! <alias name="block_drv" child="usb_drv"/>
the USB driver becomes reachable for session requests routed to either "usb_drv",
"nic_drv", "input_drv", and "block_drv". Consequently, the routing
configuration of components that use either of those drivers does no longer
depend on any platform-intrinsic knowledge.
RTC session interface
=====================
Until now, the RTC session interface used an integer to return the current
time. Although this is preferable when performing time-related
calculations, a structured representation is more convenient to use, i.e., if
the whole purpose is showing the current time. This interface change is only
visible to components that use the RTC session directly.
Since the current OS API of Genode lacks time-related functions, most users
end up using the libc, which already converts the structured time stamp
internally, or provide their own time related functions.
Update of rump-kernel-based file systems
========================================
We updated the rump-kernel support to a newer rump-kernel version (as of mid of
January 2015). This way, Genode is able to benefit from upstream stability
improvements related to the memory management. Furthermore, we revised the
Genode backend to allow the rump_fs server to cope well with a large amount of
memory assigned to it. The latter is useful to utilize the block cache of the
NetBSD kernel.
Libraries and applications
##########################
As a stepping stone in the
[https://github.com/genodelabs/genode/issues/1399 - forthcoming community effort]
to bring the Nix package manager to Genode, ports of libbz2 and sqlite have
been added to the _repos/libports/_ repository.
Runtime environments
####################
VirtualBox on NOVA
==================
Whereas our previous efforts to run VirtualBox on Genode/NOVA were mostly
concerned with enabling principal functionality and with the addition of
features, we took the release cycle of Genode 15.02 as a chance to focus
on performance and stability improvements.
:Performance:
Our goal with VirtualBox on NOVA is to achieve a user experience
comparable to running VirtualBox on Linux. Our initial port of VirtualBox used
to cut a lot of corners with regards to performance and timing accuracy
because we had to concentrate on more fundamental issues of the porting
work first. Now, with the feature set settled, it was time to revisit
and solidify our interim solutions.
The first category of performance improvements is the handling of timing,
and virtual guest time in particular. In our original version,
we could observe a substantial drift of the guest time compared to the host time.
The drift is not merely inconvenient but may even irritate the guest OS
because it violates its assumptions about the behaviour of certain virtual devices.
The drift was caused by basing the timing on a simple jiffies counter
that was incremented by a thread after sleeping for a fixed period. Even
though the thread almost never executes, there is still a chance that it gets
preempted by the kernel and resumed only after the time slices of
concurrently running threads have elapsed. This can take tens of milliseconds.
During this time, the jiffies counter remains unchanged. We could
significantly reduce the drift by basing the timing on absolute time values
requested from the timer driver. Depending on the used guest OS, however,
there is still a residual inaccuracy left, which is subject to ongoing
investigations.
The second type of improvements is related to the handling of virtual
interrupts. In its original habitat, VirtualBox relies on so-called
external-interrupt virtualization events. If a host interrupt occurs while the
virtual machine is active, the virtualization event is forwarded by the
VirtualBox hypervisor to the virtual machine monitor (VMM).
On NOVA, however, the kernel does not propagate this
condition to the user-level VMM because the occurrence of host interrupts should
be of no matter to the VMM. In the event of a host interrupt, NOVA takes
a normal scheduling decision (eventually activating the user-level device driver
the interrupt belongs to) and leaves the virtual CPU (vCPU) in a runnable
state - to be rescheduled later. Once the interrupt is handled, the vCPU gets
resumed. The VMM remains out of the loop. Because the update of the VirtualBox
device models ultimately relies on the delivery of external-interrupt
virtualization events, the lack of this kind of event introduced huge delays
with respect to the update of device models and the injection of virtual
interrupts. We solved this problem by exploiting a VirtualBox-internal
mechanism called POKE. By setting the so-called POKE flag, an I/O thread is
able to express its wish to force the virtual machine into the VMM. We only
needed to find the right spots to set the POKE flag.
Another performance-related optimization is the caching of RTC time
information inside VirtualBox. The original version of the gettimeofday
function used by VirtualBox contacted the RTC server for obtaining the
wall-clock time on each call. After the update to VirtualBox 4.3, the rate of those
calls increased significantly. To reduce the costs of these calls, our
new version of gettimeofday combines infrequent calls to the RTC driver
with a component-local time source based on the jiffies mechanism mentioned above.
With these optimizations in place,
simple benchmarks like measuring the boot time of Window 7 or the time of
compiling Genode within a Debian VM suggest that our version of VirtualBox
has reached a performance that is roughly on par with the Linux version.
:Stability:
Since the upgrade to VirtualBox 4.3.16 in release 14.11, we fixed several
regression issues caused by the upgrade. Beside that, we completed the
support to route serial output of guests to Genode, lifted the restriction
to use just one fixed VESA mode, and enabled support for 32-bit Windows 8
guests on 64-bit Genode/NOVA. The 64-bit host restriction stems from
the fact that Windows 8 requires support for the non-executable bit (NX)
feature of page tables. The 32-bit version of the NOVA kernel does not leverage
the physical address extension (PAE) feature, which is a pre-requisite for
using NX on 32-bit.
In the course of the adaptation, our port of VirtualBox now evaluates the
PAE and HardwareVirtExUX XML tags of .vbox files:
!<VirtualBox xmlns=...>
! <Machine uuid=...>
! <Hardware ..>
! <CPU ...>
! <HardwareVirtExUX enabled="true"/>
! <PAE enabled="true"/>
! ...
The PAE tag specifies whether to report PAE capabilities to the guest
or not. The HardwareVirtExUx tag is used by our port to decide whether to stay
for non-paged x86 modes in Virtualbox's recompiler (REM) or not. Until now, we used REM
to emulate execution when the guest was running in real mode and protected mode
with paging disabled. However, newer Intel machines support the unrestricted guest
feature, which makes the usage of REM in non-paged modes not strictly
necessary anymore. Setting the HardwareVirtExUx tag to false accommodates
older machines with no support for the unrestricted-guest feature.
Device drivers
##############
iPXE-based network drivers
==========================
We enabled and tested the driver with Intel I218-LM and I218-V PCI devices.
Intel wireless stack
====================
In this release, several small issues regarding the wireless stack are fixed.
From now on, the driver only probes devices on the PCI bus that correspond to
the PCI_CLASS_NETWORK_OTHER device class. Prior to that, the driver probed all
devices attached to the bus resulting in problems with other devices, e.g.
the GPU, when accessing their extended PCI config space.
Since the driver uses cooperative scheduling internally, it must never block
or, in case it blocks, must schedule another task. Various sleep functions
lacked this scheduling call and are now fixed. Furthermore, a bug in the timer
implementation has been corrected, which caused the scheduling of wrong timeouts.
In addition to these fixes, patches for enabling the support for
Intel 7260 cards were incorporated.
Up to now, the configuration of the wireless driver was rather inconvenient because
it did not export any information to the system. The driver now creates two
distinct reports to communicate its state and information about the wireless
infrastructure to other components. The first one is a list of all available
access points. The following exemplary report shows its structure:
!<wlan_accesspoints>
! <accesspoint ssid="skynet" bssid="00:01:02:03:04:05" quality="40"/>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:06" quality="70" protection="WPA-PSK"/>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:07" quality="10" protection="WPA-PSK"/>
!</wlan_accesspoints>
Each '<accesspoint>' node has attributes that contain the SSID and the BSSID
of the access point as well as the link quality (signal strength). These
attributes are mandatory. If the network is protected, the node will also
have an attribute describing the type of protection in addition.
The second report provides information about the state of the connection
with the currently associated access point:
!<wlan_state>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:06" quality="70"
! protection="WPA-PSK" state="connected"/>
!</wlan_state>
Valid state values are 'connected', 'disconnected', 'connecting' and
'disconnecting'.
The driver obtains its configuration via a ROM module. This ROM
module contains the selected access point and can be updated during runtime.
To connect to an access point, a configuration like the following is used:
!<selected_accesspoint ssid="foobar" bssid="01:02:03:04:05:06"
! protection="WPA-PSK" psk="foobar123!"/>
To disconnect from an access point, an empty configuration can be set:
!<selected_accesspoint/>
For now, the prevalent WPA/WPA2 protection using a pre-shared key is supported.
Improved UART driver for Exynos5
================================
The UART driver for the Exynos5 SoC has been enhanced by enabling the RX
channel. This improvement was motivated by automated tests, where a run script
needs to interact with some component via a terminal connection.
Touchscreen support
===================
We enabled support of Wacom USB touchscreen devices via dde_linux - a port of
Linux USB driver to Genode. In order to make touchscreen coordinates
usable by Genode's input services, they must be calibrated
to screen-absolute coordinates. The screen resolution is not determined
automatically by the USB driver. It can, however, be configured as a sub
node of the '<hid>' XML tag of the USB driver's configuration:
!<start name="usb_drv">
! ...
! <config uhci=... ohci=... xhci=...>
! <hid>
! <screen width="1024" height="768"/>
! </hid>
! ...
USB session interface
=====================
We enhanced our USB driver with the support of remote USB sessions. This
feature makes it possible to implement USB-device drivers outside the USB
server using a native Genode API. The new USB session can be found under
_repos/os/include/usb_session_ and can be used to communicate with the USB
server, which merely acts as a host controller and HUB driver in this scenario.
Under _repos/os/include/usb_, there are a number of convenience
and wrapper functions that operate directly on top of a USB session. These
functions are meant to ease the task of USB-device-driver programming by hiding
most of the USB session management, like packet-stream handling.
We also added a USB terminal server, which exposes a Genode terminal session to
its clients and drives the popular PL2303 USB to UART adapters using the new
USB-session interface.
A practical use case for this component is the transmission of logging data on
systems where neither UART, AMT, nor JTAG are available. A run script
showcasing this feature can be found at _repos/dde_linux/run/usb_terminal.run_.
RTC proxy driver for Linux
==========================
There are a handful of run scripts that depend on the RTC service. So far,
it was not possible to run these tests on Linux due to the lack of an RTC
driver on this platform. To address this problem, we created a proxy driver
that uses the time() system call to provide a
reasonable base period on Linux.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Support for the USB-Armory board
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With [https://www.crowdsupply.com/inverse-path/usb-armory - USB Armory],
there is an intriguing hardware platform for Genode on the horizon.
In short, USB Armory is a computer in the form factor of a USB
stick. It is meant for security applications such as VPNs,
authentication tokens, and encrypted storage. It is based on the
FreeScale i.MX53 SoC, which is well supported by Genode, i.e.,
Genode can be used as secure-world OS besides Linux running in the
normal world.
Apart from introducing a novel form factor, this project is
interesting because it strives to be an 100% open platform, which
includes hardware, software, and firmware. This motivated us to
bring Genode to this platform.
The underlying idea is to facilitate
[http://genode.org/documentation/articles/trustzone - ARM TrustZone] to
use Genode as a companion to a Linux-based OS on the platform.
Whereas Linux would run in the normal world of TrustZone, Genode runs
in the secure world. With Linux, the normal world will control the
communication over USB and provide a familiar environment to implement
USB-Armory applications. However, security-critical functions and data like
cryptographic keys will reside exclusively in the secure world. Even in
the event that Linux gets compromised, the credentials of the user
will stay protected.
The support of the USB Armory platform was added in two steps:
First, we enabled our base-hw kernel to run as TrustZone monitor with
Genode on the "secure side". Since the USB Armory is based on the
FreeScale i.MX53 SoC, which Genode already supported, this step went
relatively straight-forward.
Second, we enabled a recent version of the Linux kernel (3.18) to run in the
normal world. The normal world is supervised by a user-level Genode component
called tz_vmm (TrustZone Virtual Machine Monitor). The tz_vmm is, among
others, responsible for providing startup and hardware information to the
non-secure guest. The Linux kernel version we used previously as TrustZone
guest on i.MX53 boards expected this information to be communicated via
so-called ATAGs. The new version, however, expects this to be done via a
device tree blob. As a consequence, the tz_vmm had to be adapted to properly
load this blob into the non-secure RAM. The original USB-Armory device tree
was modified to blind out the RAM regions that get protected by the TrustZone
hardware. This way, Linux won't attempt to access them. Furthermore,
to keep basic user interaction simple, our device tree tells Linux to use the
same non-secure UART as Genode for console I/O.
The kernel itself received some modifications, for two reasons. First,
we don't want Linux to rely on resources that are protected to keep
the secure world secure. This is why the driver for the interrupt controller
that originally made use of the TrustZone interrupt configuration, had to be
adapted. Second, to prevent Linux from disturbing Genode activities, we
disabled most of the dynamic clock and power management as it may sporadically
gear down or even disable hardware that Genode relies on. Furthermore, we
disabled the Linux drivers for I2C interfaces and the GPIO configuration as
these are reserved for Genode.
IPC helping
~~~~~~~~~~~
In traditional L4 microkernels, scheduling parameters (like time-slice
length and priority) used to be bound to threads. Usually, those parameters
are defined at thread creation time. The initial version
of base-hw followed this traditional approach. However, it has a few problems:
* For most threads, the proper *choice of scheduling parameters* is very
difficult if not impossible. For example, the CPU-time demands of a
server thread may depend on the usage patterns of its clients. Most
theoretical work in the domain of scheduling presumes the knowledge of
job lengths in advance of computing a schedule. But in practice and in
particular in general-purpose computing, job lengths are hardly known a priori.
As a consequence, in most scenarios, scheduling parameters are
set to default values.
* With each thread being represented as an independent schedulable entity,
the kernel has to take a scheduling decision each time a thread performs an
IPC call because the calling thread gets blocked and the called thread
may get unblocked. In a microkernel-based system, those events occur at a
much higher rate than the duration of typical time slices, which puts the
scheduler in a *performance-critical* position.
* Regarding IPC calls, a synchronous flow of control along IPC call chains is
desired. Ideally, an IPC call should have the same characteristics as
a function call with respect to scheduling. When a client thread performs an
IPC call, it expects the server to immediately become active to
handle the request. But if the kernel treats each thread independently,
it may pick any other thread and thereby introduce *high latencies* into
IPC operations.
To counter those problems, the NOVA microhypervisor introduced a new approach
that decouples scheduling parameters from threads. Instead of selecting
threads for execution, the scheduler selects so-called scheduling contexts.
For a selected scheduling context, the kernel dynamically determines a
thread to execute by taking IPC relationships into account. When a thread
performs an IPC, the thread's scheduling context will be used to execute
the called server. In principle, a server does not need CPU time on its own
but always works with CPU resources provided by clients.
The new version of the base-hw kernel adapts NOVA's approach with slight
modifications. Each thread owns exactly one scheduling context for its entire
lifetime. However, by the means of "helping" during an IPC call, the caller
lends its scheduling context to the callee. Even if the callee is still busy
and cannot handle the IPC request right away, the caller helps because it
wants the callee to become available for its request as soon as
possible. Consequently, a thread has potentially many scheduling contexts at
its disposal, its own scheduling context plus all scheduling contexts
provisioned by helpers. This works transitively.
Purged outdated platforms
~~~~~~~~~~~~~~~~~~~~~~~~~
We removed the support for two stale platforms that remained unused for
more than a year, namely FreeScale i.MX31 and the TrustZone variant
of the Coretile Versatile Express board.
NOVA
====
On Genode/NOVA, we used to employ one pager thread in core for each thread
in the system. We were forced to do so because not every page
fault can be resolved immediately. In some situations, core asynchronously
propagates the fault to an external component for the resolution.
In the meantime, the
pager thread leaves the page fault unanswered. Unfortunately, the kernel
provides no mechanism to support this scenario besides just blocking the
pager thread using a semaphore. This, in turn, means that the pager thread is not
available for other page-fault requests. Ultimately, we had to setup a
dedicated pager per thread.
This implementation has the downside of "wasting" memory for a lot of
pager threads. Moreover, it becomes a denial-of-service vector as soon as more
threads get created than core can accommodate. The number of threads is
limited per address space - also for core - by the size of Genode's context
area, which typically means 256 threads.
To avoid the downsides mentioned, we extended the NOVA IPC reply syscall to
specify an optional semaphore capability. The NOVA kernel validates the
capability and blocks the faulting thread in the semaphore. The faulted thread
remains blocked even after the pager has replied to the fault message. But
the pager immediately becomes available for other
page-fault requests. With this change, it suffices to maintain only one pager
thread per CPU for all client threads.
The benefits are manifold. First, the base-nova implementation converges more
closely to other Genode base platforms. Second, core can not run out of threads
anymore as the number of threads in core is fixed for a given setup. And the
third benefit is that the helping mechanism of NOVA can be leveraged for
concurrently faulting threads.
Build system and tools
######################
Tools for convenient handling of port contrib directories
=========================================================
We supplemented our tools for the ports mechanism with two convenient
scripts:
:_tool/ports/shortcut_:
Creates a symbolic link from _contrib/<port-name>-<hash>_ to
_contrib/<port-name>_. This is useful when working on the third-party
code contained in the _contrib_ directory.
:_tool/ports/current_:
Prints the current contrib directory of a port. When switching
branches back and forth, the hash of the used port might change.
The script provides a shortcut to looking up the hash file for a
specific port within the repositories and printing its content.

1216
doc/release_notes-15-05.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -14,138 +14,95 @@ The road map is not fixed. If there is commercial interest of pushing the
Genode technology to a certain direction, we are willing to revisit our plans.
Review of the past year
#######################
Review of 2014
##############
In 2013, we worked on four construction sites: Framework infrastructure,
self-hosting, tooling and optimization, and hardware support. When
reviewing the road map for 2013, it is great to see that we largely
lived up to our planning.
Most of the progress in 2014 was motivated by our goal to use
Genode as general-purpose OS on x86-based platforms. To highlight a
few achievements, we started to use [http://rumpkernel.org/ - Rump kernels]
as file-system providers, enabled VirtualBox on NOVA, pulled off the
engineering feat to run the Intel Wireless stack natively on microkernels, and
came up with a new GUI architecture. We regard these features as the
groundwork to make Genode a feasible platform for day-to-day computing.
The framework infrastructure was enhanced with concepts for managing
CPUs on multi-processor systems and for dynamically balancing memory
resources, it received new audio and file-system capabilities, and, with
the addition of Qt5 and the lxIP stack, we could enable highly
sophisticated workloads natively on Genode.
On our endeavour of self-hosting Genode on Genode, we could eliminate
long-standing show stoppers for several base platforms. We were able to
improve them to the point where we can routinely execute Genode's tool
chain across several base platforms such as NOVA and Fiasco.OC as part
of our nightly automated tests. On the user-facing side, a new
command-line interface has seen the light of the day.
Two highlights when it comes to tooling were the new event tracing
facilities, and profound support for automated testing. Thanks to the
latter, we expose Genode to over 500 test runs including automated
performance benchmarks. By executing those tests each night, we have
become able to resolve regressions before they enter the master branch.
So the master branch remains always in a good shape.
As expected for an operating-system project, most of our work was spent
on hardware support. On x86, we added IOMMU support, and the
virtualization capabilities on NOVA have seen a major upgrade. On ARM,
we enabled or vastly enhanced the device drivers for Samsung Exynos 5,
Freescale i.MX, and Raspberry Pi. We also explored the possibilities of
combining Genode with ARM TrustZone.
Only two topics, namely Intel wireless and a new user interface concept
had been deferred. We decided to postpone the Intel wireless topic to
address gigabit networking instead. Even though the new user-interface
concept served as a strong motivation behind many improvements of the
base system such as dynamic reconfiguration and dynamic resource
balancing, the work on those fundamentals left little room to bring
forward the actual UI concept. Now that those pieces are in place, we
can go full steam ahead.
The most surprising topic that was not clearly laid out in our last
year's road map is the advancement of the base-hw platform. Started as a
mere experiment, it received so much love and attention that it
unexpectedly became able to host the whole universe of Genode's software
stack.
That said, even though we are proud about the progress, we are still not there
yet. So what keeps us back? The answer is actually not technical. Most
developments over the past years were concerned with individual features or
technical challenges. But the integration of sophisticated system scenarios
was a rare occurrence. For the most part, such integration activities were
solely triggered by a particular project or by a presentation. In order to
make Genode fit for regular use, we need to make the composing of advanced
systems a habit for most of the regular developers.
2014
####
Big picture for 2015
####################
In 2014, we will put the emphasis on the base-hw kernel, 3rd-party software,
storage, and the user-facing side of Genode.
On the account of this realization, the overall theme of 2015 will be the
consolidation and cultivation of the existing feature set rather than the
conquering of new grounds. This implies the following topics:
The experience with base-hw in 2013 ignited our ambitions to develop this
kernel not just into a complete base platform for Genode, but also
to explore new grounds. To fully accommodate Genode, we will complement
base-hw with multi-processor support, kernel-protected capability-based
security, and real-time scheduling. Beyond supporting Genode's software
stack, we will explore the use of ARM's virtualization extensions
to turn base-hw into a microhypervisor, similar to NOVA but focusing on ARM.
* Advancing our automated test and integration infrastructure towards
the continuous integration of real-world system scenarios,
* Fostering good-quality documentation,
* Optimization of performance and stability,
* Improvement of our tooling
With Genode becoming more and more flexible, the role of 3rd-party software in
both source-code and binary form grows. Even though Genode offers a pretty
convenient mechanism to automatically download and integrate 3rd-party source
codes, the burden to resolve inter-dependencies between such source packages is
still left to the user of the framework. Many new users stumble over
the installation of 3rd-party code as it is not obvious to see which packages
are required for a particular system scenario. To make Genode better
approachable and more convenient to use, we plan to consolidate the current
mechanisms into a solid source-code package management solution.
Furthermore, we have to address outstanding limitations of the most
commonly used base platforms, namely base-hw and NOVA. I.e., only
with kernel-protected capabilities, base-hw can be considered as a viable
base platform for security-critical systems, and only with proper
kernel-resource management, NOVA can be recommended as a kernel for
general-purpose computing.
The improved 3rd-party software support will hopefully allow us to realize
sophisticated and popular usage scenarios more easily. As security is one of
Genode's major benefits compared to commodity operating systems, we consider
supporting TOR, either as server, or client side, or even both. One
possibility would be to provide a ready-to-use live image containing a TOR
client and a configured browser, which would enable users to browse
anonymously.
Besides the use of ported 3rd-party software on top of Genode, we see clear
demand for hosting 3rd-party binary software, particularly virtualized OSes.
The Seoul VMM (on NOVA) and L4Linux (on Fiasco.OC) already allow for the use
of Linux guest OSes as Genode sub systems. However, both solutions fall short
in different ways. Whereas L4Linux requires the maintenance of a patched Linux
kernel, Seoul can execute unpatched Linux kernels but requires a fine-tuned
kernel configuration. Because we long for a product-quality virtualization
solution that works just out of the box with most existing guest OSes, we will
make VirtualBox available on Genode/NOVA.
The move to employing Genode for day-to-day computing requires reliable,
secure, and fast storage. Hence, we will build and optimize components that
operate on file-system and block level. This includes work on device drivers,
file-system stacks, caching mechanisms, block-level encryption, as well as
improved per-process virtual file systems.
Finally, we plan to complement Genode with an entirely capability-based user
interface, which will present the user with a unique model of how to interact
with the system. With user interface, we actually refer to three different
things: System configuration (the user interface a system integrator has
to deal with), text-based user interface, and a graphical desktop environment.
We hope to cover those with one single holistic concept.
Besides the cultivation of the existing feature set, there will still be room
for new things. We are particularly excited about the prospect of combining
Genode with the [http://sel4.systems - seL4 kernel] and
the [http://nixos.org/nix/ - Nix package manager]. Furthermore, we desire to
continue the work on our new GUI architecture towards a capability-based
desktop environment.
Milestones
==========
Milestones for 2015
###################
In the following, there is a rough schedule of the planned work. As usual,
In the following, we present a rough schedule of the planned work. As usual,
it is not set in stone. If you are interested in a particular line of work,
please get in touch.
:February - Release 14.02:
* First version of VirtualBox on NOVA
* Base-hw: multi-processor support
* Block cache
* Component composition tool kit
:May - Release 14.05:
* Base-hw: real-time scheduling
* 3rd-party source-code package management
* Block-level encryption
February - Release 15.02
========================
:August - Release 14.08:
* Desktop environment
* Base-hw: kernel-protected capability-based security
* TOR on Genode
* ARM virtualization on top of the base-hw kernel
* Modularized tooling for automated tests
May - Release 15.05
===================
* Comprehensive documentation of the Genode foundations
* Kernel-protected capabilities for the base-hw kernel
* seL4 microkernel as base platform
* Refined platform-driver architecture (support for MSIs, assignment of
I/O resources to drivers, standardized configuration)
August - Release 15.08
======================
* Capability-based desktop environment allowing the interactive installation
and management of Genode subsystems and the interaction with files
* Accommodation of typical desktop-computing tasks (e.g., email)
* Interactive tools for observing the system behavior
* NOVA kernel-resource management
November - Release 15.11
========================
* Achieving cross-kernel binary compatibility
* Package management
* Modern web browser
:November - Release 14.11:
* Base-hw: virtualization on ARM, support for Cortex-A7
* Intel wireless
* NOVA kernel resource management

View File

@@ -114,13 +114,6 @@ but build upon of each other:
The repository contains a server that uses a rump kernel to provide
various NetBSD file systems to Genode.
:'qt4':
This source-code repository contains the Genode version of Qt4 framework.
Please find more information about using Qt4 with Genode in the repository's
'README' file. Please note that the Qt4 support is deprecated. Use Qt5
as contained in 'libports' instead.
:'ports':
This source-code repository hosts ports of 3rd-party applications to

View File

@@ -4,51 +4,22 @@
# \date 2011-08-05
#
VERBOSE ?= @
ECHO = @echo
GIT_URL = https://github.com/nfeske/codezero.git
GIT_REV = 6fa4884a5a1cf6207372f69ae01e5faa6d5a39c8
CONTRIB_DIR = contrib
PATCHES = $(shell find patches -name *.patch)
#
# Utility to check if a tool is installed
#
check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.))
$(call check_tool,git)
$(call check_tool,patch)
$(call check_tool,python2.6)
$(call check_tool,scons)
VERBOSE ?= @
ECHO := @echo
#
# Print help information by default
#
help::
prepare: $(CONTRIB_DIR)
prepare:
$(VERBOSE)../../tool/ports/prepare_port codezero
help::
$(ECHO)
$(ECHO) "Check out upstream source code of the Codezero kernel"
$(ECHO)
$(ECHO) "The source code will be located at the '$(CONTRIB_DIR)/' directory."
$(ECHO) "Prepare the codezero base repository"
$(ECHO)
$(ECHO) "--- available commands ---"
$(ECHO) "prepare - checkout upstream source codes"
$(ECHO) "clean - remove upstream source codes"
$(ECHO)
$(CONTRIB_DIR)/.git:
$(VERBOSE)git clone $(GIT_URL) $(CONTRIB_DIR)
$(CONTRIB_DIR): $(CONTRIB_DIR)/.git
$(VERBOSE)cd $(CONTRIB_DIR); git reset --hard $(GIT_REV)
$(ECHO) "applying patches to '$(CONTRIB_DIR)/'"
$(VERBOSE)for i in $(PATCHES); do patch -d $@ -p1 < $$i; done
.PHONY: $(CONTRIB_DIR)
clean::
$(VERBOSE)rm -rf $(CONTRIB_DIR)

View File

@@ -98,7 +98,7 @@ CONFIG_CONT0_BAREMETAL_PROJ_IPC_DEMO=n
#
# Container 0 Pager Linker Parameters
#
CONFIG_CONT0_PAGER_LMA=0x40000
CONFIG_CONT0_PAGER_LMA=0x41000
CONFIG_CONT0_PAGER_VMA=0x100000
@@ -106,7 +106,7 @@ CONFIG_CONT0_PAGER_VMA=0x100000
# Container 0 Pager Physical Memory Regions (Capabilities)
#
CONFIG_CONT0_PAGER_PHYSMEM_REGIONS=1
CONFIG_CONT0_PAGER_PHYS0_START=0x40000
CONFIG_CONT0_PAGER_PHYS0_START=0x41000
CONFIG_CONT0_PAGER_PHYS0_END=0x4000000
@@ -231,7 +231,7 @@ CONFIG_CONT3_PAGER_LOAD_ADDR=0x3100000
CONFIG_SUBARCH_V5=y
CONFIG_SUBARCH_V7=n
CONFIG_SUBARCH_V6=n
CONFIG_CONT0_PAGER_LOAD_ADDR=0x40000
CONFIG_CONT0_PAGER_LOAD_ADDR=0x41000
CONFIG_CONT0_PAGER_VIRT_ADDR=0x100000
CONFIG_CONT3_PAGER_VIRT_ADDR=0xd0000000
CONFIG_CONT0_START_PC_ADDR=0x100000

View File

@@ -215,7 +215,7 @@ The default configuration for the VersatilePB926 platform as found at
'base-codzero/config/vpb926.cml' is paramaterized as follows:
:Default pager parameters:
! 0x40000 Pager LMA
! 0x41000 Pager LMA
! 0x100000 Pager VMA
These values are important because they are currently hard-wired in the
linker script used by Genode. If you need to adopt these values, make
@@ -224,9 +224,9 @@ sure to also update the Genode linker script located at
:Physical Memory Regions:
! 1 Number of Physical Regions
! 0x40000 Physical Region 0 Start Address
! 0x41000 Physical Region 0 Start Address
! 0x4000000 Physical Region 0 End Address
We only use 64MB of memory. The physical memory between 0 and 0x40000 is
We only use 64MB of memory. The physical memory between 0 and 0x41000 is
used by the kernel.
:Virtual Memory Regions:

View File

@@ -1,3 +1,5 @@
CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
LIBL4_DIR = $(CODEZERO_DIR)/conts/userlibs/libl4
INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libc/include

View File

@@ -18,9 +18,9 @@ SRC_CC += child/child.cc
SRC_CC += process/process.cc
SRC_CC += elf/elf_binary.cc
SRC_CC += lock/lock.cc
SRC_CC += signal/signal.cc signal/common.cc
SRC_CC += signal/signal.cc signal/common.cc signal/platform.cc
SRC_CC += server/server.cc server/common.cc
SRC_CC += thread/thread.cc thread/thread_bootstrap.cc thread/trace.cc
SRC_CC += thread/thread.cc thread/myself.cc thread/thread_bootstrap.cc thread/trace.cc
SRC_CC += thread/context_allocator.cc env/utcb.cc
SRC_CC += lock/cmpxchg.cc

View File

@@ -2,6 +2,7 @@ SRC_CC += console/log_console.cc
SRC_CC += cpu/cache.cc
SRC_CC += env/env.cc env/context_area.cc env/reinitialize.cc
SRC_CC += thread/thread_start.cc
SRC_CC += irq/platform.cc
INC_DIR += $(BASE_DIR)/src/base/env
INC_DIR += $(REP_DIR)/include/codezero/dummies

View File

@@ -1,3 +1,5 @@
CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
LIBL4_DIR = $(CODEZERO_DIR)/conts/userlibs/libl4
SRC_C += init.c irq.c mutex.c
@@ -7,11 +9,17 @@ SRC_C += $(addprefix lib/,addr.c bit.c idpool.c)
SRC_C += $(addprefix lib/thread/,init.c thread.c)
SRC_C += $(addprefix lib/cap/,cap.c read.c)
#
# Dummies
#
SRC_C += dummy.c
INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libc/include
INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libmem/include
INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libmem
vpath % $(LIBL4_DIR)/src
vpath % $(LIBL4_DIR)/src
vpath %.c $(REP_DIR)/src/lib/syscall
#
# The libl4 source files uses macros defined in macros.h but do not

View File

@@ -2,17 +2,7 @@
# Specifics for the Codezero kernel API
#
#
# Read default and builddir-specific config files
#
# In these config files, we expect to find the definition of CODEZERO_DIR
#
-include $(call select_from_repositories,etc/codezero.conf)
-include $(BUILD_BASE_DIR)/etc/codezero.conf
ifeq ($(CODEZERO_DIR),)
$(error Could not find the definition of CODEZERO_DIR in etc/codezero.conf)
endif
CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
#
# Convert path to absolute directory
@@ -28,11 +18,9 @@ INC_DIR += $(BUILD_BASE_DIR)/include
#
# Codezero headers
#
CODEZERO_ABS_DIR = $(call absdir,$(CODEZERO_DIR))
INC_DIR += $(CODEZERO_ABS_DIR)/include
INC_DIR += $(CODEZERO_ABS_DIR)/conts/userlibs/libl4/include
INC_DIR += $(CODEZERO_ABS_DIR)/conts/userlibs/libdev/uart/include
INC_DIR += $(CODEZERO_DIR)/include
INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libl4/include
INC_DIR += $(CODEZERO_DIR)/conts/userlibs/libdev/uart/include
#
# Allow programs to test for the Codezero kernel

View File

@@ -1,7 +1,5 @@
diff --git a/src/arch/arm/vectors.S b/src/arch/arm/vectors.S
index 0475389..62f3c38 100644
--- a/src/arch/arm/vectors.S
+++ b/src/arch/arm/vectors.S
--- src/kernel/codezero/src/arch/arm/vectors.S
+++ src/kernel/codezero/src/arch/arm/vectors.S
@@ -503,7 +503,7 @@ BEGIN_PROC(arm_irq_exception_basic)
mov lr, pc
ldr pc, =do_irq
@@ -11,20 +9,16 @@ index 0475389..62f3c38 100644
/* Minimal IRQ state saved on irq stack right after irq vector enters: */
#define IRQ_R0 0
diff --git a/conts/userlibs/libc/src/arch-arm/memcpy.S b/conts/userlibs/libc/src/arch-arm/memcpy.S
index 383f5d2..b4df27f 100644
--- a/conts/userlibs/libc/src/arch-arm/memcpy.S
+++ b/conts/userlibs/libc/src/arch-arm/memcpy.S
--- src/kernel/codezero/conts/userlibs/libc/src/arch-arm/memcpy.S
+++ src/kernel/codezero/conts/userlibs/libc/src/arch-arm/memcpy.S
@@ -57,4 +57,4 @@ BEGIN_PROC(memcpy)
bne last
1:
pop {r0, r4 - r11, pc}
-END_PROC(_memcpy)
+END_PROC(memcpy)
diff --git a/conts/userlibs/libc/src/arch-arm/memset.S b/conts/userlibs/libc/src/arch-arm/memset.S
index ce9b06c..3746955 100644
--- a/conts/userlibs/libc/src/arch-arm/memset.S
+++ b/conts/userlibs/libc/src/arch-arm/memset.S
--- src/kernel/codezero/conts/userlibs/libc/src/arch-arm/memset.S
+++ src/kernel/codezero/conts/userlibs/libc/src/arch-arm/memset.S
@@ -65,4 +65,4 @@ BEGIN_PROC(memset)
bne end

View File

@@ -1,7 +1,5 @@
diff --git a/src/api/map.c b/src/api/map.c
index 1d15086..6139b4c 100644
--- a/src/api/map.c
+++ b/src/api/map.c
--- src/kernel/codezero/src/api/map.c
+++ src/kernel/codezero/src/api/map.c
@@ -78,6 +78,6 @@ int sys_unmap(unsigned long virtual, unsigned long npages, unsigned int tid)
retval = ret;
}
@@ -10,10 +8,8 @@ index 1d15086..6139b4c 100644
+ return retval;
}
diff --git a/src/api/thread.c b/src/api/thread.c
index 985c425..579e4fb 100644
--- a/src/api/thread.c
+++ b/src/api/thread.c
--- src/kernel/codezero/src/api/thread.c
+++ src/kernel/codezero/src/api/thread.c
@@ -497,7 +497,7 @@ out_err:
*/
int sys_thread_control(unsigned int flags, struct task_ids *ids)
@@ -32,10 +28,8 @@ index 985c425..579e4fb 100644
/*
* Caller may operate on a thread if it shares
* the same address space with that thread's pager
diff --git a/src/arch/arm/mapping-common.c b/src/arch/arm/mapping-common.c
index 385f7c2..55b4bea 100644
--- a/src/arch/arm/mapping-common.c
+++ b/src/arch/arm/mapping-common.c
--- src/kernel/codezero/src/arch/arm/mapping-common.c
+++ src/kernel/codezero/src/arch/arm/mapping-common.c
@@ -313,12 +313,11 @@ int check_mapping(unsigned long vaddr, unsigned long size,
int remove_mapping_space(struct address_space *space, unsigned long vaddr)
{
@@ -50,10 +44,8 @@ index 385f7c2..55b4bea 100644
pmd_i = PMD_INDEX(vaddr);
/*
diff --git a/src/glue/arm/init.c b/src/glue/arm/init.c
index 2373c66..43c6fda 100644
--- a/src/glue/arm/init.c
+++ b/src/glue/arm/init.c
--- src/kernel/codezero/src/glue/arm/init.c
+++ src/kernel/codezero/src/glue/arm/init.c
@@ -68,8 +68,6 @@ void print_sections(void)
/* The kip is non-standard, using 0xBB to indicate mine for now ;-) */
void kip_init()
@@ -73,10 +65,8 @@ index 2373c66..43c6fda 100644
add_boot_mapping(virt_to_phys(&kip), USER_KIP_PAGE, PAGE_SIZE,
MAP_USR_RO);
printk("%s: Kernel built on %s, %s\n", __KERNELNAME__,
diff --git a/loader/libs/elf/src/elf.c b/loader/libs/elf/src/elf.c
index 4a1b5e0..f97273b 100644
--- a/loader/libs/elf/src/elf.c
+++ b/loader/libs/elf/src/elf.c
--- src/kernel/codezero/loader/libs/elf/src/elf.c
+++ src/kernel/codezero/loader/libs/elf/src/elf.c
@@ -339,16 +339,12 @@ elf_loadFile(void *elfFile, bool phys)
{
int i;
@@ -103,10 +93,8 @@ index 4a1b5e0..f97273b 100644
// Comment
printf("Copying to range from 0x%x to 0x%x of size: 0x%x\n", (unsigned int)dest, (unsigned int)dest + (unsigned int)len, (unsigned int)len);
memcpy((void*) (uintptr_t) dest, (void*) (uintptr_t) src, len);
diff --git a/loader/libs/elf/src/elf32.c b/loader/libs/elf/src/elf32.c
index 2d13798..78bbf33 100644
--- a/loader/libs/elf/src/elf32.c
+++ b/loader/libs/elf/src/elf32.c
--- src/kernel/codezero/loader/libs/elf/src/elf32.c
+++ src/kernel/codezero/loader/libs/elf/src/elf32.c
@@ -248,7 +248,6 @@ elf32_fprintf(FILE *f, struct Elf32_Header *file, int size, const char *name, in
struct Elf32_Shdr *sections;
unsigned numSections;
@@ -123,10 +111,8 @@ index 2d13798..78bbf33 100644
printf("Section Headers:\n");
printf(" [Nr] Name Type Addr Off\n");
diff --git a/src/generic/capability.c b/src/generic/capability.c
index 0860ea5..ef44445 100644
--- a/src/generic/capability.c
+++ b/src/generic/capability.c
--- src/kernel/codezero/src/generic/capability.c
+++ src/kernel/codezero/src/generic/capability.c
@@ -403,7 +403,7 @@ struct capability *cap_match_mem(struct capability *cap,
{
struct sys_map_args *args = args_ptr;
@@ -144,10 +130,8 @@ index 0860ea5..ef44445 100644
pfn_point = pfn;
if (start > pfn_point || cap->end < pfn_point + args->npages)
return 0;
diff --git a/loader/main.c b/loader/main.c
index 7d21a4c..8d7d6db 100644
--- a/loader/main.c
+++ b/loader/main.c
--- src/kernel/codezero/loader/main.c
+++ src/kernel/codezero/loader/main.c
@@ -26,7 +26,6 @@ int load_elf_image(unsigned long **entry, void *filebuf);
int load_container_image(void *cont_section)
{

View File

@@ -1,7 +1,5 @@
diff --git a/loader/main.c b/loader/main.c
index 7d21a4c..ee03918 100644
--- a/loader/main.c
+++ b/loader/main.c
--- src/kernel/codezero/loader/main.c
+++ src/kernel/codezero/loader/main.c
@@ -135,3 +135,5 @@ int main(void)
return -1;
}

View File

@@ -1,7 +1,5 @@
diff --git a/conts/userlibs/SConstruct b/conts/userlibs/SConstruct
index 41c7913..421b563 100644
--- a/conts/userlibs/SConstruct
+++ b/conts/userlibs/SConstruct
--- src/kernel/codezero/conts/userlibs/SConstruct
+++ src/kernel/codezero/conts/userlibs/SConstruct
@@ -11,6 +11,7 @@ PROJRELROOT = '../..'
sys.path.append(PROJRELROOT)

View File

@@ -1,7 +1,5 @@
diff --git a/src/drivers/SConscript b/src/drivers/SConscript
index eedb59f..8f5cd5d 100644
--- a/src/drivers/SConscript
+++ b/src/drivers/SConscript
--- src/kernel/codezero/src/drivers/SConscript
+++ src/kernel/codezero/src/drivers/SConscript
@@ -8,24 +8,24 @@ src_local = []
objs = []
@@ -34,10 +32,8 @@ index eedb59f..8f5cd5d 100644
+ duplicate=0, variant_dir = join(bdir, 'omap/timer'))
Return('objs')
diff --git a/conts/baremetal/empty/SConstruct b/conts/baremetal/empty/SConstruct
index b70d69a..4889d8e 100644
--- a/conts/baremetal/empty/SConstruct
+++ b/conts/baremetal/empty/SConstruct
--- src/kernel/codezero/conts/baremetal/empty/SConstruct
+++ src/kernel/codezero/conts/baremetal/empty/SConstruct
@@ -48,7 +48,7 @@ env = Environment(CC = config.toolchain_userspace + 'gcc',
CPPFLAGS = '-include l4/config.h -include l4/macros.h -include l4/types.h')
@@ -47,10 +43,8 @@ index b70d69a..4889d8e 100644
Depends(objs, join(PROJROOT, CONFIG_H))
prog = env.Program(join(builddir, 'main.elf'), objs)
diff --git a/SConstruct b/SConstruct
index 2abc190..58c983d 100644
--- a/SConstruct
+++ b/SConstruct
--- src/kernel/codezero/SConstruct
+++ src/kernel/codezero/SConstruct
@@ -71,35 +71,35 @@ env = Environment(CC = config.toolchain_kernel + 'gcc',
objects = []
objects += SConscript('src/generic/SConscript',

View File

@@ -1,7 +1,5 @@
diff --git a/include/l4/generic/tcb.h b/include/l4/generic/tcb.h
index 7b315b8..ace38d8 100644
--- a/include/l4/generic/tcb.h
+++ b/include/l4/generic/tcb.h
--- src/kernel/codezero/include/l4/generic/tcb.h
+++ src/kernel/codezero/include/l4/generic/tcb.h
@@ -70,7 +70,7 @@ struct task_ids {
struct container;

View File

@@ -0,0 +1 @@
fb29b6a49c1e6ee759e034da8a59cf66b7ed74ef

View File

@@ -0,0 +1,9 @@
LICENSE := GPLv3
VERSION := git
DOWNLOADS := codezero.git
URL(codezero) := https://github.com/nfeske/codezero.git
REV(codezero) := 6fa4884a5a1cf6207372f69ae01e5faa6d5a39c8
DIR(codezero) := src/kernel/codezero
PATCHES := $(wildcard $(REP_DIR)/patches/*.patch)

View File

@@ -15,16 +15,6 @@
#include <base/thread.h>
/**
* Resolve 'Thread_base::myself' when not linking the thread library
*
* This weak symbol is primarily used by test cases. Most other Genode programs
* use the thread library. If the thread library is not used, 'myself' can only
* be called by the main thread, for which 'myself' is defined as zero.
*/
Genode::Thread_base * __attribute__((weak)) Genode::Thread_base::myself() { return 0; }
Genode::Native_utcb *Genode::Thread_base::utcb()
{
/*

View File

@@ -82,7 +82,7 @@ void Genode::Thread_base::_thread_bootstrap()
}
void Genode::Thread_base::_init_platform_thread(Type type)
void Genode::Thread_base::_init_platform_thread(size_t, Type type)
{
if (type == NORMAL) { return; }

View File

@@ -55,7 +55,8 @@ void Thread_base::start()
/* create thread at core */
char buf[48];
name(buf, sizeof(buf));
_thread_cap = _cpu_session->create_thread(buf);
enum { WEIGHT = Cpu_session::DEFAULT_WEIGHT };
_thread_cap = _cpu_session->create_thread(WEIGHT, buf);
/* assign thread to protection domain */
env()->pd_session()->bind_thread(_thread_cap);

View File

@@ -26,3 +26,5 @@ Ram_dataspace_capability Cpu_session_component::utcb(Thread_capability thread_ca
return Ram_dataspace_capability();
}
Cpu_session::Quota Cpu_session_component::quota() { return Quota(); }

View File

@@ -1,71 +0,0 @@
/*
* \brief IRQ session interface for NOVA
* \author Norman Feske
* \date 2010-01-30
*/
/*
* Copyright (C) 2010-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _CORE__INCLUDE__IRQ_SESSION_COMPONENT_H_
#define _CORE__INCLUDE__IRQ_SESSION_COMPONENT_H_
#include <base/lock.h>
#include <util/list.h>
#include <irq_session/capability.h>
namespace Genode {
class Irq_session_component : public Rpc_object<Irq_session>,
public List<Irq_session_component>::Element
{
private:
enum { STACK_SIZE = 4096 };
unsigned _irq_number;
Range_allocator *_irq_alloc;
Rpc_entrypoint _entrypoint;
Irq_session_capability _cap;
bool _attached;
public:
/**
* Constructor
*
* \param cap_session capability session to use
* \param irq_alloc platform-dependent IRQ allocator
* \param args session construction arguments
*/
Irq_session_component(Cap_session *cap_session,
Range_allocator *irq_alloc,
const char *args);
/**
* Destructor
*/
~Irq_session_component();
/**
* Return capability to this session
*
* If an initialization error occurs, returned capability is invalid.
*/
Irq_session_capability cap() const { return _cap; }
/***************************
** Irq session interface **
***************************/
void wait_for_irq();
};
}
#endif /* _CORE__INCLUDE__IRQ_SESSION_COMPONENT_H_ */

View File

@@ -14,6 +14,9 @@
#ifndef _CORE__INCLUDE__PLATFORM_PD_H_
#define _CORE__INCLUDE__PLATFORM_PD_H_
/* Genode includes */
#include <base/allocator.h>
/* core includes */
#include <platform_thread.h>
#include <address_space.h>
@@ -42,13 +45,19 @@ namespace Genode {
* Constructors
*/
Platform_pd(bool core);
Platform_pd(char const *, signed pd_id = -1, bool create = true);
Platform_pd(Allocator * md_alloc, char const *,
signed pd_id = -1, bool create = true);
/**
* Destructor
*/
~Platform_pd();
/**
* Register quota donation at allocator guard
*/
void upgrade_ram_quota(size_t ram_quota) { }
/**
* Bind thread to protection domain
*

View File

@@ -60,7 +60,7 @@ namespace Genode {
/**
* Constructor
*/
Platform_thread(const char *name = 0, unsigned priority = 0,
Platform_thread(size_t, const char *name = 0, unsigned priority = 0,
addr_t utcb = 0, int thread_id = THREAD_INVALID);
/**
@@ -152,6 +152,11 @@ namespace Genode {
***********************/
addr_t utcb() const { return _utcb; }
/**
* Set CPU quota of the thread to 'quota'
*/
void quota(size_t const quota) { /* not supported*/ }
};
}

View File

@@ -13,7 +13,6 @@
/* Genode includes */
#include <base/printf.h>
#include <base/sleep.h>
/* core includes */
#include <irq_root.h>
@@ -25,48 +24,111 @@
using namespace Genode;
void Irq_session_component::wait_for_irq()
bool Irq_object::_associate() { return true; }
void Irq_object::_wait_for_irq()
{
using namespace Codezero;
/* attach thread to IRQ when first called */
if (!_attached) {
int ret = l4_irq_control(IRQ_CONTROL_REGISTER, 0, _irq_number);
if (ret < 0) {
PERR("l4_irq_control(IRQ_CONTROL_REGISTER) returned %d", ret);
sleep_forever();
}
_attached = true;
}
/* block for IRQ */
int ret = l4_irq_control(IRQ_CONTROL_WAIT, 0, _irq_number);
int ret = l4_irq_control(IRQ_CONTROL_WAIT, 0, _irq);
if (ret < 0)
PWRN("l4_irq_control(IRQ_CONTROL_WAIT) returned %d", ret);
}
Irq_session_component::Irq_session_component(Cap_session *cap_session,
Range_allocator *irq_alloc,
const char *args)
:
_irq_alloc(irq_alloc),
_entrypoint(cap_session, STACK_SIZE, "irq"),
_attached(false)
void Irq_object::start()
{
long irq_number = Arg_string::find_arg(args, "irq_number").long_value(-1);
if (!irq_alloc || (irq_number == -1)||
irq_alloc->alloc_addr(1, irq_number).is_error()) {
PERR("unavailable IRQ %lx requested", irq_number);
::Thread_base::start();
_sync_bootup.lock();
}
void Irq_object::entry()
{
if (!_associate()) {
PERR("Could not associate with IRQ 0x%x", _irq);
return;
}
_irq_number = irq_number;
_cap = Irq_session_capability(_entrypoint.manage(this));
/* thread is up and ready */
_sync_bootup.unlock();
/* wait for first ack_irq */
_sync_ack.lock();
using namespace Codezero;
/* attach thread to IRQ when first called */
int ret = l4_irq_control(IRQ_CONTROL_REGISTER, 0, _irq);
if (ret < 0) {
PERR("l4_irq_control(IRQ_CONTROL_REGISTER) returned %d", ret);
return;
}
while (true) {
_wait_for_irq();
if (!_sig_cap.valid())
continue;
Genode::Signal_transmitter(_sig_cap).submit(1);
_sync_ack.lock();
}
}
Irq_object::Irq_object(unsigned irq)
:
Thread<4096>("irq"),
_sync_ack(Lock::LOCKED), _sync_bootup(Lock::LOCKED),
_irq(irq)
{ }
Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
const char *args)
:
_irq_number(Arg_string::find_arg(args, "irq_number").long_value(-1)),
_irq_alloc(irq_alloc),
_irq_object(_irq_number)
{
long msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
if (msi)
throw Root::Unavailable();
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) {
PERR("Unavailable IRQ 0x%x requested", _irq_number);
throw Root::Unavailable();
}
_irq_object.start();
}
Irq_session_component::~Irq_session_component()
{
PERR("not yet implemented");
PERR("Not yet implemented.");
}
void Irq_session_component::ack_irq()
{
_irq_object.ack_irq();
}
void Irq_session_component::sigh(Genode::Signal_context_capability cap)
{
_irq_object.sigh(cap);
}
Genode::Irq_session::Info Irq_session_component::info()
{
/* no MSI support */
return { .type = Genode::Irq_session::Info::Type::INVALID };
}

View File

@@ -98,7 +98,8 @@ Platform_pd::Platform_pd(bool core)
}
Platform_pd::Platform_pd(char const *, signed pd_id, bool create)
Platform_pd::Platform_pd(Allocator * md_alloc, char const *,
signed pd_id, bool create)
: _space_id(TASK_ID_INVALID)
{
_space_id = TASK_ID_INVALID;

View File

@@ -98,7 +98,7 @@ Weak_ptr<Address_space> Platform_thread::address_space()
}
Platform_thread::Platform_thread(const char *name, unsigned, addr_t,
Platform_thread::Platform_thread(size_t, const char *name, unsigned, addr_t,
int thread_id)
: _tid(THREAD_INVALID)
{

View File

@@ -7,6 +7,7 @@ SRC_CC += \
ram_session_component.cc \
ram_session_support.cc \
rom_session_component.cc \
cap_session_component.cc \
cpu_session_component.cc \
cpu_session_support.cc \
pd_session_component.cc \
@@ -41,6 +42,7 @@ include $(GEN_CORE_DIR)/version.inc
vpath main.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)
vpath cap_session_component.cc $(GEN_CORE_DIR)
vpath cpu_session_component.cc $(GEN_CORE_DIR)
vpath pd_session_component.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)

View File

@@ -98,7 +98,8 @@ void Thread_base::_thread_start()
void Thread_base::start()
{
/* create and start platform thread */
_tid.pt = new(platform()->core_mem_alloc()) Platform_thread(_context->name);
_tid.pt = new(platform()->core_mem_alloc())
Platform_thread(0, _context->name);
_tid.l4id = create_thread(1, stack_top(), (void *)&_thread_start);

View File

@@ -1,9 +1,6 @@
TARGET = codezero
-include $(BUILD_BASE_DIR)/etc/codezero.conf
ifeq ($(wildcard $(CODEZERO_DIR)),)
$(error No valid kernel configured in 'etc/codezero.conf')
endif
CODEZERO_DIR := $(call select_from_ports,codezero)/src/kernel/codezero
include $(REP_DIR)/lib/mk/codezero_cml.inc

View File

@@ -21,7 +21,7 @@
* the Codezero build system.
*/
vma_start = 0x100000;
lma_start = 0x40000;
lma_start = 0x41000;
offset = vma_start - lma_start;
@@ -58,7 +58,7 @@ SECTIONS
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
_dtors_end = .;
} : ro = 0x90909090
} : ro = 0x0
/* Linux: exception section for uaccess mechanism */
__ex_table : { *(__ex_table) }

View File

@@ -18,9 +18,10 @@ SRC_CC += child/child.cc
SRC_CC += process/process.cc
SRC_CC += elf/elf_binary.cc
SRC_CC += lock/lock.cc
SRC_CC += signal/signal.cc signal/common.cc
SRC_CC += signal/signal.cc signal/common.cc signal/platform.cc
SRC_CC += server/server.cc server/common.cc
SRC_CC += thread/thread.cc thread/thread_bootstrap.cc thread/trace.cc
SRC_CC += thread/myself.cc
SRC_CC += thread/context_allocator.cc
INC_DIR += $(REP_DIR)/src/base/lock

View File

@@ -10,6 +10,7 @@ SRC_CC += console/log_console.cc
SRC_CC += cpu/cache.cc
SRC_CC += env/env.cc env/context_area.cc env/reinitialize.cc
SRC_CC += thread/thread_start.cc
SRC_CC += irq/platform.cc
INC_DIR += $(BASE_DIR)/src/base/env

View File

@@ -0,0 +1,39 @@
diff --git fiasco/snapshot/kernel/fiasco/src/kern/kernel_console.cpp fiasco/snapshot/kernel/fiasco/src/kern/kernel_console.cpp
index ea632ce..4d88354 100644
--- fiasco/snapshot/kernel/fiasco/src/kern/kernel_console.cpp
+++ fiasco/snapshot/kernel/fiasco/src/kern/kernel_console.cpp
@@ -9,7 +9,7 @@ public:
int getchar( bool blocking = true );
void getchar_chance();
- static Mux_console *console() FIASCO_CONST;
+ static Mux_console *console();
private:
static bool initialized;
diff --git fiasco/snapshot/kernel/fiasco/src/kern/kernel_uart.cpp fiasco/snapshot/kernel/fiasco/src/kern/kernel_uart.cpp
index 42efe5c..0efb426 100644
--- fiasco/snapshot/kernel/fiasco/src/kern/kernel_uart.cpp
+++ fiasco/snapshot/kernel/fiasco/src/kern/kernel_uart.cpp
@@ -39,7 +39,7 @@ IMPLEMENTATION [serial]:
#include "config.h"
#include "panic.h"
-PUBLIC static FIASCO_CONST
+PUBLIC static
Uart *
Kernel_uart::uart()
{
diff --git fiasco/snapshot/kernel/fiasco/src/kern/map_util-mem.cpp fiasco/snapshot/kernel/fiasco/src/kern/map_util-mem.cpp
index 2363e65..43d9d8d 100644
--- fiasco/snapshot/kernel/fiasco/src/kern/map_util-mem.cpp
+++ fiasco/snapshot/kernel/fiasco/src/kern/map_util-mem.cpp
@@ -128,7 +128,7 @@ save_access_attribs (Mapdb* mapdb, const Mapdb::Frame& mapdb_frame,
// Mapdb instance for memory mappings
//
-Mapdb * mapdb_instance() FIASCO_CONST;
+Mapdb * mapdb_instance();
//---------------------------------------------------------------------------
IMPLEMENTATION[!64bit]:

View File

@@ -1 +1 @@
fa0ea19bd94fb109dac558e37996b60243eef785
7df3c35beaecb0915782bb9d572e2ee973d572c6

View File

@@ -1,201 +0,0 @@
#
# \brief Fiasco-specific test-environment supplements
# \author Norman Feske
# \author Christian Helmuth
# \date 2010-08-26
#
# This file is meant to be used as '--include' argument for 'tool/run'.
#
##
# Install files needed to boot via PXE
#
proc install_pxe_bootloader_to_run_dir { } {
exec cp [genode_dir]/tool/boot/pulsar [run_dir]/boot/pulsar
exec cp [genode_dir]/tool/boot/bender [run_dir]/boot/bender
}
##
# Read the location of the Fiasco user directory from 'etc/fiasco.conf'
#
proc l4_dir { } {
global _l4_dir
if {![info exists _l4_dir]} {
if {[file exists etc/fiasco.conf]} {
set _l4_dir [exec sed -n "/^L4_BUILD_DIR/s/^.*=\\s*//p" etc/fiasco.conf]
if {[file exists $_l4_dir]} { return $_l4_dir }
}
set _l4_dir "[pwd]/l4"
if {![file exists $_l4_dir]} {
puts -nonewline stderr "Error: Could neither find the L4 build directory "
puts -nonewline stderr "within '<genode-build-dir>/l4' nor at a location "
puts -nonewline stderr "specified via 'L4_BUILD_DIR = <l4v2-build-dir>' "
puts stderr "in <genode-build-dir>/etc/fiasco.conf'."
exit 1
}
}
return $_l4_dir
}
##
# Return whether the l4-buid-directory is provided from the outside
#
proc l4_dir_external { } {
if {[l4_dir] == "[pwd]/l4"} { return 0 }
return 1
}
##
# Return the location of the Fiasco kernel
#
proc fiasco { } {
return [kernel_location_from_config_file etc/fiasco.conf [pwd]/kernel/fiasco/fiasco]
}
##
# Return whether fiasco kernel is provided from the outside
#
proc fiasco_external { } {
if {[fiasco] == "[pwd]/kernel/fiasco/fiasco"} { return 0 }
return 1
}
##################################
## Test framework API functions ##
##################################
proc create_boot_directory { } {
exec rm -rf [run_dir]
exec mkdir -p [run_dir]/genode
exec mkdir -p [run_dir]/fiasco
}
proc bin_dir { } {
if {[have_spec x86_32]} { return "[l4_dir]/bin/x86_586" }
puts stderr "Error: Cannot determine bin directory"
exit 1
}
set fiasco_serial_esc_arg "-serial_esc "
proc build_boot_image {binaries} {
global fiasco_serial_esc_arg
#
# Collect contents of the ISO image
#
copy_and_strip_genode_binaries_to_run_dir $binaries
if {![fiasco_external]} { build { kernel } }
if {![l4_dir_external]} { build { bootstrap sigma0 } }
# assert existence of the L4 build directory
l4_dir
puts "using fiasco kernel [fiasco]"
exec cp [fiasco] [run_dir]/fiasco/fiasco
puts "using sigma0/bootstrap at [l4_dir]"
exec cp [bin_dir]/l4v2/sigma0 [run_dir]/fiasco
exec cp [bin_dir]/bootstrap [run_dir]/fiasco
install_iso_bootloader_to_run_dir
#
# Generate grub config file
#
# The core binary is part of the 'binaries' list but it must
# appear right after 'sigma0' as boot module. Hence the special case.
#
set fh [open "[run_dir]/boot/grub/menu.lst" "WRONLY CREAT TRUNC"]
puts $fh "timeout 0"
puts $fh "default 0"
puts $fh "\ntitle Genode on L4/Fiasco"
puts $fh " kernel /boot/bender"
puts $fh " module /fiasco/bootstrap -serial -modaddr=0x02000000"
puts $fh " module /fiasco/fiasco -serial -jdb_cmd=JH $fiasco_serial_esc_arg"
puts $fh " module /fiasco/sigma0"
puts $fh " module /genode/core"
puts $fh " module /genode/config"
foreach binary $binaries {
if {$binary != "core"} {
puts $fh " module /genode/$binary" } }
puts $fh " vbeset 0x117 506070"
close $fh
#
# Install PXE bootloader pulsar
#
install_pxe_bootloader_to_run_dir
create_iso_image_from_run_dir
create_disk_image_from_run_dir
#
# Generate pulsar config file
#
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
puts $fh " exec /boot/bender"
puts $fh " load /fiasco/bootstrap -serial -modaddr=0x02000000"
puts $fh " load /fiasco/fiasco -serial -serial_esc -jdb_cmd=JH"
puts $fh " load /fiasco/sigma0"
puts $fh " load /genode/core"
puts $fh " load /genode/config"
foreach binary $binaries {
if {$binary != "core"} {
puts $fh " load /genode/$binary" } }
close $fh
#
# Generate pulsar config file pointing to the config file above.
#
if {[info exists ::env(PXE_TFTP_DIR_BASE)] && [info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
exec ln -nfs "[pwd]" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
set tftp_base ""
if {[get_cmd_switch --tftp-absolute]} {
set tftp_base $::env(PXE_TFTP_DIR_BASE)
}
set fh [open "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)/config-00-00-00-00-00-00" "WRONLY CREAT TRUNC"]
puts $fh " root $tftp_base$::env(PXE_TFTP_DIR_OFFSET)/[run_dir]"
puts $fh " config config-52-54-00-12-34-56"
close $fh
}
}
proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} {
#
# If a running_spawn_id is specified, wait for the expected output
#
if {$running_spawn_id != -1} {
wait_for_output $wait_for_re $timeout_value $running_spawn_id
return
}
#
# Try to use one of the supported backends for running the scripts
#
if {[is_amt_available]} {
spawn_amt $wait_for_re $timeout_value
return
}
if {[is_qemu_available]} {
spawn_qemu $wait_for_re $timeout_value
return
}
global run_target
puts stderr "Error: Can't execute automatically on target '$run_target'"
exit -1
}

View File

@@ -14,6 +14,7 @@
/* Genode includes */
#include <base/cancelable_lock.h>
#include <cpu/atomic.h>
#include <cpu/memory_barrier.h>
#include <base/printf.h>
/* L4/Fiasco includes */
@@ -46,5 +47,6 @@ void Cancelable_lock::lock()
void Cancelable_lock::unlock()
{
Genode::memory_barrier();
_lock = UNLOCKED;
}

View File

@@ -34,7 +34,7 @@ void prepare_reinit_main_thread() { }
void Thread_base::_thread_bootstrap() { }
void Thread_base::_init_platform_thread(Type type)
void Thread_base::_init_platform_thread(size_t, Type type)
{
if (type == NORMAL) { return; }
_thread_cap = Genode::env()->parent()->main_thread_cap();

View File

@@ -26,3 +26,5 @@ Ram_dataspace_capability Cpu_session_component::utcb(Thread_capability thread_ca
return Ram_dataspace_capability();
}
Cpu_session::Quota Cpu_session_component::quota() { return Quota(); }

View File

@@ -17,6 +17,7 @@
#ifndef _CORE__INCLUDE__PLATFORM_PD_H_
#define _CORE__INCLUDE__PLATFORM_PD_H_
#include <base/allocator.h>
#include <platform_thread.h>
#include <address_space.h>
@@ -142,14 +143,19 @@ namespace Genode {
/**
* Constructor
*/
Platform_pd(char const *, signed pd_id = PD_INVALID,
bool create = true);
Platform_pd(Allocator * md_alloc, char const *,
signed pd_id = PD_INVALID, bool create = true);
/**
* Destructor
*/
~Platform_pd();
/**
* Register quota donation at allocator guard
*/
void upgrade_ram_quota(size_t ram_quota) { }
/**
* Initialize L4 task facility
*/

View File

@@ -53,7 +53,7 @@ namespace Genode {
/**
* Constructor
*/
Platform_thread(const char *name = 0, unsigned priority = 0,
Platform_thread(size_t, const char *name = 0, unsigned priority = 0,
addr_t utcb = 0, int thread_id = THREAD_INVALID);
/**
@@ -150,6 +150,11 @@ namespace Genode {
unsigned long pager_object_badge() const {
return convert_native_thread_id_to_badge(_l4_thread_id); }
/**
* Set CPU quota of the thread to 'quota'
*/
void quota(size_t const quota) { /* not supported*/ }
/*******************************
** Fiasco-specific Accessors **

View File

@@ -2,12 +2,10 @@
* \brief Core implementation of IRQ sessions
* \author Christian Helmuth
* \date 2007-09-13
*
* FIXME ram quota missing
*/
/*
* Copyright (C) 2007-2013 Genode Labs GmbH
* Copyright (C) 2007-2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@@ -30,8 +28,7 @@ namespace Fiasco {
using namespace Genode;
bool Irq_session_component::Irq_control_component::associate_to_irq(unsigned irq_number)
bool Irq_object::_associate()
{
using namespace Fiasco;
@@ -40,7 +37,7 @@ bool Irq_session_component::Irq_control_component::associate_to_irq(unsigned irq
l4_umword_t dw0, dw1;
l4_msgdope_t result;
l4_make_taskid_from_irq(irq_number, &irq_tid);
l4_make_taskid_from_irq(_irq, &irq_tid);
/* boost thread to IRQ priority */
enum { IRQ_PRIORITY = 0xC0 };
@@ -61,7 +58,7 @@ bool Irq_session_component::Irq_control_component::associate_to_irq(unsigned irq
}
void Irq_session_component::wait_for_irq()
void Irq_object::_wait_for_irq()
{
using namespace Fiasco;
@@ -69,7 +66,7 @@ void Irq_session_component::wait_for_irq()
l4_umword_t dw0=0, dw1=0;
l4_msgdope_t result;
l4_make_taskid_from_irq(_irq_number, &irq_tid);
l4_make_taskid_from_irq(_irq, &irq_tid);
do {
l4_ipc_call(irq_tid,
@@ -82,41 +79,88 @@ void Irq_session_component::wait_for_irq()
}
Irq_session_component::Irq_session_component(Cap_session *cap_session,
Range_allocator *irq_alloc,
void Irq_object::start()
{
::Thread_base::start();
_sync_bootup.lock();
}
void Irq_object::entry()
{
if (!_associate()) {
PERR("Could not associate with IRQ 0x%x", _irq);
return;
}
/* thread is up and ready */
_sync_bootup.unlock();
/* wait for first ack_irq */
_sync_ack.lock();
while (true) {
_wait_for_irq();
if (!_sig_cap.valid())
continue;
Genode::Signal_transmitter(_sig_cap).submit(1);
_sync_ack.lock();
}
}
Irq_object::Irq_object(unsigned irq)
:
Thread<4096>("irq"),
_sync_ack(Lock::LOCKED), _sync_bootup(Lock::LOCKED),
_irq(irq)
{ }
Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
const char *args)
:
_irq_number(Arg_string::find_arg(args, "irq_number").long_value(-1)),
_irq_alloc(irq_alloc),
_ep(cap_session, STACK_SIZE, "irqctrl"),
_control_cap(_ep.manage(&_control_component)),
_control_client(_control_cap)
_irq_object(_irq_number)
{
bool shared = Arg_string::find_arg(args, "irq_shared").bool_value(false);
if (shared) {
PWRN("IRQ sharing not supported");
throw Root::Invalid_args();
long msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
if (msi)
throw Root::Unavailable();
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) {
PERR("Unavailable IRQ 0x%x requested", _irq_number);
throw Root::Unavailable();
}
long irq_number = Arg_string::find_arg(args, "irq_number").long_value(-1);
if (irq_number == -1 || !irq_alloc ||
irq_alloc->alloc_addr(1, irq_number).is_error()) {
PERR("Unavailable IRQ %lx requested", irq_number);
throw Root::Invalid_args();
}
_irq_number = irq_number;
if (!_control_client.associate_to_irq(irq_number)) {
PWRN("IRQ association failed");
throw Root::Invalid_args();
}
/* initialize capability */
_irq_cap = Irq_session_capability(_ep.manage(this));
_irq_object.start();
}
Irq_session_component::~Irq_session_component()
{
PERR("Implement me, immediately!");
PERR("Not yet implemented.");
}
void Irq_session_component::ack_irq()
{
_irq_object.ack_irq();
}
void Irq_session_component::sigh(Genode::Signal_context_capability cap)
{
_irq_object.sigh(cap);
}
Genode::Irq_session::Info Irq_session_component::info()
{
/* no MSI support */
return { .type = Genode::Irq_session::Info::Type::INVALID };
}

View File

@@ -145,7 +145,7 @@ Platform::Sigma0 *Platform::sigma0()
Platform::Core_pager::Core_pager(Platform_pd *core_pd)
:
Platform_thread("core.pager"), Pager_object(0, Affinity::Location())
Platform_thread(0, "core.pager"), Pager_object(0, Affinity::Location())
{
Platform_thread::pager(sigma0());
@@ -490,13 +490,15 @@ Platform::Platform() :
/* setup pd object for core pd */
_core_label[0] = 0;
_core_pd = new(core_mem_alloc()) Platform_pd(_core_label, myself.id.task, false);
_core_pd = new(core_mem_alloc()) Platform_pd(nullptr, _core_label,
myself.id.task, false);
/*
* We setup the thread object for thread0 in core pd using a special
* interface that allows us to specify the lthread number.
*/
Platform_thread *core_thread = new(core_mem_alloc()) Platform_thread("core.main", myself.id.lthread);
Platform_thread *core_thread = new(core_mem_alloc())
Platform_thread(0, "core.main", myself.id.lthread);
core_thread->pager(sigma0());
_core_pd->bind_thread(core_thread);

View File

@@ -236,7 +236,8 @@ void Platform_pd::unbind_thread(Platform_thread *thread)
}
Platform_pd::Platform_pd(char const *, signed pd_id, bool create)
Platform_pd::Platform_pd(Allocator * md_alloc, char const *,
signed pd_id, bool create)
{
/* check correct init */
if (!_init)

View File

@@ -151,7 +151,8 @@ Weak_ptr<Address_space> Platform_thread::address_space()
}
Platform_thread::Platform_thread(const char *name, unsigned, addr_t, int thread_id)
Platform_thread::Platform_thread(size_t, const char *name, unsigned, addr_t,
int thread_id)
: _thread_id(thread_id), _l4_thread_id(L4_INVALID_ID), _pager(0)
{
strncpy(_name, name, sizeof(_name));

View File

@@ -7,6 +7,7 @@ SRC_CC += main.cc \
ram_session_component.cc \
ram_session_support.cc \
rom_session_component.cc \
cap_session_component.cc \
cpu_session_component.cc \
cpu_session_support.cc \
pd_session_component.cc \
@@ -42,6 +43,7 @@ vpath main.cc $(GEN_CORE_DIR)
vpath multiboot_info.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)
vpath cap_session_component.cc $(GEN_CORE_DIR)
vpath cpu_session_component.cc $(GEN_CORE_DIR)
vpath pd_session_component.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)

View File

@@ -34,7 +34,8 @@ void Thread_base::_thread_start()
void Thread_base::start()
{
/* create and start platform thread */
_tid.pt = new(platform()->core_mem_alloc()) Platform_thread(_context->name);
_tid.pt = new(platform()->core_mem_alloc())
Platform_thread(0, _context->name);
platform_specific()->core_pd()->bind_thread(_tid.pt);

View File

@@ -41,7 +41,7 @@ namespace Genode {
where normal lock isn't feasible */
enum {
/* everything above START_IDX is managed by core */
/* everything below START_IDX is managed by core */
START_IDX = Fiasco::USER_BASE_CAP >> Fiasco::L4_CAP_SHIFT
};

View File

@@ -78,9 +78,7 @@ namespace Genode {
* Native_capability in Fiasco.OC is just a reference to a Cap_index.
*
* As Cap_index objects cannot be copied around, but Native_capability
* have to, we have to use this indirection. Moreover, it might instead
* of a Cap_index reference some process-local object, and thereby
* implements a local capability.
* have to, we have to use this indirection.
*/
class Native_capability
{
@@ -97,18 +95,9 @@ namespace Genode {
private:
Cap_index* _idx;
void* _ptr;
protected:
/**
* Constructs a local capability, used by derived Capability
* class only
*
* \param ptr pointer to process-local object
*/
Native_capability(void* ptr) : _idx(0), _ptr(ptr) { }
inline void _inc()
{
if (_idx)
@@ -127,21 +116,18 @@ namespace Genode {
/**
* Default constructor creates an invalid capability
*/
Native_capability() : _idx(0), _ptr(0) { }
Native_capability() : _idx(0) { }
/**
* Construct capability manually
*/
Native_capability(Cap_index* idx)
: _idx(idx), _ptr(0) { _inc(); }
: _idx(idx) { _inc(); }
Native_capability(const Native_capability &o)
: _idx(o._idx), _ptr(o._ptr) { _inc(); }
: _idx(o._idx) { _inc(); }
~Native_capability()
{
_dec();
}
~Native_capability() { _dec(); }
/**
* Return Cap_index object referenced by this object
@@ -152,14 +138,13 @@ namespace Genode {
* Overloaded comparision operator
*/
bool operator==(const Native_capability &o) const {
return (_ptr) ? _ptr == o._ptr : _idx == o._idx; }
return _idx == o._idx; }
Native_capability& operator=(const Native_capability &o){
if (this == &o)
return *this;
_dec();
_ptr = o._ptr;
_idx = o._idx;
_inc();
return *this;
@@ -172,7 +157,6 @@ namespace Genode {
long local_name() const { return _idx ? _idx->id() : 0; }
Dst dst() const { return _idx ? Dst(_idx->kcap()) : Dst(); }
bool valid() const { return (_idx != 0) && _idx->valid(); }
void *local() const { return _ptr; }
};

View File

@@ -25,8 +25,8 @@ namespace Genode {
explicit Foc_cpu_session_client(Cpu_session_capability session)
: Rpc_client<Foc_cpu_session>(static_cap_cast<Foc_cpu_session>(session)) { }
Thread_capability create_thread(Name const &name, addr_t utcb = 0) {
return call<Rpc_create_thread>(name, utcb); }
Thread_capability create_thread(size_t weight, Name const &name, addr_t utcb = 0) {
return call<Rpc_create_thread>(weight, name, utcb); }
Ram_dataspace_capability utcb(Thread_capability thread) {
return call<Rpc_utcb>(thread); }
@@ -93,6 +93,14 @@ namespace Genode {
Native_capability alloc_irq() {
return call<Rpc_alloc_irq>(); }
int ref_account(Cpu_session_capability session) {
return call<Rpc_ref_account>(session); }
int transfer_quota(Cpu_session_capability session, size_t amount) {
return call<Rpc_transfer_quota>(session, amount); }
Quota quota() override { return call<Rpc_quota>(); }
};
}

View File

@@ -18,9 +18,10 @@ SRC_CC += process/process.cc
SRC_CC += elf/elf_binary.cc
SRC_CC += lock/lock.cc
SRC_CC += env/spin_lock.cc env/cap_map.cc
SRC_CC += signal/signal.cc signal/common.cc
SRC_CC += signal/signal.cc signal/common.cc signal/platform.cc
SRC_CC += server/server.cc server/common.cc
SRC_CC += thread/thread.cc thread/thread_bootstrap.cc thread/trace.cc
SRC_CC += thread/myself.cc
SRC_CC += thread/context_allocator.cc
INC_DIR += $(REP_DIR)/src/base/lock

View File

@@ -11,6 +11,7 @@ SRC_CC += cpu/cache.cc
SRC_CC += env/env.cc env/context_area.cc env/reinitialize.cc \
env/cap_map_remove.cc env/cap_alloc.cc
SRC_CC += thread/thread_start.cc
SRC_CC += irq/platform.cc
INC_DIR += $(BASE_DIR)/src/base/env

View File

@@ -1,4 +1,6 @@
SPECS += foc_arm platform_imx53
REP_INC_DIR += include/platform/imx53_qsb
include $(call select_from_repositories,mk/spec-platform_imx53.mk)
include $(call select_from_repositories,mk/spec-foc_arm.mk)

View File

@@ -1 +1 @@
3456a52b6603b16c9f157c9b3e2045e0984028c0
c2c8105cd296b88e0caa339680a6c6c66d4a1136

View File

@@ -2,5 +2,5 @@ LICENSE := GPLv2
VERSION := git
DOWNLOADS := foc.git
URL(foc) := http://github.com/ssumpf/foc.git
REV(foc) := 7cd187003db06c842b11c9f46f0a0753ed677203
REV(foc) := 8469170306022ab51c75cf137c411a09924600c2
DIR(foc) := src/kernel/foc

View File

@@ -30,7 +30,7 @@ append qemu_args "-nographic -m 64"
# increase expect buffer size, since there might be many log messages
match_max -d 100000
run_genode_until {child exited with exit value 0.*} 60
run_genode_until {child "test-cap_integrity" exited with exit value 0.*\n} 20
grep_output {\[init\] test message}
compare_output_to { }

View File

@@ -49,13 +49,6 @@ using namespace Fiasco;
void Ipc_ostream::_marshal_capability(Native_capability const &cap)
{
/* first transfer local capability value */
_write_to_buf(cap.local());
/* if it's a local capability we're done */
if (cap.local())
return;
if (cap.valid()) {
if (!l4_msgtag_label(l4_task_cap_valid(L4_BASE_TASK_CAP, cap.dst()))) {
_write_to_buf(0);
@@ -80,15 +73,6 @@ void Ipc_istream::_unmarshal_capability(Native_capability &cap)
{
long value = 0;
/* get local capability pointer from message buffer */
_read_from_buf(value);
/* if it's a local capability, the pointer is marshalled in the id */
if (value) {
cap = Capability<Native_capability>::local_cap((Native_capability*)value);
return;
}
/* extract capability id from message buffer */
_read_from_buf(value);

View File

@@ -29,14 +29,6 @@ namespace Fiasco {
#include <l4/sys/thread.h>
}
/**
* Resolve 'Thread_base::myself' when not linking the thread library
*
* This weak symbol is primarily used by test cases. Most other Genode programs
* use the thread library. If the thread library is not used, 'myself' can only
* be called by the main thread, for which 'myself' is defined as zero.
*/
Genode::Thread_base * __attribute__((weak)) Genode::Thread_base::myself() { return 0; }
/**
* Yield CPU time

View File

@@ -62,7 +62,7 @@ void Rpc_entrypoint::entry()
srv >> IPC_REPLY_WAIT >> opcode;
/* set default return value */
srv.ret(ERR_INVALID_OBJECT);
srv.ret(Ipc_client::ERR_INVALID_OBJECT);
/* check whether capability's label fits global id */
if (((unsigned long)srv.badge()) != _rcv_buf.label()) {

View File

@@ -0,0 +1,24 @@
/*
* \brief Implementation of the Thread API (foc-specific myself())
* \author Norman Feske
* \date 2015-04-28
*/
/*
* Copyright (C) 2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#include <base/thread.h>
Genode::Thread_base *Genode::Thread_base::myself()
{
using namespace Fiasco;
return reinterpret_cast<Thread_base*>(l4_utcb_tcr()->user[UTCB_TCR_THREAD_OBJ]);
}

View File

@@ -1,210 +0,0 @@
/*
* \brief Implementation of the Thread API
* \author Norman Feske
* \date 2010-01-11
*/
/*
* Copyright (C) 2010-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#include <base/thread.h>
#include <base/env.h>
#include <base/snprintf.h>
#include <util/string.h>
#include <util/misc_math.h>
using namespace Genode;
/**
* Return the managed dataspace holding the thread context area
*
* This function is provided by the process environment.
*/
namespace Genode {
Rm_session *env_context_area_rm_session();
Ram_session *env_context_area_ram_session();
}
void Thread_base::Context::stack_size(size_t const size)
{
/* check if the stack needs to be enhanced */
size_t const stack_size = (addr_t)_stack - stack_base;
if (stack_size >= size) { return; }
/* check if the stack enhancement fits the context region */
enum {
CONTEXT_SIZE = Native_config::context_virtual_size(),
CONTEXT_AREA_BASE = Native_config::context_area_virtual_base(),
UTCB_SIZE = sizeof(Native_utcb),
PAGE_SIZE_LOG2 = 12,
PAGE_SIZE = (1UL << PAGE_SIZE_LOG2),
};
addr_t const context_base = Context_allocator::addr_to_base(this);
size_t const ds_size = align_addr(size - stack_size, PAGE_SIZE_LOG2);
if (stack_base - ds_size < context_base) { throw Stack_too_large(); }
/* allocate and attach backing store for the stack enhancement */
addr_t const ds_addr = stack_base - ds_size - CONTEXT_AREA_BASE;
try {
Ram_session * const ram = env_context_area_ram_session();
Ram_dataspace_capability const ds_cap = ram->alloc(ds_size);
Rm_session * const rm = env_context_area_rm_session();
void * const attach_addr = rm->attach_at(ds_cap, ds_addr, ds_size);
if (ds_addr != (addr_t)attach_addr) { throw Stack_alloc_failed(); }
}
catch (Ram_session::Alloc_failed) { throw Stack_alloc_failed(); }
/* update context information */
stack_base -= ds_size;
}
Thread_base::Context *
Thread_base::_alloc_context(size_t stack_size, bool main_thread)
{
/*
* Synchronize context list when creating new threads from multiple threads
*
* XXX: remove interim fix
*/
static Lock alloc_lock;
Lock::Guard _lock_guard(alloc_lock);
/* allocate thread context */
Context *context = _context_allocator()->alloc(this, main_thread);
if (!context)
throw Context_alloc_failed();
/* determine size of dataspace to allocate for context members and stack */
enum { PAGE_SIZE_LOG2 = 12 };
size_t ds_size = align_addr(stack_size, PAGE_SIZE_LOG2);
if (stack_size >= Native_config::context_virtual_size() -
sizeof(Native_utcb) - (1UL << PAGE_SIZE_LOG2))
throw Stack_too_large();
/*
* Calculate base address of the stack
*
* The stack is always located at the top of the context.
*/
addr_t ds_addr = Context_allocator::addr_to_base(context) +
Native_config::context_virtual_size() -
ds_size;
/* add padding for UTCB if defined for the platform */
if (sizeof(Native_utcb) >= (1 << PAGE_SIZE_LOG2))
ds_addr -= sizeof(Native_utcb);
/* allocate and attach backing store for the stack */
Ram_dataspace_capability ds_cap;
try {
ds_cap = env_context_area_ram_session()->alloc(ds_size);
addr_t attach_addr = ds_addr - Native_config::context_area_virtual_base();
if (attach_addr != (addr_t)env_context_area_rm_session()->attach_at(ds_cap, attach_addr, ds_size))
throw Stack_alloc_failed();
}
catch (Ram_session::Alloc_failed) { throw Stack_alloc_failed(); }
/*
* Now the thread context is backed by memory, so it is safe to access its
* members.
*
* We need to initialize the context object's memory with zeroes,
* otherwise the ds_cap isn't invalid. That would cause trouble
* when the assignment operator of Native_capability is used.
*/
memset(context, 0, sizeof(Context) - sizeof(Context::utcb));
context->thread_base = this;
context->stack_base = ds_addr;
context->ds_cap = ds_cap;
/*
* The value at the top of the stack might get interpreted as return
* address of the thread start function by GDB, so we set it to 0.
*/
*(addr_t*)context->stack_top() = 0;
return context;
}
void Thread_base::_free_context(Context* context)
{
addr_t ds_addr = context->stack_base - Native_config::context_area_virtual_base();
Ram_dataspace_capability ds_cap = context->ds_cap;
/* call de-constructor explicitly before memory gets detached */
context->~Context();
Genode::env_context_area_rm_session()->detach((void *)ds_addr);
Genode::env_context_area_ram_session()->free(ds_cap);
/* context area ready for reuse */
_context_allocator()->free(context);
}
void Thread_base::name(char *dst, size_t dst_len)
{
snprintf(dst, min(dst_len, (size_t)Context::NAME_LEN), "%s", _context->name);
}
Thread_base *Thread_base::myself()
{
using namespace Fiasco;
return reinterpret_cast<Thread_base*>(l4_utcb_tcr()->user[UTCB_TCR_THREAD_OBJ]);
}
void Thread_base::join()
{
_join_lock.lock();
}
void* Thread_base::alloc_secondary_stack(char const *name, size_t stack_size)
{
Context *context = _alloc_context(stack_size, false);
strncpy(context->name, name, sizeof(context->name));
return (void *)context->stack_top();
}
void Thread_base::free_secondary_stack(void* stack_addr)
{
addr_t base = Context_allocator::addr_to_base(stack_addr);
_free_context(Context_allocator::base_to_context(base));
}
Thread_base::Thread_base(const char *name, size_t stack_size, Type const type,
Cpu_session *cpu_session)
:
_cpu_session(cpu_session),
_context(type == REINITIALIZED_MAIN ?
_context : _alloc_context(stack_size, type == MAIN)),
_join_lock(Lock::LOCKED)
{
strncpy(_context->name, name, sizeof(_context->name));
_init_platform_thread(type);
}
Thread_base::Thread_base(const char *name, size_t stack_size, Type type)
: Thread_base(name, stack_size, type, nullptr) { }
Thread_base::~Thread_base()
{
_deinit_platform_thread();
_free_context(_context);
}

View File

@@ -39,7 +39,7 @@ void Thread_base::_deinit_platform_thread()
}
void Thread_base::_init_platform_thread(Type type)
void Thread_base::_init_platform_thread(size_t weight, Type type)
{
/* if no cpu session is given, use it from the environment */
if (!_cpu_session)
@@ -50,16 +50,21 @@ void Thread_base::_init_platform_thread(Type type)
/* create thread at core */
char buf[48];
name(buf, sizeof(buf));
_thread_cap = _cpu_session->create_thread(buf);
_thread_cap = _cpu_session->create_thread(weight, buf);
/* assign thread to protection domain */
env()->pd_session()->bind_thread(_thread_cap);
if (!_thread_cap.valid() ||
env()->pd_session()->bind_thread(_thread_cap))
throw Cpu_session::Thread_creation_failed();
return;
}
/* adjust values whose computation differs for a main thread */
_tid = Fiasco::MAIN_THREAD_CAP;
_thread_cap = env()->parent()->main_thread_cap();
if (!_thread_cap.valid())
throw Cpu_session::Thread_creation_failed();
/* make thread object known to the Fiasco environment */
addr_t const t = (addr_t)this;
Fiasco::l4_utcb_tcr()->user[Fiasco::UTCB_TCR_THREAD_OBJ] = t;

View File

@@ -4,6 +4,5 @@ LD_TEXT_ADDR = 0x80100000
REQUIRES += arm foc_arndale
SRC_CC += arm/platform_arm.cc
INC_DIR += $(REP_DIR)/src/core/include/arm
vpath platform_services.cc $(GEN_CORE_DIR)

View File

@@ -34,6 +34,7 @@ namespace Fiasco {
using namespace Genode;
/***************************
** Cap_index_allocator **
***************************/

View File

@@ -107,3 +107,6 @@ void Genode::Cpu_session_component::single_step(Genode::Thread_capability thread
Fiasco::l4_thread_ex_regs(tid, ~0UL, ~0UL, flags);
}
Genode::Cpu_session::Quota Genode::Cpu_session_component::quota() { return Quota(); }

View File

@@ -2,7 +2,6 @@ include $(PRG_DIR)/../target.inc
REQUIRES += arm foc_imx53
SRC_CC += arm/platform_arm.cc
INC_DIR += $(REP_DIR)/src/core/include/arm
LD_TEXT_ADDR = 0x70140000

View File

@@ -1,29 +0,0 @@
/**
* \brief Base class for shared interrupts on ARM
* \author Sebastian Sumpf
* \date 2012-10-05
*/
/*
* Copyright (C) 2012-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _CORE__INCLUDE__ARM__IRQ_PROXY_COMPONENT_H_
#define _CORE__INCLUDE__ARM__IRQ_PROXY_COMPONENT_H_
#include <irq_proxy.h>
namespace Genode {
/**
* On ARM we disable shared interrupts
*/
typedef Irq_proxy_single Irq_proxy_base;
}
#endif /* _CORE__INCLUDE__ARM__IRQ_PROXY_COMPONENT_H_ */

View File

@@ -22,14 +22,12 @@ namespace Genode {
class Cap_session_component : public Rpc_object<Cap_session>
{
private:
static long _unique_id_cnt; /* TODO: remove this from generic core code */
public:
Cap_session_component(Allocator *md_alloc, const char *args) {}
void upgrade_ram_quota(size_t ram_quota) { }
Native_capability alloc(Native_capability ep);
void free(Native_capability cap);

View File

@@ -64,7 +64,9 @@ namespace Genode {
public:
Cpu_thread_component(Session_label const &label,
Cpu_thread_component(size_t const weight,
size_t const quota,
Session_label const &label,
Thread_name const &name,
unsigned priority, addr_t utcb,
Signal_context_capability sigh,
@@ -89,6 +91,8 @@ namespace Genode {
void bound(bool b) { _bound = b; }
Trace::Source *trace_source() { return &_trace_source; }
size_t weight() const { return Cpu_session::DEFAULT_WEIGHT; }
void sigh(Signal_context_capability sigh)
{
_sigh = sigh;
@@ -122,6 +126,7 @@ namespace Genode {
typedef Tslab<Cpu_thread_component, 1024> Cpu_thread_allocator;
Session_label _label;
Rpc_entrypoint *_session_ep;
Rpc_entrypoint *_thread_ep;
Pager_entrypoint *_pager_ep;
Allocator_guard _md_alloc; /* guarded meta-data allocator */
@@ -137,6 +142,26 @@ namespace Genode {
Trace::Source_registry &_trace_sources;
Trace::Control_area _trace_control_area;
size_t _weight;
size_t _quota;
Cpu_session_component * _ref;
List<Cpu_session_component> _ref_members;
Lock _ref_members_lock;
void _incr_weight(size_t);
void _decr_weight(size_t);
size_t _weight_to_quota(size_t) const;
void _decr_quota(size_t);
void _incr_quota(size_t);
void _update_thread_quota(Cpu_thread_component *) const;
void _update_each_thread_quota();
void _transfer_quota(Cpu_session_component *, size_t);
void _insert_ref_member(Cpu_session_component *) { }
void _unsync_remove_ref_member(Cpu_session_component *) { }
void _remove_ref_member(Cpu_session_component *) { }
void _deinit_ref_account();
void _deinit_threads();
/**
* Exception handler that will be invoked unless overridden by a
* call of 'Cpu_session::exception_handler'.
@@ -158,11 +183,13 @@ namespace Genode {
/**
* Constructor
*/
Cpu_session_component(Rpc_entrypoint *thread_ep,
Cpu_session_component(Rpc_entrypoint *session_ep,
Rpc_entrypoint *thread_ep,
Pager_entrypoint *pager_ep,
Allocator *md_alloc,
Trace::Source_registry &trace_sources,
const char *args, Affinity const &affinity);
const char *args, Affinity const &affinity,
size_t quota);
/**
* Destructor
@@ -179,7 +206,7 @@ namespace Genode {
** CPU session interface **
***************************/
Thread_capability create_thread(Name const &, addr_t);
Thread_capability create_thread(size_t, Name const &, addr_t);
Ram_dataspace_capability utcb(Thread_capability thread);
void kill_thread(Thread_capability);
Thread_capability first();
@@ -200,6 +227,9 @@ namespace Genode {
unsigned trace_control_index(Thread_capability);
Dataspace_capability trace_buffer(Thread_capability);
Dataspace_capability trace_policy(Thread_capability);
int ref_account(Cpu_session_capability c);
int transfer_quota(Cpu_session_capability c, size_t q);
Quota quota() override;
/***********************************

View File

@@ -0,0 +1,59 @@
/*
* \brief Fiasco.OC-specific core implementation of IRQ sessions
* \author Christian Helmuth
* \author Stefan Kalkowski
* \author Sebastian Sumpf
* \date 2007-09-13
*/
/*
* Copyright (C) 2007-2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#pragma once
/* Genode includes */
#include <base/printf.h>
#include <irq_session/irq_session.h>
#include <cap_index.h>
namespace Genode { class Irq_object; }
class Genode::Irq_object
{
private:
Cap_index *_cap;
Irq_session::Trigger _trigger; /* interrupt trigger */
Irq_session::Polarity _polarity; /* interrupt polarity */
unsigned _irq;
Genode::addr_t _msi_addr;
Genode::addr_t _msi_data;
Signal_context_capability _sig_cap;
Native_thread _capability() const { return _cap->kcap(); }
public:
Irq_object();
~Irq_object();
Irq_session::Trigger trigger() const { return _trigger; }
Irq_session::Polarity polarity() const { return _polarity; }
Genode::addr_t msi_address() const { return _msi_addr; }
Genode::addr_t msi_value() const { return _msi_data; }
void sigh(Genode::Signal_context_capability cap) { _sig_cap = cap; }
void notify() { Genode::Signal_transmitter(_sig_cap).submit(1); }
bool associate(unsigned irq, bool msi, Irq_session::Trigger,
Irq_session::Polarity);
void ack_irq();
};

View File

@@ -1,77 +0,0 @@
/*
* \brief IRQ session interface for Fiasco.OC
* \author Stefan Kalkowski
* \date 2011-01-28
*/
/*
* Copyright (C) 2011-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _CORE__INCLUDE__IRQ_SESSION_COMPONENT_H_
#define _CORE__INCLUDE__IRQ_SESSION_COMPONENT_H_
#include <base/lock.h>
#include <base/semaphore.h>
#include <base/rpc_server.h>
#include <util/list.h>
#include <irq_session/capability.h>
namespace Genode {
class Irq_proxy_component;
class Irq_session_component : public Rpc_object<Irq_session>,
public List<Irq_session_component>::Element
{
private:
/*
* Each IRQ session uses a dedicated server activation
*/
enum { STACK_SIZE = 2048 };
Rpc_entrypoint _ep;
Irq_session_capability _irq_cap;
Irq_proxy_component *_proxy;
public:
/**
* Constructor
*
* \param cap_session capability session to use
* \param irq_alloc platform-dependent IRQ allocator
* \param args session construction arguments
*/
Irq_session_component(Cap_session *cap_session,
Range_allocator *irq_alloc,
const char *args);
/**
* Destructor
*/
~Irq_session_component();
/**
* Return capability to this session
*
* If an initialization error occurs, returned capability is invalid.
*/
Irq_session_capability cap() const { return _irq_cap; }
/***************************
** Irq session interface **
***************************/
void wait_for_irq();
};
}
#endif /* _CORE__INCLUDE__IRQ_SESSION_COMPONENT_H_ */

View File

@@ -34,9 +34,15 @@ namespace Genode {
public:
Pd_session_component(Rpc_entrypoint *thread_ep, const char *args)
Pd_session_component(Rpc_entrypoint *thread_ep,
Allocator *md_alloc, const char *args)
: _thread_ep(thread_ep) { }
/**
* Register quota donation at allocator guard
*/
void upgrade_ram_quota(size_t ram_quota) { }
/**************************
** PD session interface **

View File

@@ -42,7 +42,7 @@ namespace Genode {
private:
enum {
THREAD_MAX = (1 << 6),
THREAD_MAX = (1 << 7),
UTCB_AREA_SIZE = (THREAD_MAX * Fiasco::L4_UTCB_OFFSET),
};

View File

@@ -167,6 +167,11 @@ namespace Genode {
unsigned long pager_object_badge() {
return (unsigned long) _thread.local.dst(); }
/**
* Set CPU quota of the thread to 'quota'
*/
void quota(size_t const quota) { /* not supported*/ }
/*******************************
** Fiasco-specific Accessors **

View File

@@ -1,24 +0,0 @@
/**
* \brief Base class for shared interrupts on x86
* \author Sebastian Sumpf
* \date 2012-10-05
*/
/*
* Copyright (C) 2012-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _CORE__INCLUDE__X86__IRQ_PROXY_COMPONENT_H_
#define _CORE__INCLUDE__X86__IRQ_PROXY_COMPONENT_H_
#include <irq_proxy.h>
namespace Genode {
typedef Irq_proxy<Thread<1024 * sizeof(addr_t)> > Irq_proxy_base;
}
#endif /* _CORE__INCLUDE__X86__IRQ_PROXY_COMPONENT_H_ */

View File

@@ -4,12 +4,10 @@
* \author Stefan Kalkowski
* \author Sebastian Sumpf
* \date 2007-09-13
*
* FIXME ram quota missing
*/
/*
* Copyright (C) 2007-2013 Genode Labs GmbH
* Copyright (C) 2007-2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@@ -18,10 +16,10 @@
/* Genode includes */
#include <base/printf.h>
#include <util/arg_string.h>
#include <util/bit_array.h>
/* core includes */
#include <irq_root.h>
#include <irq_proxy_component.h>
#include <irq_session_component.h>
#include <platform.h>
#include <util.h>
@@ -34,17 +32,18 @@ namespace Fiasco {
#include <l4/sys/types.h>
}
using namespace Genode;
namespace Genode {
class Interrupt_handler;
class Irq_proxy_component;
}
using namespace Genode;
/**
* Dispatches interrupts from kernel
*/
class Genode::Interrupt_handler : public Thread<4096>
class Genode::Interrupt_handler : public Thread<2048*sizeof(long)>
{
private:
@@ -59,170 +58,229 @@ class Genode::Interrupt_handler : public Thread<4096>
static Interrupt_handler handler;
return handler._thread_cap.dst();
}
};
/**
* Irq_proxy interface implementation
*/
class Genode::Irq_proxy_component : public Irq_proxy_base
enum { MAX_MSIS = 256 };
static class Msi_allocator : public Genode::Bit_array<MAX_MSIS>
{
private:
Cap_index *_cap;
Semaphore _sem;
long _trigger; /* interrupt trigger */
long _polarity; /* interrupt polarity */
Native_thread _capability() const { return _cap->kcap(); }
protected:
bool _associate()
{
using namespace Fiasco;
if (l4_error(l4_factory_create_irq(L4_BASE_FACTORY_CAP, _capability()))) {
PERR("l4_factory_create_irq failed!");
return false;
}
if (l4_error(l4_icu_bind(L4_BASE_ICU_CAP, _irq_number, _capability()))) {
PERR("Binding IRQ%ld to the ICU failed", _irq_number);
return false;
}
/* set interrupt mode */
Platform::setup_irq_mode(_irq_number, _trigger, _polarity);
if (l4_error(l4_irq_attach(_capability(), _irq_number,
Interrupt_handler::handler_cap()))) {
PERR("Error attaching to IRQ %ld", _irq_number);
return false;
}
return true;
}
void _wait_for_irq()
{
using namespace Fiasco;
int err;
l4_msgtag_t tag = l4_irq_unmask(_capability());
if ((err = l4_ipc_error(tag, l4_utcb())))
PERR("IRQ unmask: %d\n", err);
_sem.down();
}
void _ack_irq() { }
public:
Irq_proxy_component(long irq_number)
:
Irq_proxy_base(irq_number),
_cap(cap_map()->insert(platform_specific()->cap_id_alloc()->alloc())),
_sem(), _trigger(-1), _polarity(-1) { }
Msi_allocator() {
using namespace Fiasco;
Semaphore *semaphore() { return &_sem; }
l4_icu_info_t info { .features = 0 };
l4_msgtag_t res = l4_icu_info(Fiasco::L4_BASE_ICU_CAP, &info);
void start(long trigger, long polarity)
{
_trigger = trigger;
_polarity = polarity;
_start();
if (l4_error(res) || !(info.features & L4_ICU_FLAG_MSI))
set(0, MAX_MSIS);
else
if (info.nr_msis < MAX_MSIS)
set(info.nr_msis, MAX_MSIS - info.nr_msis);
}
} msi_alloc;
bool match_mode(long trigger, long polarity)
{
if (trigger == Irq_session::TRIGGER_UNCHANGED &&
polarity == Irq_session::POLARITY_UNCHANGED)
return true;
bool Genode::Irq_object::associate(unsigned irq, bool msi,
Irq_session::Trigger trigger,
Irq_session::Polarity polarity)
{
if (msi)
/*
* Local APIC address, See Intel x86 Spec - Section MSI 10.11.
*
* XXX local Apic ID encoding missing - address is constructed
* assuming that local APIC id of boot CPU is 0 XXX
*/
_msi_addr = 0xfee00000UL;
if (_trigger < 0 && _polarity < 0)
return true;
_irq = irq;
_trigger = trigger;
_polarity = polarity;
return _trigger == trigger && _polarity == polarity;
}
using namespace Fiasco;
if (l4_error(l4_factory_create_irq(L4_BASE_FACTORY_CAP,
_capability()))) {
PERR("l4_factory_create_irq failed!");
return false;
}
long trigger() const { return _trigger; }
long polarity() const { return _polarity; }
};
unsigned long gsi = _irq;
if (_msi_addr)
gsi |= L4_ICU_FLAG_MSI;
if (l4_error(l4_icu_bind(L4_BASE_ICU_CAP, gsi, _capability()))) {
PERR("Binding IRQ %u to the ICU failed", _irq);
return false;
}
if (!_msi_addr)
/* set interrupt mode */
Platform::setup_irq_mode(gsi, _trigger, _polarity);
if (l4_error(l4_irq_attach(_capability(), reinterpret_cast<l4_umword_t>(this),
Interrupt_handler::handler_cap()))) {
PERR("Error attaching to IRQ %u", _irq);
return false;
}
if (_msi_addr && l4_error(l4_icu_msi_info(L4_BASE_ICU_CAP, gsi,
&_msi_data))) {
PERR("Error getting MSI info");
return false;
}
return true;
}
/********************************
** IRQ session implementation **
********************************/
Irq_session_component::Irq_session_component(Cap_session *cap_session,
Range_allocator *irq_alloc,
const char *args)
:
_ep(cap_session, STACK_SIZE, "irqctrl"),
_proxy(0)
void Genode::Irq_object::ack_irq()
{
using namespace Fiasco;
long irq_number = Arg_string::find_arg(args, "irq_number").long_value(-1);
if (irq_number == -1) {
PERR("Unavailable IRQ %lx requested", irq_number);
throw Root::Invalid_args();
}
long irq_trigger = Arg_string::find_arg(args, "irq_trigger").long_value(-1);
irq_trigger = irq_trigger == -1 ? 0 : irq_trigger;
long irq_polarity = Arg_string::find_arg(args, "irq_polarity").long_value(-1);
irq_polarity = irq_polarity == -1 ? 0 : irq_polarity;
/*
* temorary hack for fiasco.oc using the local-apic,
* where old pic-line 0 maps to 2
*/
if (irq_number == 0)
irq_number = 2;
if (!(_proxy = Irq_proxy_component::get_irq_proxy<Irq_proxy_component>(irq_number,
irq_alloc))) {
PERR("No proxy for IRQ %lu found", irq_number);
throw Root::Unavailable();
}
/* sanity check */
if (!_proxy->match_mode(irq_trigger, irq_polarity)) {
PERR("Interrupt mode mismatch: IRQ %ld current mode: t: %ld p: %ld"
"request mode: trg: %ld p: %ld",
irq_number, _proxy->trigger(), _proxy->polarity(),
irq_trigger, irq_polarity);
throw Root::Unavailable();
}
/* set interrupt mode and start proxy */
_proxy->start(irq_trigger, irq_polarity);
if (!_proxy->add_sharer())
throw Root::Unavailable();
/* initialize capability */
_irq_cap = _ep.manage(this);
int err;
l4_msgtag_t tag = l4_irq_unmask(_capability());
if ((err = l4_ipc_error(tag, l4_utcb())))
PERR("IRQ unmask: %d\n", err);
}
void Irq_session_component::wait_for_irq()
Genode::Irq_object::Irq_object()
:
_cap(cap_map()->insert(platform_specific()->cap_id_alloc()->alloc())),
_trigger(Irq_session::TRIGGER_UNCHANGED),
_polarity(Irq_session::POLARITY_UNCHANGED),
_irq(~0U), _msi_addr(0), _msi_data(0)
{ }
Genode::Irq_object::~Irq_object()
{
_proxy->wait_for_irq();
if (_irq == ~0U)
return;
using namespace Fiasco;
unsigned long gsi = _irq;
if (_msi_addr)
gsi |= L4_ICU_FLAG_MSI;
if (l4_error(l4_irq_detach(_capability())))
PERR("Error detaching IRQ");
if (l4_error(l4_icu_unbind(L4_BASE_ICU_CAP, gsi, _capability())))
PERR("Error unbinding IRQ");
cap_map()->remove(_cap);
}
Irq_session_component::~Irq_session_component() {
_proxy->remove_sharer(); }
/***************************
** IRQ session component **
***************************/
/***************************************
** Interrupt handler implemtentation **
***************************************/
Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
const char *args)
:
_irq_number(~0U), _irq_alloc(irq_alloc)
{
long irq_number = Arg_string::find_arg(args, "irq_number").long_value(-1);
long msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
if (msi) {
if (msi_alloc.get(irq_number, 1)) {
PERR("Unavailable MSI %ld requested.", irq_number);
throw Root::Unavailable();
}
msi_alloc.set(irq_number, 1);
} else {
if (!irq_alloc || irq_alloc->alloc_addr(1, irq_number).is_error()) {
PERR("Unavailable IRQ %ld requested.", irq_number);
throw Root::Unavailable();
}
}
_irq_number = irq_number;
long irq_t = Arg_string::find_arg(args, "irq_trigger").long_value(-1);
long irq_p = Arg_string::find_arg(args, "irq_polarity").long_value(-1);
Irq_session::Trigger irq_trigger;
Irq_session::Polarity irq_polarity;
switch(irq_t) {
case -1:
case Irq_session::TRIGGER_UNCHANGED:
irq_trigger = Irq_session::TRIGGER_UNCHANGED;
break;
case Irq_session::TRIGGER_EDGE:
irq_trigger = Irq_session::TRIGGER_EDGE;
break;
case Irq_session::TRIGGER_LEVEL:
irq_trigger = Irq_session::TRIGGER_LEVEL;
break;
default:
throw Root::Unavailable();
}
switch(irq_p) {
case -1:
case POLARITY_UNCHANGED:
irq_polarity = POLARITY_UNCHANGED;
break;
case POLARITY_HIGH:
irq_polarity = POLARITY_HIGH;
break;
case POLARITY_LOW:
irq_polarity = POLARITY_LOW;
break;
default:
throw Root::Unavailable();
}
_irq_object.associate(_irq_number, msi, irq_trigger, irq_polarity);
}
Irq_session_component::~Irq_session_component()
{
if (_irq_number == ~0U)
return;
if (_irq_object.msi_address()) {
msi_alloc.clear(_irq_number, 1);
} else {
Genode::addr_t free_irq = _irq_number;
_irq_alloc->free((void *)free_irq);
}
}
void Irq_session_component::ack_irq() { _irq_object.ack_irq(); }
void Irq_session_component::sigh(Genode::Signal_context_capability cap)
{
_irq_object.sigh(cap);
}
Genode::Irq_session::Info Irq_session_component::info()
{
if (!_irq_object.msi_address() || !_irq_object.msi_value())
return { .type = Genode::Irq_session::Info::Type::INVALID };
return {
.type = Genode::Irq_session::Info::Type::MSI,
.address = _irq_object.msi_address(),
.value = _irq_object.msi_value()
};
}
/**************************************
** Interrupt handler implementation **
**************************************/
/* Build with frame pointer to make GDB backtraces work. See issue #1061. */
__attribute__((optimize("-fno-omit-frame-pointer")))
@@ -240,11 +298,8 @@ void Interrupt_handler::entry()
if ((err = l4_ipc_error(tag, l4_utcb())))
PERR("IRQ receive: %d\n", err);
else {
Irq_proxy_component *proxy;
proxy = Irq_proxy_component::get_irq_proxy<Irq_proxy_component>(label);
if (proxy)
proxy->semaphore()->up();
Irq_object * irq_object = reinterpret_cast<Irq_object *>(label);
irq_object->notify();
}
}
}

View File

@@ -4,6 +4,5 @@ LD_TEXT_ADDR = 0x80140000
REQUIRES += arm foc_panda
SRC_CC += arm/platform_arm.cc
INC_DIR += $(REP_DIR)/src/core/include/arm
vpath platform_services.cc $(GEN_CORE_DIR)

View File

@@ -2,7 +2,6 @@ include $(PRG_DIR)/../target.inc
REQUIRES += arm foc_pbxa9
SRC_CC += arm/platform_arm.cc
INC_DIR += $(REP_DIR)/src/core/include/arm
LD_TEXT_ADDR = 0x70490000

View File

@@ -30,6 +30,7 @@
/* Fiasco includes */
namespace Fiasco {
#include <l4/sigma0/sigma0.h>
#include <l4/sys/icu.h>
#include <l4/sys/ipc.h>
#include <l4/sys/kip>
#include <l4/sys/thread.h>
@@ -140,7 +141,8 @@ Platform::Core_pager::Core_pager(Platform_pd *core_pd, Sigma0 *sigma0)
{
Platform_thread::pager(sigma0);
core_pd->bind_thread(this);
if (core_pd->bind_thread(this))
panic("Binding thread failed");
cap(thread().local);
/* stack begins at the top end of the '_core_pager_stack' array */
@@ -332,7 +334,17 @@ void Platform::_setup_mem_alloc()
}
void Platform::_setup_irq_alloc() { _irq_alloc.add_range(0, 0x100); }
void Platform::_setup_irq_alloc()
{
using namespace Fiasco;
l4_icu_info_t info { .features = 0 };
l4_msgtag_t res = l4_icu_info(Fiasco::L4_BASE_ICU_CAP, &info);
if (l4_error(res))
panic("could not determine number of IRQs");
_irq_alloc.add_range(0, info.nr_irqs);
}
void Platform::_setup_basics()
@@ -499,7 +511,8 @@ Platform::Platform() :
Platform_thread(thi, irqi, "core.main");
core_thread->pager(&_sigma0);
_core_pd->bind_thread(core_thread);
if (_core_pd->bind_thread(core_thread))
panic("Binding thread failed");
}

View File

@@ -43,7 +43,14 @@ static addr_t core_utcb_base() {
int Platform_pd::bind_thread(Platform_thread *thread)
{
for (unsigned i = 0; i < THREAD_MAX; i++) {
/*
* Fiasco.OC limits the UTCB area for roottask to 16K. Therefore, the
* number of threads is limited to 16K / L4_UTCB_OFFSET.
* (see kernel/fiasco/src/kern/kernel_thread-std.cpp:94)
*/
unsigned const thread_max = thread->core_thread() ? 16*1024/L4_UTCB_OFFSET : THREAD_MAX;
for (unsigned i = 0; i < thread_max; i++) {
if (_threads[i])
continue;

View File

@@ -35,7 +35,7 @@ void Thread_base::_deinit_platform_thread()
}
void Thread_base::_init_platform_thread(Type) { }
void Thread_base::_init_platform_thread(size_t, Type) { }
void Thread_base::start()
@@ -46,7 +46,9 @@ void Thread_base::start()
Platform_thread *pt =
new(platform()->core_mem_alloc()) Platform_thread(_context->name);
platform_specific()->core_pd()->bind_thread(pt);
if (platform_specific()->core_pd()->bind_thread(pt))
throw Cpu_session::Thread_creation_failed();
_tid = pt->gate().remote;
_thread_cap =
reinterpret_cap_cast<Cpu_thread>(Native_capability(pt->thread().local));

View File

@@ -2,7 +2,6 @@ include $(PRG_DIR)/../target.inc
REQUIRES += arm foc_vea9x4
SRC_CC += arm/platform_arm.cc
INC_DIR += $(REP_DIR)/src/core/include/arm
LD_TEXT_ADDR = 0x60490000

View File

@@ -5,7 +5,5 @@ REQUIRES += x86
SRC_CC += io_port_session_component.cc \
x86/platform_x86.cc
INC_DIR += $(REP_DIR)/src/core/include/x86
vpath io_port_session_component.cc $(GEN_CORE_DIR)/x86
vpath platform_services.cc $(GEN_CORE_DIR)/x86

View File

@@ -1,7 +0,0 @@
This repository contains dummy implementations of platform-specific Genode APIs
to enable the compilation of Genode for the host platform. Because the
repository provides only dummy implementations, most of the generated binaries
will not work. However, the repository serves two important purposes. It
documents the platform- specific APIs that must be filled out when porting
Genode to another platform, and it is the build environment for unit tests
executed on the host platform.

View File

@@ -1,13 +0,0 @@
#
# Description of build platform
#
#
# If you want to build the host-specific Genode
# binaries, use this config option.
#
ifeq ($(shell uname -m),x86_64)
SPECS ?= host x86_64
else
SPECS ?= host x86_32
endif

View File

@@ -1,4 +0,0 @@
#
# Use the default host compiler instead of the Genode tool chain
#
CROSS_DEV_PREFIX =

View File

@@ -1,39 +0,0 @@
/*
* \brief Dummy IPC message buffer
* \author Norman Feske
* \date 2009-10-02
*/
/*
* Copyright (C) 2009-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__BASE__IPC_MSGBUF_H_
#define _INCLUDE__BASE__IPC_MSGBUF_H_
namespace Genode {
class Msgbuf_base
{
private:
size_t _size;
public:
char buf[];
/**
* Return size of message buffer
*/
inline size_t size() const { return _size; };
};
template <unsigned BUF_SIZE>
class Msgbuf : public Msgbuf_base { };
}
#endif /* _INCLUDE__BASE__IPC_MSGBUF_H_ */

View File

@@ -1,141 +0,0 @@
/*
* \brief Dummy pager support for Genode
* \author Norman Feske
* \date 2009-10-02
*/
/*
* Copyright (C) 2009-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__BASE__IPC_PAGER_H_
#define _INCLUDE__BASE__IPC_PAGER_H_
#include <base/cache.h>
#include <base/ipc.h>
#include <base/stdint.h>
#include <base/native_types.h>
namespace Genode {
class Mapping
{
public:
/**
* Constructor
*/
Mapping(addr_t dst_addr, addr_t src_addr,
Cache_attribute, bool io_mem,
unsigned l2size = 12, bool rw = true) { }
/**
* Construct invalid mapping
*/
Mapping() { }
/**
* Prepare map operation
*/
void prepare_map_operation() { }
};
/**
* Special paging server class
*/
class Ipc_pager : public Native_capability
{
protected:
/**
* Wait for short-message (register) IPC -- pagefault
*/
void _wait() { }
/**
* Send short flex page and
* wait for next short-message (register) IPC -- pagefault
*/
void _reply_and_wait() { }
public:
/**
* Constructor
*/
Ipc_pager() { }
/**
* Wait for a new fault received as short message IPC
*/
void wait_for_fault() { }
/**
* Reply current page-fault and wait for a new one
*
* Send short flex page and wait for next short-message (register)
* IPC -- fault
*/
void reply_and_wait_for_fault() { }
/**
* Request instruction pointer of current page fault
*/
addr_t fault_ip() { return 0; }
/**
* Request fault address of current page fault
*/
addr_t fault_addr() { return 0; }
/**
* Set parameters for next reply
*/
void set_reply_mapping(Mapping m) { }
/**
* Set destination for next reply
*/
void set_reply_dst(Native_capability pager_object) { }
/**
* Answer call without sending a flex-page mapping
*
* This function is used to acknowledge local calls from one of
* core's region-manager sessions.
*/
void acknowledge_wakeup() { }
/**
* Return thread ID of last faulter
*/
Native_thread_id last() const { return 0; }
/**
* Return badge for faulting thread
*/
unsigned long badge() const { return 0; }
/**
* Return true if last fault was a write fault
*/
bool is_write_fault() const { return false; }
/**
* Return true if last fault was an exception
*/
bool is_exception() const
{
/*
* Reflection of exceptions is not supported on this platform.
*/
return false;
}
};
}
#endif /* _INCLUDE__BASE__IPC_PAGER_H_ */

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