Compare commits

...

1254 Commits
14.02 ... 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
Christian Helmuth
f4e735fa16 version: 14.08 2014-08-28 13:36:05 +02:00
Norman Feske
1126c74717 News item for Genode 14.08 2014-08-28 13:34:43 +02:00
Norman Feske
4e0250bc38 Release notes for version 14.08 2014-08-28 13:34:43 +02:00
Norman Feske
a905f4916a doc: update components.txt 2014-08-28 13:34:43 +02:00
Christian Helmuth
cf5eb9753e ports: fetch openvpn from github 2014-08-28 12:35:56 +02:00
Josef Söntgen
4c017900c8 tools: strip rumpkernel based tools
Until now, the rumpkernel based tools were installed with all symbols
included. This accounts for about 200MiB used space on 64Bit system.
Stripping the binaries prior to installation brings the space
requirements down to 20MiB.

Fixes #1245.
2014-08-28 12:35:56 +02:00
Josef Söntgen
416c6579d4 tools: fix clean rule in tool_chain_rump
The clean rule is used to delete already built binaries as well as to
clean-up any left-overs from previous build attempts. If there was
no previous attempt just return true to prevent make from complaining.

Fixes #1245.
2014-08-28 12:35:55 +02:00
Sebastian Sumpf
f11b0439b2 lwip_lx.run: Increase timer quota 2014-08-28 12:35:55 +02:00
Sebastian Sumpf
98165dd91b dde_linux: Update to Linux 3.14.5
Update patch files and file lists.
2014-08-28 12:35:55 +02:00
Norman Feske
3a7773073d wm.run: use priorities for smoother rpi GUI 2014-08-26 11:00:36 +02:00
Norman Feske
1cddf05070 demo.run: adapt nested nitpicker to config changes 2014-08-26 11:00:36 +02:00
Norman Feske
3745869106 nitpicker: fix find_view w/o pointer present
Before the pointer handling was removed from the nitpicker server, the
pointer was always the first view, which was skipped in the find_view
function. However, since we support pointer-less operation by now, we
have to consider all views starting with the top-most one.
2014-08-26 11:00:36 +02:00
Norman Feske
e6dc43e6f6 decorator: redraw after disappearing window 2014-08-26 11:00:36 +02:00
Norman Feske
6a4f232d60 nit_fb: fix translation of absolute motion events 2014-08-26 11:00:35 +02:00
Josef Söntgen
ddb81fa361 libc: add net/route.h and its dependencies
Fixes #1235.
2014-08-26 11:00:35 +02:00
Josef Söntgen
9f886e1d94 ports: add openvpn-2.3.4
The port was succesfully tested a echo test and lighttpd. DHCP over
OpenVPN is not tested and probably will not work out of the box.
Therefore, the ip address etc. need to be specified manually.

For now, only ethernet bridging (using a TAP device) is supported.

Fixes #1235.
2014-08-26 11:00:35 +02:00
Josef Söntgen
474a68f05f libc: add if_tun.h
Fixes #1235.
2014-08-26 11:00:35 +02:00
Josef Söntgen
1a170e9caf libports: add vfs_jitterentropy library
This file system library uses the the jitterentropy library to provide
a rudimentary '/dev/random' device.

Fixes #1239.
2014-08-26 11:00:13 +02:00
Josef Söntgen
2f46930824 libports: add jitterentropy-20140411
This commit adds a port the jitterentropy library to Genode. As
backend on x86_{32,64} 'rdtsc' is used and on ARMv{6,7} the
performance-counter.

Fixes #1239.
2014-08-26 11:00:13 +02:00
Josef Söntgen
2bf67136c6 libc: add support for external vfs file systems
These file systems are provided on-demand by loading a shared library
when the fstab node is traversed. By convention this library is named
after the file system it provides. For example a file system that
provides a 'random' file system node is called 'vfs_random.lib.so'. It
is still possible to give the the node another name in the vfs. The
following code snippts illustrates this matter:

! [...]
! <config>
!   <libc>
!     <vfs>
!       <dir name="dev"> <jitterentropy name="random"/> </dir>
!     </vfs>
!   </libc>
! </config>
! [...]

Here the jitterentropy file system, implemented in
'vfs_jitterentropy.lib.so' provides a file system node named 'random'
in the 'dev' directory. When traversing the vfs section the libc will
try to load 'vfs_jitterentropy.lib.so' but programs may access the
file system only via '/dev/random'.

Fixes #1240.
2014-08-22 16:16:41 +02:00
Josef Söntgen
c745aa4454 libc: utilize Rtc_file_system in time functions
Fixes #1241.
2014-08-22 16:16:41 +02:00
Josef Söntgen
ebc07949ff libc: add support for Rtc_file_system
Fixes #1241.
2014-08-22 16:16:41 +02:00
Josef Söntgen
4cab202d8a libcrypto: remove MD2, RC5 and store
Remove components that are disabled upstream.

Fixes #1236.
2014-08-22 16:16:41 +02:00
Josef Söntgen
1f1b7f7158 libcrypto: use platform specific mk files
Instead of checking the target platform in the mk file use the common
pattern of providing a mk file for each platform.

Fixes #1236.
2014-08-22 16:16:41 +02:00
Josef Söntgen
5322714183 libssl: use platform specific mk files
Instead of checking the target platform in the mk file use the common
pattern of providing a mk file for each platform.

Fixes #1236.
2014-08-22 16:16:41 +02:00
Josef Söntgen
225dcf897b openssl: update to version 1.0.1i
Just a normal version bump, though we should revise the openssl port
regarding explicit memset() etc. issues.

Fixes #1236.
2014-08-22 16:16:40 +02:00
Josef Söntgen
e23a0c8a13 openssl: use Genode specific RAND backend
The backend merely provides simpler access to '/dev/random' because
on Genode the common random device checks are unnecessary.

Fixes #1236.
2014-08-22 16:16:40 +02:00
Josef Söntgen
baa64bf795 vfs: add Rtc_file_system
The Rtc_file_system reads the current time from a Rtc_session and
provides the time as '%Y-%m-%d %H:%M\n' to all users of the vfs
node.

Fixes #1238.
2014-08-22 16:16:40 +02:00
Josef Söntgen
51b6c4b508 vfs: add vfs handle header to single_file header
Fixes #1238.
2014-08-22 16:16:40 +02:00
Christian Prochaska
3d516c451d wm: fix WHEEL event translation
Fixes #1242.
2014-08-22 16:16:40 +02:00
Christian Prochaska
a06bd8cfe8 GBD: migrate to new ports mechanism
Fixes #1237.
2014-08-22 16:16:40 +02:00
Christian Prochaska
38771dc693 GCC: migrate to new ports mechanism
Fixes #1234.
2014-08-22 16:16:40 +02:00
Christian Prochaska
4973f2a310 Qt5: migrate to new ports mechanism
Fixes #1233.
2014-08-22 16:16:40 +02:00
Christian Prochaska
a34ab1b978 terminal_log: don't write null-termination to terminal
Fixes #1231.
2014-08-22 16:16:39 +02:00
Norman Feske
61b370ecba gems: new backdrop application
The new backdrop found at gems/src/app/backdrop replaces the old program
that was hosted in the demo repository.
2014-08-22 16:16:39 +02:00
Norman Feske
6a46dcd2af wm: remove debug messages 2014-08-21 12:54:35 +02:00
Norman Feske
eab1febd0d os: add RGB888 pixel format 2014-08-21 12:54:35 +02:00
Norman Feske
3b71998054 nitpicker: load initial config before announcement
This patch fixes a potential race condition that could happen if a
client connects to nitpicker before the signal for the import of the
initial configuration was delivered. In this case, nitpicker would be
unable to assign a domain to the session (because this information comes
from the configuration), rendering subsequent calls to 'mode' invalid.
The patch solves this problem by manually calling the signal handler
for importing the configuration.
2014-08-18 14:18:24 +02:00
Christian Prochaska
2f7167fab2 Qt5: use double buffering
Fixes #1229.
2014-08-18 13:28:29 +02:00
Christian Prochaska
85744a8308 fb_drv: implement 'buffered' mode for OMAP4
Fixes #1228.
2014-08-18 13:28:15 +02:00
Christian Prochaska
5abca43688 fb_drv: fix clipping
Use the clipped coordinates for calculating the buffer addresses, too.

Fixes #1227.
2014-08-18 13:27:58 +02:00
Christian Prochaska
a189135940 Qt5: fix menu problems
- fix sub menu positioning
- disable window decoration for popup menus

Fixes #1226.
2014-08-18 13:27:38 +02:00
Christian Prochaska
e851b98806 Qt launchpad: use XML configuration
With this patch, Qt launchpad entries are configured the same way as with
the Scout launchpad.

Fixes #1222.
2014-08-18 13:27:23 +02:00
Christian Prochaska
2e64a01ea5 Qt launchpad: coding style fixes
Fixes #1221.
2014-08-18 13:27:05 +02:00
Christian Prochaska
ee86b9d47a dde_ipxe: add Intel I217-LM PCI ID
Fixes #1220.
2014-08-18 13:26:48 +02:00
Christian Prochaska
bd6ffb8261 Start the ACPI driver in Qt5 run scripts if needed
Fixes #1219.
2014-08-18 13:26:23 +02:00
Christian Helmuth
dc2961338d Bootable GRUB2 disk image with ext2 partition
This provides bootable disk images for x86 platforms via

! RUN_OPT="--target disk"

The resulting disk image contains one ext2 partition with binaries from
the GRUB2 boot loader and the run scenario. The default disk size fits
all binaries, but is configurable via

! --disk-size <size in MiB>

in RUN_OPT.

The feature depends on an grub2-head.img, which is part of the commit,
but may also be generated by executing tool/create_grub2. The script
generates a disk image prepared for one partition, which contains files
for GRUB2. All image preparation steps that need superuser privileges
are conducted by this script.

The final step of writing the entire image to a disk must be executed
later by

  sudo dd if=<image file> of=<device> bs=8M conv=fsync

Fixes #1203.
2014-08-18 13:25:21 +02:00
Christian Helmuth
f442e64eaf prepare_port: log target when extracting archives
Fixes #1224.
2014-08-15 10:19:49 +02:00
Martin Stein
14e9a89cba hw: no superfluous ORing of zeros and clean up
fix #710
2014-08-15 10:19:49 +02:00
Martin Stein
e7d57ded36 hw & trustzone: fix alignm. of VM exception-vector
After modifying mode transition for branch prediction tz_vmm wasn't
working anymore on hw_imx53_tz but the modifications had nothing to do
with the VM code. However, the amount of instructions in the MT before the
VM exception-vector changed. So I tried stuffing the last working version with
NOPs and found that tz_vmm worked for some NOP amounts and for others not.
Thus, I increased the alignment of the VM exception-vector from 16 bytes to 32
bytes, é voila, its working with any amount of NOPs as well as with branch
prediction commits.

ref #474
2014-08-15 10:19:49 +02:00
Martin Stein
c03b277a34 hw & arm_v7: enable branch prediction
fix #474
2014-08-15 10:19:49 +02:00
Martin Stein
9da42dde2f hw & arm_v7: mode transition via transit ttbr0
Previously, we did the protection-domain switches without a transitional
translation table that contains only global mappings. This was fine as long
as the CPU did no speculative memory accesses. However, to enabling branch
prediction triggers such accesses. Thus, if we don't want to invalidate
predictors on every context switch, we need to switch more carefully.

ref #474
2014-08-15 10:19:48 +02:00
Martin Stein
03cd76821c hw & arm: exceptions to asserts in transl. table
ref #474
2014-08-15 10:19:48 +02:00
Martin Stein
e686aee5f9 hw: provide 'bool aligned' function in util.h
ref #474
2014-08-15 10:19:48 +02:00
Martin Stein
d48d0e7b43 hw: rename processor CPU
fix #1217
2014-08-15 10:19:48 +02:00
Martin Stein
1cba71208f hw: cpu_support to kernel/thread_base
ref #1217
2014-08-15 10:19:48 +02:00
Martin Stein
a5cf09fa6e hw: re-organize file structure
fix #1197
2014-08-15 10:19:48 +02:00
Norman Feske
bfdc4138ba seoul: remove superfluous includes from console
The console included nitpicker_view headers, which were not used. The
headers vanished with the recent nitpicker API change, which broke the
build of seoul.
2014-08-15 10:19:48 +02:00
Norman Feske
905ca7bf3f nit_fb: use server API, make resizeable
This patch reimplements the nit_fb server using the server API and
thereby enables the dynamic resizing the of the framebuffer.

Note that the new implementation does not feature the ability to perform
a periodic refresh via the 'refresh_rate' configuration argument. This
feature was removed because the refresh policy can (and should) always
be implemented on the client side.
2014-08-15 10:19:48 +02:00
Norman Feske
d3eac95ac5 Adapt run scripts to nitpicker config changes 2014-08-13 12:07:55 +02:00
Norman Feske
6f627ee073 qt5: Adaptation to nitpicker pointer change 2014-08-13 12:07:55 +02:00
Norman Feske
dc2da978f4 qt5: Adapt qpluginwidget new nitpicker/loader
The QPluginWidget used to be a QNitpickerViewWidget but the new loader
interface does no longer hand out a view capability. So we need to
decouple both classes. This patch moves the view-geometry calculation to
a separate class to make it easier reusable, in particular for the
QPluginWidget.
2014-08-13 12:07:55 +02:00
Norman Feske
dc1a08074a qt5: use window manager 2014-08-13 12:07:55 +02:00
Norman Feske
18ab2ddcb1 qt5: change mirror to HU Berlin 2014-08-12 13:08:02 +02:00
Norman Feske
acd9599890 Window manager
The window manager provides a nitpicker session interface. In contrast
to the nitpicker server, which leaves the view layout up to the client,
the window manager organizes the views on screen according to a policy
provided by a window layouter. Furthermore, it equips views with window
decorations as provided by a window decorator. Both layouter and
decorator are independent programs.
2014-08-12 13:08:02 +02:00
Norman Feske
59555c540e decorator stress test 2014-08-12 13:08:02 +02:00
Norman Feske
09ec663d2d Minimalistic decorator for window system 2014-08-12 13:08:02 +02:00
Norman Feske
20090000d2 Scout: Add DroidSans-Bold10 font as tff 2014-08-12 13:08:01 +02:00
Norman Feske
7888e7be02 loader: Adaptation to new nitpicker interface 2014-08-12 13:08:01 +02:00
Norman Feske
8539239fc4 nitpicker: documentation 2014-08-12 13:08:01 +02:00
Norman Feske
46fa29a156 nitpicker: reduce artifacts during mode change 2014-08-11 15:55:34 +02:00
Christian Prochaska
6b42f8b54e nitpicker: let 'Connection' track donated quota
This patch adds support for the consecutive re-dimensioning the virtual
framebuffer. When changing the buffer size, the session gets upgraded by
the missing portion of the quota instead of donating the whole size of
the new buffer each time.
2014-08-11 15:55:34 +02:00
Norman Feske
b5b1dd03bd nitpicker: Move status bar to separate program 2014-08-11 15:55:34 +02:00
Norman Feske
7fef141b96 nitpicker: Nitpicker::Session::mode_sigh function
The new 'mode_sigh' functions allows a client to register a signal
handler that is notified each time when nitpicker's screen properties
change.
2014-08-11 15:55:34 +02:00
Norman Feske
8df93aa4d4 nitpicker: Generate focus reports 2014-08-11 15:55:33 +02:00
Norman Feske
6a237a6c55 nitpicker: Domain-specific coordinate constraints
This patch introduces a way to tweak the coordinate systems per
domain. The 'origin' attribute denotes the origin of the coordinate
system. Valid values are "top_left", "top_right", "bottom_left",
"bottom_right", and "pointer". Furthermore, the screen dimensions as
reported to the nitpicker client can be tweaked per domain using the
'width' and 'height' attributes. If the specified value is positive,
it is taken as literal boundary. If the value is negative, the size
if deducted by the specified amount from the physical screen area.
2014-08-11 15:55:33 +02:00
Norman Feske
1745453315 nitpicker: Layers and client-side mouse cursor
This patch introduces a mandatory layer attribute to domains. The layer
ordering is superimposed on the stacking order of the views. The
top-most layer can be assigned to a pointer-managing client. An example
for such a pointer is located at os/src/app/pointer. It replaces the
formerly built-in nitpicker mouse cursor.

The new layering mechanism replaces the former "stay-top" session
argument. So the Nitpicker::Connection no longer takes the stay-top flag
as the first argument.
2014-08-11 15:55:33 +02:00
Norman Feske
6c4c4e5528 nitpicker: Support pointer as coordinate origin 2014-08-11 15:55:33 +02:00
Norman Feske
1ac343fabd nitpicker: Reduce superfluous refresh operations 2014-08-11 15:55:33 +02:00
Norman Feske
65e283142a nitpicker: Support for opaque views in X-ray mode
A session can be explicitly configured to present its views in a
completely opaque way when the X-ray mode is active as opposed to the
default where each view gets tinted and surrounded by a frame. This
is useful for decorator views, which look overly busy otherwise.
2014-08-11 15:55:33 +02:00
Norman Feske
2575fc0ade nitpicker: Draw black view if no buffer is present 2014-08-11 15:55:33 +02:00
Norman Feske
0d82070b82 nitpicker: Add label arg to connection constructor 2014-08-11 15:55:33 +02:00
Norman Feske
26fcea44b2 nitpicker: Hide global-operation key events 2014-08-11 15:55:33 +02:00
Norman Feske
295b4241aa nitpicker: Remove <global-keys> compound node 2014-08-11 15:55:32 +02:00
Norman Feske
dbebfd624e nitpicker: Domain configuration
This patch introduces the notion of a "domain" to the nitpicker
configuration concept. Session policies always refer to a domain where
multiple session policies can refer to the same domain. Thereby a domain
provides a way to express the grouping of sessions. This is useful for
applications that open multiple nitpicker sessions (such as Qt5 apps that
use one nitpicker session per window, menu, etc.). We want to assign all
those sessions to a single domain.

The configuration looks as follows:

<config>
  ...
  <domain name="default" color="#ffffff"/>
  <policy label="" domain="default"/>
  ...
</config>
2014-08-11 15:55:32 +02:00
Norman Feske
91e01411a4 nitpicker: Reworked session interface
This patch changes nitpicker's session interface to use session-local
view handles instead of view capabilities. This enables the batching
of multiple view operations into one atomic update.
2014-08-11 15:55:32 +02:00
Norman Feske
24869bd3ff nitpicker: Support for session-focus management
This patch introduces a focus-management facility to the nitpicker
session interface. As a side effect of this change, we remove the notion
of a "focused view". There can only be a "focused session". This makes
sense because input is directed to sessions, not views.

Issue #1168
2014-08-11 15:55:32 +02:00
Norman Feske
d22cddd1e8 nitpicker: Perform redraw asynchronously
This patch changes nitpicker's way of redrawing. Originally, redraw
operations were triggered immediately by the RPC functions invoked by
clients. In the presence of clients that invoked a large number of those
functions, the server could become overloaded with processing redraw
operations. The new version performs redraw operations out of band with
the RPC functions. Similar to the design of the DOpE GUI server, redraw
operations are processed periodically. The RPC functions merely modify
meta data and track the dirty areas that need to be updated.
Consequently, nitpicker's RPC functions become light-weight operations.

As a nice collateral effect of this patch, nitpicker's internal
structure could be simplified because the drawing backend is no longer
needed by the code that dispatches the RPC interface.
2014-08-11 15:55:32 +02:00
Norman Feske
d5f57992ac demo: Utility for animating values 2014-08-11 15:55:32 +02:00
Norman Feske
0be6817226 Add 'Weak_ptr' to the public Genode API
So far, the lifetime-management utilities 'Weak_ptr' and 'Locked_ptr'
had been preserved for core-internal use only. However, the utilities
are handy for many use cases outside of core where object lifetimes
must be managed. So we promote them to the public API.
2014-08-11 15:55:32 +02:00
Norman Feske
c652655bcb Add Rom_session::update
The new Rom_session::update function can be used to request the update of
an existing ROM dataspace. If the new data fits into the existing
dataspace, a subsequent call of 'dataspace' can be omitted. This way,
ROM dataspace updates don't suffer from page-fault-handling costs that
would occur when replacing the dataspace with each update.
2014-08-11 15:55:31 +02:00
Norman Feske
0fab869bcc os: add equality operators to 'Area' 2014-08-11 15:55:31 +02:00
Norman Feske
9d7270b174 os: Slave config with non-zero-terminated strings 2014-08-11 15:55:31 +02:00
Norman Feske
76ecfff7b6 os: Handle corner case in Xml_node::sub_node
When calling 'sub_node' on a node with no sub nodes, the Xml_node would
interpret the characters after the current node while searching for sub
nodes. The patch adds a sanity check that lets the 'sub_node' function
throw an exception when called on a node with no sub nodes.
2014-08-11 15:55:31 +02:00
Norman Feske
65e73074d9 os: forward args for Lazy_volatile_object
This patch makes the handling of constructor arguments consistent among
the Volatile_object and Lazy_volatile_object classes. Arguments are
always forwarded. Otherwise, passing a reference as argument would result
in an unwanted copy of the passed object.
2014-08-11 15:55:31 +02:00
Norman Feske
8768a6dae2 os: New utility for managing object handles
Some session interfaces use session-local handles for referring to
server-side objects, e.g., a file-system session hands out file handles
to the client. The new 'Handle_registry' class template can be used to
associate numeric handles with objects on the server side and thereby
simplifies the implementation of such servers.
2014-08-11 15:55:31 +02:00
Norman Feske
9b0c17730d os: Utility for tracking dirty rectangles 2014-07-25 12:14:18 +02:00
Norman Feske
9cc9736bf1 os: Construct invalid 'Rect' by default 2014-07-25 12:14:18 +02:00
Norman Feske
867a7018e8 qt5: implement QNitpickerPlatformWindow::raise
This function is needed to bring menus on top.
2014-07-25 12:14:18 +02:00
Norman Feske
b46d062918 dde_linux: incorporate file lists into port hash 2014-07-24 16:16:21 +02:00
Christian Menard
ad2cd4b328 dde_linux: HID multitouch support
Fixes #1209
2014-07-24 16:15:58 +02:00
Christian Prochaska
2da020b688 terminal: fix off-by-one bug
Fixes #1215.
2014-07-24 10:18:08 +02:00
Christian Prochaska
72bb821990 Fix 'noux_terminal_fs' test
Fixes #1213.
2014-07-24 10:18:08 +02:00
Martin Stein
1bc8de83ff hw & arm_v6: fix bug in calculation of kernel SP
For ARMv6, this aspect wasn't updatet to the new kernel-stack
managment that came up with SMP support.

ref #1199
2014-07-24 10:18:08 +02:00
Norman Feske
600753b8b7 ports-foc: retire unmaintained L4Linux examples 2014-07-24 10:18:08 +02:00
Norman Feske
0bef86223b debug_nitpicker.run: adapt to libc VFS changes 2014-07-24 10:18:08 +02:00
Norman Feske
6820de51ba gdb_monitor: Support session upgrades
This patch enables the debugging on services that rely on dynamic
session upgrades. For example, nitpicker expects its clients to donate
RAM quota that matches the size of the virtual framebuffer, which might
change during the lifetime of a nitpicker session.
2014-07-24 10:18:08 +02:00
Norman Feske
37248560d1 tool chain: disable -Werror for building GDB
Thanks to @duralog for reporting the issue!

Fixes #1214
2014-07-24 10:18:08 +02:00
Alexander Boettcher
5d06078d27 x86 vmm: add general multiprocessor support
* repos/ports/include/vmm
 - add support to specify cpu location during vCPU construction
* seoul
 - update to latest seoul branch supporting smp
 - adjust to vmm interface changes
 - vCPUs will be put in a round robin fashion on the available host CPUs,
   beginning with the next CPU after the default (boot) CPU
 - number of vCPUs can be specified in run script
* virtualbox
 - adjust to vmm interface changes
 - uses still one vCPU, placed on default (boot) CPU

Fixes #1212
2014-07-24 10:18:07 +02:00
Alexander Boettcher
40fc64e24f run: fix parsing of mp_server output test
Until now worked solely for 2 CPU setups. Adjust it to the actual available
number of CPUs.

Issue #1212
2014-07-24 10:18:07 +02:00
Alexander Boettcher
a371fdab4f Revert "timer: apply PIT quirk to avoid high cpu load"
This reverts commit edc03489b3.

Since commit

"timer: nova specific version of the service"

a nova specific timer is used and this quirk is not necessary anymore.

Issue #1211
2014-07-24 10:18:07 +02:00
Christian Prochaska
a46de84f89 Fix race condition in page fault notification
When a page fault cannot be resolved, the GDB monitor can get a hint about
which thread faulted by evaluating the thread state object returned by
'Cpu_session::state()'. Unfortunately, with the current implementation,
the signal which informs GDB monitor about the page fault is sent before
the thread state object of the faulted thread has been updated, so it
can happen that the faulted thread cannot be determined immediately
after receiving the signal.

With this commit, the thread state gets updated before the signal is sent.

At least on base-nova it can also happen that the thread state is not
accessible yet after receiving the page fault notification. For this
reason, GDB monitor needs to retry its query until the state is
accessible.

Fixes #1206.
2014-07-24 10:18:07 +02:00
Christian Prochaska
2a5fd44d7d tcp_terminal: fix run script
Fixes #1210.
2014-07-24 10:18:07 +02:00
Alexander Boettcher
cdb7904daa timer: nova specific version of the service
Issue #1211
2014-07-24 10:18:07 +02:00
Alexander Boettcher
e70c13ce1f nova: update to r6 nova kernel branch
- adds general support for semaphore timeouts
- fixes PCID feature (aka tagged TLB) seeen on Lenovo X201

Fixes #1211
2014-07-24 10:18:06 +02:00
Martin Stein
6cb9559feb hw: core as library
The build config for core is now provided through libraries to enable
implicit config composition through specifiers and thereby avoid
consideration of inappropriate targets.

fix #1199
2014-07-24 10:18:06 +02:00
Martin Stein
5f145b74a5 hw_imx31: fix compilation error in timer.h
fix #1200
2014-07-24 10:18:06 +02:00
Stefan Kalkowski
609f7abb0a hw: map a dataspace in core according to its flags
Thereby removing obsolete quirk for uncached CPU state dataspace
in VM session.

Fixes #1198
2014-07-24 10:18:06 +02:00
Alexander Boettcher
c5380674df vbox: add network support
- support e1000 model by default and add support for pcnet model
- add Genode xml config option to enable network models

Fixes #1201
2014-07-24 10:18:06 +02:00
Alexander Boettcher
46124546f0 vbox: support to disable acpi
Issue #1201
2014-07-24 10:18:06 +02:00
Alexander Boettcher
761f0498a9 vbox: don't run shared folder test on qemu 2014-07-24 10:18:06 +02:00
Stefan Kalkowski
8f57ff1f27 hw: re-enable the L2 cache for i.MX53 (Ref #1194) 2014-07-09 16:26:06 +02:00
Stefan Kalkowski
1c11099f09 hw: clean cache lines of altered translation table
For Cortex A8, and ARM1176JZF clean cache lines of altered MMU translation
tables.

Fix #1194
2014-07-09 16:26:06 +02:00
Norman Feske
2b75fd8142 resource_yield.run: increase entrypoint stack size
Needed for fiasco_x86 on real hardware.
2014-07-09 16:26:06 +02:00
Norman Feske
bcb3c78f62 okl4: consider elfweaver in cleanall rule 2014-07-09 16:26:06 +02:00
Alexander Boettcher
b8f6abc714 vbox: disable some exits to get TinyCore running 2014-07-09 16:26:06 +02:00
Alexander Boettcher
605a5d7df2 vbox: use priorities in run scripts
By using priorities, we make sure that the timer gets scheduled whenever
it is able to run regardless of how much load is on the system.
2014-07-09 16:26:06 +02:00
Alexander Boettcher
21e9eebf25 vbox: add LPT3 to ioport whitelist 2014-07-09 16:26:06 +02:00
Alexander Boettcher
6f75bb750a vbox: mouse queue quirk 2014-07-09 16:26:05 +02:00
Alexander Boettcher
edc03489b3 timer: apply PIT quirk to avoid high cpu load 2014-07-09 16:26:05 +02:00
Alexander Boettcher
b289273d28 alarm: use on_alarm(count) feature 2014-07-09 16:26:05 +02:00
Alexander Boettcher
ca9f0ba89c os: extend on_alarm() by unsigned count value
The count value can be used to batch timeouts. I.e., if a periodic
timeout triggered multiple times before the timer had a chance to
process them, the count corresponds to the number of passed periods.
2014-07-09 16:26:05 +02:00
Stefan Kalkowski
1c99ee951a hw: set pages shareable in SMP systems only
Fixes #1181
2014-07-09 16:26:05 +02:00
Norman Feske
db45a0d10d resource_yield test: fix race condition 2014-07-09 16:26:05 +02:00
Norman Feske
6de13fd71c Disable config syntax check for tool-chain test 2014-07-09 16:26:04 +02:00
Norman Feske
7f3601c34b python.run: make xmllint happy
This patch removes the XML-lookalike content from the inline config node
if the test-python program.
2014-07-09 16:26:04 +02:00
Stefan Kalkowski
b07b6666d6 run: wait some time before loading images via JTAG
When powering up the device it sometimes needs some seconds before the
bootloader prepared the board to use JTAG uploading.
2014-07-09 16:26:04 +02:00
Stefan Kalkowski
3d68125b5e create_builddir: add hw_imx53 (TrustZone) target
Until now, the HW platform support for the TrustZone features of the
i.MX53 boards could only be used, when adding a "trustzone" SPEC variable
manually. This commit adds a create_builddir target for HW i.MX53 with
TrustZone features enabled, fo convenience reasons.
2014-07-09 16:26:04 +02:00
Christian Helmuth
f7a7421091 Configurable clearing of array in Bit_array_base
Fixes #1177.
2014-07-09 16:26:04 +02:00
Christian Helmuth
24941ffaeb run: check XML syntax of generated config files
Fixes #1005.
2014-07-09 16:26:04 +02:00
Christian Helmuth
2c8f814c66 autopilot: provide time information
- Log elapsed time per test in summary
- Command-line switch `--time-stamp` prefixes log output lines with
  current time stamp (requires ts utility from Debian package _moreutils_)

Fixes #1156.
2014-06-27 14:25:09 +02:00
Norman Feske
365925a9ad ps2_drv: handle event-queue overflow
Fixes #1185
2014-06-27 14:15:53 +02:00
Norman Feske
b6f8bcca6a os: Add Input::Event_queue::reset function
Resetting the input-event queue is useful for error handling.

Issue #1185
2014-06-27 14:07:03 +02:00
Norman Feske
bb83c0d3da mesa: apply patches (fix #1193) 2014-06-27 14:05:50 +02:00
Martin Stein
f3ae42275a hw: move global TLB flush to extra class
A subject that inherits from Processor_client not necessarily has the need for
doing a processor-global TLB flush (e.g. VMs). At the other hand the Thread
class (as representation of the only source of TLB flushes) is already one of
the largest classes in base-hw because it provides all the syscall backends
and should therefore not accumulate other aspects without a functional reason.
Hence, I decided to move the aspect of synchronizing a TLB flush over all
processors to a dedicated class named Processor_domain_update.
Additionally a singleton of Processor_domain_update_list is used to enable
each processor to see all update-domain requests that are currently pending.

fix #1174
2014-06-26 13:42:52 +02:00
Stefan Kalkowski
42397cb512 os: avoid deadlock in packet stream (fix #1186)
Respectively resend a packet-stream-not-empty signal when a new signal handler
gets registered.
2014-06-26 12:14:03 +02:00
Martin Stein
6e993d31d4 hw: for_each & safer type casts in Double_list
ref #1174
2014-06-26 12:09:40 +02:00
Martin Stein
f0478ee214 hw: move double list to extra header
ref #1174
2014-06-26 12:09:26 +02:00
Alexander Boettcher
a6fdd68154 pthread: remove obsolete warning avoidance
Issue #1188
2014-06-26 12:06:15 +02:00
Alexander Boettcher
671e36bc45 vbox: disable ioapic support by default
and add xml configuration option to switch it on if required. Avoids trouble
on Windows 7 guest where IRQ injected by VMMDev PCI device is not delivered.

If ioapic is required and Windows guest addition "hangs", look in file
DevPCI.cpp, function pciSetIrqInternal, variable fIsApicEnabled. If

config[0xde] == 0xbe
config[0xad] == 0xef

it works. "Deadbeaf" seems to/should be set in ACPI file vbox.dsl. Happens for
unknown reason not on Genode/Nova.

Fixes #1188
2014-06-26 12:06:00 +02:00
Alexander Boettcher
f0c7eccdc7 vbox: save/restore fpu state of EMT thread
Issue #1188
2014-06-26 12:05:43 +02:00
Alexander Boettcher
149f199735 vbox: rework irq injection code
Issue #1188
2014-06-26 12:05:24 +02:00
Stefan Kalkowski
5385ada7a4 run-tool: enable image loading via openocd
By adding: "--target jtag \
            --jtag-debugger <debugger configuration> \
            --jtag-board <board configuration>" to the RUN_OPTs
this commits enables the run-tool to load and execute an ELF image
via JTAG to the target platform.

Fixes #1191
2014-06-26 12:04:53 +02:00
Stefan Kalkowski
e45fc7f0d7 hw: avoid locks before cache initialization
Fix #1190
2014-06-26 12:04:31 +02:00
Alexander Boettcher
b4e86cc499 ahci: throw exception if device can not be found
Fixes #1183
2014-06-26 12:03:28 +02:00
Stefan Kalkowski
b8798fc026 hw: prevent from off-by-one bugs in PIC classes
Instead of using Pic::MAX_INTERRUPT_ID this commit introduces more
conveniently the Pic:NR_OF_IRQ.

Ref #1169
2014-06-26 11:40:07 +02:00
Stefan Kalkowski
6d12f4eba7 hw: off-by-one bug when determining the last IRQ
Fix #1169
2014-06-26 11:39:55 +02:00
Sebastian Sumpf
f48bfd5db9 L4Linux: USB netperf tests on Arndale only
Issue #1189
2014-06-26 11:08:22 +02:00
Sebastian Sumpf
3eb21be9bd L4Linux: Disable netperf USB 3.0 test for x86
Issue #1189
2014-06-26 10:57:27 +02:00
Stefan Kalkowski
b93a58066f trustzone: automate run script for nightly tests
Ref #1182
2014-06-26 10:57:27 +02:00
Stefan Kalkowski
a492366eea hw: fix the TrustZone VM entry path
Commit 6a3368ee that refactored the mode transition assembler path, and
high-level entry point, fundamentally broke that part for the TrustZone VMs.
Instead of jumping to the appropriated address, the instruction value at that
point where used as target address.
Moreover, the TrustZone part of the mode transition page was not included into
the boundary check.

Ref #1182
2014-06-26 10:57:27 +02:00
Stefan Kalkowski
7b5237f9ff hw: add CSU I/O memory to core's memory regions
The central security regions has to be mapped when starting the hw-kernel
on the i.MX53 and using the TrustZone mechanisms.

Ref #1182
2014-06-26 10:57:27 +02:00
Stefan Kalkowski
7ca56e3fc4 hw: fix compilation errors for i.MX53/TrustZone
Fix #1182
2014-06-26 10:57:27 +02:00
Stefan Kalkowski
e5b78a6494 hw: disable L2 cache for imx53 platform
Currently the L2 cache for i.MX53 doesn't work correctly in the
hw-kernel, so we temporarily disable it.

Ref #1182
2014-06-26 10:57:27 +02:00
Christian Helmuth
1c2ff67d96 test-input: log event type as string 2014-06-26 10:57:26 +02:00
Stefan Kalkowski
786fe805da base: introduce caching attributes (fix #1184)
On ARM it's relevant to not only distinguish between ordinary cached memory
and write-combined one, but also having non-cached memory too. To insert the
appropriated page table entries e.g.: in the base-hw kernel, we need to preserve
the information about the kind of memory from allocation until the pager
resolves a page fault. Therefore, this commit introduces a new Cache_attribute
type, and replaces the write_combined boolean with the new type where necessary.
2014-06-26 10:57:26 +02:00
Christian Prochaska
9580954d81 blit: fix alignment errors on ARM
Depending on 'src_w' and 'dst_w', different lines of a block to copy may be
32-bit aligned or not, so the alignment of each line needs to get checked.

Fixes #1111.
2014-06-26 10:57:26 +02:00
Stefan Kalkowski
031cabf862 hw: let assembler constants be upper-case (Ref #1180) 2014-06-26 10:57:26 +02:00
Stefan Kalkowski
00ee2b565a hw: define assembler constants in global scope
Don't define assembler constants inside macros, thereby calling the
corresponding macros isn't needed anymore. To prevent having to much
constants included in files where they aren't needed, split macros.s
file into a generic mode_transition.s part, and globally used macros.s.

Fix #1180
2014-06-26 10:57:26 +02:00
Martin Stein
f5fdcc8f1e hw: get a thread cap in Thread_base constructor
Previously this was not done before Thread_base::start(..) in
base-hw as it was not needed to have a valid cap that early. However,
when changing the affinity of a thread we need the cap to be valid
before Thread_base::start(..).

fix #1151
2014-06-26 10:57:26 +02:00
Martin Stein
ccba43574f hw: fix bug in scheduler timing
By now the scheduling timer was only refreshed for a new scheduling timeout
when the choosen scheduling context has changed. But we want it to be refreshed
also when the scheduled context yields without an effect to the schedulers
choice (this is the case e.g. when the idle thread gets a scheduling timeout
or a thread yields without any competitor in its priority band).

ref #1151
2014-06-26 10:57:26 +02:00
Sebastian Sumpf
cf73ae2c20 usb_drv: Make EHCI-queue header non-cachable
Fixes #758
2014-06-26 10:57:26 +02:00
Sebastian Sumpf
cc8bf82300 usb_drv: Add timeout support for events (ref #758) 2014-06-26 10:57:26 +02:00
Sebastian Sumpf
3961a3e2a1 usb_drv: Add hrtimer support (ref #758) 2014-06-26 10:57:26 +02:00
Christian Helmuth
6f58cdffb6 nic: log errors in base-linux nic_drv 2014-06-26 10:57:25 +02:00
Christian Helmuth
7abc1733c5 util: abort construction of zero-sized bit arrays 2014-06-26 10:57:25 +02:00
Alexander Boettcher
963551877f netperf: wait for output of all spawned processes 2014-06-26 10:57:25 +02:00
Christian Helmuth
d2cacbc7a6 test-input: use key name from input/keycode.h 2014-06-26 10:57:25 +02:00
Josef Söntgen
7d593f2582 lxip: dissolve receiver in socket handler
Fixes #1179.
2014-06-26 10:57:25 +02:00
Martin Stein
f45cf49405 base: test for the pseudo-parallel use of an FPU
fix #1126
2014-06-26 10:57:25 +02:00
Martin Stein
4b7d58fccc hw & cortex_a9: do lazy FPU-context switch
ref #1126
2014-06-26 10:57:25 +02:00
Stefan Kalkowski
05603951b6 hw: enable and maintain outer l2 cache
Fix #1170
2014-06-26 10:57:25 +02:00
Norman Feske
6125e10be6 base: Never copy the dealloc argument for destroy
By using &&, we prevent the accidental copying of deallocator instances,
passed to the destroy function. We always want to take the deallocator
as reference or pointer.
2014-06-26 10:57:25 +02:00
Christian Prochaska
4672ae637a Qt5: set the parent view of a QPluginWidget's view
For the correct integration of a QPluginWidget in a parent QWidget, with
this commit the parent QWidget's Nitpicker view is made the parent view of
the plugin's Nitpicker view.

Fixes #1173.
2014-06-26 10:57:25 +02:00
Christian Prochaska
64863a4b33 loader: allow to set the parent of the subsystem's view
This commit adds a 'parent_view()' function to the loader session, which
allows to set the parent view of the subsystem's Nitpicker view.

If the function is to be used, this must get done before calling
'start()'.

Fixes #1172.
2014-06-26 10:57:24 +02:00
Christian Prochaska
5ea772d284 Qt5: don't create superfluous Nitpicker buffer
When Qt creates a Nitpicker session for determining the screen resolution,
it is not necessary to create a Nitpicker buffer.

Fixes #1166.
2014-06-26 10:57:24 +02:00
Alexander Boettcher
3a8bf754e1 vbox: workaround for bug in Windows guest addition
In file

src/VBox/Additions/WINNT/SharedFolders/driver/file.c

the function

static int vbsfTransferCommon(VBSFTRANSFERCTX *pCtx)

in the

VbglR0CanUsePhysPageList()

branch does not correctly evaluate the read or written bytes from
the VMM. It ever assumes that whole pages are read/written.

Workaround the bug in the Windows guest additions of Vbox until fixed
upstream by filling up the read/write buffer completely within the VMM code
of Vbox.

Fixes #1176
2014-06-26 10:57:24 +02:00
Alexander Boettcher
5922617eab vbox: add test for shared folders
Issue #1176
2014-06-26 10:57:24 +02:00
Alexander Boettcher
0a8c419dee tcp_terminal: fix handling of read characters
Fixes #1167
2014-06-06 15:01:23 +02:00
Alexander Boettcher
aae541f9c0 tcp_terminal.run: support native x86 hardware run
Issue #1167
2014-06-06 15:00:46 +02:00
Christian Helmuth
bf158017da vfs: really write _count_ bytes in log file system
Genode::strncpy() enures the destination string is null terminated by
writing a null-byte. In this case, the null-bytes always overwrote the
last character of the output byte stream.
2014-06-06 14:54:32 +02:00
Stefan Kalkowski
220f57cdcf gpio_drv: prevent copy of non-copyable objects
Follow up fix for commit 0b7ea4abab
Ref #1093
2014-06-06 14:54:32 +02:00
Christian Prochaska
a12b7edc06 Qt5: handle dialog windows as top-level windows
Fixes #1164.
2014-06-06 14:54:32 +02:00
Christian Prochaska
70e51c0632 Qt5: don't create Nitpicker views for desktop widgets
Fixes #1163.
2014-06-06 14:54:31 +02:00
Martin Stein
984be753ad base & exynos5: platform driver in affinity test
Ensures that the Exynos5 CPU is clocked equally no matter how the kernel
initialized it. This makes the result of this time critical test more
comparable.

fix #1162
2014-06-06 14:54:31 +02:00
Martin Stein
8d145bd80c hw & rpi: provide Pic::MAX_INTERRUPT_ID
fix #1160
2014-06-06 14:54:31 +02:00
Martin Stein
f53e4ff8f5 hw: align kernel stack appropriately
fix #1161
2014-06-06 14:54:31 +02:00
Martin Stein
8d43b67ca6 hw: map binaries of boot modules on demand
fix #1139
2014-06-06 14:54:31 +02:00
Martin Stein
f8be04bc70 base: extra section for binaries of boot modules
This enables us to map the binaries of the boot modules on demand at least in
base-hw.

ref #1139
2014-06-06 14:54:31 +02:00
Christian Helmuth
06a10b3695 hw: log "Test succeeded" in nested_init.run 2014-06-06 14:54:30 +02:00
Johannes Schlatow
b52da1045e nic_drv: read MAC and tap device from config
E.g.:
<nic mac="12:23:34:45:56:67" tap="tap1"/>

Fixes #1165.
2014-06-06 14:54:30 +02:00
Josef Söntgen
0f4d525eda dde_rump: implement rumpuser_dprintf()
Though we do not actually need this function, it is helpful while
debugging.

Fixes #1141.
2014-06-06 14:54:30 +02:00
Josef Söntgen
43cb97cd83 dde_rump: fix int casting warnings
Fixes #1141.
2014-06-06 14:54:30 +02:00
Josef Söntgen
65bdddbbdf dde_rump: rump_iso compare output on 64bit systems
Fixes #1141.
2014-06-06 14:54:30 +02:00
Christian Helmuth
2c15aaf67d linux: fix lx_rmap test to not stuck
The test did not fail actually. It just behaved strangely and got stuck
in the good case, which is fixed now.

Fixes #1121.
2014-06-06 14:54:08 +02:00
Christian Prochaska
023afebba1 Qt5: constrain the window buffer refresh area
With this patch, the information about the changed window area is taken
into account when refreshing the Nitpicker buffer.

Fixes #1132.
2014-06-06 14:54:08 +02:00
Christian Prochaska
17c22b2ac9 Qt5: use the Genode main thread
Now that it is possible to resize the stack of the Genode main thread, it
is not necessary anymore to create a new Genode thread as Qt main thread.

Fixes #1134.
2014-06-06 14:54:08 +02:00
Josef Söntgen
edfd90a1bc ram_blk: remove superfluous block_number check
block_number is Block::sector_t (uint64_t), which never can by less
than 0.

Fixes #1142.
2014-06-06 14:54:08 +02:00
Josef Söntgen
c9412d37b9 ram_blk: change blocksize output to decimal
Reading 200 instead of 512 is confusing.

Fixes #1142.
2014-06-06 14:54:08 +02:00
Christian Prochaska
14951649e4 dde_linux: implement memory barriers in USB driver
This patch implements the memory barrier macros in the USB driver for ARMv7
and x86.

Fixes #1159.
2014-06-06 14:54:08 +02:00
Norman Feske
0ed68a56b7 Use signals for delivering input events
This patch changes both the Input::Session interface and the skeleton
for the server-side implementation of this interface
('input/component.h').

The Input::Session interface offers a new 'sigh' function, which can be
called be the client to register a signal handler. The signal handler
gets notified on the arrival of new input. This alleviates the need to
poll for input events at the client side.

The server-side skeleton for implementing input services underwent a
redesign to make it more modular and robust. I.e., there are no
global functions needed at the server side and the event-queue
enable/disable mechanism is implemented at a central place (in the root
component) rather than inside each driver.

Fixes #46
2014-06-06 14:54:07 +02:00
Sebastian Sumpf
6c10bfe049 dde_linux: Remove bogus line from XHCI patch
This was a left over from the 'vi' editor
2014-06-02 12:56:05 +02:00
Norman Feske
6d3a41a95c tool: Sort patches when generating port hashes
Issue #1082
2014-06-02 11:31:50 +02:00
Norman Feske
5a32c08235 doc: markup-fix in doc/porting_guide.txt 2014-05-29 13:55:27 +02:00
Norman Feske
5f8577ae71 News item for Genode 14.05 2014-05-29 13:55:26 +02:00
Martin Stein
a7f003edf4 Final touches of the release notes 14.05 2014-05-29 09:21:39 +02:00
Christian Helmuth
2034180d87 version: 14.05 2014-05-28 15:54:27 +02:00
Norman Feske
88cae5e82e Release notes for version 14.05 2014-05-28 15:53:34 +02:00
Josef Söntgen
bdfe634fdf doc: update porting guide to new port mechanism 2014-05-28 15:53:33 +02:00
Alexander Boettcher
f2d38443f7 vbox: fix share-folder setup 2014-05-28 14:57:05 +02:00
Stefan Kalkowski
7138b2740a hw: fix section insertion in translation tables
Fixes an alignment problem introduced by commit "hw: map core on demand"
where physical address alignment wasn't checked anymore, when inserting
a section within the first-level table of ARM's short translation table
format.

Many thanks to Christian Prochaska for helping to debug the problem.
2014-05-28 12:28:11 +02:00
Christian Helmuth
a42a5995cf vbox: enable guest additions
Fixes #1157
2014-05-27 13:45:58 +02:00
Alexander Boettcher
4673eb9578 vbox: update to 4.2.24 2014-05-27 13:45:58 +02:00
Alexander Boettcher
2c61392237 vmm utils: cpu-session parameter for VMM thread
Issue #1157
2014-05-27 13:45:36 +02:00
Christian Helmuth
2c3a0bbe1b nova: re-throw uncatched exception of dying thread
If the re-throw works, we will can see which exception type was thrown.
2014-05-27 13:45:20 +02:00
Christian Helmuth
973d710101 vfs: catch lookup-failed exception on node discovery 2014-05-27 13:45:20 +02:00
Alexander Boettcher
8ef8e8ede9 rtc: document current interface
Issue #1148
2014-05-27 13:45:20 +02:00
Norman Feske
615830e107 Enable hash checks for ports mechanism 2014-05-27 13:45:03 +02:00
Norman Feske
acf00c29c3 Add 'update_hash' and 'list' to tool/ports
Issue #1082
2014-05-27 13:45:03 +02:00
Sebastian Sumpf
24f97f9593 usb_drv: Check SCSI command queue state
In case the storage-entry point dispatches more then one packet, wait for the
previous command to finish before setting a new request. This has to be done
because the 'queuecommand' does actually *not* queue things, but can only handle
one request at the time.

Fix #1143
2014-05-27 11:14:46 +02:00
Sebastian Sumpf
53316bfd55 ports-foc: Enable l4inux_netperf tests for x86
USB network cards can now be tested on x86.

Ref #1143
2014-05-27 11:14:46 +02:00
Christian Prochaska
7740da3197 gmplib: use faster download mirror
Fixes #1155.
2014-05-27 11:14:46 +02:00
Josef Söntgen
9e443c78db dde_rump: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:46 +02:00
Christian Prochaska
db89c85954 Qt5: ARM-related improvements
- fix compile errors when building for ARM
- use the correct device drivers in Qt run scripts

Fixes #1154.
2014-05-27 11:14:45 +02:00
Christian Prochaska
078883fda3 base: interface for D- and I-cache synchronization
On ARM, when machine instructions get written into the data cache
(for example by a JIT compiler), one needs to make sure that the
instructions get written out to memory and read from memory into
the instruction cache before they get executed. This functionality
is usually provided by a kernel syscall and this patch adds a generic
interface for Genode applications to use it.

Fixes #1153.
2014-05-27 11:14:45 +02:00
Christian Prochaska
b28a551538 run: use 'upvar' instead of 'global'
Using 'upvar' instead of 'global' in the 'append_if' and 'lappend_if'
functions makes it possible to use these functions with local variables
of the calling function.

Fixes #1137.
2014-05-27 11:14:45 +02:00
Josef Söntgen
e777165090 dde_rump: block encryption server using cgd(4)
The 'rump_cgd' server provides block level encryption for a block
session by employing the 'cgd(4)' device provided by the rumpkernel.

'rump_cgd' uses a Block_session to get access to an existing block
device and provides another Block_session to its clients. Each block
written or read by the client is transperently encrypted or decrypted
by the server.

For now 'rump_cgd' may only _configure_ a 'cgd' device but is unable
to generate a configuration. The used cipher is hardcoded to
_aes-cbc_ with a keysize of 256 bit. Furthermore the server is able to
serve one client only.

To ease the usage, its interface is modelled after the interface of
'cgdconfig(8)'. As implications thereof the key must have the same
format as used by 'cgdconfig'. That means the key is a base 64 encoded
string in which the first 4 bytes denote the actual length of the key
in bits (these 4 bytes are stored in big endian order).

Preparing a raw (e.g. without partition table) encrypted Ext2 disk
image is done by executing 'tool/rump':

! dd if=/dev/urandom of=/path/to/disk_image
! rump -c /path/to/disk_image # key is printed to stdout
! rump -c -k <key> -F ext2fs /path/to/disk_image

To use this disk image the following config snippet can be used:

! <start name="rump_cgd">
! 	<resource name="RAM" quantum="8M" />
! 	<provides><service name="Block"/></provides>
! 	<config action="configure">
! 		<params>
! 			<method>key</method>}
! 			<key>AAABAJhpB2Y2UvVjkFdlP4m44449Pi3A/uW211mkanSulJo8</key>
! 		</params>
! 	</config>
! 	<route>
! 		<service name="Block"> <child name="ahci"/> </service>
! 		<any-service> <parent/> <any-child/> </any-service>
! 	</route>
! </start>

the Block service provided by rump_cgd may be used by a file system
server in return:

! <start name="rump_fs">
! 	<resource name="RAM" quantum="16M"/>
! 	<provides><service name="File_system"/></provides>
! 	<config fs="ext2fs">
! 		<policy label="" root="/" writeable="yes"/>
! 	</config>
! 	<route>
! 		<service name="Block"> <child name="rump_cgd"/> </service>
! 		<any-service> <parent/> <any-child/> </any-service>
! 	</route>
! </start>

Since 'tool/rump' just utilizes the rumpkernel running on the host
system to do its duty there is a script called 'tool/cgdconf' that
extracts the key from a 'cgdconfig(8)' generated configuration file
and also is able to generade such a file from a given key. Thereby
the interoperabilty between 'rump_cgd' and the general rumpkernel
based tools is secured.
2014-05-27 11:14:45 +02:00
Josef Söntgen
aaf0454956 tool: wrapper script for rumpkernel tools
The rumpkernel based tools are intended to be used by executing
'tool/rump'. Since it covers the most common use cases for these
tools, this script is comparatively extensive, hence giving a short
tutorial seems reasonable:

* Format a disk image with Ext2:

To format a disk image with the Ext2 file system, first prepare the
actual image by executing dd:

! dd if=/dev/zero of=/path/to/disk_image bs=1M count=128

Second, use 'tool/rump' to format the disk image:

! rump -f -F ext2fs /path/to/disk_image

Afterwards the just created file system may be populated with the
content of another directory by executing

! rump -F ext2fs -p /path/to/another_dir /path/to/disk_image

The content of the file system image can be listed by executing

! rump -F ext2fs -l /path/to/disk_image

* Create a encrypted disk image:

Creating a cryptographic disk image based on cgd(4) is done by
executing the following command:
! rump -c /path/to/disk_image

This will generate a key that may be used to decrypt the image
later on. Since this command will _only_ generate a key and NOT
initialize the disk image, it is highly advised to prepare the disk
image by using '/dev/urandom' instead of '/dev/zero' (only new blocks
that will be written to the disk image are encrypted). In addition
while generating the key a temporary configuration file will be
created. Although this file has proper permissions, it may leak the
generated key if it is created on persistent storage. To specify a more
secure directory the '-t' option should be used:

! rump -c -t /path/to/secure/directory /path/to/disk_image

Decrypting the disk image requires the key generated in the previous
step:

! rump -c -k <key> /path/to/disk_image

For now this key has to specified as command line argument. This is
an issue if the shell, which is used, is maintaing a history of
executed commands.

For completness sake let us put all examples together by creating a
encrypted Ext2 image that will contain all files of Genode's _demo_
scenario:

! dd if=/dev/urandom of=/tmp/demo.img bs=1M count=16
! $(GENODE_DIR)/tool/rump -c -t /ramfs -F ext2fs /tmp/demo.img > \
!         /ramfs/key # key is printed out to stdout
! $(GENODE_DIR)/tool/rump -c -t /ramfs -F ext2fs -k <key> \
!         -p $(BUILD_DIR)/var/run/demo /tmp/demo.img

To check if the image was populated succesfully, execute the
following:

! $(GENODE_DIR)/tool/rump -c -t /ramfs -F ext2fs -k <key> -l \
!         /tmp/demo.img
2014-05-27 11:14:45 +02:00
Josef Söntgen
a9e95e24fe tool: makefile for building rumpkernel tools
The rumpkernel tools are used within the Genode OS Framework tool chain
for preparing and populating disk images as well as creating cgd(4)
based cryptographic disk devices.

Execute 'tool/tool_chain_rump build' to build the tools and afterwards
'tool/tool_chain_rump install' to install the binaries. The default
install location is _/usr/local/genode-rump_.
2014-05-27 11:14:45 +02:00
Josef Söntgen
c04ddbf6d8 dde_rump: move memcpy() to rump lib
On ARM in one way or another 'string.h' prototypes will be used. Move
the definitions from rump_fs to the rump library because it is needed
by all rump based servers running on ARM.

Issue #1141.
2014-05-27 11:14:45 +02:00
Josef Söntgen
0a0f0031a4 libports: enable curl on arm 2014-05-27 11:14:45 +02:00
Christian Prochaska
ea79c0e2e9 openssl: add ARM support
Fixes #1136.
2014-05-27 11:14:45 +02:00
Christian Prochaska
33f64343e1 core: make parent EP stack size depend on addr_t
Make the stack size of core's parent entrypoint thread depend on
sizeof(addr_t).

Fixes #1152.
2014-05-27 11:14:44 +02:00
Christian Prochaska
15e231d733 noux_gdb: adapt to libc VFS
Fixes #1150.
2014-05-27 11:14:44 +02:00
Christian Helmuth
039e333d2b Adapt version generation to new directory layout 2014-05-27 11:14:44 +02:00
Christian Prochaska
927af36c58 Volatile_object: align the embedded object
The space for the embedded object needs to be natively aligned to avoid
alignment errors on ARM.

Fixes #1149.
2014-05-27 11:14:44 +02:00
Norman Feske
afbe3d8674 doc: Update link to gosh 2014-05-27 11:14:44 +02:00
Norman Feske
6a1c11393e doc: Uniform markup of the build-system manual
Use _italic_ for path names rather than 'verbatim'. Because path names
tend to be quite long, the overly use of verbatim makes paragraphs hard
to read.
2014-05-27 11:14:44 +02:00
Norman Feske
b718a94b47 doc: Description of HOST_TOOLS mechanism 2014-05-27 11:14:44 +02:00
Norman Feske
05a460c11f Temporarily disable hash checks
...until the transition to the new ports management is complete.
2014-05-27 11:14:44 +02:00
Stefan Kalkowski
aff92004d1 base-pistachio: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:44 +02:00
Stefan Kalkowski
de4335b443 base-fiasco: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:43 +02:00
Stefan Kalkowski
5cdfb0a3a5 base-foc: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:43 +02:00
Josef Söntgen
313202fb65 dde_ipxe: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:43 +02:00
Sebastian Sumpf
d1e10e939d dde_linux: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:43 +02:00
Stefan Kalkowski
abcb0f62d7 ports-foc: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:43 +02:00
Norman Feske
6adbb9e438 ports: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:43 +02:00
Norman Feske
e17f271ba6 dde_oss: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:43 +02:00
Norman Feske
7d4f8fa746 base-nova: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:43 +02:00
Norman Feske
35cf48cdc8 base-okl4: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:42 +02:00
Norman Feske
85a2ebc1c4 libports: migrate to new ports mechanism
Issue #1082
2014-05-27 11:14:42 +02:00
Norman Feske
bcbb0dabf5 Build-system support for creating host tools 2014-05-27 11:14:42 +02:00
Norman Feske
de65c3f7cc tool/prepare.mk: Switch directories silently 2014-05-27 11:14:42 +02:00
Norman Feske
3de1423a6a Build-system support for ported 3rd-party code
The new 'select_from_ports' function allows a target description file to
query the path to an installed port. All ports are stored in a central
location specified as CONTRIB_DIR. By default, CONTRIB_DIR is defined
as '<genode-dir>/contrib'. Ports of 3rd-party source code are managed
using the tools at '<genode-dir>/tool/ports/'.

Issue #1082
2014-05-27 11:14:42 +02:00
Norman Feske
a128b40f03 Tool for preparing a single 3rd-party port
Issue #1082
2014-05-27 11:14:42 +02:00
Norman Feske
ba291bcc57 build system: Back out on error at libdep stage 2014-05-27 11:14:41 +02:00
Norman Feske
9f43aa4363 base-nova: fully qualify Utcb type 2014-05-27 11:14:41 +02:00
Christian Prochaska
f1aa137c9d tool_chain: fix GDB build with makeinfo 5
Issue #1051.
2014-05-14 16:08:01 +02:00
Christian Prochaska
776d7f947f tool_chain: fix GCC build with makeinfo 5
Issue #1051.
2014-05-14 16:08:01 +02:00
Christian Prochaska
d4bf55a308 tool_chain: use real patches
Issue #1051.
2014-05-14 16:08:00 +02:00
Sebastian Sumpf
99245aceb2 noux: Disable makeinfo for coreutils
Issue #1051
2014-05-14 16:08:00 +02:00
Christian Prochaska
fe5c31b774 Add the 'build' directory to '.gitignore'
Issue #1082.
2014-05-14 16:08:00 +02:00
Norman Feske
b2f78cc475 Unify 'make prepare' between libports and ports 2014-05-14 16:08:00 +02:00
Norman Feske
ca971bbfd8 Move repositories to 'repos/' subdirectory
This patch changes the top-level directory layout as a preparatory
step for improving the tools for managing 3rd-party source codes.
The rationale is described in the issue referenced below.

Issue #1082
2014-05-14 16:08:00 +02:00
Stefan Kalkowski
1f9890d635 Follow-up for: "Merge libc_vfs plugin into libc"
This patch avoids the construction of the Genode::Config object in Noux
processes. The construction of this object would populate the Noux
process with additional capabilities, which cannot be handled by
'fork()'.
2014-05-07 10:37:51 +02:00
Stefan Kalkowski
42cce8668b noux: upgrade RM session for client (fix #1138) 2014-05-07 10:37:40 +02:00
Stefan Kalkowski
6553e9d79f part_blk test: increase failing timeout 2014-05-07 10:37:40 +02:00
Alexander Boettcher
8c5f350e0e nova: avoid fault during core thread fault dump 2014-05-07 10:37:40 +02:00
Christian Helmuth
de0a771fae Generic sleep_forever() based on lock
The old implementation of sleep_forever() used a local Ipc_server
object, which is not announced (i.e., known) outside of the blocking
process/thread, to infinitely wait for incoming messages. In past and
present, this leads to problems (e.g., issues #538 and #1032).

Fixes #1135.
Fixes #538.
Fixes #1032.
2014-05-07 10:37:39 +02:00
Alexander Boettcher
8366d07082 vbox: use separate memory spaces
Use the libc Mem_alloc implementation per MMTYP of virtualbox. With this the
invariant that all memory allocation of a MMTYP are dense located.

Fixes #1130
2014-05-07 10:37:39 +02:00
Alexander Boettcher
8da1c77908 libc: move mem alloc definition in header file
Prerequisite to fix Issue #1130, to be able to reinstantiate the libc
memory allocator several times if wanted.
2014-05-07 10:37:39 +02:00
Christian Helmuth
bab5bb67e7 ahci: enable simple test on x86_64
Related to #1133.
2014-05-07 10:37:39 +02:00
Stefan Kalkowski
ed2d54ed87 hw: make core target require 'hw' spec (fix #599) 2014-05-07 10:37:39 +02:00
Stefan Kalkowski
73eb7a8d4b hw: map core on demand (fix #723)
Instead of mapping all physical memory 1:1 into core/kernel's address space,
this commit limits the 1:1 mapping to the binary image, and I/O memory
regions used by the kernel only. All subsequent memory accesses of core
are done by mapping the corresponding memory on demand, and not necessarily
1:1.

This commit has several side effects:

The page table code had to be revisited completely. The kernel inserts no
longer anything into the page tables, apart from the initial translations
to have the core/kernel image available when enabling the MMU. The page
tables and higher level translation tables are no longer named Tlb, but
Translation_table instead. There is no indirection class required to define
the translation tables of a concrete SoC, the appropriated ARM specifier
is sufficient.
The ability to map core's memory the same way like it's done for all other
protection domains, makes a special treatment of core's threads (no context
area) obsolete.

Ref #567 (partly solves it)
Fix #723
Fix #1068
2014-05-07 10:37:39 +02:00
Stefan Kalkowski
34b18e9da2 hw: restrict processor broadcast to TLB flushing
Removes the generic processor broadcast function call. By now, that call
was used for cross processor TLB maintance operations only. When core/kernel
gets its memory mapped on demand, and unmapped again, the previous cross
processor flush routine doesn't work anymore, because of a hen-egg problem.
The previous cross processor broadcast is realized using a thread constructed
by core running on top of each processor core. When constructing threads in
core, a dataspace for its thread context is constructed. Each constructed
RAM dataspace gets attached, zeroed out, and detached again. The detach
routine requires a TLB flush operation executed on each processor core.

Instead of executing a thread on each processor core, now a thread waiting
for a global TLB flush is removed from the scheduler queue, and gets attached
to a TLB flush queue of each processor. The processor local queue gets checked
whenever the kernel is entered. The last processor, which executed the TLB
flush, re-attaches the blocked thread to its scheduler queue again.

To ease uo the above described mechanism, a platform thread is now directly
associated with a platform pd object, instead of just associate it with the
kernel pd's id.

Ref #723
2014-05-07 10:37:38 +02:00
Stefan Kalkowski
b888a26d57 core: extend core memory allocator
* Allow to translate physical to virtual core addresses and vice versa
* Eliminate race introduced by commit "core: re-design memory allocator"

Ref #723
2014-05-07 10:37:38 +02:00
Alexander Boettcher
0ddc69d370 vbox: join emt and vcpu handler thread
Fixes #1129
2014-05-07 10:37:38 +02:00
Alexander Boettcher
4782fd34f6 vmm: parameterize Vcpu_dispatcher
Pre-condition to realize #1129, to be able to let a vCPU handler thread also
be a pthread.
2014-05-07 10:37:37 +02:00
Alexander Boettcher
512c29c486 nova: mtd fields are unsigned
Bit 31 (FPU Mtd) got negative expanded when combined with 64bit value.

Detected during work on #1129
2014-05-07 10:37:37 +02:00
Alexander Boettcher
37dc5c2c78 vbox: remove patches regarding ioport width check
Issue #1129
2014-05-07 10:37:37 +02:00
Alexander Boettcher
8824ce8962 libc: don't take alien thread for main pthread
It covers bugs which we should detect and fix, especially depending on
the result of pthread_myself locking implementation (ours and vbox) takes
decision to take a lock or just to assume it is a reentrant locking attempt.

Fixes #1128
2014-05-07 10:37:37 +02:00
Norman Feske
b9cf2eade8 nitpicker: Consider menubar for pointer reports
The pointer-report facility used to report the screen-absolute position
of the mouse pointer. For nitpicker clients, however, this position is
meaningless because their coordinate is always constrained to the area
below the menu bar. This patch offsets the reported position
accordingly.
2014-05-07 10:37:36 +02:00
Norman Feske
13cc423050 os: Add Point::operator == 2014-05-07 10:37:36 +02:00
Norman Feske
fb673fe4fd os: Add Rect::contains() to geometry utils 2014-05-07 10:37:36 +02:00
Norman Feske
3e4eb0d135 os: Refine Attached_rom_dataspace::update 2014-05-07 10:37:36 +02:00
Norman Feske
34dd7f982c os: Make buffer size of 'Reporter' configurable 2014-05-07 10:37:36 +02:00
Norman Feske
5de17d4223 os: Add 'Framebuffer::Session::sync_sigh'
The new framebuffer-session function allows a client to register a
handler for receiving display-synchronization events.
2014-05-07 10:37:35 +02:00
Alexander Boettcher
0b04f9de25 run: limit created threads in test
The rm_session quota of the context area is not sufficient to start more
then ~95 threads per address space. If one really needs so many threads per
address space one could increase the quota or dynamically respond to it using
the Expanding_rm_session class. Until now there is no need to support so much
threads per address space.

Issue #1122
2014-05-07 10:37:35 +02:00
Alexander Boettcher
9fd6034e94 base: check cpu_session pointer during destruction
Issue #1122
2014-04-29 15:30:27 +02:00
Norman Feske
a9fc5304c0 Unify success messages of run scripts
The pattern "Test succeeded" is relied on by the automated
testing framework. We need to use it consistently to avoid
false negatives.
2014-04-29 15:27:13 +02:00
Norman Feske
60d9c90921 Merge libc_vfs plugin into libc
Issue #999
2014-04-29 15:27:13 +02:00
Norman Feske
c7f1b85652 Retire libc_{log, block, fs, rom}
Those plugins are superseded by libc_vfs.

Issue #999
2014-04-29 15:25:39 +02:00
Norman Feske
8876dd057d Add libc_vfs plugin and test
Issue #999
2014-04-29 15:19:28 +02:00
Norman Feske
d65872a815 fs test: Appropriately use rmdir instead of unlink 2014-04-29 15:19:28 +02:00
Norman Feske
fd66252ca4 libc_fs: Use priority higher than libc_vfs
This way, we make sure that libc_fs is used if both plugins are
present, which happens during the transition to libc_vfs.
2014-04-29 15:19:28 +02:00
Norman Feske
16378745bf libc_terminal: Use prio to override libc_vfs 2014-04-29 15:19:28 +02:00
Norman Feske
7750a399cc libc: Add 'rmdir' to plugin interface 2014-04-29 15:19:28 +02:00
Norman Feske
a011c76d85 libc: Make File_descriptor::fd_path char const * 2014-04-29 15:19:28 +02:00
Norman Feske
dd9b606182 libc: Add fd status and flags to File_descriptor
Those values need to be stored local to the FD. Including
them in the 'File_descriptor' eases the handling of libc
plugins.
2014-04-29 15:19:28 +02:00
Norman Feske
8e74fdc585 vfs: inline file system 2014-04-29 15:19:27 +02:00
Norman Feske
959b26fee0 vfs: ROM file system 2014-04-29 15:19:27 +02:00
Norman Feske
83a03df6a4 vfs: LOG file system 2014-04-29 15:19:27 +02:00
Norman Feske
c3c6a82d13 Move VFS from noux to 'os/include/vfs'
By separating the VFS from Noux, we become able to reuse the
VFS for libc-using programs. The most substantial change is the
removal of Noux::Sysio data structures from the VFS. Instead, the
Noux::Sysio refers to the VFS types now.

The new VFS library is located at 'os/include/vfs/'.

Furthermore, the patch removes various code duplications related
to pseudo file systems that provide a single file (block, zero,
random, terminal, null). The new 'Single_file_system' holds the
common boilerplate code for those.

Issue #999
2014-04-29 15:19:27 +02:00
Norman Feske
d7d62c53a6 mixer: Increase stack size of entrypoint 2014-04-24 14:56:36 +02:00
Norman Feske
2b5f4b0aaf file system: Exception for non-permitted symlinks
Until now, there was not exception type for the condition where a
symlink was created on a file system w/o supporting symlinks, e.g., FAT.
The corresponding file-system server (ffat_fs) used to return a negative
handle as a work around. I added 'Permission_denied' to the list of
exceptions thrown by 'File_system::Session::symlink' to handle this case
in a clean way.
2014-04-24 14:56:36 +02:00
Norman Feske
b43a5f1255 tar_fs: Return correct size of stat'ed dirs
Genode's file system interface returns the number of directories
multiplied by sizeof(Directory_entry) as size of a directory. The
tar_fs server used to return zero. The fix counts the sub nodes of
the given directory.
2014-04-24 14:56:36 +02:00
Norman Feske
a96f912f73 test/libc_ffat: Operate on cwd instead of root dir
The test used to rely on a writable root directory. To reuse the test
for the new VFS, where '/' is never writable, I changed all absolute
paths to relative paths.
2014-04-24 14:56:36 +02:00
Norman Feske
797a6c7422 libc_noux: style fix 2014-04-24 14:56:36 +02:00
Norman Feske
3bb7d4e67b noux: Decouple Dir_file_system from file systems
By introducing the new 'File_system_registry', we can remove the
knowledge about the actual file-system implementations from the
'Dir_file_system'. Thereby the code becomes more generic, which is
a precondition for using it as the basis for Genode's VFS library.

Issue #999
2014-04-24 14:56:36 +02:00
Norman Feske
28a5404281 noux: Handle SYSCALL_KILL in switch (fix warning) 2014-04-24 14:56:36 +02:00
Norman Feske
d83e076f11 terminal_session: Add label argument to connection 2014-04-24 14:56:36 +02:00
Sebastian Sumpf
b1a6db090f rump: Stabilize rump libs and fs server
* Perform sanity check before calculating memory available to rump kernel
* Distinguish between 'Hard_context' and 'Hard_context_thread', so no dead
  threads (that will not be started) are created
* Install signal-handler for memory-resource requests. This way the fs server
  will not block forever when the quota is execeeded and a resource requests
  fails, leaving the rump kernels to perform necessary actions

Fixes #1127
2014-04-24 10:32:58 +02:00
Stefan Kalkowski
4dd2db7634 use consistent scheme for chosen MAC addresses
Take a similar MAC address scheme within run scripts like
within the nic bridge to simplify DHCP configuration.
2014-04-22 14:48:33 +02:00
Martin Stein
58c4f1585b hw: fix bug in Kernel::update_*_region
fix #1125
2014-04-17 14:01:35 +02:00
Christian Prochaska
0e208c3d3d Arora: apply all patches
Fixes #1124.
2014-04-17 13:38:15 +02:00
Martin Stein
5d23e5903e hw: raise max amount of signal contexts
This is needed at least for the resource-request test since all available
interrupts are provided through a signal context.

fix #1123
2014-04-17 11:05:20 +02:00
Martin Stein
b53601d01b hw: cleanup signal-session component
ref #1123
2014-04-17 11:04:59 +02:00
Christian Helmuth
3d274366ab vbox: improve BFE argument handling 2014-04-16 17:31:24 +02:00
Christian Helmuth
2c7c814e19 Generate Genode version string on each build
The version string was generated when core/main.cc was rebuilt, which
happens on changes in the file itself or in a header file it includes.
But, the version should reflect if the Genode repository was changed at
any place. Therefore, I moved the version string to its own version.cc
which is forcedly rebuilt any time core is examined by the build system.

@nfeske what do you think about it? Core is now relinked on any build.

Fixes #551.
2014-04-16 17:30:31 +02:00
Alexander Boettcher
a7bc8bac9a nova: support usage of priorities in Genode/Nova
Enables finally the usage of priorities on base-nova.

Fixes #986
2014-04-16 17:30:31 +02:00
Alexander Boettcher
9ae441e469 nova: replacement of generic Genode spinlock
Turn Genode user-level spinlock into a user-level "helpinglock". This requires
support by the kernel introduced with kernel branch r5.

The commit avoids live-locks when multiple threads with SCs on different
priority levels compete for the same user-level Genode "spinlock".

Issue #986
2014-04-16 17:30:31 +02:00
Alexander Boettcher
bfa3053e62 nova: set pager and native ec cap for main thread
Prerequisite for follow up commit regarding base-nova specific Genode Spinlock
replacement.

Issue #986
2014-04-16 17:30:30 +02:00
Alexander Boettcher
ecaf09a41b nova: extent ec_ctrl in kernel and base-nova
The commit switches the kernel branch to r5 and updates the syscall bindings
in base-nova accordingly. Beside some cleanups, r5 extents the ec_ctrl syscall
to support following features:

* An EC may yield its current timeslice. The timeslice gets enqueued at the end
  of the run queue without refreshing the left budget of the quantum.
* An EC helps with the current SC another EC. Used in Genode to implement
  helping over a user-level lock to avoid live-lock situation. (Think of
  a limited priority-inheritance mechanism.)
* An EC requests a new scheduler decision. Used in Genode to transfer back the
  potentially helping SC to the helper EC.

Issue #986
2014-04-14 12:32:31 +02:00
Christian Prochaska
617d5ee3e6 OpenSSL: update to version 1.0.1g
Fixes #1118.
2014-04-14 12:32:31 +02:00
Alexander Boettcher
69bc875ac7 tool: increase amt reset timeout 2014-04-14 12:32:31 +02:00
Alexander Boettcher
0eef45e63f vbox: implement pthread_create specifically
Issue #1114
2014-04-14 12:32:31 +02:00
Alexander Boettcher
0c08334b2c pthread: separate structure and create function
With the commit an application may create a modified version of pthread_create.
Will be used by Virtualbox port.

Issue #1114
2014-04-14 12:32:31 +02:00
Alexander Boettcher
03ce614c23 base: add cpu_session parameter to thread creation
Fixes #1114
2014-04-14 12:32:31 +02:00
Alexander Boettcher
5169de72c4 base: set default cpu affinity
Set cpu_session default affinity space already during
construction of the thread, so that main thread is placed in the cpu affinity
space as defined by the parent. Otherwise the main thread is placed potentially
outside the affinity space, typically on the first/boot CPU.

Fixes #1107
2014-04-14 12:32:31 +02:00
Alexander Boettcher
73f71322f0 init: put ep for child in affinity space of child
Issue #1107
2014-04-14 12:32:30 +02:00
Alexander Boettcher
93f06dd11a nova: set invalid affinity space in thread constructor
Otherwise affinity space is set to 1x1 and in cpu_session_component.cc the cpu
session local affinity space defined by parent is not taken because
"Location::valid()" returns true.

Issue #1107
2014-04-14 12:32:30 +02:00
Stefan Kalkowski
b5fe1d752b hw: don't implement IRQ usage policy in core
Fix #995
Fix #1112
Fix #1113
2014-04-14 12:32:30 +02:00
Martin Stein
a9521853bd hw: provide Kernel::update_instr_region
fix #1115
2014-04-14 12:28:16 +02:00
Martin Stein
3f14defd9d hw: don't restrict update_data_region to core
ref #1115
2014-04-14 12:28:16 +02:00
Martin Stein
5a1fc6da60 hw: rename update_region in update_data_region
ref #1115
2014-04-14 12:28:16 +02:00
Norman Feske
b7e806d5eb News item for TrustZone article 2014-04-10 15:40:40 +02:00
Martin Stein
fabea7fba1 hw: provide invalidate_instr_caches_by_virt_region
ref #1115
2014-04-07 17:11:53 +02:00
Martin Stein
f8c2596259 hw: beautify flush_data_caches_by_virt_region
ref #1115
2014-04-07 17:11:46 +02:00
Martin Stein
d67a26ea4c hw: invalidate data caches on kernel init
fix #1108
2014-04-07 17:11:37 +02:00
Martin Stein
7836d92b22 hw & arm_v7: make flush_data_caches more readable
ref #1108
2014-04-07 17:11:28 +02:00
Martin Stein
9f95784f02 hw: diversify feedback from IPC node to thread
ref #1108
2014-04-07 17:11:20 +02:00
Martin Stein
e856158824 hw: no msg_base argument to Ipc_node::send_request
ref #1108
2014-04-07 17:10:53 +02:00
Martin Stein
b34ce7d2b0 hw: handier names for IPC methods
ref #1108
2014-04-07 17:10:45 +02:00
Martin Stein
f0ec8b27c1 hw: no argument to Ipc_node::_await_ipc_succeeded
ref #1108
2014-04-07 17:10:38 +02:00
Martin Stein
b55646e1b0 hw: remove Ipc_node::_received_ipc_request
ref #1108
2014-04-07 17:10:28 +02:00
Martin Stein
8d1e40eb5b hw: remove Ipc_node::_await_ipc
ref #1108
2014-04-07 17:10:22 +02:00
Martin Stein
ebfd6a55b3 hw: remove useless argument of Thread::_call
ref #1108
2014-04-07 17:10:10 +02:00
Martin Stein
8f9d4737a6 hw: correct spelling of the verb look up
fix #1101
2014-04-07 17:10:05 +02:00
Martin Stein
7ffcc74d72 hw: centralize permission check of kernel calls
ref #1101
2014-04-07 17:09:58 +02:00
Martin Stein
02c16e7106 hw: split resume_local_thread from resume_thread
Kernel::resume_thread was restricted to core when the targeted thread was in
another domain. Now there are two kernel calls, resume_local_thread and
resume_thread, where the former is never restricted and is provided via
public kernel/interface.h and the latter is always restricted to core and
is provided via core-local kernel/core_interface.h.

ref #1101
2014-04-07 17:09:52 +02:00
Martin Stein
c72f91fefb hw: simplify return value of Kernel::resume_thread
ref #1101
2014-04-07 17:09:33 +02:00
Martin Stein
6974abcf41 hw: don't use assert in Kernel::pause_vm
ref #1101
2014-04-07 17:09:16 +02:00
Martin Stein
99db9e5246 hw: don't use assert in Kernel::run_vm
ref #1101
2014-04-07 17:08:59 +02:00
Martin Stein
7bbabcf817 hw: don't use assert in Kernel::new_vm
ref #1101
2014-04-07 17:08:49 +02:00
Martin Stein
f8b4541e2b hw: get rid of fixme note in Kernel::update_region
ref #1101
2014-04-07 17:08:35 +02:00
Martin Stein
4f19d4869f hw: don't use assert in Kernel::update_region
ref #1101
2014-04-07 17:08:29 +02:00
Martin Stein
ea156e18ec hw: don't use assert in Kernel::update_pd
ref #1101
2014-04-07 17:08:23 +02:00
Martin Stein
dbad6f7061 hw: don't use assert in Kernel::bin_thread
ref #1101
2014-04-07 17:08:16 +02:00
Martin Stein
9e089e7e75 hw: don't use assert in Kernel::start_thread
ref #1101
2014-04-07 17:08:11 +02:00
Martin Stein
fba4f54571 hw: split pause_current_thread from pause_thread
Kernel::pause_current_thread can be implemented much simpler and is not
restricted to core threads, in contrast to Kernel::pause_thread which
also benefits from the split and can be moved to core_interface.h.

ref #1101
2014-04-07 17:07:24 +02:00
Martin Stein
abd55fda9a hw: don't return a result in Kernel::pause_thread
ref #1101
2014-04-07 17:06:09 +02:00
Martin Stein
5e940da040 hw: don't use assert in Kernel::pause_thread
ref #1101
2014-04-07 17:05:43 +02:00
Martin Stein
055b7c57b6 hw: correct result type of Kernel::new_vm
ref #1101
2014-04-07 17:05:34 +02:00
Martin Stein
d5b38b674e hw: simplify buffer of Kernel::access_thread_regs
ref #1101
2014-04-07 17:05:29 +02:00
Martin Stein
06ea6cd462 hw: simplify result of Kernel::access_thread_regs
ref #1101
2014-04-07 17:04:50 +02:00
Martin Stein
1eeba3ed73 hw: comment result of Kernel::route_thread_event
ref #1101
2014-04-07 17:04:36 +02:00
Martin Stein
873c3f3984 hw: correct return type of Kernel::new_thread
ref #1101
2014-04-07 17:04:20 +02:00
Martin Stein
a64372647d hw: rename mode_transition_virt_base
ref #1101
2014-04-07 17:03:48 +02:00
Martin Stein
5112df9792 hw: remove unused kernel_pd_alignm_log2
ref #1101
2014-04-07 17:03:15 +02:00
Martin Stein
e2268c09a0 hw: move core-restricted interface to local header
fix #1096
2014-04-07 17:02:50 +02:00
Martin Stein
f0ac145471 hw: faster Kernel::Signal_receiver::_listen()
ref #1096
2014-04-07 17:02:26 +02:00
Martin Stein
00708b6696 hw: reduce stack size of idle threads
ref #1096
2014-04-07 17:02:11 +02:00
Martin Stein
d30edd4841 hw: make RM faults less noisy in release mode
If an RM fault ends up in any trouble, the faulter remains paused and
the pager activation continues with the next fault. Thus we can print
a warning instead of an error and safe execution time in release mode.

ref #1096
2014-04-07 17:02:00 +02:00
Martin Stein
9affbf33ec hw: make kernel less noisy in release mode
In most cases an error report is not necessary in the kernel as the problem
does not affect the kernel itself but the according user-land context. Thus
we can also do a warning that is not printed in release mode and hence safe
execution time.

ref #1096
2014-04-07 17:01:46 +02:00
Martin Stein
ff28a89000 noux: make RM replay less noisy in release mode
As the message "replay: missing dataspace info for ..." occurs multiple times
on every fork, it slows down at least noux_tool_chain_auto with hw_arndale
about 10 seconds. To avoid this overhead in release mode I've turned it into a
warning rather than an error.

ref #1096
2014-04-07 17:01:21 +02:00
Martin Stein
a34227cdda hw: use reliable start message in run env
Previously for determining wether boot-up succeeded or not, we looked
for a message that is switched off in release mode. Now the kernel
provides a reliable message as soon as initialization is done.

ref #1096
2014-04-07 17:01:01 +02:00
Alexander Boettcher
7fc26d496a base-fiasco: relocate all modules in bootstrap
Fix #1116
2014-04-07 14:45:15 +02:00
Alexander Boettcher
47b1db6f0a fiasco: add bda support for bootstrap
Issue #1116
2014-04-07 14:45:15 +02:00
Alexander Boettcher
819e54f860 run: change resolution of virtualbox_auto_disk
We changed the test hardware and the new one does not support 1400x1050 anymore.
Choose some conservative resolution since this is anyway a auto test nobody
is really looking at the screen output.
2014-04-07 11:56:45 +02:00
Christian Prochaska
0918c6006b stdcxx: build 'tinfo.cc'
The 'tinfo.cc' file needs to get built, because it implements
'std::type_info::operator==(std::type_info const&) const', which
is needed by the 'icu' library on ARM.

Fixes #1109.
2014-04-07 11:55:14 +02:00
Christian Prochaska
7f2b99e2a8 qt5_textedit.run: fix the USB driver configuration
This patch adds the 'uhci', 'ehci' and 'xhci' XML attributes to the USB
driver configuration in the 'qt5_textedit.run' script.

Fixes #1110.
2014-04-07 11:54:41 +02:00
Alexander Boettcher
1eb3f13484 pit: no lock required in pit anymore
timer service calls platform timer nowadays solely from the vary same thread
 - the entrypoint of the timer service

Issue #1106
2014-04-01 16:42:37 +02:00
Alexander Boettcher
7d232cafb0 timer: fix corner case if counter is 0
If counter drops to 0, the wrap flag is set also. That means we have actually
no wrap around. The patch avoids to add too much time to the elapsed time
variable.

Issue #1106
2014-04-01 16:42:37 +02:00
Alexander Boettcher
34a33e7301 timer: fix wrap handling for x86 PIT
Issue #1106
2014-04-01 16:42:37 +02:00
Alexander Boettcher
a604ea6851 os: reprogram timer solely if needed
If an alarm/timeout object became head of the timeout queue, then the
low level timer must be reprogrammed.

Issue #1106
2014-04-01 16:42:37 +02:00
Christian Helmuth
cd0d378142 Provide Genode version information in log
Fixes #551
2014-04-01 16:38:49 +02:00
Norman Feske
2f3b67c9e0 nitpicker: Fix implementation of Mode interface
The generalization of nitpicker's graphic backend changed the interface
of 'Mode::forget', which is a (non-pure) virtual function implemented
by 'User_state::forget'. Unfortunately, the signature change was not
applied to 'User_state::forget' so that the actual implementation was
no longer called. This inconsistency remained unnoticed because there
is a default implementation of the virtual function.

The effect of the omission of the 'User_state::forget' call was a
dangling pointer ('User_state::_pointed_view').

Lesson learned: Always annotate functions with the C++11 'override' when
implementing virtual functions.
2014-04-01 16:37:40 +02:00
Johannes Schlatow
2262eb8347 base: fix bug in String::valid()
String::valid() does not check whether _length is zero.
Consequently, this leads to _buf[-1] being evaluated.
2014-04-01 16:37:09 +02:00
Christian Prochaska
e6c7596af5 ldso: flush the log console in 'errx()'
The error message given to the 'errx()' function does not always contain a
'\n' character. Adding 'printf("\n")' ensures that the message appears on
the log console.

Fixes #1103.
2014-03-31 21:05:48 +02:00
Alexander Boettcher
869fbc92b1 base: allocate contexts solely inside context area
Reserve first bit in bit allocator for main thread of context allocator and
remove special cases in context allocator. Without the reservation there is
is one context outside the context area allocated.

Fixes #1100
2014-03-31 21:05:20 +02:00
Alexander Boettcher
ced0f71f13 noux: enable 64bit builds for foc and nova
Fixes #816
2014-03-31 20:59:25 +02:00
Christian Helmuth
7e35b84054 nova: simplify handling of multi-boot command line
Fixes #1105.
2014-03-31 16:53:14 +02:00
Christian Helmuth
2e5cb2ea82 Use do statement in PDBG and PWRN
The do statement ensures the macros to generate just one expression that
is compatible with any programming construct. The concrete bug was

  if (cond)
    PDBG(...);
  else
    ...

which was expanded to

  if (cond)
    if (DO_PDBG)
      Genode::printf(...);
  else
    ...

This is obviously wrong as the *else* branch is then connected to the
second *if*.
2014-03-31 16:47:12 +02:00
Christian Helmuth
c7d2d3a231 hello: fix missing build steps and vague config
Fixes #36.
2014-03-18 17:00:46 +01:00
Norman Feske
a951a9f72f uart/exynos5: Add missing author 2014-03-18 16:29:37 +01:00
Norman Feske
e285d806b3 uart/omap4: prevent copy of non-copyable objects
Follow up fix for commit 0b7ea4abab + minor whitespace changes.

Ref #1093
2014-03-18 14:33:59 +01:00
Stefan Kalkowski
ba4045889b pandaboard: prevent copy of non-copyable objects
Follow up fix for commit 0b7ea4abab
Ref #1093
2014-03-18 14:24:55 +01:00
Norman Feske
b8e6124594 Remove outdated sections from doc/architecture.txt
Fixes #71
2014-03-18 14:24:55 +01:00
Stefan Kalkowski
0dece91973 core: re-design memory allocator (fix #1091)
* Core_mem_allocator: implement Range_allocator interface
* Core_mem_allocator: allocate with page-granularity only
* Use slab allocators in core where meaningful (e.g. dataspace objects)
2014-03-18 14:24:55 +01:00
Martin Stein
36bfb56e49 util_mmio: make memory dumps easier to read
fix #1095
2014-03-14 13:24:20 +01:00
Martin Stein
9a9d093e01 util_mmio: test bitsets with a width of 64bit
ref #1095
2014-03-14 13:24:09 +01:00
Martin Stein
6476cb3bbd mmio: fix type inaccuracy in bitset reads
We must ensure that the type in use fits the shift value that gets
applied while combining the bitset sub-values.

ref #1095
2014-03-14 13:23:44 +01:00
Martin Stein
76668f0774 util_mmio: replace test_failed by error
ref #1095
2014-03-14 13:23:31 +01:00
Martin Stein
db8957562f util_mmio: test Mmio::Register with 64bit width
ref #1095
2014-03-14 13:23:19 +01:00
Martin Stein
358b2ef0c7 util_mmio: refer to failed tests via line number
ref #1095
2014-03-14 13:23:10 +01:00
Christian Helmuth
8de324245c framebuffer.run: refresh screen after test step
The commit also refactors initialization and generic functions into a
test-environment class.

Fixes #1092.
2014-03-14 13:20:06 +01:00
Christian Helmuth
83cc8da588 vbox: fix format warning (size_t) in autotest 2014-03-14 13:17:37 +01:00
Johannes Schlatow
da9e764c47 Init: bugfix
Fix a use-after-free bug concerning the use case where the config
of the init process changes dynamically. The childs' services were not
removed from the corresponding Service_registry properly.

Fixes #1094
2014-03-14 13:17:37 +01:00
Torsten Hilbrich
0b7ea4abab Genode::Connection: Mark as noncopyable
When an object derived from Genode::Connection is copied we had
strange issues. An example is that the first RPC invocation works
correctly but the second one blocks or even delivers incorrect data.

We can avoid this issue if the object is always passed by reference.
Ensure this by deriving from Genode::Noncopyable.
2014-03-14 13:17:37 +01:00
Martin Stein
f988c254df hw: comment conditions of interprocessor interrupt
ref #1088
2014-03-14 13:17:37 +01:00
Martin Stein
8ce197d7fa hw: do inter-processor interrupt only when needed
The processor scheduler can determine without much overhead wether
the currently scheduled client becomes out-dated due to the insertion
of another client. This can be used to safe inter-processor interrupts
when a remote insertion doesn't imply an update of the currently
scheduled client.

fix #1088
2014-03-14 13:17:37 +01:00
Martin Stein
18cee192e2 hw: don't do redundant inter-processor interrupts
At least with the ARM generic interrupt controller, inter-processor interrupts
are edge triggered and banked for all source processors. Thus it might be
possible that such an interrupt gets triggered redundantly until the targeted
processor is able to grab the kernel lock. As we're only interested in making
a processor recognize accumulative updates to its scheduler, we can omit
further interrupts if there is one pending already at the targeted processor.

ref #1088
2014-03-14 13:17:37 +01:00
Martin Stein
852785324f hw: move Processor_client to processor.h
ref #1088
2014-03-14 13:17:37 +01:00
Martin Stein
8818d810a1 hw: clean-up destruction of processor clients
ref #1088
2014-03-14 13:17:36 +01:00
Martin Stein
17f17df74b hw: rename Execution_context in Processor_client
ref #1088
2014-03-14 13:17:36 +01:00
Martin Stein
010e00ae7a hw: rename Cpu_scheduler in Processor_scheduler
ref #1088
2014-03-14 13:17:36 +01:00
Martin Stein
a8d071b372 hw: inter-processor interrupt on remote scheduling
ref #1088
2014-03-14 13:17:36 +01:00
Martin Stein
044a109c3a hw: reset scheduling timeout implicitely
This is needed as soon as we do inter-processor interrupts to
inform a processor about a remote modification in its scheduling plan.
In this case we can not explicitely decide wether to reset timer
or not. Instead we must decide it according to the choices of the
scheduler before and after the modification.

ref #1088
2014-03-14 13:17:36 +01:00
Martin Stein
a99a33e93e noux: enhance stack of all noux programs
This is done because we ran into a stack overflow while compiling
Genodes core/main.cc with GCC in Noux.

fix #1075
2014-03-14 13:17:36 +01:00
Martin Stein
3f9b098b70 base: provide Thread_base::stack_size(size_t)
The new method enhances the stack of the targeted thread if it is smaller
than a given size.

ref #1075
2014-03-14 13:17:36 +01:00
Alexander Boettcher
c3b161e814 run: enable virtualbox auto test for nightly runs
With #1090 fixed the test should succeed now.
2014-03-14 13:17:36 +01:00
Sebastian Sumpf
65dac52574 vbox: Increase quota for rump_fs in auto test 2014-03-14 13:17:35 +01:00
Sebastian Sumpf
330b0a731c rump: Add panic message 2014-03-14 13:17:35 +01:00
Sebastian Sumpf
45b4d6b187 libc_fs: Make plugin thread safe
Issue #1090
2014-03-14 13:17:35 +01:00
Alexander Boettcher
e7f3e99aab tool: test result output of amtterm reset
"amtterm reset" returns 0 as exitcode even if the reset command failed.
So check explicitly the output of the command to detect the error case.
2014-03-14 13:17:35 +01:00
Norman Feske
f5be746894 libc: Don't filter out sigsetjmp from libc-gen
Issue #1085
2014-03-14 13:17:35 +01:00
Norman Feske
6525ec5951 Simplify Framebuffer::Session interface
This patch removes the 'Framebuffer::Session::release()' function from
the interface to make the mode-change protocol consistent with the way
the Rom_session interface handles ROM-module changes. That is, the
client acknowledges the release of its current dataspace by requesting a
new dataspace via the 'Framebuffer::Session::dataspace()' function.

Fixes #1057
2014-03-14 13:17:35 +01:00
Christian Helmuth
a61e278cec scout: include scout/platform.h for new operator 2014-03-14 13:17:27 +01:00
Martin Stein
b9041d601d hw: Fix name of Page_flags type
The type was accidentally changed by "hw & arm_v6: clean up TLB driver"

ref #1076
2014-03-14 13:16:05 +01:00
Martin Stein
aeb9213e73 mp_server.run: allow testing with hw_arndale
fix #1076
2014-03-14 13:16:05 +01:00
Martin Stein
d605681ce4 affinity.run: allow testing with hw_arndale
ref #1076
2014-03-14 13:16:05 +01:00
Martin Stein
6e21ab42d2 hw: apply MMU cache-flushes to all processors
ref #1076
2014-03-14 13:16:05 +01:00
Martin Stein
56e4588e91 hw: provide processor broadcasts in core
A processor broadcast executes a function on all available processors
which is needed at least to do MMU cache-flushes globally.

ref #1076
2014-03-14 13:16:05 +01:00
Martin Stein
395e955756 hw: set affinity of core threads
ref #1076
2014-03-14 13:16:05 +01:00
Martin Stein
a586828844 hw: consider affinity location in Platform_thread
ref #1076
2014-03-14 13:16:05 +01:00
Martin Stein
49bf33e404 hw: multiprocessor aware processor scheduling
ref #1076
2014-03-14 13:16:05 +01:00
Martin Stein
f545fa0e36 hw: provide identification of a processor object
ref #1076
2014-03-14 13:16:04 +01:00
Martin Stein
e38060d81e hw: get a thread cap in Thread_base constructor
Previously this was not done before Thread_base::start(..) in
base-hw as it was not needed to have a valid cap that early. However,
when changing the affinity of a thread we need the cap to be valid
before Thread_base::start(..).

ref #1076
2014-03-07 17:24:54 +01:00
Martin Stein
52addb591b hw: multiprocessor aware verbosity on thread start
ref #1076
2014-03-07 17:24:28 +01:00
Martin Stein
ed9c4f4427 hw: get start-thread syscall multiprocessing aware
ref #1076
2014-03-07 17:24:12 +01:00
Sebastian Sumpf
5f0843082a usb_drv: XHCI support for x86-architectures
USB 3.0 support on x86 (64/32) platforms, as well as pci support for XHCI
controllers.

Issue #1084
2014-03-06 14:56:52 +01:00
Christian Helmuth
f02e9001e8 vbox: fix dependencies of generated files
Express that the target binary files depend on the generated files not
the source files. The old expression seems to confuse Make, which then
logs a bogus error like the following

      COMPILE  Runtime/common/err/errmsg.o
  genode-x86-g++: error: Runtime/common/err/errmsg.cpp: No such file or directory
  genode-x86-g++: fatal error: no input files
  compilation terminated.
  make[2]: *** [Runtime/common/err/errmsg.o] Error 1
  make[1]: *** [virtualbox-runtime.lib] Error 2
2014-03-06 14:53:33 +01:00
Christian Helmuth
6c1d1363ff vbox: requires installation of yasm 2014-03-06 14:53:32 +01:00
Martin Stein
194b6b64c1 hw: rename Multiprocessor in Processor_pool
fix #1083
2014-03-04 19:05:21 +01:00
Martin Stein
d2fd00a828 hw: rename files multiprocessor.* in processor.*
ref #1083
2014-03-04 19:05:09 +01:00
Martin Stein
7bdb8c9007 hw: let Processor inherit from Processor_driver
ref #1083
2014-03-04 19:04:50 +01:00
Martin Stein
effeb765b9 hw: rename <spec>::Cpu in <spec>::Processor_driver
ref #1083
2014-03-04 19:04:32 +01:00
Martin Stein
5d444a12dc hw: rename Genode::Cpu in Processor_driver
ref #1083
2014-03-04 19:04:16 +01:00
Martin Stein
108b29d33d hw: adjust defines in processor_driver.h
ref #1083
2014-03-04 19:04:06 +01:00
Martin Stein
f9ea52db9a hw: rename cpu.h in processor_driver.h
ref #1083
2014-03-04 19:03:58 +01:00
Martin Stein
2a503d3599 hw: adjust defines in core/processor_driver/
ref #1083
2014-03-04 19:03:48 +01:00
Martin Stein
e3c262579d hw: rename core/cpu/ in core/processor_driver/
ref #1083
2014-03-04 19:03:13 +01:00
Martin Stein
1335b7b550 hw: rename handle_exception() in exception()
fix #1078
2014-03-04 19:02:30 +01:00
Martin Stein
3a4f7128fd hw: make _processor private to Execution_context
ref #1078
2014-03-04 19:01:45 +01:00
Martin Stein
ce9e43ae51 hw: move handle_interrupt to Execution_context
ref #1078
2014-03-04 19:01:29 +01:00
Martin Stein
7cea03f695 hw: move Thread::_processor to Execution_context
ref #1078
2014-03-04 18:58:51 +01:00
Martin Stein
6a3368ee27 hw_arndale: idle threads on secondary processors
fix #1006
2014-03-04 15:03:43 +01:00
Martin Stein
e83849cf99 hw & arm: clean up core CRT0
ref #1006
2014-03-04 15:01:59 +01:00
Martin Stein
1e7c0c2066 hw: fix assembly alignments
ref #1006
2014-03-04 14:58:50 +01:00
Martin Stein
722154f0a8 hw: kernel initialization in extra function
ref #1006
2014-03-04 14:56:44 +01:00
Martin Stein
c288973bf2 hw & arm: declare every mapping as MP shared
ref #1006
2014-03-04 14:55:04 +01:00
Martin Stein
f0c54a7ca3 hw & arm_v6: clean up TLB driver
ref #1006
2014-03-04 14:54:49 +01:00
Martin Stein
1730e10469 hw & arm_v7: clean up TLB driver
ref #1006
2014-03-04 14:54:27 +01:00
Martin Stein
be7a119deb hw & arm: simplify TLB descriptor-type bits
ref #1006
2014-03-04 14:53:52 +01:00
Martin Stein
6fcdbf5e9e hw & arm: simplify TLB permission bits via bitsets
ref #1006
2014-03-04 14:52:34 +01:00
Martin Stein
864189762c mmio: provide set and get method for bitsets
ref #1006
2014-03-04 14:52:01 +01:00
Norman Feske
1914f5ae2e Clarify comment 2014-03-04 14:51:17 +01:00
Martin Stein
ff70ca6427 mmio: provide bits method for bitsets
ref #1006
2014-03-04 14:49:27 +01:00
Christian Prochaska
e142d0d2e8 gdb_monitor: improve the backtrace test
With this patch, functions which execute blocking syscalls on Fiasco.OC
are built with frame pointers to get a correct backtrace shown in GDB.

Also, the backtrace test for a thread currently executing a syscall now
traces the  'Genode::Thread_base::join()' function instead of
'Genode::sleep_forever()', because base-nova has a custom implementation
of 'Genode::sleep_forever()' with a different backtrace than on Fiasco.OC.

Fixes #1061.
2014-03-04 11:36:29 +01:00
Stefan Kalkowski
2ed22595ff hw: simplify Page_flags (fix #711)
Instead of using a special bitfield use a compound of boolean
values for the generic page attributes. To reduce copy overhead,
change the corresponding functions, where Page_flags are used as
arguments, to use references.
2014-03-03 14:11:22 +01:00
Stefan Kalkowski
47179201a5 base-hw: reenable failsafe run script (Fix #801) 2014-03-03 13:01:39 +01:00
Stefan Kalkowski
4c5c9fd7a9 fiasco.oc: remove redundant atomic.h header
Fixes #565
2014-03-03 13:01:05 +01:00
Stefan Kalkowski
28bb1f8fd7 hw: remove use of float in exynos timer (fix #713) 2014-03-03 13:00:36 +01:00
Stefan Kalkowski
83266db30b hw: disable assertions if release spec is set only
Fix #1071
2014-03-03 12:51:25 +01:00
Sebastian Sumpf
caad308a21 ldso: Export HW system call interface
Fixes #1081
2014-03-03 12:49:35 +01:00
Martin Stein
b6a28795dd base & x86: setup GOT pointer in crt0.s
This is normally needed in LDSO and was previously done by the LDSO specific crt0.s.
I forgot to keep it during the unification of the different crt0s.

fix #1077
2014-03-03 12:48:29 +01:00
Norman Feske
4092cd1f6e Clarification in release notes 14.02
Thanks to Udo Steinberg for the notification.
2014-02-28 14:34:07 +01:00
Norman Feske
bea9feb362 News item for Genode 14.02 2014-02-28 11:18:53 +01:00
6208 changed files with 271115 additions and 226330 deletions

193
.gitignore vendored
View File

@@ -3,165 +3,36 @@
*.swp
*.rej
/base-codezero/contrib
/base-fiasco/contrib
/base-fiasco/download
/base-foc/contrib
/base-nova/contrib
/base-nova/download
/base-okl4/contrib
/base-okl4/download
/base-pistachio/contrib
/dde_ipxe/contrib
/dde_linux/contrib
/dde_linux/download
/dde_oss/contrib
/dde_oss/download
/dde_rump/contrib
/dde_rump/include/rump
/libports/contrib
/libports/download
/libports/include/curl/
/libports/include/EGL/egl.h
/libports/include/EGL/eglext.h
/libports/include/GL
/libports/include/KHR
/libports/include/SDL
/libports/include/exfat
/libports/include/ffat
/libports/include/fribidi
/libports/include/freetype
/libports/include/ft2build.h
/libports/include/fuse-ext2
/libports/include/iconv/
/libports/include/icu/
/libports/include/jbig2dec
/libports/include/libc-amd64/
/libports/include/libc-arm/
/libports/include/libc-i386/
/libports/include/libc/
/libports/include/libpng
/libports/include/libssh/
/libports/include/lua
/libports/include/lwip/lwip
/libports/include/lwip/netif
/libports/include/mupdf
/libports/include/ncurses/MKterm.h.awk
/libports/include/ncurses/capdefaults.c
/libports/include/ncurses/curses.h
/libports/include/ncurses/ncurses.h
/libports/include/ncurses/hashed_db.h
/libports/include/ncurses/hashsize.h
/libports/include/ncurses/init_keytry.h
/libports/include/ncurses/keys.list
/libports/include/ncurses/nc_alloc.h
/libports/include/ncurses/nc_panel.h
/libports/include/ncurses/nc_tparm.h
/libports/include/ncurses/ncurses_def.h
/libports/include/ncurses/ncurses_dll.h
/libports/include/ncurses/parametrized.h
/libports/include/ncurses/term.h
/libports/include/ncurses/term_entry.h
/libports/include/ncurses/termcap.h
/libports/include/ncurses/tic.h
/libports/include/ncurses/unctrl.h
/libports/include/openjpeg
/libports/include/openssl
/libports/src/lib/openssl/x86_32/aes_enc.s
/libports/src/lib/openssl/x86_32/cpuid.s
/libports/src/lib/openssl/x86_64/aes_enc.s
/libports/src/lib/openssl/x86_64/cpuid.s
/libports/src/lib/openssl/x86_64/modexp512.s
/libports/src/lib/openssl/x86_64/rc4_md5.s
/libports/include/pcre
/libports/include/python2.6
/libports/include/qoost
/libports/include/readline/keymaps.h
/libports/include/readline/rlstdc.h
/libports/include/readline/rltypedefs.h
/libports/include/readline/tilde.h
/libports/include/stdcxx
/libports/include/zlib
/libports/include/gmp/gmp-impl.h
/libports/include/gmp/arm/gmp-mparam.h
/libports/include/gmp/x86_32/gmp-mparam.h
/libports/include/gmp/x86_64/gmp-mparam.h
/libports/include/mpc/
/libports/include/mpfr/
/libports/include/stdcxx-genode/bits/atomic_lockfree_defines.h
/libports/include/stdcxx-genode/bits/atomic_word.h
/libports/include/stdcxx-genode/bits/basic_file.h
/libports/include/stdcxx-genode/bits/c++allocator.h
/libports/include/stdcxx-genode/bits/c++io.h
/libports/include/stdcxx-genode/bits/c++locale.h
/libports/include/stdcxx-genode/bits/cpu_defines.h
/libports/include/stdcxx-genode/bits/cxxabi_tweaks.h
/libports/include/stdcxx-genode/bits/ctype_base.h
/libports/include/stdcxx-genode/bits/ctype_inline.h
/libports/include/stdcxx-genode/bits/cxxabi_forced.h
/libports/include/stdcxx-genode/bits/error_constants.h
/libports/include/stdcxx-genode/bits/exception_defines.h
/libports/include/stdcxx-genode/bits/hash_bytes.h
/libports/include/stdcxx-genode/bits/messages_members.h
/libports/include/stdcxx-genode/bits/os_defines.h
/libports/include/stdcxx-genode/bits/time_members.h
/libports/include/stdcxx-genode/bits/exception_ptr.h
/libports/include/stdcxx-genode/bits/nested_exception.h
/libports/include/stdcxx-genode/exception
/libports/include/stdcxx-genode/new
/libports/include/stdcxx-genode/typeinfo
/libports/include/stdcxx-genode/initializer_list
/libports/include/x86emu/stdint.h
/libports/include/x86emu/stdio.h
/libports/include/x86emu/stdlib.h
/libports/include/x86emu/string.h
/libports/include/x86emu/x86emu.h
/libports/include/x86emu/x86emu/
/libports/src/lib/gmp/mpn/asm-defs.m4
/libports/src/lib/gmp/mpn/arm/hamdist.c
/libports/src/lib/gmp/mpn/arm/popcount.c
/libports/src/lib/gmp/mpn/x86_32/add_n.asm
/libports/src/lib/gmp/mpn/x86_32/sub_n.asm
/libports/src/lib/gmp/mpn/x86_64/add_n.asm
/libports/src/lib/gmp/mpn/x86_64/hamdist.asm
/libports/src/lib/gmp/mpn/x86_64/popcount.asm
/libports/src/lib/gmp/mpn/x86_64/sub_n.asm
/libports/src/lib/ncurses/codes.c
/libports/src/lib/ncurses/comp_captab.c
/libports/src/lib/ncurses/fallback.c
/libports/src/lib/ncurses/make_hash
/libports/src/lib/ncurses/make_keys
/libports/src/lib/ncurses/names.c
/libports/src/lib/ncurses/unctrl.c
/libports/src/lib/qt5/qtjsbackend
/libports/src/lib/qt5/qtwebkit/Source/JavaScriptCore
/libports/src/lib/qt5/qtwebkit/Source/WebCore/generated
/libports/tool/mesa/glsl
/libports/tool/mupdf
/libports/tool/qt5/bootstrap
/libports/tool/qt5/misc/var
/libports/tool/qt5/moc
/libports/tool/qt5/qmake/*.d
/libports/tool/qt5/qmake/*.o
/libports/tool/qt5/qmake/qmake
/libports/tool/qt5/rcc
/libports/tool/qt5/uic
/ports-foc/contrib
/ports-okl4/contrib
/ports-okl4/download
/ports/contrib
/ports/download
/ports/src/app/arora/html
/ports/src/lib/gdbserver_platform/generated
/qt4/contrib
/qt4/download
/qt4/tool/bootstrap
/qt4/tool/misc/var
/qt4/tool/moc
/qt4/tool/qmake/*.d
/qt4/tool/qmake/*.o
/qt4/tool/qmake/qmake
/qt4/tool/rcc
/qt4/tool/uic
/linux_drivers
/build
/contrib
/repos/base-codezero/contrib
/repos/base-fiasco/contrib
/repos/base-fiasco/download
/repos/base-foc/contrib
/repos/base-pistachio/contrib
/repos/dde_ipxe/contrib
/repos/dde_linux/contrib
/repos/dde_linux/download
/repos/dde_oss/contrib
/repos/dde_oss/download
/repos/dde_rump/contrib
/repos/dde_rump/include/rump
/repos/libports/contrib
/repos/libports/download
/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/qt4/contrib
/repos/qt4/download
/repos/qt4/tool/bootstrap
/repos/qt4/tool/misc/var
/repos/qt4/tool/moc
/repos/qt4/tool/qmake/*.d
/repos/qt4/tool/qmake/*.o
/repos/qt4/tool/qmake/qmake
/repos/qt4/tool/rcc
/repos/qt4/tool/uic

138
README
View File

@@ -36,7 +36,7 @@ usage scenario.
Directory overview
##################
The Genode source tree is composed of the following subdirectories:
The source tree is composed of the following subdirectories:
:'doc':
@@ -50,145 +50,17 @@ The Genode source tree is composed of the following subdirectories:
! doc/components.txt
:'base':
:'repos':
This directory contains the source-code repository of the fundamental
frameworks and interfaces of Genode. Furthermore, it contains the generic
parts of core.
:'os':
This directory contains the non-base OS components such as the init process,
device drivers, and basic system services.
:'demo':
This directory contains the source-code repository of various services and
applications that we use for demonstration purposes. For example, a graphical
application launcher called Launchpad and the Scout tutorial browser.
:'base-<platform>':
These directories contain platform-specific source-code repositories
complementing the 'base' repository. The following platforms are supported:
:'linux':
Linux kernel (both x86_32 and x86_64)
:'nova':
NOVA hypervisor developed at University of Technology Dresden
See [http://genode.org/documentation/platforms/nova]
:'foc':
Fiasco.OC is a modernized version of the Fiasco microkernel with a
completely revised kernel interface fostering capability-based
security. It is not compatible with L4/Fiasco.
See [http://genode.org/documentation/platforms/foc]
:'hw':
The hw platform allows the execution of Genode on bare ARM hardware
without the need for a separate kernel. The kernel functionality is
included in core.
See [http://genode.org/documentation/platforms/hw]
:'okl4':
OKL4 kernel (x86_32 and ARM) developed at Open-Kernel-Labs.
See [http://genode.org/documentation/platforms/okl4]
:'pistachio':
L4ka::Pistachio kernel developed at University of Karlsruhe.
See [http://genode.org/documentation/platforms/pistachio]
:'fiasco':
L4/Fiasco kernel developed at University of Technology Dresden.
See [http://genode.org/documentation/platforms/fiasco]
:'codezero':
Codezero microkernel developed by B-Labs
See [http://genode.org/documentation/platforms/codezero]
:'host':
Pseudo platform documenting the interface between the generic and
platform-specific parts of the base framework. This is not a functional
base platform.
This directory contains the so-called source-code repositories of Genode.
Please refer to the README file in the 'repos' directory to learn more
about the roles of the individual repositories.
:'tool':
Source-code management tools and scripts. Please refer to the README file
contained in the directory.
:'hello_tutorial':
Tutorial for creating a simple client-server scenario with Genode. This
repository includes documentation and the complete source code.
:'libports':
This source-code repository contains ports of popular open-source libraries
to Genode, most importantly the C library. The repository contains no
upstream source code but means to download the code and adapt it to Genode.
For instructions about how to use this mechanism, please consult the README
file at the top level of the repository. Among the 3rd-party libraries
are Qt5, libSDL, freetype, Python, ncurses, Mesa, and libav.
:'dde_linux':
This source-code repository contains the device driver environment for
executing Linux device drivers natively on Genode. Currently, this
repository hosts the USB stack.
:'linux_drivers':
Deprecated version of the Linux device driver environment featuring audio
drivers and the Intel GEM driver. This repository is in a transitionary
phase. Its functionality will be incorporated into 'dde_linux'.
:'dde_ipxe':
This source-code repository contains the device-driver environment for
executing drivers of the iPXE project.
:'dde_oss':
This source-code repository contains the device-driver environment for the
audio drivers of the Open Sound System (OSS).
:'dde_rump':
This source-code repository contains the port of rump kernels, which are
used to execute subsystems of the NetBSD kernel as user level processes.
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
Genode. The repository does not contain upstream source code but provides
a mechanism for downloading the official source distributions and adapt
them to the Genode environment. The used mechanism is roughly the same
as used for the 'libports' repository. Please consult 'libports/README'
for further information.
:'ports-<platform>':
These platform-specific source-code repositories contain software that
capitalizes special features of the respective kernel platform.
For the Fiasco.OC platform, 'ports-foc' hosts a port of the L4Linux
kernel. For further information, please refer to the README file at the
top level of the respective repository.
:'gems':
This source-code repository contains Genode applications that use
both native Genode interfaces as well as features of other high-level
repositories, in particular shared libraries provided by 'libports'.
Contact
#######

1
VERSION Normal file
View File

@@ -0,0 +1 @@
15.05

View File

@@ -1,54 +0,0 @@
#
# \brief Download and prepare the Codezero kernel
# \author Norman Feske
# \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)
#
# Print help information by default
#
help::
prepare: $(CONTRIB_DIR)
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)
$(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

@@ -1,170 +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/ipc.h>
#include <base/stdint.h>
#include <base/native_types.h>
namespace Genode {
class Mapping
{
private:
addr_t _from_phys_addr;
addr_t _to_virt_addr;
size_t _num_pages;
bool _writeable;
enum { PAGE_SIZE_LOG2 = 12 };
public:
/**
* Constructor
*/
Mapping(addr_t dst_addr, addr_t src_addr,
bool write_combined, bool io_mem,
unsigned l2size = PAGE_SIZE_LOG2,
bool rw = true)
:
_from_phys_addr(src_addr),
_to_virt_addr(dst_addr),
_num_pages(1 << (l2size - PAGE_SIZE_LOG2)),
_writeable(rw)
{ }
/**
* Construct invalid mapping
*/
Mapping() : _num_pages(0) { }
/**
* Prepare map operation
*
* No preparations are needed on Codezero because all mapping
* originate from the physical address space.
*/
void prepare_map_operation() { }
addr_t from_phys() const { return _from_phys_addr; }
addr_t to_virt() const { return _to_virt_addr; }
size_t num_pages() const { return _num_pages; }
bool writeable() const { return _writeable; }
};
/**
* Special paging server class
*/
class Ipc_pager : public Native_capability
{
private:
Native_thread_id _last; /* faulted thread */
addr_t _pf_addr; /* page-fault address */
addr_t _pf_ip; /* instruction pointer of faulter */
bool _pf_write; /* true on write fault */
Mapping _reply_mapping;
// protected:
//
// /**
// * Wait for pagefault
// */
// void _wait();
//
// /**
// * Send page-fault reply and wait for next page fault
// */
// void _reply_and_wait();
public:
/**
* Constructor
*/
Ipc_pager();
/**
* Wait for a new page fault received as short message IPC
*/
void wait_for_fault();
/**
* Reply current page-fault and wait for a new one
*/
void reply_and_wait_for_fault();
/**
* Request instruction pointer of current page fault
*/
addr_t fault_ip() { return _pf_ip; }
/**
* Request fault address of current page fault
*/
addr_t fault_addr() { return _pf_addr; }
/**
* Set parameters for next reply
*/
void set_reply_mapping(Mapping m) { _reply_mapping = m; }
/**
* Set destination for next reply
*/
void set_reply_dst(Native_capability pager_object) {
_last = pager_object.local_name(); }
/**
* Answer call without sending a 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 _last; }
/**
* Return badge for faulting thread
*/
unsigned long badge() const { return _last; }
/**
* Return true if page fault was a write fault
*/
bool is_write_fault() const { return _pf_write; }
/**
* 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_ */

View File

@@ -1,76 +0,0 @@
/*
* \brief Aggregate Codezero syscall bindings
* \author Norman Feske
* \date 2010-02-16
*/
/*
* 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 _INCLUDE__CODEZERO__SYSCALLS_H_
#define _INCLUDE__CODEZERO__SYSCALLS_H_
/*
* Codezero headers happen to include the compiler's 'stdarg.h'. If this
* happened within the 'Codezero' namespace below, we would not be able to
* include 'stdarg.h' later on into the root namespace (stdarg's include guards
* would prevent this. Therefore, we make sure to include the file into the
* root namespace prior processing any Codezero headers.
*/
#include <stdarg.h>
namespace Codezero { extern "C" {
/* make Codezero includes happy */
extern char *strncpy(char *dest, const char *src, __SIZE_TYPE__);
extern void *memcpy(void *dest, const void *src, __SIZE_TYPE__);
/*
* Work around the problem of C++ keywords being used as
* argument names in the Codezero API headers.
*/
#define new _new_
#define virtual _virtual_
#define printf(A, ...)
#include <l4lib/macros.h>
#include <l4lib/arch/arm/syscalls.h>
#include <l4lib/arch/arm/syslib.h>
#include <l4lib/ipcdefs.h>
#include <l4lib/init.h>
#include <l4lib/mutex.h>
#include <l4/api/thread.h>
#include <l4/api/irq.h>
#include <l4lib/exregs.h>
#include <l4/lib/list.h> /* needed for capability.h */
#include <l4/generic/capability.h>
#include <l4/generic/cap-types.h>
#include <l4/arch/arm/exception.h>
#include <l4/arch/arm/io.h>
#undef new
#undef virtual
#ifdef max
#undef max
#endif
#undef printf
} }
namespace Codezero {
/**
* Return thread ID of the calling thread
*/
inline int thread_myself()
{
struct task_ids ids = { 0, 0, 0 };
l4_getid(&ids);
return ids.tid;
}
}
#endif /* _INCLUDE__CODEZERO__SYSCALLS_H_ */

View File

@@ -1,33 +0,0 @@
#
# \brief Portions of base library shared by core and non-core processes
# \author Norman Feske
# \date 2013-02-14
#
LIBS += cxx syscall startup
SRC_CC += cap_copy.cc
SRC_CC += ipc/ipc.cc ipc/pager.cc ipc/ipc_marshal_cap.cc
SRC_CC += pager/pager.cc pager/common.cc
SRC_CC += avl_tree/avl_tree.cc
SRC_CC += allocator/slab.cc
SRC_CC += allocator/allocator_avl.cc
SRC_CC += heap/heap.cc heap/sliced_heap.cc
SRC_CC += console/console.cc
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 += server/server.cc server/common.cc
SRC_CC += thread/thread.cc thread/thread_bootstrap.cc thread/trace.cc
SRC_CC += thread/context_allocator.cc env/utcb.cc
SRC_CC += lock/cmpxchg.cc
INC_DIR += $(REP_DIR)/src/base/lock
INC_DIR += $(BASE_DIR)/src/base/thread
INC_DIR += $(REP_DIR)/include/codezero/dummies
vpath cap_copy.cc $(BASE_DIR)/src/platform
vpath %.cc $(REP_DIR)/src/base
vpath %.cc $(BASE_DIR)/src/base

View File

@@ -1,12 +0,0 @@
SRC_CC += console/log_console.cc
SRC_CC += env/env.cc env/context_area.cc env/reinitialize.cc
SRC_CC += thread/thread_start.cc
INC_DIR += $(BASE_DIR)/src/base/env
INC_DIR += $(REP_DIR)/include/codezero/dummies
LIBS += base-common
vpath %.cc $(REP_DIR)/src/base
vpath %.cc $(BASE_DIR)/src/base

View File

@@ -1,51 +0,0 @@
#
# 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
#
# Convert path to absolute directory
#
absdir = $(shell readlink -f $(1))
#
# Headers generated within the build directory
# (see 'lib/mk/platform.mk')
#
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
#
# Allow programs to test for the Codezero kernel
#
# This is needed by the 'pl050/irq_handler.h' to handle the interrupt semantics
# of Codezero.
#
CC_OPT += -D__CODEZERO__
#
# Clean rules for removing the side effects of building the platform
#
clean_includes:
$(VERBOSE)rm -rf $(BUILD_BASE_DIR)/include
cleanall: clean_includes

View File

@@ -1,33 +0,0 @@
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
@@ -503,7 +503,7 @@ BEGIN_PROC(arm_irq_exception_basic)
mov lr, pc
ldr pc, =do_irq
ldmfd sp!, {r0-r3, pc}^
-END_PROC(arm_irq_exception)
+END_PROC(arm_irq_exception_basic)
/* 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
@@ -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
@@ -65,4 +65,4 @@ BEGIN_PROC(memset)
bne end
ldmfd sp!, {r4 - r11, pc}
-END_PROC(_memset)
+END_PROC(memset)

View File

@@ -1,10 +0,0 @@
diff --git a/loader/main.c b/loader/main.c
index 7d21a4c..ee03918 100644
--- a/loader/main.c
+++ b/loader/main.c
@@ -135,3 +135,5 @@ int main(void)
return -1;
}
+
+asm(".global __aeabi_unwind_cpp_pr0; __aeabi_unwind_cpp_pr0:");

View File

@@ -1,13 +0,0 @@
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
@@ -70,7 +70,7 @@ struct task_ids {
struct container;
-#define tcb_pagerid(tcb) ((tcb)->pager->tid)
+#define tcb_pagerid(tcb) 4
#define space_is_pager(tcb) \
((tcb)->space->spid == (tcb)->pager->space->spid)

View File

@@ -1,106 +0,0 @@
#
# \brief Codezero-specific test-environment supplements
# \author Norman Feske
# \date 2011-08-05
#
# This file is meant to be used as '--include' argument for 'tool/run'.
#
##
# Return location of prebuilt mirror of codezero source tree
#
proc kernel_dir { } { return [pwd]/kernel/codezero }
##
# Return container directory where the Genode binaries should be copied to
#
proc container_dir { } { return [kernel_dir]/build/cont0/empty0 }
##
# Return location of 'gen_romfs' tool
#
proc gen_romfs { } { return "[genode_dir]/base-codezero/tool/gen_romfs" }
##
# Print and execute shell command
#
proc exec_sh { command } {
puts "$command"
exec sh -c $command
}
##################################
## Test framework API functions ##
##################################
proc create_boot_directory { } {
# create only intermediate directries hosting the run directory
exec mkdir -p [run_dir]
exec rm -rf [run_dir]
exec mkdir -p [run_dir]/genode
}
proc build_boot_image {binaries} {
if {![file exists kernel]} { build kernel }
copy_and_strip_genode_binaries_to_run_dir $binaries
# the codezero build system expects that the pager binary is named 'main.elf'
exec cp [run_dir]/genode/core [container_dir]/main.elf
# obtain list of modules
set modules [glob [run_dir]/genode/*]
# remove core from list of modules
set core_idx [lsearch -exact $modules [run_dir]/genode/core]
set modules [lreplace $modules $core_idx $core_idx]
# generate elf image containing the boot modules
exec_sh "[gen_romfs] -p [cross_dev_prefix] -c [run_dir]/genode/core -o [container_dir]/modules.elf $modules"
set tool_chain_dir [file dirname [cross_dev_prefix]]
set prepend_path ""
if {[file isdirectory $tool_chain_dir]} {
set prepend_path $tool_chain_dir }
# force re-generation of 'cinfo.c', which depends on the container content
exec_sh "rm -f [kernel_dir]/src/generic/cinfo.c"
# rebuild codezero, linking the new container content
exec_sh "cd [kernel_dir]; PATH=$prepend_path:\$PATH ./build.py"
# copy result to [run_dir]/image.elf (to be picked up by spawn_qemu)
exec_sh "cp [kernel_dir]/build/final.elf [run_dir]/image.elf"
}
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_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

@@ -1,40 +0,0 @@
/*
* \brief Helper functions UTCB access on Codezero
* \author Norman Feske
* \date 2012-03-01
*/
/*
* 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.
*/
/* Genode includes */
#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()
{
/*
* If 'utcb' is called on the object returned by 'myself',
* the 'this' pointer may be NULL (if the calling thread is
* the main thread). Therefore we handle this special case
* here.
*/
if (this == 0) return 0;
return &_context->utcb;
}

View File

@@ -1,96 +0,0 @@
/*
* \brief Thread bootstrap code
* \author Christian Prochaska
* \author Martin Stein
* \date 2013-02-15
*/
/*
* Copyright (C) 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.
*/
/* Genode includes */
#include <base/thread.h>
#include <base/env.h>
#include <util/string.h>
/* Codezero includes */
#include <codezero/syscalls.h>
Genode::Native_thread_id main_thread_tid;
Codezero::l4_mutex main_thread_running_lock;
/*****************************
** Startup library support **
*****************************/
void prepare_init_main_thread()
{
/* initialize codezero environment */
Codezero::__l4_init();
/* provide kernel identification of thread through temporary environment */
main_thread_tid = Codezero::thread_myself();
}
void prepare_reinit_main_thread() { prepare_init_main_thread(); }
/****************************
** Codezero libl4 support **
****************************/
/*
* Unfortunately, the function 'exregs_print_registers' in 'exregs.c' refers to
* 'memset'. Because we do not want to link core against a C library, we have to
* resolve this function here.
*/
extern "C" void *memset(void *s, int c, Genode::size_t n) __attribute__((weak));
extern "C" void *memset(void *s, int c, Genode::size_t n)
{
return Genode::memset(s, c, n);
}
/*
* Same problem as for 'memset'. The 'printf' symbol is referenced from
* 'mutex.c' and 'exregs.c' of Codezero's libl4.
*/
extern "C" int printf(const char *format, ...) __attribute__((weak));
extern "C" int printf(const char *format, ...)
{
va_list list;
va_start(list, format);
Genode::vprintf(format, list);
va_end(list);
return 0;
}
/*****************
** Thread_base **
*****************/
void Genode::Thread_base::_thread_bootstrap()
{
Codezero::l4_mutex_init(utcb()->running_lock());
Codezero::l4_mutex_lock(utcb()->running_lock()); /* block on first mutex lock */
}
void Genode::Thread_base::_init_platform_thread(Type type)
{
if (type == NORMAL) { return; }
/* adjust values whose computation differs for a main thread */
_tid.l4id = main_thread_tid;
_thread_cap = Genode::env()->parent()->main_thread_cap();
/* get first mutex lock (normally done by _thread_bootstrap) */
Codezero::l4_mutex_init(utcb()->running_lock());
Codezero::l4_mutex_lock(utcb()->running_lock());
}

View File

@@ -1,72 +0,0 @@
/*
* \brief NOVA-specific implementation of the Thread API
* \author Norman Feske
* \date 2010-01-19
*/
/*
* 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.
*/
/* Genode includes */
#include <base/thread.h>
#include <base/printf.h>
#include <base/sleep.h>
#include <base/env.h>
/* Codezero includes */
#include <codezero/syscalls.h>
using namespace Genode;
/**
* Entry point entered by new threads
*/
void Thread_base::_thread_start()
{
Thread_base::myself()->_thread_bootstrap();
Thread_base::myself()->entry();
Thread_base::myself()->_join_lock.unlock();
Genode::sleep_forever();
}
/*****************
** Thread base **
*****************/
void Thread_base::_deinit_platform_thread()
{
env()->cpu_session()->kill_thread(_thread_cap);
env()->rm_session()->remove_client(_pager_cap);
}
void Thread_base::start()
{
/* create thread at core */
char buf[48];
name(buf, sizeof(buf));
_thread_cap = env()->cpu_session()->create_thread(buf);
/* assign thread to protection domain */
env()->pd_session()->bind_thread(_thread_cap);
/* create new pager object and assign it to the new thread */
_pager_cap = env()->rm_session()->add_client(_thread_cap);
env()->cpu_session()->set_pager(_thread_cap, _pager_cap);
/* register initial IP and SP at core */
env()->cpu_session()->start(_thread_cap, (addr_t)_thread_start, _context->stack_top());
}
void Thread_base::cancel_blocking()
{
Codezero::l4_mutex_unlock(utcb()->running_lock());
env()->cpu_session()->cancel_blocking(_thread_cap);
}

View File

@@ -1,28 +0,0 @@
/*
* \brief Platform-specific parts of cores CPU-service
* \author Martin Stein
* \date 2012-04-17
*/
/*
* 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.
*/
/* Genode includes */
#include <base/printf.h>
/* Core includes */
#include <cpu_session_component.h>
using namespace Genode;
Ram_dataspace_capability Cpu_session_component::utcb(Thread_capability thread_cap)
{
PERR("%s: Not implemented", __PRETTY_FUNCTION__);
return Ram_dataspace_capability();
}

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

@@ -1,72 +0,0 @@
/*
* \brief Platform interface
* \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 _CORE__INCLUDE__PLATFORM_H_
#define _CORE__INCLUDE__PLATFORM_H_
/* Genode includes */
#include <base/printf.h>
/* local includes */
#include <platform_generic.h>
#include <core_mem_alloc.h>
namespace Genode {
class Platform : public Platform_generic
{
private:
typedef Core_mem_allocator::Phys_allocator Phys_allocator;
Core_mem_allocator _core_mem_alloc; /* core-accessible memory */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Rom_fs _rom_fs; /* ROM file system */
/**
* Virtual address range usable by non-core processes
*/
addr_t _vm_base;
size_t _vm_size;
int _init_rom_fs();
public:
/**
* Constructor
*/
Platform();
/********************************
** Generic platform interface **
********************************/
Range_allocator *ram_alloc() { return _core_mem_alloc.phys_alloc(); }
Range_allocator *io_mem_alloc() { return &_io_mem_alloc; }
Range_allocator *io_port_alloc() { return &_io_port_alloc; }
Range_allocator *irq_alloc() { return &_irq_alloc; }
Range_allocator *region_alloc() { return _core_mem_alloc.virt_alloc(); }
Allocator *core_mem_alloc() { return &_core_mem_alloc; }
addr_t vm_start() const { return _vm_base; }
size_t vm_size() const { return _vm_size; }
Rom_fs *rom_fs() { return &_rom_fs; }
void wait_for_exit();
};
}
#endif /* _CORE__INCLUDE__PLATFORM_H_ */

View File

@@ -1,81 +0,0 @@
/*
* \brief Protection-domain facility
* \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 _CORE__INCLUDE__PLATFORM_PD_H_
#define _CORE__INCLUDE__PLATFORM_PD_H_
/* core includes */
#include <platform_thread.h>
#include <address_space.h>
/* Codezero includes */
#include <codezero/syscalls.h>
namespace Genode {
class Platform_thread;
class Platform_pd : public Address_space
{
private:
enum { MAX_THREADS_PER_PD = 32 };
enum { UTCB_VIRT_BASE = 0x30000000 };
enum { UTCB_AREA_SIZE = MAX_THREADS_PER_PD*sizeof(struct Codezero::utcb) };
unsigned _space_id;
bool utcb_in_use[MAX_THREADS_PER_PD];
public:
/**
* Constructors
*/
Platform_pd(bool core);
Platform_pd(char const *, signed pd_id = -1, bool create = true);
/**
* Destructor
*/
~Platform_pd();
/**
* Bind thread to protection domain
*
* \return 0 on success or
* -1 if thread ID allocation failed.
*/
int bind_thread(Platform_thread *thread);
/**
* Unbind thread from protection domain
*
* Free the thread's slot and update thread object.
*/
void unbind_thread(Platform_thread *thread);
/**
* Assign parent interface to protection domain
*/
int assign_parent(Native_capability parent) { return 0; }
/*****************************
** Address-space interface **
*****************************/
void flush(addr_t, size_t) { PDBG("not implemented"); }
};
}
#endif /* _CORE__INCLUDE__PLATFORM_PD_H_ */

View File

@@ -1,158 +0,0 @@
/*
* \brief Thread facility
* \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 _CORE__INCLUDE__PLATFORM_THREAD_H_
#define _CORE__INCLUDE__PLATFORM_THREAD_H_
/* Genode includes */
#include <base/pager.h>
#include <base/thread_state.h>
#include <base/native_types.h>
/* core includes */
#include <address_space.h>
namespace Genode {
class Platform_pd;
class Platform_thread
{
private:
friend class Platform_pd;
enum { PD_NAME_MAX_LEN = 64 };
unsigned _tid; /* global codezero thread ID */
unsigned _space_id;
Weak_ptr<Address_space> _address_space;
addr_t _utcb;
char _name[PD_NAME_MAX_LEN];
Pager_object *_pager;
/**
* Assign physical thread ID and UTCB address to thread
*
* This function is called from 'Platform_pd::bind_thread'.
*/
void _assign_physical_thread(unsigned tid, unsigned space_id,
addr_t utcb,
Weak_ptr<Address_space> address_space)
{
_tid = tid; _space_id = space_id; _utcb = utcb;
_address_space = address_space;
}
public:
enum { THREAD_INVALID = -1 }; /* invalid thread number */
/**
* Constructor
*/
Platform_thread(const char *name = 0, unsigned priority = 0,
addr_t utcb = 0, int thread_id = THREAD_INVALID);
/**
* Destructor
*/
~Platform_thread();
/**
* Start thread
*
* \param ip instruction pointer to start at
* \param sp stack pointer to use
* \param cpu_no target cpu
*
* \retval 0 successful
* \retval -1 thread could not be started
*/
int start(void *ip, void *sp, unsigned int cpu_no = 0);
/**
* Pause this thread
*/
void pause();
/**
* Resume this thread
*/
void resume();
/**
* Cancel currently blocking operation
*/
void cancel_blocking();
/**
* Override thread state with 's'
*
* \throw Cpu_session::State_access_failed
*/
void state(Thread_state s);
/**
* Read thread state
*
* \throw Cpu_session::State_access_failed
*/
Thread_state state();
/**
* Return the address space to which the thread is bound
*/
Weak_ptr<Address_space> address_space();
/************************
** Accessor functions **
************************/
/**
* Set pager capability
*/
Pager_object *pager(Pager_object *pager) const { return _pager; }
void pager(Pager_object *pager) { _pager = pager; }
Pager_object *pager() { return _pager; }
/**
* Return identification of thread when faulting
*/
unsigned long pager_object_badge() const { return _tid; }
/**
* Set the executing CPU for this thread
*/
void affinity(Affinity::Location) { }
/**
* Get the executing CPU for this thread
*/
Affinity::Location affinity() { return Affinity::Location(); }
/**
* Get thread name
*/
const char *name() const { return "noname"; }
/***********************
** Codezero specific **
***********************/
addr_t utcb() const { return _utcb; }
};
}
#endif /* _CORE__INCLUDE__PLATFORM_THREAD_H_ */

View File

@@ -1,46 +0,0 @@
/*
* \brief Core-internal utilities
* \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 _CORE__INCLUDE__UTIL_H_
#define _CORE__INCLUDE__UTIL_H_
/* Genode includes */
#include <rm_session/rm_session.h>
#include <base/printf.h>
/* Codezero includes */
#include <codezero/syscalls.h>
namespace Genode {
inline size_t get_page_size_log2() { return 12; }
inline size_t get_page_size() { return 1 << get_page_size_log2(); }
inline addr_t get_page_mask() { return ~(get_page_size() - 1); }
inline addr_t trunc_page(addr_t addr) { return addr & get_page_mask(); }
inline addr_t round_page(addr_t addr) { return trunc_page(addr + get_page_size() - 1); }
inline addr_t map_src_addr(addr_t core_local, addr_t phys) { return phys; }
inline size_t constrain_map_size_log2(size_t size_log2) { return get_page_size_log2(); }
inline void print_page_fault(const char *msg, addr_t pf_addr, addr_t pf_ip,
Rm_session::Fault_type pf_type,
unsigned long faulter_badge)
{
printf("%s (%s pf_addr=%p pf_ip=%p from %02lx)\n", msg,
pf_type == Rm_session::WRITE_FAULT ? "WRITE" : "READ",
(void *)pf_addr, (void *)pf_ip,
faulter_badge);
}
}
#endif /* _CORE__INCLUDE__UTIL_H_ */

View File

@@ -1,72 +0,0 @@
/*
* \brief Implementation of IRQ session component
* \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.
*/
/* Genode includes */
#include <base/printf.h>
#include <base/sleep.h>
/* core includes */
#include <irq_root.h>
/* Codezero includes */
#include <codezero/syscalls.h>
using namespace Genode;
void Irq_session_component::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);
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)
{
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);
return;
}
_irq_number = irq_number;
_cap = Irq_session_capability(_entrypoint.manage(this));
}
Irq_session_component::~Irq_session_component()
{
PERR("not yet implemented");
}

View File

@@ -1,293 +0,0 @@
/*
* \brief Platform interface implementation
* \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.
*/
/* Genode includes */
#include <base/printf.h>
#include <base/sleep.h>
#include <base/thread.h>
/* core includes */
#include <core_parent.h>
#include <platform.h>
#include <map_local.h>
/* Codezero includes */
#include <codezero/syscalls.h>
using namespace Genode;
enum { verbose_boot_info = true };
/*
* Memory-layout information provided by the linker script
*/
/* virtual address range consumed by core's program image */
extern unsigned _prog_img_beg, _prog_img_end;
/* physical address range occupied by core */
extern addr_t _vma_start, _lma_start;
/**************************
** Boot-module handling **
**************************/
/**
* Scan ROM module image for boot modules
*
* By convention, the boot modules start at the page after core's BSS segment.
*/
int Platform::_init_rom_fs()
{
/**
* Format of module meta-data as found in the ROM module image
*/
struct Module
{
long name; /* physical address of null-terminated string */
long base; /* physical address of module data */
long size; /* size of module data in bytes */
};
/* find base address of ROM module image */
addr_t phys_base = round_page((addr_t)&_prog_img_end);
/* map the first page of the image containing the module meta data */
class Out_of_virtual_memory_during_rom_fs_init { };
void *virt_base = 0;
if (!_core_mem_alloc.virt_alloc()->alloc(get_page_size(), &virt_base))
throw Out_of_virtual_memory_during_rom_fs_init();
if (!map_local(phys_base, (addr_t)virt_base, 1)) {
PERR("map_local failed");
return -1;
}
/* remove page containing module infos from physical memory allocator */
_core_mem_alloc.phys_alloc()->remove_range(phys_base, get_page_size());
/* validate the presence of a ROM image by checking the magic cookie */
const char cookie[4] = {'G', 'R', 'O', 'M'};
for (size_t i = 0; i < sizeof(cookie); i++)
if (cookie[i] != ((char *)virt_base)[i]) {
PERR("could not detect ROM modules");
return -2;
}
printf("detected ROM module image at 0x%p\n", (void *)phys_base);
/* detect overly large meta data, we only support 4K */
addr_t end_of_header = ((long *)virt_base)[1];
size_t header_size = end_of_header - (long)phys_base;
if (header_size > get_page_size()) {
PERR("ROM fs module header exceeds %d bytes", get_page_size());
return -3;
}
/* start of module list */
Module *module = (Module *)((addr_t)virt_base + 2*sizeof(long));
/*
* Interate over module list and populate core's ROM file system with
* 'Rom_module' objects.
*/
for (; module->name; module++) {
/* convert physical address of module name to core-local address */
char *name = (char *)(module->name - phys_base + (addr_t)virt_base);
printf("ROM module \"%s\" at physical address 0x%p, size=%zd\n",
name, (void *)module->base, (size_t)module->size);
Rom_module *rom_module = new (core_mem_alloc())
Rom_module(module->base, module->size, name);
_rom_fs.insert(rom_module);
/* remove module from physical memory allocator */
_core_mem_alloc.phys_alloc()->remove_range(module->base, round_page(module->size));
}
return 0;
}
/****************************************
** Support for core memory management **
****************************************/
bool Core_mem_allocator::Mapped_mem_allocator::_map_local(addr_t virt_addr, addr_t phys_addr, unsigned size_log2)
{
return map_local(phys_addr, virt_addr, 1 << (size_log2 - get_page_size_log2()));
}
/************************
** Platform interface **
************************/
Platform::Platform() :
_io_mem_alloc(core_mem_alloc()), _io_port_alloc(core_mem_alloc()),
_irq_alloc(core_mem_alloc()), _vm_base(0), _vm_size(0)
{
using namespace Codezero;
/* init core UTCB */
static char main_utcb[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));
static struct exregs_data exregs;
exregs_set_utcb(&exregs, (unsigned long)&main_utcb[0]);
l4_exchange_registers(&exregs, thread_myself());
/* error handling is futile at this point */
/* read number of capabilities */
int num_caps;
int ret;
if ((ret = l4_capability_control(CAP_CONTROL_NCAPS,
0, &num_caps)) < 0) {
PERR("l4_capability_control(CAP_CONTROL_NCAPS) returned %d", ret);
class Could_not_obtain_num_of_capabilities { };
throw Could_not_obtain_num_of_capabilities();
}
struct capability cap_array[num_caps];
if (verbose_boot_info)
printf("allocated cap array[%d] of size %d on stack\n",
num_caps, sizeof(cap_array));
/* read all capabilities */
if ((ret = l4_capability_control(CAP_CONTROL_READ,
0, cap_array)) < 0) {
PERR("l4_capability_control(CAP_CONTROL_READ) returned %d", ret);
class Read_caps_failed { };
throw Read_caps_failed();
}
/* initialize core allocators */
bool phys_mem_defined = false;
addr_t dev_mem_base = 0;
for (int i = 0; i < num_caps; i++) {
struct capability *cap = &cap_array[i];
addr_t base = cap->start << get_page_size_log2(),
size = cap->size << get_page_size_log2();
if (verbose_boot_info)
printf("cap type=%x, rtype=%x, base=%lx, size=%lx\n",
cap_type(cap), cap_rtype(cap), base, size);
switch (cap_type(cap)) {
case CAP_TYPE_MAP_VIRTMEM:
/*
* Use first non-UTCB virtual address range as default
* virtual memory range usable for all processes.
*/
if (_vm_size == 0) {
/* exclude page at virtual address 0 */
if (base == 0 && size >= get_page_size()) {
base += get_page_size();
size -= get_page_size();
}
_vm_base = base;
_vm_size = size;
/* add range as free range to core's virtual address allocator */
_core_mem_alloc.virt_alloc()->add_range(base, size);
break;
}
PWRN("ignoring additional virtual address range [%lx,%lx)",
base, base + size);
break;
case CAP_TYPE_MAP_PHYSMEM:
/*
* We interpret the first physical memory resource that is bigger
* than typical device resources as RAM.
*/
enum { RAM_SIZE_MIN = 16*1024*1024 };
if (!phys_mem_defined && size > RAM_SIZE_MIN) {
_core_mem_alloc.phys_alloc()->add_range(base, size);
phys_mem_defined = true;
dev_mem_base = base + size;
}
break;
case CAP_TYPE_IPC:
case CAP_TYPE_UMUTEX:
case CAP_TYPE_IRQCTRL:
case CAP_TYPE_QUANTITY:
break;
}
}
addr_t core_virt_beg = trunc_page((addr_t)&_prog_img_beg),
core_virt_end = round_page((addr_t)&_prog_img_end);
size_t core_size = core_virt_end - core_virt_beg;
printf("core image:\n");
printf(" virtual address range [%08lx,%08lx) size=0x%zx\n",
core_virt_beg, core_virt_end, core_size);
printf(" physically located at 0x%08lx\n", _lma_start);
/* remove core image from core's virtual address allocator */
_core_mem_alloc.virt_alloc()->remove_range(core_virt_beg, core_size);
/* preserve context area in core's virtual address space */
_core_mem_alloc.virt_alloc()->raw()->remove_range(Native_config::context_area_virtual_base(),
Native_config::context_area_virtual_size());
/* remove used core memory from physical memory allocator */
_core_mem_alloc.phys_alloc()->remove_range(_lma_start, core_size);
/* remove magically mapped UART from core virtual memory */
_core_mem_alloc.virt_alloc()->remove_range(USERSPACE_CONSOLE_VBASE, get_page_size());
/* add boot modules to ROM fs */
if (_init_rom_fs() < 0) {
PERR("initialization of romfs failed - halt.");
while(1);
}
/* initialize interrupt allocator */
_irq_alloc.add_range(0, 255);
/* regard physical addresses higher than memory area as MMIO */
_io_mem_alloc.add_range(dev_mem_base, 0x80000000 - dev_mem_base);
/*
* Print statistics about allocator initialization
*/
printf("VM area at [%08lx,%08lx)\n", _vm_base, _vm_base + _vm_size);
if (verbose_boot_info) {
printf(":phys_alloc: "); _core_mem_alloc.phys_alloc()->raw()->dump_addr_tree();
printf(":virt_alloc: "); _core_mem_alloc.virt_alloc()->raw()->dump_addr_tree();
printf(":io_mem_alloc: "); _io_mem_alloc.raw()->dump_addr_tree();
}
}
void Platform::wait_for_exit()
{
sleep_forever();
}
void Core_parent::exit(int exit_value) { }

View File

@@ -1,126 +0,0 @@
/*
* \brief Protection-domain facility
* \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.
*/
/* Genode includes */
#include <base/printf.h>
/* core includes */
#include <platform_pd.h>
#include <platform.h>
#include <util.h>
using namespace Genode;
using namespace Codezero;
/***************************
** Public object members **
***************************/
int Platform_pd::bind_thread(Platform_thread *thread)
{
/* allocate new thread at the kernel */
struct task_ids ids = { 1, _space_id, TASK_ID_INVALID };
int ret = l4_thread_control(THREAD_CREATE | TC_SHARE_SPACE, &ids);
if (ret < 0) {
PERR("l4_thread_control returned %d, tid=%d\n", ret, ids.tid);
return -1;
}
/* allocate UTCB for new thread */
int utcb_idx;
for (utcb_idx = 0; utcb_idx < MAX_THREADS_PER_PD; utcb_idx++)
if (!utcb_in_use[utcb_idx]) break;
if (utcb_idx == MAX_THREADS_PER_PD) {
PERR("UTCB allocation failed");
return -2;
}
/* mark UTCB as being in use */
utcb_in_use[utcb_idx] = true;
/* map UTCB area for the first thread of a new PD */
if (utcb_idx == 0) {
void *utcb_phys = 0;
if (!platform()->ram_alloc()->alloc(UTCB_AREA_SIZE, &utcb_phys)) {
PERR("could not allocate physical pages for UTCB");
return -3;
}
ret = l4_map(utcb_phys, (void *)UTCB_VIRT_BASE,
UTCB_AREA_SIZE/get_page_size(), MAP_USR_RW, ids.tid);
if (ret < 0) {
PERR("UTCB mapping into new PD failed, ret=%d", ret);
return -4;
}
}
addr_t utcb_addr = UTCB_VIRT_BASE + utcb_idx*sizeof(struct utcb);
thread->_assign_physical_thread(ids.tid, _space_id, utcb_addr,
this->Address_space::weak_ptr());
return 0;
}
void Platform_pd::unbind_thread(Platform_thread *thread)
{
/* find UTCB index of thread */
unsigned utcb_idx;
for (utcb_idx = 0; utcb_idx < MAX_THREADS_PER_PD; utcb_idx++)
if (thread->utcb() == UTCB_VIRT_BASE + utcb_idx*sizeof(struct utcb))
break;
if (utcb_idx == MAX_THREADS_PER_PD) {
PWRN("could not find UTCB index of thread");
return;
}
utcb_in_use[utcb_idx] = false;
PWRN("not fully implemented");
}
Platform_pd::Platform_pd(bool core)
{
PWRN("not yet implemented");
}
Platform_pd::Platform_pd(char const *, signed pd_id, bool create)
: _space_id(TASK_ID_INVALID)
{
_space_id = TASK_ID_INVALID;
/* mark all UTCBs of the new PD as free */
for (int i = 0; i < MAX_THREADS_PER_PD; i++)
utcb_in_use[i] = false;
struct task_ids ids = { TASK_ID_INVALID, TASK_ID_INVALID, TASK_ID_INVALID };
int ret = l4_thread_control(THREAD_CREATE | TC_NEW_SPACE, &ids);
if (ret < 0) {
PERR("l4_thread_control(THREAD_CREATE | TC_NEW_SPACE) returned %d", ret);
return;
}
/* set space ID to valid value to indicate success */
_space_id = ids.spid;
}
Platform_pd::~Platform_pd()
{
PWRN("not yet implemented");
}

View File

@@ -1,112 +0,0 @@
/*
* \brief Thread facility
* \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.
*/
/* Genode includes */
#include <base/printf.h>
#include <util/string.h>
/* core includes */
#include <platform_thread.h>
/* Codezero includes */
#include <codezero/syscalls.h>
enum { verbose_thread_start = true };
using namespace Genode;
using namespace Codezero;
int Platform_thread::start(void *ip, void *sp, unsigned int cpu_no)
{
Native_thread_id pager = _pager ? _pager->cap().dst() : THREAD_INVALID;
/* setup thread context */
struct exregs_data exregs;
memset(&exregs, 0, sizeof(exregs));
exregs_set_stack(&exregs, (unsigned long)sp);
exregs_set_pc (&exregs, (unsigned long)ip);
exregs_set_pager(&exregs, pager);
exregs_set_utcb (&exregs, _utcb);
int ret = l4_exchange_registers(&exregs, _tid);
if (ret < 0) {
printf("l4_exchange_registers returned ret=%d\n", ret);
return -2;
}
/* start execution */
struct task_ids ids = { _tid, _space_id, _tid };
ret = l4_thread_control(THREAD_RUN, &ids);
if (ret < 0) {
printf("Error: l4_thread_control(THREAD_RUN) returned %d\n", ret);
return -3;
}
if (verbose_thread_start)
printf("core started thread \"%s\" with ID %d inside space ID %d\n",
_name, _tid, _space_id);
return 0;
}
void Platform_thread::pause()
{
PDBG("not implemented");
}
void Platform_thread::resume()
{
PDBG("not implemented");
}
void Platform_thread::state(Thread_state s)
{
PDBG("Not implemented");
throw Cpu_session::State_access_failed();
}
Thread_state Platform_thread::state()
{
PDBG("Not implemented");
throw Cpu_session::State_access_failed();
}
void Platform_thread::cancel_blocking()
{
PDBG("not implemented");
}
Weak_ptr<Address_space> Platform_thread::address_space()
{
return _address_space;
}
Platform_thread::Platform_thread(const char *name, unsigned, addr_t,
int thread_id)
: _tid(THREAD_INVALID)
{
strncpy(_name, name, sizeof(_name));
}
Platform_thread::~Platform_thread()
{
PDBG("not implemented");
}

View File

@@ -1,55 +0,0 @@
TARGET = core
GEN_CORE_DIR = $(BASE_DIR)/src/core
SRC_CC += \
main.cc \
ram_session_component.cc \
ram_session_support.cc \
rom_session_component.cc \
cpu_session_component.cc \
cpu_session_support.cc \
pd_session_component.cc \
io_mem_session_component.cc \
io_mem_session_support.cc \
thread_start.cc \
platform_thread.cc \
platform_pd.cc \
platform_services.cc \
platform.cc \
dataspace_component.cc \
rm_session_component.cc \
rm_session_support.cc \
irq_session_component.cc \
signal_session_component.cc \
signal_source_component.cc \
trace_session_component.cc \
core_rm_session.cc \
core_mem_alloc.cc \
dump_alloc.cc \
context_area.cc
LIBS += core_printf base-common
INC_DIR += $(REP_DIR)/src/core/include \
$(GEN_CORE_DIR)/include \
$(REP_DIR)/include/codezero/dummies \
$(BASE_DIR)/src/base/thread
vpath main.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rom_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)
vpath io_mem_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_support.cc $(GEN_CORE_DIR)
vpath platform_services.cc $(GEN_CORE_DIR)
vpath signal_session_component.cc $(GEN_CORE_DIR)
vpath signal_source_component.cc $(GEN_CORE_DIR)
vpath trace_session_component.cc $(GEN_CORE_DIR)
vpath dataspace_component.cc $(GEN_CORE_DIR)
vpath core_mem_alloc.cc $(GEN_CORE_DIR)
vpath dump_alloc.cc $(GEN_CORE_DIR)
vpath context_area.cc $(GEN_CORE_DIR)
vpath %.cc $(REP_DIR)/src/core

View File

@@ -1,120 +0,0 @@
/*
* \brief Implementation of Thread API interface for core
* \author Norman Feske
* \date 2006-05-03
*/
/*
* Copyright (C) 2006-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.
*/
/* Codezero includes */
#include <codezero/syscalls.h>
/* Genode includes */
#include <base/thread.h>
#include <base/printf.h>
#include <base/sleep.h>
/* core includes */
#include <platform.h>
#include <platform_thread.h>
enum { verbose_thread_start = true };
using namespace Genode;
void Thread_base::_deinit_platform_thread() { }
/**
* Create and start new thread
*
* \param space_no space ID in which the new thread will be executed
* \param sp initial stack pointer
* \param ip initial instruction pointer
* \return new thread ID, or
* negative error code
*/
inline int create_thread(unsigned space_no,
void *sp, void *ip,
int pager_tid = 1)
{
using namespace Codezero;
struct task_ids ids = { 1U, space_no, TASK_ID_INVALID };
/* allocate new thread at the kernel */
unsigned long flags = THREAD_CREATE | TC_SHARE_SPACE | TC_SHARE_GROUP;
int ret = l4_thread_control(flags, &ids);
if (ret < 0) {
PERR("l4_thread_control returned %d, spid=%d\n",
ret, ids.spid);
return -1;
}
unsigned long utcb_base_addr = (unsigned long)l4_get_utcb();
/* calculate utcb address of new thread */
unsigned long new_utcb = utcb_base_addr + ids.tid*sizeof(struct utcb);
/* setup thread context */
struct exregs_data exregs;
memset(&exregs, 0, sizeof(exregs));
exregs_set_stack(&exregs, (unsigned long)sp);
exregs_set_pc (&exregs, (unsigned long)ip);
exregs_set_pager(&exregs, pager_tid);
exregs_set_utcb (&exregs, new_utcb);
ret = l4_exchange_registers(&exregs, ids.tid);
if (ret < 0) {
printf("l4_exchange_registers returned ret=%d\n", ret);
return -2;
}
/* start execution */
ret = l4_thread_control(THREAD_RUN, &ids);
if (ret < 0) {
printf("Error: l4_thread_control(THREAD_RUN) returned %d\n", ret);
return -3;
}
/* return new thread ID allocated by the kernel */
return ids.tid;
}
void Thread_base::_thread_start()
{
Thread_base::myself()->_thread_bootstrap();
Thread_base::myself()->entry();
sleep_forever();
}
void Thread_base::start()
{
/* create and start platform thread */
_tid.pt = new(platform()->core_mem_alloc()) Platform_thread(_context->name);
_tid.l4id = create_thread(1, stack_top(), (void *)&_thread_start);
if (_tid.l4id < 0)
PERR("create_thread returned %d", _tid.l4id);
if (verbose_thread_start)
printf("core started local thread \"%s\" with ID %d\n",
_context->name, _tid.l4id);
}
void Thread_base::cancel_blocking()
{
PWRN("not implemented");
}

View File

@@ -1,74 +0,0 @@
TARGET = codezero
-include $(BUILD_BASE_DIR)/etc/codezero.conf
ifeq ($(wildcard $(CODEZERO_DIR)),)
$(error No valid kernel configured in 'etc/codezero.conf')
endif
include $(REP_DIR)/lib/mk/codezero_cml.inc
TOOL_CHAIN_DIR = $(dir $(CROSS_DEV_PREFIX))
CODEZERO_DST_DIR = $(BUILD_BASE_DIR)/kernel/codezero
CODEZERO_BUILD_DIR = $(CODEZERO_DST_DIR)/build
.PHONY: $(TARGET)
MIRROR_COPY := conts/baremetal/empty conts/userlibs \
build.py include SConstruct src loader
MIRROR_SYMLINK := scripts tools
update_copy = $(VERBOSE)tar c -C $(CODEZERO_DIR) $(MIRROR_COPY) | tar x -C $(CODEZERO_DST_DIR)
ifneq ($(VERBOSE),)
CODEZERO_STDOUT := > /dev/null
endif
#
# Environment variables passed to the Codezero build system
#
BUILD_ENV = PATH=$(dir $(CROSS_DEV_PREFIX)):$$PATH
#
# Local copy of the CML file used for supplying the configuration
# to the Codezero build system.
#
LOCAL_CONFIG_CML := $(shell pwd)/config.cml
$(TARGET): $(CODEZERO_BUILD_DIR)
$(MSG_BUILD)kernel
$(update_copy)
$(VERBOSE)cd $(CODEZERO_DST_DIR); $(BUILD_ENV) ./build.py $(CODEZERO_STDOUT)
#
# Mirror the parts of the Codezero source tree that are relevant for building
# the kernel
#
$(CODEZERO_DST_DIR): $(CODEZERO_DIR)
$(VERBOSE)test -d $@ || mkdir -p $@
$(VERBOSE)for d in $(MIRROR_SYMLINK); do ln -sf $(realpath $^)/$$d $@/$$d; done
$(CODEZERO_BUILD_DIR): $(CODEZERO_DST_DIR) $(CODEZERO_CML)
$(update_copy)
$(VERBOSE)cp $(CODEZERO_CML) $(LOCAL_CONFIG_CML)
@#
@# Create copy of the CML config in the local build directory to update
@# the tool chain parameters according to the CROSS_DEV_PREFIX configured
@# for Genode.
@#
$(VERBOSE)sed -i "/TOOLCHAIN_USERSPACE/s/\".*\"/\"$(notdir $(CROSS_DEV_PREFIX))\"/" $(LOCAL_CONFIG_CML)
$(VERBOSE)sed -i "/TOOLCHAIN_KERNEL/s/\".*\"/\"$(notdir $(CROSS_DEV_PREFIX))\"/" $(LOCAL_CONFIG_CML)
$(VERBOSE)cd $(CODEZERO_DST_DIR); $(BUILD_ENV) ./build.py -C -b -f $(LOCAL_CONFIG_CML) $(CODEZERO_STDOUT)
clean cleanall: clean_codezero
#
# Make sure to execute the 'clean_codezero' rule prior the generic clean
# rule in 'prg.mk' because the generic rule will attempt to remove $(TARGET)
# file, which is a directory in our case.
#
clean_prg_objects: clean_codezero
clean_codezero:
$(VERBOSE)rm -f $(LOCAL_CONFIG_CML)
$(VERBOSE)rm -rf $(CODEZERO_DST_DIR)

View File

@@ -1,131 +0,0 @@
/*
* \brief Linker script for Genode programs
* \author Christian Helmuth
* \date 2006-04-12
*/
/*
* Copyright (C) 2006-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.
*/
/* values taken from Codezero's mm0 linker script */
/*physical_base = 0x00208000;*/
/*virtual_base = 0xe0000000;*/
/*offset = virtual_base - physical_base;*/
/*
* Addresses correspond to the linker script generated by
* the Codezero build system.
*/
vma_start = 0x100000;
lma_start = 0x40000;
offset = vma_start - lma_start;
ENTRY(_start)
PHDRS
{
ro PT_LOAD;
rw PT_LOAD;
}
SECTIONS
{
. = vma_start;
.text : AT (ADDR(.text) - offset) {
/* begin of program image (link address) */
_prog_img_beg = .;
*(.text.crt0)
*(.init)
*(.text .text.* .gnu.linkonce.t.*)
*(.fini)
*(.rodata .rodata.* .gnu.linkonce.r.*)
. = ALIGN(0x08);
_ctors_start = .;
KEEP (*(.ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.init_array)) /* list of constructors specific for ARM eabi */
_ctors_end = .;
_dtors_start = .;
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
_dtors_end = .;
} : ro = 0x90909090
/* Linux: exception section for uaccess mechanism */
__ex_table : { *(__ex_table) }
.eh_frame_hdr : { *(.eh_frame_hdr) }
. = ALIGN(0x1000);
_prog_img_data = .;
.data : AT (ADDR(.data) - offset) {
/*
* Leave space for parent capability parameters at start of data
* section. The protection domain creator is reponsible for storing
* sane values here.
*/
_parent_cap = .;
LONG(0xffffffff);
LONG(0xffffffff);
_vma_start = .;
LONG(vma_start);
_lma_start = .;
LONG(lma_start);
*(.data .data.* .gnu.linkonce.d.*)
} : rw
/* exception frames for C++ */
.eh_frame : {
__eh_frame_start__ = .;
KEEP (*(.eh_frame))
LONG(0)
} : rw
.init_array : {
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
}
.gcc_except_table : { KEEP(*(.gcc_except_table)) }
.dynamic : { *(.dynamic) }
/* .ARM.exidx is sorted, so has to go in its own output section */
__exidx_start = .;
.ARM.exidx : {
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
}
__exidx_end = .;
.ARM.extab : {
*(.ARM.extab*)
} : rw
. = ALIGN(4);
.bss : AT (ADDR(.bss) - offset) {
*(.bss .bss.* .gnu.linkonce.b.* COMMON)
}
/* end of program image -- must be after last section */
_prog_img_end = .;
/DISCARD/ : {
*(.note)
*(.note.ABI-tag)
*(.comment)
}
}

View File

@@ -1,57 +0,0 @@
#
# \brief Download, and unpack Fiasco and addtional needed tools (sigma0, bootstrap)
# \author Stefan Kalkowski
# \date 2011-07-18
#
VERBOSE ?= @
ECHO = @echo
DOWNLOAD_DIR = download
CONTRIB_DIR = contrib
FIASCO_ARCHIVE = 3rd_fiasco.tar.bz2
FIASCO_URI = http://downloads.sourceforge.net/project/genode/3rd/$(FIASCO_ARCHIVE)
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,wget)
$(call check_tool,patch)
$(call check_tool,tar)
$(call check_tool,byacc)
#
# Print help information by default
#
help:
$(ECHO)
$(ECHO) "Prepare the Fiasco base repository"
$(ECHO)
$(ECHO) "--- available commands ---"
$(ECHO) "prepare - download and extract the Fiasco source code"
$(ECHO) "clean - clean everything except downloaded archives"
$(ECHO) "cleanall - clean everything including downloaded archives"
$(ECHO)
$(DOWNLOAD_DIR)/$(FIASCO_ARCHIVE):
$(ECHO) "downloading source code to '$(DOWNLOAD_DIR)/'"
$(VERBOSE)mkdir -p $(DOWNLOAD_DIR)
$(VERBOSE)wget -c $(FIASCO_URI) -O $@
$(CONTRIB_DIR): $(DOWNLOAD_DIR)/$(FIASCO_ARCHIVE)
$(ECHO) "unpacking source code to '$(CONTRIB_DIR)/'"
$(VERBOSE)tar xjf $<
$(VERBOSE)mv 3rd $@
$(ECHO) "applying patches to '$@/'"
$(VERBOSE)for i in $(PATCHES); do patch -d $@ -p0 < $$i; done
$(VERBOSE)touch $@
prepare: $(CONTRIB_DIR)
clean:
$(VERBOSE)rm -rf $(CONTRIB_DIR)
cleanall: clean
$(VERBOSE)rm -rf $(DOWNLOAD_DIR)

View File

@@ -1,57 +0,0 @@
/*
* \brief Basic locking primitive
* \author Norman Feske
* \date 2006-07-26
*/
/*
* Copyright (C) 2006-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__CANCELABLE_LOCK_H_
#define _INCLUDE__BASE__CANCELABLE_LOCK_H_
#include <base/lock_guard.h>
#include <base/native_types.h>
#include <base/blocking.h>
namespace Genode {
class Cancelable_lock
{
private:
int volatile _lock;
public:
enum State { LOCKED, UNLOCKED };
/**
* Constructor
*/
Cancelable_lock(State initial = UNLOCKED);
/**
* Try to aquire lock an block while lock is not free
*
* This function may throw a Genode::Blocking_canceled exception.
*/
void lock();
/**
* Release lock
*/
void unlock();
/**
* Lock guard
*/
typedef Genode::Lock_guard<Cancelable_lock> Guard;
};
}
#endif /* _INCLUDE__BASE__CANCELABLE_LOCK_H_ */

View File

@@ -1,174 +0,0 @@
/*
* \brief Fiasco pager support
* \author Christian Helmuth
* \date 2006-06-14
*/
/*
* Copyright (C) 2006-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_
/* Genode includes */
#include <base/ipc.h>
#include <base/stdint.h>
#include <base/native_types.h>
#include <fiasco/thread_helper.h>
#include <util/touch.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
namespace Genode {
class Mapping
{
private:
addr_t _dst_addr;
Fiasco::l4_fpage_t _fpage;
public:
/**
* Constructor
*/
Mapping(addr_t dst_addr, addr_t src_addr,
bool write_combined, bool io_mem,
unsigned l2size = L4_LOG2_PAGESIZE,
bool rw = true, bool grant = false)
:
_dst_addr(dst_addr),
_fpage(Fiasco::l4_fpage(src_addr, l2size, rw, grant))
{
if (write_combined)
_fpage.fp.cache = Fiasco::L4_FPAGE_BUFFERABLE;
}
/**
* Construct invalid flexpage
*/
Mapping() : _dst_addr(0), _fpage(Fiasco::l4_fpage(0, 0, 0, 0)) { }
Fiasco::l4_umword_t dst_addr() const { return _dst_addr; }
Fiasco::l4_fpage_t fpage() const { return _fpage; }
/**
* Prepare map operation
*
* On Fiasco, we need to map a page locally to be able to map it to
* another address space.
*/
void prepare_map_operation()
{
addr_t core_local_addr = _fpage.fp.page << 12;
size_t mapping_size = 1 << _fpage.fp.size;
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
if (_fpage.fp.write)
touch_read_write((unsigned char volatile *)(core_local_addr + i));
else
touch_read((unsigned char const volatile *)(core_local_addr + i));
}
}
};
/**
* Special paging server class
*/
class Ipc_pager : public Native_capability
{
private:
Native_thread_id _last; /* origin of last fault message */
addr_t _pf_addr; /* page-fault address */
addr_t _pf_ip; /* instruction pointer of faulter */
Mapping _reply_mapping; /* page-fault answer */
public:
/**
* Constructor
*/
Ipc_pager();
/**
* Wait for a new page fault received as short message IPC
*/
void wait_for_fault();
/**
* Reply current page-fault and wait for a new one
*
* Send short flex page and wait for next short-message (register)
* IPC -- pagefault
*/
void reply_and_wait_for_fault();
/**
* Request instruction pointer of current page fault
*/
addr_t fault_ip() { return _pf_ip; }
/**
* Request fault address of current page fault
*/
addr_t fault_addr() { return _pf_addr & ~3; }
/**
* Set parameters for next reply
*/
void set_reply_mapping(Mapping m) { _reply_mapping = m; }
/**
* Set destination for next reply
*/
void set_reply_dst(Native_capability pager_object) {
_last.raw = pager_object.local_name(); }
/**
* Answer call without sending a flex-page mapping
*
* This function is used to acknowledge local calls from one of
* core's region-manager sessions.
*/
void acknowledge_wakeup();
/**
* Return thread ID of last faulter
*/
Native_thread_id last() const { return _last; }
/**
* Return badge for faulting thread
*
* As Fiasco has no server-defined badges for page-fault messages, we
* interpret the sender ID as badge.
*/
unsigned long badge() const {
return convert_native_thread_id_to_badge(_last); }
bool is_write_fault() const { return (_pf_addr & 2); }
/**
* 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_ */

View File

@@ -1,31 +0,0 @@
#
# \brief Portions of base library shared by core and non-core processes
# \author Norman Feske
# \date 2013-02-14
#
LIBS += cxx startup
SRC_CC += cap_copy.cc
SRC_CC += ipc/ipc.cc ipc/pager.cc ipc/ipc_marshal_cap.cc
SRC_CC += pager/pager.cc pager/common.cc
SRC_CC += avl_tree/avl_tree.cc
SRC_CC += allocator/slab.cc
SRC_CC += allocator/allocator_avl.cc
SRC_CC += heap/heap.cc heap/sliced_heap.cc
SRC_CC += console/console.cc
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 += server/server.cc server/common.cc
SRC_CC += thread/thread.cc thread/thread_bootstrap.cc thread/trace.cc
SRC_CC += thread/context_allocator.cc
INC_DIR += $(REP_DIR)/src/base/lock
INC_DIR += $(BASE_DIR)/src/base/thread
vpath cap_copy.cc $(BASE_DIR)/src/platform
vpath %.cc $(REP_DIR)/src/base
vpath %.cc $(BASE_DIR)/src/base

View File

@@ -1,16 +0,0 @@
#
# \brief Portions of base library that are exclusive to non-core processes
# \author Norman Feske
# \date 2013-02-14
#
LIBS += base-common
SRC_CC += console/log_console.cc
SRC_CC += env/env.cc env/context_area.cc env/reinitialize.cc
SRC_CC += thread/thread_start.cc
INC_DIR += $(BASE_DIR)/src/base/env
vpath %.cc $(REP_DIR)/src/base
vpath %.cc $(BASE_DIR)/src/base

View File

@@ -1,15 +0,0 @@
--- fiasco/snapshot/kernel/fiasco/src/kern/kernel_uart.cpp 2008-07-30 13:19:01.000000000 +0200
+++ fiasco/snapshot/kernel/fiasco/src/kern/kernel_uart.cpp 2013-06-10 14:21:54.183996620 +0200
@@ -72,6 +72,12 @@
if ( (s = strstr(cmdline, " -comport "))
||(s = strstr(cmdline, " -comport=")))
p = strtoul(s + 10, 0, 0);
+ else
+ {
+ unsigned short bda_comports = (*((unsigned short *)0x410) >> 9) & 0x7;
+ if (bda_comports)
+ p = *((unsigned short *)0x400);
+ }
if ((s = strstr(cmdline, " -comirq=")))
i = strtoul(s + 9, 0, 0);

View File

@@ -1,199 +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 /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
#
# 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

@@ -1,50 +0,0 @@
/*
* \brief Lock implementation
* \author Norman Feske
* \date 2007-10-15
*/
/*
* Copyright (C) 2007-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.
*/
/* Genode includes */
#include <base/cancelable_lock.h>
#include <cpu/atomic.h>
#include <base/printf.h>
/* L4/Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
}
using namespace Genode;
Cancelable_lock::Cancelable_lock(Cancelable_lock::State initial)
: _lock(UNLOCKED)
{
if (initial == LOCKED)
lock();
}
void Cancelable_lock::lock()
{
/*
* XXX: How to notice cancel-blocking signals issued when being outside the
* 'l4_ipc_sleep' system call?
*/
while (!Genode::cmpxchg(&_lock, UNLOCKED, LOCKED))
if (Fiasco::l4_ipc_sleep(Fiasco::l4_ipc_timeout(0, 0, 500, 0)) != L4_IPC_RETIMEOUT)
throw Genode::Blocking_canceled();
}
void Cancelable_lock::unlock()
{
_lock = UNLOCKED;
}

View File

@@ -1,41 +0,0 @@
/*
* \brief Platform specific thread initialization
* \author Martin Stein
* \date 2014-01-06
*/
/*
* Copyright (C) 2014 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.
*/
/* Genode includes */
#include <base/thread.h>
#include <base/env.h>
using namespace Genode;
/*****************************
** Startup library support **
*****************************/
void prepare_init_main_thread() { }
void prepare_reinit_main_thread() { }
/*****************
** Thread_base **
*****************/
void Thread_base::_thread_bootstrap() { }
void Thread_base::_init_platform_thread(Type type)
{
if (type == NORMAL) { return; }
_thread_cap = Genode::env()->parent()->main_thread_cap();
}

View File

@@ -1,28 +0,0 @@
/*
* \brief Platform-specific parts of cores CPU-service
* \author Martin Stein
* \date 2012-04-17
*/
/*
* 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.
*/
/* Genode includes */
#include <base/printf.h>
/* Core includes */
#include <cpu_session_component.h>
using namespace Genode;
Ram_dataspace_capability Cpu_session_component::utcb(Thread_capability thread_cap)
{
PERR("%s: Not implemented", __PRETTY_FUNCTION__);
return Ram_dataspace_capability();
}

View File

@@ -1,158 +0,0 @@
/*
* \brief Fiasco platform
* \author Christian Helmuth
* \author Norman Feske
* \date 2007-09-10
*/
/*
* Copyright (C) 2007-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__PLATFORM_H_
#define _CORE__INCLUDE__PLATFORM_H_
#include <base/sync_allocator.h>
#include <base/allocator_avl.h>
#include "platform_generic.h"
#include "platform_thread.h"
#include "platform_pd.h"
#include "multiboot.h"
namespace Genode {
class Platform : public Platform_generic
{
private:
/*
* Shortcut for the type of allocator instances for physical resources
*/
typedef Synchronized_range_allocator<Allocator_avl> Phys_allocator;
char _core_label[1]; /* to satisfy _core_pd */
Platform_pd *_core_pd; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Phys_allocator _region_alloc; /* virtual memory allocator for core */
Multiboot_info _mb_info; /* multiboot information */
Rom_fs _rom_fs; /* ROM file system */
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
addr_t _vm_start; /* begin of virtual memory */
size_t _vm_size; /* size of virtual memory */
/*
* We do not export any boot module loaded before FIRST_ROM.
*/
enum { FIRST_ROM = 3 };
/**
* Setup base resources
*
* - Map and provide KIP as ROM module
* - Initializes region allocator
* - Initializes multiboot info structure
*/
void _setup_basics();
/**
* Setup RAM, IO_MEM, and region allocators
*/
void _setup_mem_alloc();
/**
* Setup I/O port space allocator
*/
void _setup_io_port_alloc();
/**
* Setup IRQ allocator
*/
void _setup_irq_alloc();
/**
* Parse multi-boot information and update ROM database
*/
void _setup_rom();
/**
* Setup pager for core-internal threads
*/
void _setup_core_pager();
public:
/**
* Pager object representing the pager of core namely sigma0
*/
struct Sigma0 : public Pager_object
{
/**
* Constructor
*/
Sigma0();
int pager(Ipc_pager &ps) { /* never called */ return -1; }
};
/**
* Return singleton instance of Sigma0 pager object
*/
static Sigma0 *sigma0();
/**
* Core pager thread that handles core-internal page-faults
*/
struct Core_pager : public Platform_thread, public Pager_object
{
/**
* Constructor
*/
Core_pager(Platform_pd *core_pd);
int pager(Ipc_pager &ps) { /* never called */ return -1; }
};
/**
* Return singleton instance of core pager object
*/
Core_pager *core_pager();
/**
* Constructor
*/
Platform();
/**
* Accessor for core pd object
*/
Platform_pd *core_pd() { return _core_pd; }
/********************************
** Generic platform interface **
********************************/
Allocator *core_mem_alloc() { return &_ram_alloc; }
Range_allocator *ram_alloc() { return &_ram_alloc; }
Range_allocator *io_mem_alloc() { return &_io_mem_alloc; }
Range_allocator *io_port_alloc() { return &_io_port_alloc; }
Range_allocator *irq_alloc() { return &_irq_alloc; }
Range_allocator *region_alloc() { return &_region_alloc; }
addr_t vm_start() const { return _vm_start; }
size_t vm_size() const { return _vm_size; }
Rom_fs *rom_fs() { return &_rom_fs; }
void wait_for_exit();
};
}
#endif /* _CORE__INCLUDE__PLATFORM_H_ */

View File

@@ -1,195 +0,0 @@
/*
* \brief L4/Fiasco protection domain facility
* \author Christian Helmuth
* \date 2006-04-11
*
* Protection domains are L4 tasks under Fiasco and serve as base
* container for the platform.
*/
/*
* Copyright (C) 2006-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__PLATFORM_PD_H_
#define _CORE__INCLUDE__PLATFORM_PD_H_
#include <platform_thread.h>
#include <address_space.h>
namespace Fiasco {
#include <l4/sys/types.h>
}
namespace Genode {
class Platform_thread;
class Platform_pd : public Address_space
{
private:
enum {
VERSION_BITS = 10,
PD_FIRST = 0x10,
PD_MAX = (1 << 11) - 1, /* leave 0x7ff free for L4_INVALID_ID */
PD_VERSION_MAX = (1 << 10) - 1,
PD_INVALID = -1,
THREAD_MAX = (1 << 7),
};
unsigned _pd_id; /* plain pd number */
unsigned _version; /* version number */
Fiasco::l4_taskid_t _l4_task_id; /* L4 task ID */
/**********************************************
** Threads of this protection domain object **
**********************************************/
Platform_thread *_threads[THREAD_MAX];
/**
* Initialize thread allocator
*/
void _init_threads();
/**
* Thread iteration for one task
*/
Platform_thread *_next_thread();
/**
* Thread allocation
*
* Again a special case for Core thread0.
*/
int _alloc_thread(int thread_id, Platform_thread *thread);
/**
* Thread deallocation
*
* No special case for Core thread0 here - we just never call it.
*/
void _free_thread(int thread_id);
/******************
** PD allocator **
******************/
struct Pd_alloc
{
unsigned reserved : 1;
unsigned free : 1;
unsigned version : VERSION_BITS;
Pd_alloc(bool r, bool f, unsigned v)
: reserved(r), free(f), version(v) { }
Pd_alloc() : reserved(0), free(0), version(0) { }
};
static Pd_alloc *_pds()
{
static Pd_alloc static_pds[PD_MAX];
return static_pds;
}
/**
* Protection-domain creation
*
* The syscall parameter propagates if any L4 kernel function
* should be used. We need the special case for the Core startup.
*/
void _create_pd(bool syscall);
/**
* Protection domain destruction
*
* No special case for Core here - we just never call it.
*/
void _destroy_pd();
/**
* Protection domain allocation
*
* Find free L4 task and use it. We need the special case for Core
* startup.
*/
int _alloc_pd(signed pd_id);
/**
* Protection domain deallocation
*
* No special case for Core here - we just never call it.
*/
void _free_pd();
/***************
** Debugging **
***************/
void _debug_log_pds(void);
void _debug_log_threads(void);
public:
/**
* Constructor
*/
Platform_pd(char const *, signed pd_id = PD_INVALID,
bool create = true);
/**
* Destructor
*/
~Platform_pd();
/**
* Initialize L4 task facility
*/
static void init();
/**
* Bind thread to protection domain
*
* \return 0 on success or
* -1 if thread ID allocation failed.
*
* This function allocates the physical L4 thread ID.
*/
int bind_thread(Platform_thread *thread);
/**
* Unbind thread from protection domain
*
* Free the thread's slot and update thread object.
*/
void unbind_thread(Platform_thread *thread);
/**
* Assign parent interface to protection domain
*/
int assign_parent(Native_capability parent) { return 0; }
int pd_id() const { return _pd_id; }
/*****************************
** Address-space interface **
*****************************/
/*
* On L4/Fiasco, we don't use directed unmap but rely on the
* in-kernel mapping database. See 'rm_session_support.cc'.
*/
void flush(addr_t, size_t) { PDBG("not implemented"); }
};
}
#endif /* _CORE__INCLUDE__PLATFORM_PD_H_ */

View File

@@ -1,164 +0,0 @@
/*
* \brief Fiasco thread facility
* \author Christian Helmuth
* \date 2006-04-11
*/
/*
* Copyright (C) 2006-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__PLATFORM_THREAD_H_
#define _CORE__INCLUDE__PLATFORM_THREAD_H_
/* Genode includes */
#include <base/native_types.h>
#include <base/thread_state.h>
#include <base/pager.h>
/* core includes */
#include <platform_pd.h>
#include <address_space.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
namespace Genode {
class Platform_pd;
class Platform_thread
{
private:
int _thread_id; /* plain thread number */
Native_thread_id _l4_thread_id; /* L4 thread ID */
char _name[32]; /* thread name that will be
registered at the kernel
debugger */
Platform_pd *_platform_pd; /* protection domain thread
is bound to */
Pager_object *_pager;
public:
enum {
THREAD_INVALID = -1, /* invalid thread number */
};
/**
* Constructor
*/
Platform_thread(const char *name = 0, unsigned priority = 0,
addr_t utcb = 0, int thread_id = THREAD_INVALID);
/**
* Destructor
*/
~Platform_thread();
/**
* Start thread
*
* \param ip instruction pointer to start at
* \param sp stack pointer to use
*
* \retval 0 successful
* \retval -1 thread could not be started
*/
int start(void *ip, void *sp);
/**
* Pause this thread
*/
void pause();
/**
* Resume this thread
*/
void resume();
/**
* Cancel currently blocking operation
*/
void cancel_blocking();
/**
* This thread is about to be bound
*
* \param thread_id local thread ID
* \param l4_thread_id final L4 thread ID
* \param pd platform pd, thread is bound to
*/
void bind(int thread_id, Native_thread_id l4_thread_id,
Platform_pd *pd);
/**
* Unbind this thread
*/
void unbind();
/**
* Override thread state with 's'
*
* \throw Cpu_session::State_access_failed
*/
void state(Thread_state s);
/**
* Read thread state
*
* \throw Cpu_session::State_access_failed
*/
Thread_state state();
/**
* Set the executing CPU for this thread
*
* SMP is not supported on L4/Fiasco.
*/
void affinity(Affinity::Location) { }
/**
* Request the affinity of this thread
*/
Affinity::Location affinity() { return Affinity::Location(); }
/**
* Return the address space to which the thread is bound
*/
Weak_ptr<Address_space> address_space();
/************************
** Accessor functions **
************************/
/**
* Return/set pager
*/
Pager_object *pager() const { return _pager; }
void pager(Pager_object *pager) { _pager = pager; }
/**
* Return identification of thread when faulting
*/
unsigned long pager_object_badge() const {
return convert_native_thread_id_to_badge(_l4_thread_id); }
/*******************************
** Fiasco-specific Accessors **
*******************************/
int thread_id() const { return _thread_id; }
Native_thread_id native_thread_id() const { return _l4_thread_id; }
const char *name() const { return _name; }
};
}
#endif /* _CORE__INCLUDE__PLATFORM_THREAD_H_ */

View File

@@ -1,121 +0,0 @@
/*
* \brief Fiasco utilities
* \author Christian Helmuth
* \date 2006-04-11
*
* Is very practical now, but please keep the errors of the l4util pkg in mind.
*/
/*
* Copyright (C) 2006-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__UTIL_H_
#define _CORE__INCLUDE__UTIL_H_
/* Genode includes */
#include <base/stdint.h>
#include <base/printf.h>
#include <rm_session/rm_session.h>
#include <util/touch.h>
#include <fiasco/thread_helper.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/ipc.h>
#include <l4/sys/kdebug.h>
#include <l4/sys/ktrace.h>
}
namespace Genode {
inline void log_event(const char *s)
{
Fiasco::fiasco_tbuf_log(s);
}
inline void log_event(const char *s, unsigned v1, unsigned v2, unsigned v3)
{
Fiasco::fiasco_tbuf_log_3val(s, v1, v2, v3);
}
inline void panic(const char *s)
{
using namespace Fiasco;
outstring(s);
enter_kdebug("> panic <");
}
inline void touch_ro(const void *addr, unsigned size)
{
using namespace Fiasco;
unsigned char const volatile *bptr;
unsigned char const *eptr;
bptr = (unsigned char const volatile *)(((unsigned)addr) & L4_PAGEMASK);
eptr = (unsigned char const *)(((unsigned)addr + size - 1) & L4_PAGEMASK);
for ( ; bptr <= eptr; bptr += L4_PAGESIZE)
touch_read(bptr);
}
inline void touch_rw(const void *addr, unsigned size)
{
using namespace Fiasco;
unsigned char volatile *bptr;
unsigned char const *eptr;
bptr = (unsigned char volatile *)(((unsigned)addr) & L4_PAGEMASK);
eptr = (unsigned char const *)(((unsigned)addr + size - 1) & L4_PAGEMASK);
for (; bptr <= eptr; bptr += L4_PAGESIZE)
touch_read_write(bptr);
}
inline addr_t trunc_page(addr_t addr)
{
using namespace Fiasco;
return l4_trunc_page(addr);
}
inline addr_t round_page(addr_t addr)
{
using namespace Fiasco;
return l4_round_page(addr);
}
inline addr_t round_superpage(addr_t addr)
{
using namespace Fiasco;
return l4_round_superpage(addr);
}
inline size_t get_page_size() { return L4_PAGESIZE; }
inline size_t get_page_size_log2() { return L4_LOG2_PAGESIZE; }
inline size_t get_super_page_size() { return L4_SUPERPAGESIZE; }
inline size_t get_super_page_size_log2() { return L4_LOG2_SUPERPAGESIZE; }
inline void print_page_fault(const char *msg, addr_t pf_addr, addr_t pf_ip,
Rm_session::Fault_type pf_type,
unsigned long badge)
{
Native_thread_id tid;
tid.raw = badge;
printf("%s (%s pf_addr=%p pf_ip=%p from %x.%02x)\n", msg,
pf_type == Rm_session::WRITE_FAULT ? "WRITE" : "READ",
(void *)pf_addr, (void *)pf_ip,
(int)tid.id.task, (int)tid.id.lthread);
}
inline addr_t map_src_addr(addr_t core_local_addr, addr_t phys_addr) {
return core_local_addr; }
inline size_t constrain_map_size_log2(size_t size_log2) { return size_log2; }
}
#endif /* _CORE__INCLUDE__UTIL_H_ */

View File

@@ -1,122 +0,0 @@
/*
* \brief Core implementation of IRQ sessions
* \author Christian Helmuth
* \date 2007-09-13
*
* FIXME ram quota missing
*/
/*
* Copyright (C) 2007-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.
*/
/* Genode includes */
#include <base/printf.h>
#include <util/arg_string.h>
/* core includes */
#include <irq_root.h>
#include <util.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/types.h>
}
using namespace Genode;
bool Irq_session_component::Irq_control_component::associate_to_irq(unsigned irq_number)
{
using namespace Fiasco;
int err;
l4_threadid_t irq_tid;
l4_umword_t dw0, dw1;
l4_msgdope_t result;
l4_make_taskid_from_irq(irq_number, &irq_tid);
/* boost thread to IRQ priority */
enum { IRQ_PRIORITY = 0xC0 };
l4_sched_param_t param = {sp:{prio:IRQ_PRIORITY, small:0, state:0, time_exp:0, time_man:0}};
l4_threadid_t ext_preempter = L4_INVALID_ID;
l4_threadid_t partner = L4_INVALID_ID;
l4_sched_param_t old_param;
l4_thread_schedule(l4_myself(), param, &ext_preempter, &partner, &old_param);
err = l4_ipc_receive(irq_tid,
L4_IPC_SHORT_MSG, &dw0, &dw1,
L4_IPC_BOTH_TIMEOUT_0, &result);
if (err != L4_IPC_RETIMEOUT) PERR("IRQ association failed");
return (err == L4_IPC_RETIMEOUT);
}
void Irq_session_component::wait_for_irq()
{
using namespace Fiasco;
l4_threadid_t irq_tid;
l4_umword_t dw0=0, dw1=0;
l4_msgdope_t result;
l4_make_taskid_from_irq(_irq_number, &irq_tid);
do {
l4_ipc_call(irq_tid,
L4_IPC_SHORT_MSG, 0, 0,
L4_IPC_SHORT_MSG, &dw0, &dw1,
L4_IPC_NEVER, &result);
if (L4_IPC_IS_ERROR(result)) PERR("Ipc error %lx", L4_IPC_ERROR(result));
} while (L4_IPC_IS_ERROR(result));
}
Irq_session_component::Irq_session_component(Cap_session *cap_session,
Range_allocator *irq_alloc,
const char *args)
:
_irq_alloc(irq_alloc),
_ep(cap_session, STACK_SIZE, "irqctrl"),
_control_cap(_ep.manage(&_control_component)),
_control_client(_control_cap)
{
bool shared = Arg_string::find_arg(args, "irq_shared").bool_value(false);
if (shared) {
PWRN("IRQ sharing not supported");
throw Root::Invalid_args();
}
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_session_component::~Irq_session_component()
{
PERR("Implement me, immediately!");
}

View File

@@ -1,521 +0,0 @@
/*
* \brief Fiasco platform interface implementation
* \author Christian Helmuth
* \date 2006-04-11
*/
/*
* Copyright (C) 2006-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.
*/
/* Genode includes */
#include <base/printf.h>
#include <base/allocator_avl.h>
#include <base/crt0.h>
#include <base/sleep.h>
#include <util/misc_math.h>
#include <fiasco/thread_helper.h>
/* core includes */
#include <core_parent.h>
#include <platform.h>
#include <platform_thread.h>
#include <platform_pd.h>
#include <util.h>
#include <multiboot.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/ipc.h>
#include <l4/sys/kernel.h>
#include <l4/sys/kip.h>
#include <l4/sigma0/sigma0.h>
}
using namespace Genode;
static const bool verbose = true;
static const bool verbose_core_pf = false;
static const bool verbose_region_alloc = false;
/***********************************
** Core address space management **
***********************************/
static Synchronized_range_allocator<Allocator_avl> &_core_address_ranges()
{
static Synchronized_range_allocator<Allocator_avl> _core_address_ranges(0);
return _core_address_ranges;
}
enum { PAGER_STACK_ELEMENTS = 1024 };
static unsigned long _core_pager_stack[PAGER_STACK_ELEMENTS];
static unsigned _core_pager_arg;
/**
* Core pager "service loop"
*/
static void _core_pager_loop()
{
unsigned pd_id = _core_pager_arg;
using namespace Fiasco;
l4_threadid_t t;
l4_umword_t dw0, dw1;
l4_msgdope_t r;
bool send_reply = false;
while (1) {
if (send_reply)
/* unblock faulter and wait for next pagefault */
l4_ipc_reply_and_wait(t, L4_IPC_SHORT_MSG, 0, 0,
&t, L4_IPC_SHORT_MSG, &dw0, &dw1,
L4_IPC_NEVER, &r);
else
l4_ipc_wait(&t, L4_IPC_SHORT_MSG, &dw0, &dw1, L4_IPC_NEVER, &r);
/* ignore messages from non-core pds */
if (t.id.task != pd_id) break;
/* detect local map request */
if (dw1 == 0) {
l4_msgdope_t ipc_result;
l4_ipc_send(t, L4_IPC_SHORT_FPAGE, 0, dw0,
L4_IPC_SEND_TIMEOUT_0, &ipc_result);
send_reply = false;
continue;
}
bool rw = dw0 & 2;
addr_t pfa = dw0 & ~2;
if (pfa < L4_PAGESIZE) {
/* NULL pointer access */
PERR("Possible null pointer %s in %x.%02x at %lx IP %lx",
rw ? "WRITE" : "READ", (int)t.id.task, (int)t.id.lthread, pfa, dw1);
/* do not unblock faulter */
send_reply = false;
continue;
} else if (!_core_address_ranges().valid_addr(pfa)) {
/* page-fault address is not in RAM */
PERR("%s access outside of RAM in %x.%02x at %lx IP %lx",
rw ? "WRITE" : "READ", (int)t.id.task, (int)t.id.lthread, pfa, dw1);
/* do not unblock faulter */
send_reply = false;
continue;
} else if (verbose_core_pf)
PDBG("pfa=%lx ip=%lx thread %x.%02x", pfa, dw1, (int)t.id.task, (int)t.id.lthread);
/* my pf handler is sigma0 - just touch the appropriate page */
if (rw)
touch_rw((void *)pfa, 1);
else
touch_ro((void *)pfa, 1);
send_reply = true;
}
}
Platform::Sigma0::Sigma0() : Pager_object(0, Affinity::Location())
{
cap(reinterpret_cap_cast<Cpu_thread>(Native_capability(Fiasco::sigma0_threadid, 0)));
}
Platform::Sigma0 *Platform::sigma0()
{
static Sigma0 _sigma0;
return &_sigma0;
}
Platform::Core_pager::Core_pager(Platform_pd *core_pd)
:
Platform_thread("core.pager"), Pager_object(0, Affinity::Location())
{
Platform_thread::pager(sigma0());
core_pd->bind_thread(this);
cap(Native_capability(native_thread_id(), 0));
/* pager needs to know core's pd ID */
_core_pager_arg = core_pd->pd_id();
/* stack begins at the top end of the '_core_pager_stack' array */
void *sp = (void *)&_core_pager_stack[PAGER_STACK_ELEMENTS - 1];
start((void *)_core_pager_loop, sp);
using namespace Fiasco;
/* pager0 receives pagefaults from me - for NULL pointer detection */
l4_umword_t d;
l4_threadid_t preempter = L4_INVALID_ID;
l4_threadid_t pager = native_thread_id();
l4_thread_ex_regs(l4_myself(), ~0UL, ~0UL, &preempter, &pager, &d, &d, &d);
}
Platform::Core_pager *Platform::core_pager()
{
static Core_pager _core_pager(core_pd());
return &_core_pager;
}
/***********************************
** Helper for L4 region handling **
***********************************/
struct Region
{
addr_t start;
addr_t end;
Region() : start(0), end(0) { }
Region(addr_t s, addr_t e) : start(s), end(e) { }
/**
* Returns true if the specified range intersects with the region
*/
bool intersects(addr_t base, size_t size) const
{
return (((base + size) > start) && (base < end));
}
};
/**
* Log region
*/
static inline void print_region(Region r)
{
printf("[%08lx,%08lx) %08lx", r.start, r.end, r.end - r.start);
}
/**
* Add region to allocator
*/
static inline void add_region(Region r, Range_allocator &alloc)
{
if (verbose_region_alloc) {
printf("%p add: ", &alloc); print_region(r); printf("\n");
}
/* adjust region */
addr_t start = trunc_page(r.start);
addr_t end = round_page(r.end);
alloc.add_range(start, end - start);
}
/**
* Remove region from allocator
*/
static inline void remove_region(Region r, Range_allocator &alloc)
{
if (verbose_region_alloc) {
printf("%p remove: ", &alloc); print_region(r); printf("\n");
}
/* adjust region */
addr_t start = trunc_page(r.start);
addr_t end = round_page(r.end);
alloc.remove_range(start, end - start);
}
/**
* Request any RAM page from Sigma0
*/
static inline int sigma0_req_region(addr_t *addr, unsigned log2size)
{
using namespace Fiasco;
/* XXX sigma0 always maps pages RW */
l4_umword_t req_fpage = l4_fpage(0, log2size, 0, 0).fpage;
void* rcv_window = L4_IPC_MAPMSG(0, L4_WHOLE_ADDRESS_SPACE);
addr_t base;
l4_fpage_t rcv_fpage;
l4_msgdope_t result;
l4_msgtag_t tag;
int err = l4_ipc_call_tag(Fiasco::sigma0_threadid,
L4_IPC_SHORT_MSG, SIGMA0_REQ_FPAGE_ANY, req_fpage,
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
rcv_window, &base, (l4_umword_t *)&rcv_fpage,
L4_IPC_NEVER, &result, &tag);
int ret = (err || !l4_ipc_fpage_received(result));
if (!ret) touch_rw((void *)addr, 1);
*addr = base;
return ret;
}
void Platform::_setup_mem_alloc()
{
/*
* Completely map program image by touching all pages read-only to
* prevent sigma0 from handing out those page as anonymous memory.
*/
volatile const char *beg, *end;
beg = (const char *)(((unsigned)&_prog_img_beg) & L4_PAGEMASK);
end = (const char *)&_prog_img_end;
for ( ; beg < end; beg += L4_PAGESIZE) (void)(*beg);
/* request pages of known page size starting with largest */
size_t log2_sizes[] = { L4_LOG2_SUPERPAGESIZE, L4_LOG2_PAGESIZE };
for (unsigned i = 0; i < sizeof(log2_sizes)/sizeof(*log2_sizes); ++i) {
size_t log2_size = log2_sizes[i];
size_t size = 1 << log2_size;
int err = 0;
addr_t addr;
Region region;
/* request any page of current size from sigma0 */
do {
err = sigma0_req_region(&addr, log2_size);
if (!err) {
/* XXX do not allocate page0 */
if (addr == 0) {
Fiasco::l4_fpage_unmap(Fiasco::l4_fpage(0, log2_size, 0, 0),
L4_FP_FLUSH_PAGE | L4_FP_ALL_SPACES);
continue;
}
region.start = addr; region.end = addr + size;
if (!region.intersects(Native_config::context_area_virtual_base(),
Native_config::context_area_virtual_size())) {
add_region(region, _ram_alloc);
add_region(region, _core_address_ranges());
}
remove_region(region, _io_mem_alloc);
remove_region(region, _region_alloc);
}
} while (!err);
}
}
void Platform::_setup_irq_alloc() {
_irq_alloc.add_range(0, 0x10); }
void Platform::_setup_basics()
{
using namespace Fiasco;
int err;
/* region allocator is not setup yet */
/* map KIP one-to-one */
void *fpage = L4_IPC_MAPMSG(0, L4_WHOLE_ADDRESS_SPACE);
l4_umword_t dw0, dw1;
l4_msgdope_t r;
l4_msgtag_t tag;
err = l4_ipc_call_tag(Fiasco::sigma0_threadid,
L4_IPC_SHORT_MSG, SIGMA0_REQ_KIP, 0,
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
fpage, &dw0, &dw1,
L4_IPC_NEVER, &r, &tag);
bool amok = false;
if (err) {
printf("IPC error %d\n", err);
amok = true;
}
if (!l4_ipc_fpage_received(r)) {
printf("No fpage received\n");
amok = true;
}
if (amok)
panic("kip mapping failed");
/* store mapping base from received mapping */
l4_kernel_info_t *kip = (l4_kernel_info_t *)dw0;
if (kip->magic != L4_KERNEL_INFO_MAGIC)
panic("Sigma0 mapped something but not the KIP");
if (verbose) {
printf("\n");
printf("KIP @ %p\n", kip);
printf(" magic: %08x\n", kip->magic);
printf(" version: %08x\n", kip->version);
printf(" sigma0 "); printf(" esp: %08lx eip: %08lx\n", kip->sigma0_esp, kip->sigma0_eip);
printf(" sigma1 "); printf(" esp: %08lx eip: %08lx\n", kip->sigma1_esp, kip->sigma1_eip);
printf(" root "); printf(" esp: %08lx eip: %08lx\n", kip->root_esp, kip->root_eip);
}
/* add KIP as ROM module */
_kip_rom = Rom_module((addr_t)kip, L4_PAGESIZE, "l4v2_kip");
_rom_fs.insert(&_kip_rom);
/* update multi-boot info pointer from KIP */
void *mb_info_ptr = (void *)kip->user_ptr;
_mb_info = Multiboot_info(mb_info_ptr);
if (verbose) printf("MBI @ %p\n", mb_info_ptr);
/* parse memory descriptors - look for virtual memory configuration */
/* XXX we support only one VM region (here and also inside RM) */
using L4::Kip::Mem_desc;
_vm_start = 0; _vm_size = 0;
Mem_desc *desc = Mem_desc::first(kip);
for (unsigned i = 0; i < Mem_desc::count(kip); ++i)
if (desc[i].is_virtual()) {
_vm_start = round_page(desc[i].start());
_vm_size = trunc_page(desc[i].end() - _vm_start + 1);
break;
}
if (_vm_size == 0)
panic("Virtual memory configuration not found");
/* configure applicable address space but never use page0 */
_vm_size = _vm_start == 0 ? _vm_size - L4_PAGESIZE : _vm_size;
_vm_start = _vm_start == 0 ? L4_PAGESIZE : _vm_start;
_region_alloc.add_range(_vm_start, _vm_size);
/* preserve context area in core's virtual address space */
_region_alloc.remove_range(Native_config::context_area_virtual_base(),
Native_config::context_area_virtual_size());
/* I/O memory could be the whole user address space */
/* FIXME if the kernel helps to find out max address - use info here */
_io_mem_alloc.add_range(0, ~0);
/* remove KIP and MBI area from region and IO_MEM allocator */
remove_region(Region((addr_t)kip, (addr_t)kip + L4_PAGESIZE), _region_alloc);
remove_region(Region((addr_t)kip, (addr_t)kip + L4_PAGESIZE), _io_mem_alloc);
remove_region(Region((addr_t)mb_info_ptr, (addr_t)mb_info_ptr + _mb_info.size()), _region_alloc);
remove_region(Region((addr_t)mb_info_ptr, (addr_t)mb_info_ptr + _mb_info.size()), _io_mem_alloc);
/* remove core program image memory from region and IO_MEM allocator */
addr_t img_start = (addr_t) &_prog_img_beg;
addr_t img_end = (addr_t) &_prog_img_end;
remove_region(Region(img_start, img_end), _region_alloc);
remove_region(Region(img_start, img_end), _io_mem_alloc);
/* image is accessible by core */
add_region(Region(img_start, img_end), _core_address_ranges());
}
void Platform::_setup_rom()
{
Rom_module rom;
for (unsigned i = FIRST_ROM; i < _mb_info.num_modules(); i++) {
if (!(rom = _mb_info.get_module(i)).valid()) continue;
Rom_module *new_rom = new(core_mem_alloc()) Rom_module(rom);
_rom_fs.insert(new_rom);
if (verbose)
printf(" mod[%d] [%p,%p) %s\n", i,
(void *)new_rom->addr(), ((char *)new_rom->addr()) + new_rom->size(),
new_rom->name());
/* zero remainder of last ROM page */
size_t count = L4_PAGESIZE - rom.size() % L4_PAGESIZE;
if (count != L4_PAGESIZE)
memset(reinterpret_cast<void *>(rom.addr() + rom.size()), 0, count);
/* remove ROM area from region and IO_MEM allocator */
remove_region(Region(new_rom->addr(), new_rom->addr() + new_rom->size()), _region_alloc);
remove_region(Region(new_rom->addr(), new_rom->addr() + new_rom->size()), _io_mem_alloc);
/* add area to core-accessible ranges */
add_region(Region(new_rom->addr(), new_rom->addr() + new_rom->size()), _core_address_ranges());
}
}
Platform::Platform() :
_ram_alloc(0), _io_mem_alloc(core_mem_alloc()),
_io_port_alloc(core_mem_alloc()), _irq_alloc(core_mem_alloc()),
_region_alloc(core_mem_alloc())
{
/*
* We must be single-threaded at this stage and so this is safe.
*/
static bool initialized = 0;
if (initialized) panic("Platform constructed twice!");
initialized = true;
_setup_basics();
_setup_mem_alloc();
_setup_io_port_alloc();
_setup_irq_alloc();
_setup_rom();
if (verbose) {
printf(":ram_alloc: "); _ram_alloc.raw()->dump_addr_tree();
printf(":region_alloc: "); _region_alloc.raw()->dump_addr_tree();
printf(":io_mem: "); _io_mem_alloc.raw()->dump_addr_tree();
printf(":io_port: "); _io_port_alloc.raw()->dump_addr_tree();
printf(":irq: "); _irq_alloc.raw()->dump_addr_tree();
printf(":rom_fs: "); _rom_fs.print_fs();
printf(":core ranges: "); _core_address_ranges().raw()->dump_addr_tree();
}
Fiasco::l4_threadid_t myself = Fiasco::l4_myself();
Platform_pd::init();
/* setup pd object for core pd */
_core_label[0] = 0;
_core_pd = new(core_mem_alloc()) Platform_pd(_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);
core_thread->pager(sigma0());
_core_pd->bind_thread(core_thread);
/* we never call _core_thread.start(), so set name directly */
Fiasco::fiasco_register_thread_name(core_thread->native_thread_id(), core_thread->name());
}
/********************************
** Generic platform interface **
********************************/
void Platform::wait_for_exit()
{
/*
* On Fiasco, Core never exits. So let us sleep forever.
*/
sleep_forever();
}
void Core_parent::exit(int exit_value) { }

View File

@@ -1,290 +0,0 @@
/*
* \brief Fiasco protection domain facility
* \author Christian Helmuth
* \date 2006-04-11
*
* On Fiasco, the pd class has several duties:
*
* - It is an allocator for L4 tasks and cares for versioning and recycling. We
* do this with "static class members".
* - L4 threads are tied to L4 tasks and there are only 128 per L4 task. So
* each pd object is an allocator for its threads.
*/
/*
* Copyright (C) 2006-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.
*/
/* Genode includes */
#include <base/native_types.h>
/* core includes */
#include <util.h>
#include <platform_pd.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/syscalls.h>
}
using namespace Fiasco;
using namespace Genode;
static const bool verbose = false;
/**************************
** Static class members **
**************************/
static bool _init = false;
void Platform_pd::init()
{
if (_init) return;
unsigned i;
Pd_alloc reserved(true, true, 0);
Pd_alloc free(false, true, 0);
/* mark reserved protection domains */
for (i = 0; i < PD_FIRST; ++i) _pds()[i] = reserved;
/* init remainder */
for ( ; i < PD_MAX; ++i) _pds()[i] = free;
_init = true;
}
/****************************
** Private object members **
****************************/
void Platform_pd::_create_pd(bool syscall)
{
l4_threadid_t l4t = l4_myself();
l4t.id.task = _pd_id;
l4t.id.lthread = 0;
l4t.id.version_low = _version;
l4_taskid_t nt;
if (syscall)
nt = l4_task_new(l4t, 0, 0, 0, l4t);
else
nt = l4t;
if (l4_is_nil_id(nt))
panic("pd creation failed");
_l4_task_id = nt;
}
void Platform_pd::_destroy_pd()
{
l4_threadid_t l4t = _l4_task_id;
/* L4 task deletion is: make inactive with myself as chief in 2nd parameter */
l4_taskid_t nt = l4_task_new(l4t, convert_native_thread_id_to_badge(l4_myself()),
0, 0, L4_NIL_ID);
if (l4_is_nil_id(nt))
panic("pd destruction failed");
_l4_task_id = L4_INVALID_ID;
}
int Platform_pd::_alloc_pd(signed pd_id)
{
if (pd_id == PD_INVALID) {
unsigned i;
for (i = PD_FIRST; i < PD_MAX; i++)
if (_pds()[i].free) break;
/* no free protection domains available */
if (i == PD_MAX) return -1;
pd_id = i;
} else {
if (!_pds()[pd_id].reserved || !_pds()[pd_id].free)
return -1;
}
_pds()[pd_id].free = 0;
_pd_id = pd_id;
_version = _pds()[pd_id].version;
return pd_id;
}
void Platform_pd::_free_pd()
{
unsigned t = _pd_id;
/* XXX check and log double-free? */
if (_pds()[t].free) return;
/* maximum reuse count reached leave non-free */
if (_pds()[t].version == PD_VERSION_MAX) return;
_pds()[t].free = 1;
++_pds()[t].version;
}
void Platform_pd::_init_threads()
{
unsigned i;
for (i = 0; i < THREAD_MAX; ++i)
_threads[i] = 0;
}
Platform_thread* Platform_pd::_next_thread()
{
unsigned i;
/* look for bound thread */
for (i = 0; i < THREAD_MAX; ++i)
if (_threads[i]) break;
/* no bound threads */
if (i == THREAD_MAX) return 0;
return _threads[i];
}
int Platform_pd::_alloc_thread(int thread_id, Platform_thread *thread)
{
int i = thread_id;
/* look for free thread */
if (thread_id == Platform_thread::THREAD_INVALID) {
for (i = 0; i < THREAD_MAX; ++i)
if (!_threads[i]) break;
/* no free threads available */
if (i == THREAD_MAX) return -1;
} else {
if (_threads[i]) return -2;
}
_threads[i] = thread;
return i;
}
void Platform_pd::_free_thread(int thread_id)
{
if (!_threads[thread_id])
PWRN("double-free of thread %x.%x detected", _pd_id, thread_id);
_threads[thread_id] = 0;
}
/***************************
** Public object members **
***************************/
int Platform_pd::bind_thread(Platform_thread *thread)
{
/* thread_id is THREAD_INVALID by default - only core is the special case */
int thread_id = thread->thread_id();
l4_threadid_t l4_thread_id;
int t = _alloc_thread(thread_id, thread);
if (t < 0) {
PERR("Thread alloc failed");
return -1;
}
thread_id = t;
l4_thread_id = _l4_task_id;
l4_thread_id.id.lthread = thread_id;
/* finally inform thread about binding */
thread->bind(thread_id, l4_thread_id, this);
if (verbose) _debug_log_threads();
return 0;
}
void Platform_pd::unbind_thread(Platform_thread *thread)
{
int thread_id = thread->thread_id();
/* unbind thread before proceeding */
thread->unbind();
_free_thread(thread_id);
if (verbose) _debug_log_threads();
}
Platform_pd::Platform_pd(char const *, signed pd_id, bool create)
{
/* check correct init */
if (!_init)
panic("init pd facility via Platform_pd::init() before using it!");
/* init threads */
_init_threads();
int ret = _alloc_pd(pd_id);
if (ret < 0) {
_debug_log_pds();
panic("pd alloc failed");
}
_create_pd(create);
}
Platform_pd::~Platform_pd()
{
/* unbind all threads */
while (Platform_thread *t = _next_thread()) unbind_thread(t);
_destroy_pd();
_free_pd();
}
/***********************
** Debugging support **
***********************/
void Platform_pd::_debug_log_threads()
{
int i;
printf("[%02x] ", _pd_id);
for (i = 0; i < THREAD_MAX; ++i) {
printf("%c", !_threads[i] ? '.' : 'X');
if (i == 63) printf("\n ");
}
printf("\n");
}
void Platform_pd::_debug_log_pds()
{
int i;
for (i = 0; i < PD_MAX; ++i)
printf("[%02x] %d %d %d\n", i, _pds()[i].reserved, _pds()[i].free,
_pds()[i].version);
}

View File

@@ -1,169 +0,0 @@
/*
* \brief Fiasco thread facility
* \author Christian Helmuth
* \date 2006-04-11
*
* This provides a thread object and uses l4_inter_task_ex_regs() for L4 thread
* manipulation.
*/
/*
* Copyright (C) 2006-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.
*/
/* Genode includes */
#include <base/printf.h>
#include <util/string.h>
#include <cpu_session/cpu_session.h>
/* core includes */
#include <platform_thread.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/utcb.h>
#include <l4/sys/kdebug.h>
}
using namespace Genode;
using namespace Fiasco;
int Platform_thread::start(void *ip, void *sp)
{
l4_umword_t dummy, old_eflags;
l4_threadid_t thread = _l4_thread_id;
l4_threadid_t pager = _pager ? _pager->cap().dst() : L4_INVALID_ID;
l4_threadid_t preempter = L4_INVALID_ID;
l4_threadid_t cap_handler = L4_INVALID_ID;
l4_inter_task_ex_regs(thread, (l4_umword_t)ip, (l4_umword_t)sp,
&preempter, &pager, &cap_handler,
&old_eflags, &dummy, &dummy,
0, l4_utcb_get());
if (old_eflags == ~0UL)
PWRN("old eflags == ~0 on ex_regs %x.%x", (int)thread.id.task, (int)thread.id.lthread);
fiasco_register_thread_name(thread, _name);
return 0;
}
void Platform_thread::pause()
{
PDBG("not implemented");
}
void Platform_thread::resume()
{
PDBG("not implemented");
}
void Platform_thread::bind(int thread_id, l4_threadid_t l4_thread_id, Platform_pd *pd)
{
_thread_id = thread_id;
_l4_thread_id = l4_thread_id;
_platform_pd = pd;
}
void Platform_thread::unbind()
{
l4_umword_t dummy, old_eflags;
l4_threadid_t thread = _l4_thread_id;
l4_threadid_t pager = thread;
l4_threadid_t preempter = L4_INVALID_ID;
l4_threadid_t cap_handler = L4_INVALID_ID;
fiasco_register_thread_name(thread, "<dead>");
/*
* The Fiasco thread is halted by setting itself as pager and forcing
* pagefault at 0, where Genode never maps a page. The bottom line is the
* thread blocks in IPC to itself.
*/
l4_inter_task_ex_regs(thread, 0, 0,
&preempter, &pager, &cap_handler,
&old_eflags, &dummy, &dummy,
0, l4_utcb_get());
if (old_eflags == ~0UL)
PWRN("old eflags == ~0 on ex_regs %x.%x", (int)thread.id.task, (int)thread.id.lthread);
_thread_id = THREAD_INVALID;
_l4_thread_id = L4_INVALID_ID;
_platform_pd = 0;
}
void Platform_thread::state(Thread_state s)
{
PDBG("Not implemented");
throw Cpu_session::State_access_failed();
}
Thread_state Platform_thread::state()
{
Thread_state s;
l4_umword_t old_eflags, ip, sp;
l4_threadid_t thread = _l4_thread_id;
l4_threadid_t pager = L4_INVALID_ID;
l4_threadid_t preempter = L4_INVALID_ID;
l4_threadid_t cap_handler = L4_INVALID_ID;
l4_inter_task_ex_regs(thread, ~0UL, ~0UL,
&preempter, &pager, &cap_handler,
&old_eflags, &ip, &sp,
L4_THREAD_EX_REGS_NO_CANCEL, l4_utcb_get());
if (old_eflags == ~0UL)
PWRN("old eflags == ~0 on ex_regs %x.%x", (int)thread.id.task, (int)thread.id.lthread);
/* fill thread state structure */
s.ip = ip;
s.sp = sp;
return s;
}
void Platform_thread::cancel_blocking()
{
l4_umword_t dummy;
l4_threadid_t invalid = L4_INVALID_ID;
l4_inter_task_ex_regs(_l4_thread_id, ~0UL, ~0UL,
&invalid, &invalid, &invalid,
&dummy, &dummy, &dummy, 0, l4_utcb_get());
}
Weak_ptr<Address_space> Platform_thread::address_space()
{
return _platform_pd->Address_space::weak_ptr();
}
Platform_thread::Platform_thread(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));
}
Platform_thread::~Platform_thread()
{
/*
* We inform our protection domain about thread destruction, which will end up in
* Thread::unbind()
*/
if (_platform_pd)
_platform_pd->unbind_thread(this);
}

View File

@@ -1,55 +0,0 @@
TARGET = core
GEN_CORE_DIR = $(BASE_DIR)/src/core
SRC_CC += main.cc \
multiboot_info.cc \
ram_session_component.cc \
ram_session_support.cc \
rom_session_component.cc \
cpu_session_component.cc \
cpu_session_support.cc \
pd_session_component.cc \
io_mem_session_component.cc \
io_mem_session_support.cc \
thread_start.cc \
platform_thread.cc \
platform_pd.cc \
platform_services.cc \
platform.cc \
dataspace_component.cc \
rm_session_component.cc \
rm_session_support.cc \
io_port_session_component.cc \
irq_session_component.cc \
signal_session_component.cc \
signal_source_component.cc \
trace_session_component.cc \
dump_alloc.cc \
context_area.cc \
core_printf.cc
INC_DIR += $(REP_DIR)/src/core/include \
$(GEN_CORE_DIR)/include \
$(REP_DIR)/src/base/console \
$(BASE_DIR)/src/base/thread
LIBS += base-common
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 cpu_session_component.cc $(GEN_CORE_DIR)
vpath pd_session_component.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_support.cc $(GEN_CORE_DIR)
vpath signal_session_component.cc $(GEN_CORE_DIR)
vpath signal_source_component.cc $(GEN_CORE_DIR)
vpath trace_session_component.cc $(GEN_CORE_DIR)
vpath dataspace_component.cc $(GEN_CORE_DIR)
vpath dump_alloc.cc $(GEN_CORE_DIR)
vpath context_area.cc $(GEN_CORE_DIR)
vpath core_printf.cc $(BASE_DIR)/src/base/console
vpath %.cc $(REP_DIR)/src/core

View File

@@ -1,60 +0,0 @@
/*
* \brief Implementation of Thread API interface on top of Platform_thread
* \author Norman Feske
* \date 2006-05-03
*/
/*
* Copyright (C) 2006-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.
*/
/* Genode includes */
#include <base/thread.h>
#include <base/sleep.h>
/* core includes */
#include <platform.h>
#include <core_env.h>
using namespace Genode;
void Thread_base::_thread_start()
{
Thread_base::myself()->_thread_bootstrap();
Thread_base::myself()->entry();
Thread_base::myself()->_join_lock.unlock();
sleep_forever();
}
void Thread_base::start()
{
/* create and start platform thread */
_tid.pt = new(platform()->core_mem_alloc()) Platform_thread(_context->name);
platform_specific()->core_pd()->bind_thread(_tid.pt);
_tid.pt->pager(platform_specific()->core_pager());
_tid.l4id = _tid.pt->native_thread_id();
_tid.pt->start((void *)_thread_start, stack_top());
}
void Thread_base::cancel_blocking()
{
/*
* Within core, we never need to unblock threads
*/
}
void Thread_base::_deinit_platform_thread()
{
/* destruct platform thread */
destroy(platform()->core_mem_alloc(), _tid.pt);
}

View File

@@ -1,23 +0,0 @@
TARGET = fiasco
REQUIRES += fiasco
FIASCO_BUILD_DIR = $(BUILD_BASE_DIR)/kernel/$(TARGET)
FIASCO = $(FIASCO_BUILD_DIR)/fiasco
FIASCO_SRC = $(REP_DIR)/contrib/fiasco/snapshot/kernel/fiasco
STARTUP_LIB =
$(TARGET): $(FIASCO)
$(FIASCO_BUILD_DIR):
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FIASCO_SRC) BUILDDIR=$@
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $@ oldconfig
$(FIASCO): $(FIASCO_BUILD_DIR)
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FIASCO_BUILD_DIR)
$(VERBOSE)ln -sf $@ $(BUILD_BASE_DIR)/bin/$(TARGET)
clean cleanall:
$(VERBOSE)rm -rf $(FIASCO_BUILD_DIR)

View File

@@ -1,90 +0,0 @@
#
# \brief Checkout Fiasco.OC and addtional needed tools (sigma0, bootstrap)
# \author Stefan Kalkowski
# \author Sebastian Sumpf
# \date 2011-03-31
#
VERBOSE ?= @
ECHO = @echo
SVN_URI = http://svn.tudos.org/repos/oc/tudos/trunk
GIT_URI = http://github.com/ssumpf/foc.git
GIT_BRANCH = r56
CONTRIB_DIR = contrib
GNU_FIND ?= find
SVN_TARGETS = tools/preprocess \
kernel/fiasco \
l4/conf \
l4/doc \
l4/mk \
l4/tool \
l4/pkg/bootstrap \
l4/pkg/cxx \
l4/pkg/drivers-frst \
l4/pkg/l4sys \
l4/pkg/l4util \
l4/pkg/ldscripts \
l4/pkg/libgcc-pure \
l4/pkg/libgcc \
l4/pkg/libsigma0 \
l4/pkg/sigma0 \
l4/pkg/uclibc-headers \
l4/pkg/uclibc-minimal \
l4/pkg/uclibc \
l4/pkg/libvcpu
#
# 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,svn)
$(call check_tool,$(GNU_FIND))
#
# Print help information by default
#
help::
$(CONTRIB_DIR)/.git:
$(VERBOSE)git clone $(GIT_URI) $(CONTRIB_DIR)
prepare: $(CONTRIB_DIR)/.git
$(VERBOSE)cd $(CONTRIB_DIR); git fetch origin
$(VERBOSE)cd $(CONTRIB_DIR); git checkout $(GIT_BRANCH)
$(VERBOSE)cd $(CONTRIB_DIR); git rebase origin/$(GIT_BRANCH)
$(SVN_REV)/%:
$(VERBOSE)svn co -r $(SVN_REV) $(SVN_URI)/$* $@
checkout_base:
ifeq ($(SVN_REV),)
$(error Syntax 'make checkout SVN_REV=<revision>')
endif
$(VERBOSE)svn export -r $(SVN_REV) $(SVN_URI)/l4/COPYING-GPL-2 $(SVN_REV)
$(VERBOSE)svn co -r $(SVN_REV) --depth immediates $(SVN_URI) $(SVN_REV)
$(VERBOSE)svn co -r $(SVN_REV) --depth files $(SVN_URI)/l4 $(SVN_REV)/l4
$(VERBOSE)svn co -r $(SVN_REV) --depth files $(SVN_URI)/l4/pkg $(SVN_REV)/l4/pkg
checkout: checkout_base $(addprefix $(SVN_REV)/,$(SVN_TARGETS))
$(VERBOSE)$(GNU_FIND) $(SVN_REV) -depth -name .svn -type d -exec rm -r {} ";"
help::
$(ECHO)
$(ECHO) "Check out upstream source code of Fiasco.OC"
$(ECHO)
$(ECHO) "The source code will be located at the '$(CONTRIB_DIR)/' directory."
$(ECHO)
$(ECHO) "--- available commands ---"
$(ECHO) "prepare - checkout upstream source codes"
$(ECHO) "checkout SVN_REV=<rev> - checkout out <rev> revision of Fiasco.OC/L4RE from the official repositiry"
$(ECHO) " and store in directory <rev>"
$(ECHO) "clean - remove upstream source codes"
$(ECHO)
clean::
$(VERBOSE)rm -rf $(CONTRIB_DIR)
.NOTPARALLEL:

View File

@@ -1,54 +0,0 @@
/*
* \brief Atomic operations for ARM
* \author Norman Feske
* \author Stefan Kalkowski
* \date 2007-04-28
*/
/*
* Copyright (C) 2007-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__ARM__CPU__ATOMIC_H_
#define _INCLUDE__ARM__CPU__ATOMIC_H_
namespace Genode {
/**
* Atomic compare and exchange
*
* This function compares the value at dest with cmp_val.
* If both values are equal, dest is set to new_val. If
* both values are different, the value at dest remains
* unchanged.
*
* \return 1 if the value was successfully changed to new_val,
* 0 if cmp_val and the value at dest differ.
*/
inline int cmpxchg(volatile int *dest, int cmp_val, int new_val)
{
unsigned long equal, not_exclusive;
__asm__ __volatile__(
"@ cmpxchg\n"
" 1: \n"
" ldrex %0, [%2] \n"
" cmp %0, %3 \n"
" bne 2f \n"
" strexeq %0, %4, [%2]\n"
" teqeq %0, #0 \n"
" bne 1b \n"
" moveq %1, #1 \n"
" 2: \n"
" movne %1, #0 \n"
: "=&r" (not_exclusive), "=&r" (equal)
: "r" (dest), "r" (cmp_val), "r" (new_val)
: "cc");
return equal && !not_exclusive;
}
}
#endif /* _INCLUDE__ARM__CPU__ATOMIC_H_ */

View File

@@ -1,203 +0,0 @@
/*
* \brief Fiasco.OC pager support
* \author Christian Helmuth
* \author Stefan Kalkowski
* \date 2006-06-14
*/
/*
* Copyright (C) 2006-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_
/* Genode includes */
#include <base/ipc.h>
#include <base/stdint.h>
#include <base/native_types.h>
#include <base/thread_state.h>
#include <util/touch.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
namespace Genode {
class Mapping
{
private:
addr_t _dst_addr;
addr_t _src_addr;
bool _write_combined;
unsigned _log2size;
bool _rw;
bool _grant;
public:
/**
* Constructor
*/
Mapping(addr_t dst_addr, addr_t src_addr,
bool write_combined, bool io_mem,
unsigned l2size = L4_LOG2_PAGESIZE,
bool rw = true, bool grant = false)
: _dst_addr(dst_addr), _src_addr(src_addr),
_write_combined(write_combined), _log2size(l2size),
_rw(rw), _grant(grant) { }
/**
* Construct invalid flexpage
*/
Mapping() : _dst_addr(0), _src_addr(0), _write_combined(false),
_log2size(0), _rw(false), _grant(false) { }
Fiasco::l4_umword_t dst_addr() const { return _dst_addr; }
bool grant() const { return _grant; }
Fiasco::l4_fpage_t fpage() const
{
// TODO: write combined
//if (write_combined)
// _fpage.fp.cache = Fiasco::L4_FPAGE_BUFFERABLE;
unsigned char rights = _rw ? Fiasco::L4_FPAGE_RWX : Fiasco::L4_FPAGE_RX;
return Fiasco::l4_fpage(_src_addr, _log2size, rights);
}
bool write_combined() const { return _write_combined; }
/**
* Prepare map operation is not needed on Fiasco.OC, since we clear the
* dataspace before this function is called.
*/
void prepare_map_operation() { }
};
/**
* Special paging server class
*/
class Ipc_pager : public Native_capability
{
public:
enum Msg_type { PAGEFAULT, WAKE_UP, PAUSE, EXCEPTION };
private:
Native_thread _last; /* origin of last fault */
addr_t _pf_addr; /* page-fault address */
addr_t _pf_ip; /* ip of faulter */
Mapping _reply_mapping; /* page-fault answer */
unsigned long _badge; /* badge of faulting thread */
Fiasco::l4_msgtag_t _tag; /* receive message tag */
Fiasco::l4_exc_regs_t _regs; /* exception registers */
Msg_type _type;
void _parse_msg_type(void);
void _parse_exception(void);
void _parse_pagefault(void);
void _parse(unsigned long label);
public:
/**
* Constructor
*/
Ipc_pager();
/**
* Wait for a new page fault received as short message IPC
*/
void wait_for_fault();
/**
* Reply current page-fault and wait for a new one
*
* Send short flex page and wait for next short-message (register)
* IPC -- pagefault
*/
void reply_and_wait_for_fault();
/**
* Request instruction pointer of current page fault
*/
addr_t fault_ip() { return _pf_ip; }
/**
* Request fault address of current page fault
*/
addr_t fault_addr() { return _pf_addr & ~3; }
/**
* Set parameters for next reply
*/
void set_reply_mapping(Mapping m) { _reply_mapping = m; }
/**
* Set destination for next reply
*/
void set_reply_dst(Native_thread t) {
_last = t; }
/**
* 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();
/**
* Reply to an exception IPC
*/
void acknowledge_exception();
/**
* Return thread ID of last faulter
*/
Native_thread last() const { return _last; }
/**
* Return badge for faulting thread
*/
unsigned long badge() { return _badge; }
bool is_write_fault() const { return (_pf_addr & 2); }
/**
* Return true if last fault was an exception
*/
bool is_exception() const
{
return _type == Ipc_pager::EXCEPTION;
}
/**
* Return the type of ipc we received at last.
*/
Msg_type msg_type() { return _type; };
/**
* Copy the exception registers from the last exception
* to the given Thread_state object.
*/
void get_regs(Thread_state *state);
/*
* Copy the exception reply registers from the given
* Thread_state object
*/
void set_regs(Thread_state state);
};
}
#endif /* _INCLUDE__BASE__IPC_PAGER_H_ */

View File

@@ -1,184 +0,0 @@
#ifndef _INCLUDE__BASE__NATIVE_TYPES_H_
#define _INCLUDE__BASE__NATIVE_TYPES_H_
#include <base/native_config.h>
#include <base/cap_map.h>
namespace Fiasco {
#include <l4/sys/consts.h>
#include <l4/sys/types.h>
#include <l4/sys/utcb.h>
#include <l4/sys/task.h>
enum Cap_selectors {
/**********************************************
** Capability seclectors controlled by core **
**********************************************/
TASK_CAP = L4_BASE_TASK_CAP, /* use the same task cap selector
like L4Re for compatibility in
L4Linux */
/*
* To not clash with other L4Re cap selector constants (e.g.: L4Linux)
* leave the following selectors (2-7) empty
*/
PARENT_CAP = 0x8UL << L4_CAP_SHIFT, /* cap to parent session */
/*
* Each thread has a designated slot in the core controlled cap
* selector area, where its ipc gate capability (for server threads),
* its irq capability (for locks), and the capability to its pager
* gate are stored
*/
THREAD_AREA_BASE = 0x9UL << L4_CAP_SHIFT, /* offset to thread area */
THREAD_AREA_SLOT = 0x3UL << L4_CAP_SHIFT, /* size of one thread slot */
THREAD_GATE_CAP = 0, /* offset to the ipc gate
cap selector in the slot */
THREAD_PAGER_CAP = 0x1UL << L4_CAP_SHIFT, /* offset to the pager
cap selector in the slot */
THREAD_IRQ_CAP = 0x2UL << L4_CAP_SHIFT, /* offset to the irq cap
selector in the slot */
MAIN_THREAD_CAP = THREAD_AREA_BASE + THREAD_GATE_CAP, /* shortcut to the
main thread's
gate cap */
/*********************************************************
** Capability seclectors controlled by the task itself **
*********************************************************/
USER_BASE_CAP = 0x200UL << L4_CAP_SHIFT,
};
enum Utcb_regs {
UTCB_TCR_BADGE = 1,
UTCB_TCR_THREAD_OBJ = 2
};
struct Capability
{
static bool valid(l4_cap_idx_t idx) {
return !(idx & L4_INVALID_CAP_BIT) && idx != 0; }
};
}
namespace Genode {
typedef Fiasco::l4_cap_idx_t Native_thread_id;
typedef Fiasco::l4_cap_idx_t Native_thread;
typedef Fiasco::l4_cap_idx_t Native_task;
typedef Fiasco::l4_utcb_t* Native_utcb;
/**
* 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.
*/
class Native_capability
{
public:
typedef Fiasco::l4_cap_idx_t Dst;
struct Raw
{
Dst dst;
long local_name;
};
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)
_idx->inc();
}
inline void _dec()
{
if (_idx && !_idx->dec()) {
cap_map()->remove(_idx);
}
}
public:
/**
* Default constructor creates an invalid capability
*/
Native_capability() : _idx(0), _ptr(0) { }
/**
* Construct capability manually
*/
Native_capability(Cap_index* idx)
: _idx(idx), _ptr(0) { _inc(); }
Native_capability(const Native_capability &o)
: _idx(o._idx), _ptr(o._ptr) { _inc(); }
~Native_capability()
{
_dec();
}
/**
* Return Cap_index object referenced by this object
*/
Cap_index* idx() const { return _idx; }
/**
* Overloaded comparision operator
*/
bool operator==(const Native_capability &o) const {
return (_ptr) ? _ptr == o._ptr : _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;
}
/*******************************************
** Interface provided by all platforms **
*******************************************/
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; }
};
typedef int Native_connection_state;
struct Native_pd_args { };
}
#endif /* _INCLUDE__BASE__NATIVE_TYPES_H_ */

View File

@@ -1,100 +0,0 @@
/*
* \brief Client-side cpu session Fiasco.OC extension
* \author Stefan Kalkowski
* \date 2011-04-04
*/
/*
* 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 _INCLUDE__FOC_CPU_SESSION__CLIENT_H_
#define _INCLUDE__FOC_CPU_SESSION__CLIENT_H_
#include <cpu_session/client.h>
#include <foc_cpu_session/foc_cpu_session.h>
#include <base/printf.h>
namespace Genode {
struct Foc_cpu_session_client : Rpc_client<Foc_cpu_session>
{
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); }
Ram_dataspace_capability utcb(Thread_capability thread) {
return call<Rpc_utcb>(thread); }
void kill_thread(Thread_capability thread) {
call<Rpc_kill_thread>(thread); }
int set_pager(Thread_capability thread, Pager_capability pager) {
return call<Rpc_set_pager>(thread, pager); }
int start(Thread_capability thread, addr_t ip, addr_t sp) {
return call<Rpc_start>(thread, ip, sp); }
void pause(Thread_capability thread) {
call<Rpc_pause>(thread); }
void resume(Thread_capability thread) {
call<Rpc_resume>(thread); }
void cancel_blocking(Thread_capability thread) {
call<Rpc_cancel_blocking>(thread); }
int name(Thread_capability thread, char *name_dst, size_t name_len)
{
PWRN("name called, this function is deprecated");
return -1;
}
Thread_state state(Thread_capability thread) {
return call<Rpc_get_state>(thread); }
void state(Thread_capability thread, Thread_state const &state) {
call<Rpc_set_state>(thread, state); }
void exception_handler(Thread_capability thread, Signal_context_capability handler) {
call<Rpc_exception_handler>(thread, handler); }
void single_step(Thread_capability thread, bool enable) {
call<Rpc_single_step>(thread, enable); }
Affinity::Space affinity_space() const {
return call<Rpc_affinity_space>(); }
void affinity(Thread_capability thread, Affinity::Location location) {
call<Rpc_affinity>(thread, location); }
Dataspace_capability trace_control() {
return call<Rpc_trace_control>(); }
unsigned trace_control_index(Thread_capability thread) {
return call<Rpc_trace_control_index>(thread); }
Dataspace_capability trace_buffer(Thread_capability thread) {
return call<Rpc_trace_buffer>(thread); }
Dataspace_capability trace_policy(Thread_capability thread) {
return call<Rpc_trace_policy>(thread); }
void enable_vcpu(Thread_capability cap, addr_t vcpu_state) {
call<Rpc_enable_vcpu>(cap, vcpu_state); }
Native_capability native_cap(Thread_capability cap) {
return call<Rpc_native_cap>(cap); }
Native_capability alloc_irq() {
return call<Rpc_alloc_irq>(); }
};
}
#endif /* _INCLUDE__FOC_CPU_SESSION__CLIENT_H_ */

View File

@@ -1,92 +0,0 @@
/*
* \brief Fiasco.OC-specific signal-source client interface
* \author Norman Feske
* \author Stefan Kalkowski
* \date 2010-02-03
*
* On Fiasco.OC, the signal source server does not provide a blocking
* 'wait_for_signal' function because this kernel does not support out-of-order
* IPC replies. Instead, we use an IRQ kernel-object to let the client block
* until a signal is present at the server.
*
* We request the IRQ object capability and attach to the IRQ on construction
* of the 'Signal_source_client' object.
*/
/*
* 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 _INCLUDE__SIGNAL_SESSION__SOURCE_CLIENT_H_
#define _INCLUDE__SIGNAL_SESSION__SOURCE_CLIENT_H_
#include <base/rpc_client.h>
#include <base/thread.h>
#include <signal_session/foc_source.h>
namespace Fiasco {
#include <l4/sys/irq.h>
}
namespace Genode {
class Signal_source_client : public Rpc_client<Foc_signal_source>
{
private:
/**
* Capability with 'dst' referring to a Fiasco.OC IRQ object
*/
Native_capability _sem;
/**
* Request Fiasco.OC IRQ object from signal-source server
*/
void _init_sem()
{
using namespace Fiasco;
/* request mapping of semaphore capability selector */
_sem = call<Rpc_request_semaphore>();
l4_msgtag_t tag = l4_irq_attach(_sem.dst(), 0,
Thread_base::myself()->tid());
if (l4_error(tag))
PERR("l4_irq_attach failed with %ld!", l4_error(tag));
}
public:
/**
* Constructor
*/
Signal_source_client(Signal_source_capability cap)
: Rpc_client<Foc_signal_source>(static_cap_cast<Foc_signal_source>(cap))
{ _init_sem(); }
/*****************************
** Signal source interface **
*****************************/
Signal wait_for_signal()
{
using namespace Fiasco;
/* block on semaphore, will be unblocked if signal is available */
l4_irq_receive(_sem.dst(), L4_IPC_NEVER);
/*
* Now that the server has unblocked the semaphore, we are sure
* that there is a signal pending. The following 'wait_for_signal'
* request will be immediately answered.
*/
return call<Rpc_wait_for_signal>();
}
};
}
#endif /* _INCLUDE__SIGNAL_SESSION__SOURCE_CLIENT_H_ */

View File

@@ -1,33 +0,0 @@
#
# \brief Portions of base library shared by core and non-core processes
# \author Norman Feske
# \date 2013-02-14
#
LIBS += cxx syscall startup
SRC_CC += ipc/ipc.cc ipc/pager.cc
SRC_CC += pager/pager.cc pager/common.cc
SRC_CC += avl_tree/avl_tree.cc
SRC_CC += allocator/slab.cc
SRC_CC += allocator/allocator_avl.cc
SRC_CC += heap/heap.cc heap/sliced_heap.cc
SRC_CC += console/console.cc
SRC_CC += child/child.cc
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 += server/server.cc server/common.cc
SRC_CC += thread/thread.cc thread/thread_bootstrap.cc thread/trace.cc
SRC_CC += thread/context_allocator.cc
INC_DIR += $(REP_DIR)/src/base/lock
INC_DIR += $(BASE_DIR)/src/base/lock
INC_DIR += $(BASE_DIR)/src/base/thread
vpath %.cc $(REP_DIR)/src/base
vpath %.cc $(BASE_DIR)/src/base
# vi: set ft=make :

View File

@@ -1,17 +0,0 @@
#
# \brief Portions of base library that are exclusive to non-core processes
# \author Norman Feske
# \date 2013-02-14
#
LIBS += base-common
SRC_CC += console/log_console.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
INC_DIR += $(BASE_DIR)/src/base/env
vpath %.cc $(REP_DIR)/src/base
vpath %.cc $(BASE_DIR)/src/base

View File

@@ -1,71 +0,0 @@
#
# Create prerequisites for building Genode for Fiasco.OC
#
# Prior building Genode programs for Fiasco.OC, the kernel bindings must be
# generated. This is done by building a minimalistic subset of the original
# userland (L4re) that comes with Fiasco.OC.
#
#
# Execute the rules in this file only at the second build stage when we know
# about the complete build settings, e.g., the 'CROSS_DEV_PREFIX'.
#
ifeq ($(called_from_lib_mk),yes)
#
# Create mirror for architecture-specific L4sys header files
#
L4_INC_TARGETS += l4/sys \
l4f/l4/sys \
l4/sigma0 \
l4/vcpu
all: $(addprefix $(BUILD_BASE_DIR)/include/,$(L4_INC_TARGETS))
$(BUILD_BASE_DIR)/include/%:
$(VERBOSE)mkdir -p $(dir $@)
$(VERBOSE)ln -sf $(L4_BUILD_DIR)/include/$* $@
#
# Sanity checks
#
ifeq ($(L4_BUILD_DIR),$(BUILD_BASE_DIR)/l4)
ifeq ($(L4_CONFIG),)
all: $(REP_DIR)/contrib l4_config_not_defined
l4_config_not_defined:
$(VERBOSE)$(ECHO) "Error: L4_CONFIG is not defined, platform not supported"
@false
endif
endif
$(REP_DIR)/contrib:
$(VERBOSE)$(ECHO) "--> Please, execute 'make prepare' in $(REP_DIR)"
$(VERBOSE)$(ECHO) "--> before compiling Genode apps for Fiasco.OC."
$(VERBOSE)$(ECHO) "--> Run 'make cleanall' before next compilation."
$(VERBOSE)exit 1
#
# Create L4 build directory
#
# Resetting the 'MAKEFLAGS' is important because otherwise, the L4
# build system will stuble over predefined variables, i.e., 'LIB'
#
$(BUILD_BASE_DIR)/l4/.kconfig: $(REP_DIR)/contrib
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) $(VERBOSE_DIR) -C $(REP_DIR)/contrib/l4 B=$(dir $@) \
DROPSCONF_DEFCONFIG="$(L4_CONFIG)" \
VERBOSE="$(VERBOSE)" SYSTEM_TARGET="$(CROSS_DEV_PREFIX)"
PKGS = ldscripts \
libgcc-pure \
l4sys \
libgcc \
libsigma0 \
libvcpu/include
include $(REP_DIR)/mk/l4_pkg.mk
all: $(PKG_TAGS)
$(PKG_TAGS): $(BUILD_BASE_DIR)/l4/.kconfig
endif

View File

@@ -1,299 +0,0 @@
#
# \brief Fiasco.OC-specific test-environment supplements
# \author Stefan Kalkowski
# \date 2010-11-22
#
# 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
}
##
# Return the location of the Fiasco.OC user directory
#
proc l4_dir { } {
global _l4_dir
if {![info exists _l4_dir]} {
if {[file exists etc/foc.conf]} {
set _l4_dir [exec sed -n "/^L4_BUILD_DIR/s/^.*=\\s*//p" etc/foc.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 = <l4re-build-dir>' "
puts stderr "in <genode-build-dir>/etc/foc.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.OC kernel directory
#
proc fiasco { } {
global _fiasco
if {![info exists _fiasco]} {
if {[file exists etc/foc.conf]} {
set _fiasco [exec sed -n "/^KERNEL/s/^.*=\\s*//p" etc/foc.conf]
if {[file exists $_fiasco]} { return $_fiasco }
}
# try to fall back to version hosted with the Genode build directory
set _fiasco "[pwd]/kernel/fiasco.oc/fiasco"
}
return $_fiasco
}
##
# Return whether fiasco kernel is provided from the outside
#
proc fiasco_external { } {
if {[fiasco] == "[pwd]/kernel/fiasco.oc/fiasco"} { return 0 }
return 1
}
##
# Reset the target system via the Fiasco.OC kernel debugger
#
proc reset_target { {spawn_id_arg -1} } {
global spawn_id
if { $spawn_id_arg == -1 } {
set spawn_id_arg $spawn_id
}
send -i $spawn_id_arg "\033^^"
}
##################################
## Test framework API functions ##
##################################
proc create_boot_directory { } {
exec rm -rf [run_dir]
exec mkdir -p [run_dir]/genode
if {[have_spec x86]} {
exec mkdir -p [run_dir]/fiasco
exec mkdir -p [run_dir]/boot/grub
}
}
proc copy_and_strip_binaries {binaries} {
#
# Collect contents of the boot image
#
foreach binary $binaries {
exec cp bin/$binary [run_dir]/genode
catch {
exec [cross_dev_prefix]strip [run_dir]/genode/$binary }
}
#
# Generate config file for bootstrap
#
}
proc bin_dir { } {
if {[have_spec x86_32]} { return "[l4_dir]/bin/x86_586" }
if {[have_spec x86_64]} { return "[l4_dir]/bin/amd64_K8" }
if {[have_spec arm_v7a]} { return "[l4_dir]/bin/arm_armv7a" }
puts stderr "Error: Cannot determine bin directory"
exit 1
}
set fiasco_serial_esc_arg "-serial_esc "
proc build_boot_image_x86 {binaries} {
global fiasco_serial_esc_arg
copy_and_strip_binaries $binaries
set foc_targets { }
if {![fiasco_external] && ![file exists kernel]} { lappend foc_targets kernel }
if {![l4_dir_external]} {
if {![file exists bootstrap]} { lappend foc_targets bootstrap }
if {![file exists sigma0]} { lappend foc_targets sigma0 }
}
if {[llength $foc_targets] > 0} { build $foc_targets }
# assert existence of the L4 build directory
l4_dir
puts "using fiasco kernel [fiasco]"
exec cp [fiasco] [run_dir]/fiasco
puts "using sigma0/bootstrap at [l4_dir]"
exec cp [bin_dir]/l4f/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 Fiasco.OC"
puts $fh " kernel /fiasco/bootstrap -modaddr=0x01100000"
puts $fh " module /fiasco/fiasco $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_to_run_dir
create_iso_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 -modaddr=0x01100000"
puts $fh " load /fiasco/fiasco -serial_esc"
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 build_boot_image_arm {binaries} {
global run_target
global fiasco_serial_esc_arg
copy_and_strip_binaries $binaries
build "kernel sigma0 bootstrap"
#
# Generate bootstrap config
#
set fh [open "[run_dir]/modules.list" "WRONLY CREAT TRUNC"]
puts $fh "modaddr 0x01100000\n"
puts $fh "entry genode"
puts $fh "kernel [fiasco] $fiasco_serial_esc_arg"
puts $fh "roottask genode/core"
puts $fh "module genode/config"
foreach binary $binaries {
if {$binary != "core"} {
puts $fh "module genode/$binary" } }
close $fh
set gen_img_cmd "make -C [l4_dir]/source O=[l4_dir] E=genode "
append gen_img_cmd "MODULES_LIST=[pwd]/[run_dir]/modules.list "
append gen_img_cmd "MODULE_SEARCH_PATH=[pwd]/[run_dir]:[file dirname [fiasco]]:[l4_dir] "
append gen_img_cmd "SYSTEM_TARGET=[cross_dev_prefix] elfimage"
set pid [eval "spawn sh -c \"$gen_img_cmd\""]
expect { eof { } }
if {[lindex [wait $pid] end] != 0} {
puts stderr "Error: Single-image creation failed"
exit -4
}
exec cp [bin_dir]/bootstrap.elf [run_dir]/image.elf
build_uboot_image [run_dir]/image.elf
puts "\nboot image: [run_dir]/image.elf\n"
# set symbolic link to image.elf file in TFTP directory for PXE boot
if {[info exists ::env(PXE_TFTP_DIR_BASE)] &&
[info exists ::env(PXE_TFTP_DIR_OFFSET)]} {
exec ln -sf "[pwd]/[run_dir]/image.elf" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)"
if {[regexp "uboot" $run_target]} {
exec ln -sf "[pwd]/[run_dir]/uImage" "$::env(PXE_TFTP_DIR_BASE)$::env(PXE_TFTP_DIR_OFFSET)/uImage"
}
}
}
proc build_boot_image {binaries} {
if {[have_spec x86]} { return [build_boot_image_x86 $binaries] }
if {[have_spec arm]} { return [build_boot_image_arm $binaries] }
}
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
}
if {[is_serial_available]} {
spawn_serial $wait_for_re $timeout_value "L4 Bootstrapper"
return
}
global run_target
puts stderr "Error: Can't execute automatically on target '$run_target'"
exit -1
}

View File

@@ -1,382 +0,0 @@
/*
* \brief Implementation of the IPC API for Fiasco.OC
* \author Stefan Kalkowski
* \date 2009-12-03
*/
/*
* 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.
*/
/*
* l4_msgtag_t (size == 1 mword) format:
*
* --------------------------------------------------------------
* | label | 4 Bit flags | 6 Bit items | 6 Bit word count |
* --------------------------------------------------------------
*/
/* Genode includes */
#include <base/blocking.h>
#include <base/ipc.h>
#include <base/ipc_msgbuf.h>
#include <base/thread.h>
#include <util/assert.h>
/* base-foc/src/base/lock */
#include <lock_helper.h> /* for 'thread_get_my_native_id()' */
/* Fiasco.OC includes */
namespace Fiasco {
#include <l4/sys/consts.h>
#include <l4/sys/ipc.h>
#include <l4/sys/types.h>
#include <l4/sys/utcb.h>
#include <l4/sys/kdebug.h>
}
using namespace Genode;
using namespace Fiasco;
/*****************************
** IPC marshalling support **
*****************************/
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);
return;
}
}
/* transfer capability id */
_write_to_buf(cap.local_name());
/* only transfer kernel-capability if it's a valid one */
if (cap.valid())
_snd_msg->snd_append_cap_sel(cap.dst());
ASSERT(!cap.valid() ||
l4_msgtag_label(l4_task_cap_valid(L4_BASE_TASK_CAP, cap.dst())),
"Send invalid cap");
}
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);
/* if id is zero an invalid capability was transfered */
if (!value) {
cap = Native_capability();
return;
}
/* try to insert received capability in the map and return it */
cap = Native_capability(cap_map()->insert_map(value, _rcv_msg->rcv_cap_sel()));
}
/***************
** Utilities **
***************/
enum Debug {
DEBUG_MSG = 0,
HALT_ON_ERROR = 0
};
static inline bool ipc_error(l4_msgtag_t tag, bool print)
{
int ipc_error = l4_ipc_error(tag, l4_utcb());
if (ipc_error) {
if (print) {
outstring("Ipc error: ");
outhex32(ipc_error);
outstring(" occurred!\n");
}
if (HALT_ON_ERROR)
enter_kdebug("Ipc error");
return true;
}
return false;
}
/**
* Copy message registers from UTCB to destination message buffer
*/
static void copy_utcb_to_msgbuf(l4_msgtag_t tag, Msgbuf_base *rcv_msg)
{
unsigned num_msg_words = l4_msgtag_words(tag);
unsigned num_cap_sel = l4_msgtag_items(tag);
if (num_msg_words == 0 && num_cap_sel == 0)
return;
/* look up and validate destination message buffer to receive the payload */
l4_mword_t *msg_buf = (l4_mword_t *)rcv_msg->buf;
if (num_msg_words*sizeof(l4_mword_t) > rcv_msg->size()) {
if (DEBUG_MSG)
outstring("receive message buffer too small");
num_msg_words = rcv_msg->size()/sizeof(l4_mword_t);
}
/* read message payload into destination message buffer */
l4_mword_t *src = (l4_mword_t *)l4_utcb_mr();
l4_mword_t *dst = (l4_mword_t *)&msg_buf[0];
for (unsigned i = 0; i < num_msg_words; i++)
*dst++ = *src++;
rcv_msg->rcv_reset();
}
/**
* Copy message registers from message buffer to UTCB and create message tag.
*/
static l4_msgtag_t copy_msgbuf_to_utcb(Msgbuf_base *snd_msg, unsigned offset,
Native_capability dst)
{
l4_mword_t *msg_buf = (l4_mword_t *)snd_msg->buf;
unsigned num_msg_words = offset/sizeof(l4_mword_t);
unsigned num_cap_sel = snd_msg->snd_cap_sel_cnt();
if (num_msg_words + 2 * num_cap_sel > L4_UTCB_GENERIC_DATA_SIZE) {
if (DEBUG_MSG)
outstring("receive message buffer too small");
throw Ipc_error();
}
/* first copy target label to message buffer */
msg_buf[0] = dst.local_name();
/* store message into UTCB message registers */
for (unsigned i = 0; i < num_msg_words; i++)
l4_utcb_mr()->mr[i] = msg_buf[i];
/* setup flexpages of capabilities to send */
for (unsigned i = 0; i < num_cap_sel; i++) {
unsigned idx = num_msg_words + 2*i;
l4_utcb_mr()->mr[idx] = L4_ITEM_MAP/* | L4_ITEM_CONT*/;
l4_utcb_mr()->mr[idx + 1] = l4_obj_fpage(snd_msg->snd_cap_sel(i),
0, L4_FPAGE_RWX).raw;
}
/* we have consumed capability selectors, reset message buffer */
snd_msg->snd_reset();
return l4_msgtag(0, num_msg_words, num_cap_sel, 0);
}
/*****************
** Ipc_ostream **
*****************/
void Ipc_ostream::_send()
{
l4_msgtag_t tag = copy_msgbuf_to_utcb(_snd_msg, _write_offset, _dst);
tag = l4_ipc_send(_dst.dst(), l4_utcb(), tag, L4_IPC_NEVER);
if (ipc_error(tag, DEBUG_MSG))
throw Ipc_error();
_write_offset = sizeof(l4_mword_t);
}
Ipc_ostream::Ipc_ostream(Native_capability dst, Msgbuf_base *snd_msg)
:
Ipc_marshaller(&snd_msg->buf[0], snd_msg->size()),
_snd_msg(snd_msg), _dst(dst)
{
_write_offset = sizeof(l4_mword_t);
}
/*****************
** Ipc_istream **
*****************/
void Ipc_istream::_wait()
{
l4_umword_t label = 0;
addr_t rcv_cap_sel = _rcv_msg->rcv_cap_sel_base();
for (int i = 0; i < Msgbuf_base::MAX_CAP_ARGS; i++) {
l4_utcb_br()->br[i] = rcv_cap_sel | L4_RCV_ITEM_SINGLE_CAP;
rcv_cap_sel += L4_CAP_SIZE;
}
l4_utcb_br()->bdr = 0;
l4_msgtag_t tag;
do {
tag = l4_ipc_wait(l4_utcb(), &label, L4_IPC_NEVER);
} while (ipc_error(tag, DEBUG_MSG));
/* copy received label into message buffer */
_rcv_msg->label(label);
/* copy message from the UTCBs message registers to the receive buffer */
copy_utcb_to_msgbuf(tag, _rcv_msg);
/* reset unmarshaller */
_read_offset = sizeof(l4_mword_t);
}
Ipc_istream::Ipc_istream(Msgbuf_base *rcv_msg)
:
Ipc_unmarshaller(&rcv_msg->buf[0], rcv_msg->size()),
Native_capability((Cap_index*)Fiasco::l4_utcb_tcr()->user[Fiasco::UTCB_TCR_BADGE]),
_rcv_msg(rcv_msg)
{
_read_offset = sizeof(l4_mword_t);
}
Ipc_istream::~Ipc_istream() { }
/****************
** Ipc_client **
****************/
void Ipc_client::_call()
{
/* copy call message to the UTCBs message registers */
l4_msgtag_t tag = copy_msgbuf_to_utcb(_snd_msg, _write_offset, _dst);
addr_t rcv_cap_sel = _rcv_msg->rcv_cap_sel_base();
for (int i = 0; i < Msgbuf_base::MAX_CAP_ARGS; i++) {
l4_utcb_br()->br[i] = rcv_cap_sel | L4_RCV_ITEM_SINGLE_CAP;
rcv_cap_sel += L4_CAP_SIZE;
}
tag = l4_ipc_call(_dst.dst(), l4_utcb(), tag, L4_IPC_NEVER);
if (l4_ipc_error(tag, l4_utcb()) == L4_IPC_RECANCELED)
throw Genode::Blocking_canceled();
if (ipc_error(tag, DEBUG_MSG))
throw Genode::Ipc_error();
/* copy request message from the UTCBs message registers */
copy_utcb_to_msgbuf(tag, _rcv_msg);
_write_offset = _read_offset = sizeof(umword_t);
}
Ipc_client::Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
Msgbuf_base *rcv_msg, unsigned short)
: Ipc_istream(rcv_msg), Ipc_ostream(srv, snd_msg), _result(0) { }
/****************
** Ipc_server **
****************/
void Ipc_server::_prepare_next_reply_wait()
{
/* now we have a request to reply */
_reply_needed = true;
/* leave space for return value at the beginning of the msgbuf */
_write_offset = 2*sizeof(umword_t);
/* receive buffer offset */
_read_offset = sizeof(umword_t);
}
void Ipc_server::_wait()
{
/* wait for new server request */
try { Ipc_istream::_wait(); } catch (Blocking_canceled) { }
/* we only have an unknown implicit reply capability */
/* _dst = ???; */
_prepare_next_reply_wait();
}
void Ipc_server::_reply()
{
l4_msgtag_t tag = copy_msgbuf_to_utcb(_snd_msg, _write_offset, _dst);
tag = l4_ipc_send(L4_SYSF_REPLY, l4_utcb(), tag, L4_IPC_SEND_TIMEOUT_0);
ipc_error(tag, DEBUG_MSG);
}
void Ipc_server::_reply_wait()
{
if (_reply_needed) {
l4_umword_t label;
addr_t rcv_cap_sel = _rcv_msg->rcv_cap_sel_base();
for (int i = 0; i < Msgbuf_base::MAX_CAP_ARGS; i++) {
l4_utcb_br()->br[i] = rcv_cap_sel | L4_RCV_ITEM_SINGLE_CAP;
rcv_cap_sel += L4_CAP_SIZE;
}
l4_utcb_br()->bdr &= ~L4_BDR_OFFSET_MASK;
l4_msgtag_t tag = copy_msgbuf_to_utcb(_snd_msg, _write_offset, _dst);
tag = l4_ipc_reply_and_wait(l4_utcb(), tag, &label, L4_IPC_SEND_TIMEOUT_0);
if (ipc_error(tag, false)) {
/*
* The error conditions could be a message cut (which
* we want to ignore on the server side) or a reply failure
* (for example, if the caller went dead during the call.
* In both cases, we do not reflect the error condition to
* the user but want to wait for the next proper incoming
* message. So let's just wait now.
*/
_wait();
} else {
/* copy received label into message buffer */
_rcv_msg->label(label);
/* copy request message from the UTCBs message registers */
copy_utcb_to_msgbuf(tag, _rcv_msg);
}
} else
_wait();
/* reply capability is implicit in fiasco.oc and unknown to us */
/* _dst = ???; */
_prepare_next_reply_wait();
}
Ipc_server::Ipc_server(Msgbuf_base *snd_msg,
Msgbuf_base *rcv_msg)
: Ipc_istream(rcv_msg),
Ipc_ostream(Native_capability(), snd_msg),
_reply_needed(false)
{ }

View File

@@ -1,126 +0,0 @@
/*
* \brief Pager support for Fiasco.OC
* \author Stefan Kalkowski
* \date 2011-01-11
*/
/*
* 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.
*/
#include <base/ipc_pager.h>
#include <base/printf.h>
#include <base/thread.h>
namespace Fiasco {
#include <l4/sys/ipc.h>
}
using namespace Genode;
using namespace Fiasco;
void Ipc_pager::_parse(unsigned long label) {
_badge = label & ~0x3;
_parse_msg_type();
if (_type == PAGEFAULT || _type == EXCEPTION)
_parse_pagefault();
if (_type == PAUSE || _type == EXCEPTION)
memcpy(&_regs, l4_utcb_exc(), sizeof(l4_exc_regs_t));
}
void Ipc_pager::_parse_pagefault()
{
if (_tag.is_exception()) {
_pf_addr = l4_utcb_exc_pfa(l4_utcb_exc());
_pf_ip = l4_utcb_exc_pc(l4_utcb_exc());
} else {
_pf_addr = l4_utcb_mr()->mr[0];
_pf_ip = l4_utcb_mr()->mr[1];
}
}
void Ipc_pager::_parse_msg_type()
{
if (_tag.is_exception() && !l4_utcb_exc_is_pf(l4_utcb_exc())) {
_parse_exception();
return;
}
if (_tag.is_page_fault())
_type = PAGEFAULT;
else {
_type = WAKE_UP;
_pf_ip = l4_utcb_mr()->mr[1];
}
}
void Ipc_pager::wait_for_fault()
{
l4_umword_t label;
do {
_tag = l4_ipc_wait(l4_utcb(), &label, L4_IPC_NEVER);
int err = l4_ipc_error(_tag, l4_utcb());
if (!err) {
_parse(label);
return;
}
PERR("Ipc error %d in pagefault from %lx", err, label & ~0x3);
} while (true);
}
void Ipc_pager::reply_and_wait_for_fault()
{
l4_umword_t label;
l4_msgtag_t snd_tag = l4_msgtag(0, 0, 1, 0);
l4_umword_t grant = _reply_mapping.grant() ? L4_MAP_ITEM_GRANT : 0;
l4_utcb_mr()->mr[0] = _reply_mapping.dst_addr() | L4_ITEM_MAP | grant;
/*
* XXX Does L4_FPAGE_BUFFERABLE imply L4_FPAGE_UNCACHEABLE?
*/
if (_reply_mapping.write_combined())
l4_utcb_mr()->mr[0] |= L4_FPAGE_BUFFERABLE << 4;
l4_utcb_mr()->mr[1] = _reply_mapping.fpage().raw;
_tag = l4_ipc_send_and_wait(_last, l4_utcb(), snd_tag,
&label, L4_IPC_SEND_TIMEOUT_0);
int err = l4_ipc_error(_tag, l4_utcb());
if (err) {
PERR("Ipc error %d in pagefault from %lx", err, label & ~0x3);
wait_for_fault();
} else
_parse(label);
}
void Ipc_pager::acknowledge_wakeup()
{
l4_cap_idx_t dst = Fiasco::Capability::valid(_last) ? _last : L4_SYSF_REPLY;
/* answer wakeup call from one of core's region-manager sessions */
l4_ipc_send(dst, l4_utcb(), l4_msgtag(0, 0, 0, 0), L4_IPC_SEND_TIMEOUT_0);
}
void Ipc_pager::acknowledge_exception()
{
memcpy(l4_utcb_exc(), &_regs, sizeof(l4_exc_regs_t));
l4_cap_idx_t dst = Fiasco::Capability::valid(_last) ? _last : L4_SYSF_REPLY;
l4_ipc_send(dst, l4_utcb(), l4_msgtag(0, L4_UTCB_EXCEPTION_REGS_SIZE, 0, 0), L4_IPC_SEND_TIMEOUT_0);
}
Ipc_pager::Ipc_pager()
: Native_capability((Cap_index*)Fiasco::l4_utcb_tcr()->user[Fiasco::UTCB_TCR_BADGE]),
_badge(0) { }

View File

@@ -1,94 +0,0 @@
/*
* \brief Fiasco.OC-specific helper functions for the Lock implementation
* \author Stefan Kalkowski
* \author Norman Feske
* \date 2011-02-22
*
* This file serves as adapter between the generic lock implementation
* in 'lock.cc' and the underlying kernel.
*/
/*
* 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 _INCLUDE__BASE__LOCK__LOCK_HELPER_H_
#define _INCLUDE__BASE__LOCK__LOCK_HELPER_H_
/* Genode includes */
#include <base/native_types.h>
#include <base/thread.h>
/* Fiasco.OC includes */
namespace Fiasco {
#include <l4/sys/kdebug.h>
#include <l4/sys/irq.h>
#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
*/
static inline void thread_yield() { Fiasco::l4_thread_yield(); }
/**
* Custom ExchangeRegisters wrapper for waking up a thread
*
* When waking up an lock applicant, we need to make sure that the thread was
* stopped beforehand. Therefore, we evaluate the previous thread state as
* returned by the 'L4_ExchangeRegisters' call.
*
* \return true if the thread was in blocking state
*/
static inline bool thread_check_stopped_and_restart(Genode::Thread_base *thread_base)
{
Genode::Native_thread_id tid = thread_base ?
thread_base->tid() :
Fiasco::MAIN_THREAD_CAP;
Genode::Native_thread_id irq = tid + Fiasco::THREAD_IRQ_CAP;
Fiasco::l4_irq_trigger(irq);
return true;
}
/**
* Yield CPU time to the specified thread
*/
static inline void thread_switch_to(Genode::Thread_base *thread_base)
{
Genode::Native_thread_id tid = thread_base ?
thread_base->tid() :
Fiasco::MAIN_THREAD_CAP;
Fiasco::l4_thread_switch(tid);
}
/**
* Unconditionally block the calling thread
*/
static inline void thread_stop_myself()
{
using namespace Fiasco;
Genode::Thread_base *myself = Genode::Thread_base::myself();
Genode::Native_thread_id tid = myself ?
myself->tid() :
Fiasco::MAIN_THREAD_CAP;
Genode::Native_thread_id irq = tid + THREAD_IRQ_CAP;
l4_irq_receive(irq, L4_IPC_NEVER);
}
#endif /* _INCLUDE__BASE__LOCK__LOCK_HELPER_H_ */

View File

@@ -1,191 +0,0 @@
/*
* \brief Fiasco pager framework
* \author Norman Feske
* \author Christian Helmuth
* \author Stefan Kalkowski
* \date 2006-07-14
*
* FIXME Isn't this file generic?
*/
/*
* Copyright (C) 2006-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.
*/
/* Genode includes */
#include <base/pager.h>
#include <base/env.h>
#include <base/printf.h>
#include <base/lock.h>
/* Fiasco.OC includes */
namespace Fiasco {
#include <l4/sys/factory.h>
#include <l4/sys/ipc.h>
}
using namespace Genode;
/**********************
** Pager activation **
**********************/
void Pager_activation_base::entry()
{
Ipc_pager pager;
_cap = Native_capability(Thread_base::_thread_cap);
_cap_valid.unlock();
bool reply_pending = false;
while (1) {
if (reply_pending)
pager.reply_and_wait_for_fault();
else
pager.wait_for_fault();
reply_pending = false;
if (!_ep) {
PWRN("Pager entrypoint not yet defined");
continue;
}
/* lookup referenced object */
Object_pool<Pager_object>::Guard obj(_ep->lookup_and_lock(pager.badge()));
/* the pager_object might be destroyed, while we got the message */
if (!obj) {
PWRN("No pager object found!");
continue;
}
switch (pager.msg_type()) {
case Ipc_pager::PAGEFAULT:
case Ipc_pager::EXCEPTION:
{
if (pager.is_exception()) {
Lock::Guard guard(obj->state.lock);
pager.get_regs(&obj->state);
obj->state.exceptions++;
obj->state.in_exception = true;
obj->submit_exception_signal();
continue;
}
/* handle request */
if (obj->pager(pager)) {
/* could not resolv - leave thread in pagefault */
Lock::Guard guard(obj->state.lock);
obj->state.unresolved_page_fault = true;
PDBG("Could not resolve pf=%p ip=%p",
(void*)pager.fault_addr(), (void*)pager.fault_ip());
} else {
pager.set_reply_dst(obj->badge());
reply_pending = true;
continue;
}
break;
}
case Ipc_pager::WAKE_UP:
{
/*
* We got a request from one of cores region-manager sessions
* to answer the pending page fault of a resolved region-manager
* client, or to resume a previously paused thread. Hence, we
* have to send a reply to the specified thread and answer the
* call.
*/
/* send reply to the caller */
pager.set_reply_dst(Native_thread());
pager.acknowledge_wakeup();
{
Lock::Guard guard(obj->state.lock);
/* revert exception flag */
obj->state.in_exception = false;
/* set new register contents */
pager.set_regs(obj->state);
}
/* send wake up message to requested thread */
pager.set_reply_dst(obj->badge());
pager.acknowledge_exception();
break;
}
/*
* Handle exceptions that are artificially generated by the pause
* function of the CPU service.
*/
case Ipc_pager::PAUSE:
{
Lock::Guard guard(obj->state.lock);
pager.get_regs(&obj->state);
obj->state.exceptions++;
obj->state.in_exception = true;
/*
* It might occur that the thread raises an exception,
* after it already got resumed by the cpu_session, in
* that case we unblock it immediately.
*/
if (!obj->state.paused) {
pager.set_reply_dst(obj->badge());
reply_pending = true;
}
break;
}
default:
PERR("Got unknown message type %x!", pager.msg_type());
}
};
}
/**********************
** Pager entrypoint **
**********************/
Pager_entrypoint::Pager_entrypoint(Cap_session *cap_session,
Pager_activation_base *a)
: _activation(a), _cap_session(cap_session)
{
_activation->ep(this);
}
void Pager_entrypoint::dissolve(Pager_object *obj)
{
/* cleanup at cap session */
_cap_session->free(obj->Object_pool<Pager_object>::Entry::cap());
remove_locked(obj);
}
Pager_capability Pager_entrypoint::manage(Pager_object *obj)
{
using namespace Fiasco;
/* return invalid capability if no activation is present */
if (!_activation) return Pager_capability();
Native_capability c = _activation->cap();
Native_capability cap(_cap_session->alloc(c));
/* add server object to object pool */
obj->cap(cap);
insert(obj);
/* return capability that uses the object id as badge */
return reinterpret_cap_cast<Pager_object>(cap);
}

View File

@@ -1,100 +0,0 @@
/*
* \brief Default version of platform-specific part of server framework
* \author Norman Feske
* \author Stefan Kalkowski
* \date 2006-05-12
*
* This version is suitable for platforms similar to L4. Each platform
* for which this implementation is not suited contains a platform-
* specific version in its respective 'base-<platform>' repository.
*/
/*
* Copyright (C) 2006-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.
*/
/* Genode includes */
#include <base/rpc_server.h>
using namespace Genode;
/***********************
** Server entrypoint **
***********************/
Untyped_capability Rpc_entrypoint::_manage(Rpc_object_base *obj)
{
Untyped_capability new_obj_cap = _cap_session->alloc(_cap);
/* add server object to object pool */
obj->cap(new_obj_cap);
insert(obj);
/* return capability that uses the object id as badge */
return new_obj_cap;
}
void Rpc_entrypoint::entry()
{
Ipc_server srv(&_snd_buf, &_rcv_buf);
_ipc_server = &srv;
_cap = srv;
_cap_valid.unlock();
/*
* Now, the capability of the server activation is initialized
* an can be passed around. However, the processing of capability
* invocations should not happen until activation-using server
* is completely initialized. Thus, we wait until the activation
* gets explicitly unblocked by calling 'Rpc_entrypoint::activate()'.
*/
_delay_start.lock();
while (!_exit_handler.exit) {
int opcode = 0;
srv >> IPC_REPLY_WAIT >> opcode;
/* set default return value */
srv.ret(ERR_INVALID_OBJECT);
/* check whether capability's label fits global id */
if (((unsigned long)srv.badge()) != _rcv_buf.label()) {
PWRN("somebody tries to fake us!");
continue;
}
/* atomically lookup and lock referenced object */
Object_pool<Rpc_object_base>::Guard curr_obj(lookup_and_lock(srv.badge()));
if (!curr_obj)
continue;
{
Lock::Guard lock_guard(_curr_obj_lock);
_curr_obj = curr_obj;
}
/* dispatch request */
try { srv.ret(_curr_obj->dispatch(opcode, srv, srv)); }
catch (Blocking_canceled) { }
{
Lock::Guard lock_guard(_curr_obj_lock);
_curr_obj = 0;
}
}
/* answer exit call, thereby wake up '~Rpc_entrypoint' */
srv << IPC_REPLY;
/* defer the destruction of 'Ipc_server' until '~Rpc_entrypoint' is ready */
_delay_exit.lock();
}

View File

@@ -1,170 +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();
}
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)
:
_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()
{
_deinit_platform_thread();
_free_context(_context);
}

View File

@@ -1,59 +0,0 @@
/*
* \brief Fiasco.OC specific thread bootstrap code
* \author Stefan Kalkowski
* \author Martin Stein
* \date 2011-01-20
*/
/*
* 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.
*/
/* Genode includes */
#include <util/construct_at.h>
#include <base/thread.h>
/*****************************
** Startup library support **
*****************************/
void prepare_init_main_thread()
{
using namespace Genode;
enum { THREAD_CAP_ID = 1 };
Cap_index * ci(cap_map()->insert(THREAD_CAP_ID, Fiasco::MAIN_THREAD_CAP));
Fiasco::l4_utcb_tcr()->user[Fiasco::UTCB_TCR_BADGE] = (unsigned long)ci;
Fiasco::l4_utcb_tcr()->user[Fiasco::UTCB_TCR_THREAD_OBJ] = 0;
}
void prepare_reinit_main_thread()
{
using namespace Genode;
construct_at<Capability_map>(cap_map());
cap_idx_alloc()->reinit();
prepare_init_main_thread();
}
/*****************
** Thread_base **
*****************/
void Genode::Thread_base::_thread_bootstrap() { }
void Genode::Thread_base::_thread_start()
{
using namespace Genode;
Thread_base::myself()->_thread_bootstrap();
Thread_base::myself()->entry();
Thread_base::myself()->_join_lock.unlock();
Lock sleep_forever_lock(Lock::LOCKED);
sleep_forever_lock.lock();
}

View File

@@ -1,92 +0,0 @@
/*
* \brief Fiasco-specific implementation of the non-core startup Thread API
* \author Norman Feske
* \author Stefan Kalkowski
* \author Martin Stein
* \date 2010-01-19
*/
/*
* 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.
*/
/* Genode includes */
#include <base/thread.h>
#include <base/printf.h>
#include <base/sleep.h>
#include <base/env.h>
namespace Fiasco {
#include <l4/sys/utcb.h>
}
using namespace Genode;
void Thread_base::_deinit_platform_thread()
{
using namespace Fiasco;
if (_context->utcb && _thread_cap.valid()) {
Cap_index *i = (Cap_index*)l4_utcb_tcr_u(_context->utcb)->user[UTCB_TCR_BADGE];
cap_map()->remove(i);
env()->cpu_session()->kill_thread(_thread_cap);
env()->rm_session()->remove_client(_pager_cap);
}
}
void Thread_base::_init_platform_thread(Type type)
{
if (type == NORMAL)
{
/* create thread at core */
char buf[48];
name(buf, sizeof(buf));
_thread_cap = env()->cpu_session()->create_thread(buf);
/* assign thread to protection domain */
env()->pd_session()->bind_thread(_thread_cap);
return;
}
/* adjust values whose computation differs for a main thread */
_tid = Fiasco::MAIN_THREAD_CAP;
_thread_cap = env()->parent()->main_thread_cap();
/* 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;
}
void Thread_base::start()
{
using namespace Fiasco;
/* create new pager object and assign it to the new thread */
_pager_cap = env()->rm_session()->add_client(_thread_cap);
env()->cpu_session()->set_pager(_thread_cap, _pager_cap);
/* get gate-capability and badge of new thread */
Thread_state state;
try { state = env()->cpu_session()->state(_thread_cap); }
catch (...) { throw Cpu_session::Thread_creation_failed(); }
_tid = state.kcap;
_context->utcb = state.utcb;
Cap_index *i = cap_map()->insert(state.id, state.kcap);
l4_utcb_tcr_u(state.utcb)->user[UTCB_TCR_BADGE] = (unsigned long) i;
l4_utcb_tcr_u(state.utcb)->user[UTCB_TCR_THREAD_OBJ] = (addr_t)this;
/* register initial IP and SP at core */
env()->cpu_session()->start(_thread_cap, (addr_t)_thread_start, _context->stack_top());
}
void Thread_base::cancel_blocking()
{
env()->cpu_session()->cancel_blocking(_thread_cap);
}

View File

@@ -1,9 +0,0 @@
include $(PRG_DIR)/../target.inc
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

@@ -1,225 +0,0 @@
/*
* \brief Fiasco.oc platform-specific capability allocation
* \author Stefan Kalkowski
* \date 2011-01-13
*/
/*
* 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.
*/
/* Genode includes */
#include <base/capability.h>
#include <base/cap_alloc.h>
#include <util/misc_math.h>
/* core includes */
#include <cap_session_component.h>
#include <cap_id_alloc.h>
#include <cap_index.h>
#include <platform.h>
namespace Fiasco {
#include <l4/sys/consts.h>
#include <l4/sys/debugger.h>
#include <l4/sys/factory.h>
#include <l4/sys/task.h>
#include <l4/sys/types.h>
}
#include <util/assert.h>
using namespace Genode;
/***************************
** Cap_index_allocator **
***************************/
Genode::Cap_index_allocator* Genode::cap_idx_alloc()
{
static Genode::Cap_index_allocator_tpl<Core_cap_index,10*1024> alloc;
return &alloc;
}
/*******************
** Cap_mapping **
*******************/
Core_cap_index* Cap_mapping::_get_cap()
{
int id = platform_specific()->cap_id_alloc()->alloc();
return static_cast<Core_cap_index*>(cap_map()->insert(id));
}
void Cap_mapping::map(Native_thread_id task)
{
using namespace Fiasco;
if (!local.valid() || !Fiasco::Capability::valid(remote))
return;
l4_msgtag_t tag = l4_task_map(task, L4_BASE_TASK_CAP,
l4_obj_fpage(local.dst(), 0, L4_FPAGE_RWX),
((l4_cap_idx_t)remote) | L4_ITEM_MAP);
if (l4_msgtag_has_error(tag))
PERR("mapping cap failed");
}
Cap_mapping::Cap_mapping(bool alloc, Native_thread_id r)
: local(alloc ? _get_cap() : 0), remote(r) { }
Cap_mapping::Cap_mapping(Native_capability cap, Native_thread_id r)
: local(cap), remote(r) { }
/*****************************
** Cap_session_component **
*****************************/
Native_capability Cap_session_component::alloc(Cap_session_component *session,
Native_capability ep)
{
Native_capability cap;
if (!ep.valid()) {
PWRN("Invalid cap!");
return cap;
}
try {
using namespace Fiasco;
Core_cap_index* ref = static_cast<Core_cap_index*>(ep.idx());
ASSERT(ref && ref->pt(), "No valid platform_thread");
/*
* Allocate new id, and ipc-gate and set id as gate-label
*/
unsigned long id = platform_specific()->cap_id_alloc()->alloc();
Core_cap_index* idx = static_cast<Core_cap_index*>(cap_map()->insert(id));
if (!idx) {
PWRN("Out of capabilities!");
platform_specific()->cap_id_alloc()->free(id);
return cap;
}
l4_msgtag_t tag = l4_factory_create_gate(L4_BASE_FACTORY_CAP,
idx->kcap(),
ref->pt()->thread().local.dst(), id);
if (l4_msgtag_has_error(tag)) {
PERR("l4_factory_create_gate failed!");
cap_map()->remove(idx);
platform_specific()->cap_id_alloc()->free(id);
return cap;
} else
/* set debugger-name of ipc-gate to thread's name */
Fiasco::l4_debugger_set_object_name(idx->kcap(), ref->pt()->name());
idx->session(session);
idx->pt(ref->pt());
idx->inc();
cap = Native_capability(idx);
} catch (Cap_id_allocator::Out_of_ids) {
PERR("Out of IDs");
}
return cap;
}
Native_capability Cap_session_component::alloc(Native_capability ep)
{
return Cap_session_component::alloc(this, ep);
}
void Cap_session_component::free(Native_capability cap)
{
using namespace Fiasco;
if (!cap.valid())
return;
Core_cap_index* idx = static_cast<Core_cap_index*>(cap.idx());
/*
* check whether this cap_session has created the capability to delete.
*/
if (idx->session() != this)
return;
idx->dec();
}
/*******************************
** Capability ID Allocator **
*******************************/
Cap_id_allocator::Cap_id_allocator(Allocator* alloc)
: _id_alloc(alloc)
{
_id_alloc.add_range(CAP_ID_OFFSET, CAP_ID_RANGE);
}
unsigned long Cap_id_allocator::alloc()
{
Lock::Guard lock_guard(_lock);
void *id;
if (_id_alloc.alloc(CAP_ID_OFFSET, &id))
return (unsigned long) id;
throw Out_of_ids();
}
void Cap_id_allocator::free(unsigned long id)
{
Lock::Guard lock_guard(_lock);
if (id < CAP_ID_RANGE)
_id_alloc.free((void*)(id & CAP_ID_MASK), CAP_ID_OFFSET);
}
void Genode::Capability_map::remove(Genode::Cap_index* i)
{
using namespace Genode;
using namespace Fiasco;
Lock_guard<Spin_lock> guard(_lock);
if (i) {
Core_cap_index* e = static_cast<Core_cap_index*>(_tree.first() ? _tree.first()->find_by_id(i->id()) : 0);
if (e == i) {
l4_msgtag_t tag = l4_task_unmap(L4_BASE_TASK_CAP,
l4_obj_fpage(i->kcap(), 0, L4_FPAGE_RWX),
L4_FP_ALL_SPACES | L4_FP_DELETE_OBJ);
if (l4_msgtag_has_error(tag))
PERR("destruction of ipc-gate %lx failed!", (unsigned long) i->kcap());
platform_specific()->cap_id_alloc()->free(i->id());
_tree.remove(i);
}
cap_idx_alloc()->free(i, 1);
}
}
Genode::Cap_index_allocator* cap_idx_alloc()
{
static Genode::Cap_index_allocator_tpl<Core_cap_index, 20*1024> _alloc;
return &_alloc;
}

View File

@@ -1,109 +0,0 @@
/**
* \brief Core implementation of the CPU session interface extension
* \author Stefan Kalkowski
* \date 2011-04-04
*/
/*
* 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.
*/
/* Genode includes */
#include <base/printf.h>
/* Core includes */
#include <cpu_session_component.h>
#include <platform.h>
/* Fiasco.OC includes */
namespace Fiasco {
#include <l4/sys/thread.h>
#include <l4/sys/factory.h>
}
static Genode::Avl_tree<Genode::Cpu_session_irqs> _irq_tree;
Genode::Ram_dataspace_capability Genode::Cpu_session_component::utcb(Genode::Thread_capability thread_cap)
{
using namespace Genode;
PERR("%s: Not implemented", __PRETTY_FUNCTION__);
return Ram_dataspace_capability();
}
void Genode::Cpu_session_component::enable_vcpu(Genode::Thread_capability thread_cap,
Genode::addr_t vcpu_state)
{
using namespace Genode;
using namespace Fiasco;
Object_pool<Cpu_thread_component>::Guard thread(_thread_ep->lookup_and_lock(thread_cap));
if (!thread) return;
Native_thread tid = thread->platform_thread()->thread().local.dst();
l4_msgtag_t tag = l4_thread_vcpu_control(tid, vcpu_state);
if (l4_msgtag_has_error(tag))
PWRN("l4_thread_vcpu_control failed");
}
Genode::Native_capability
Genode::Cpu_session_component::native_cap(Genode::Thread_capability cap)
{
using namespace Genode;
Object_pool<Cpu_thread_component>::Guard thread(_thread_ep->lookup_and_lock(cap));
if (!thread) return Native_capability();
return thread->platform_thread()->thread().local;
}
Genode::Native_capability Genode::Cpu_session_component::alloc_irq()
{
using namespace Fiasco;
using namespace Genode;
/* find irq object container of this cpu-session */
Cpu_session_irqs* node = _irq_tree.first();
if (node)
node = node->find_by_session(this);
/* if not found, we've to create one */
if (!node) {
node = new (&_md_alloc) Cpu_session_irqs(this);
_irq_tree.insert(node);
}
/* construct irq kernel-object */
Cap_index* i = cap_map()->insert(platform_specific()->cap_id_alloc()->alloc());
l4_msgtag_t res = l4_factory_create_irq(L4_BASE_FACTORY_CAP, i->kcap());
if (l4_error(res)) {
PWRN("Allocation of irq object failed!");
return Genode::Native_capability();
}
/* construct cap and hold a reference in the irq container object */
Genode::Native_capability cap(i);
return (node->add(cap)) ? cap : Genode::Native_capability();
}
void Genode::Cpu_session_component::single_step(Genode::Thread_capability thread_cap, bool enable)
{
using namespace Genode;
Object_pool<Cpu_thread_component>::Guard thread(_thread_ep->lookup_and_lock(thread_cap));
if (!thread) return;
Native_thread tid = thread->platform_thread()->thread().local.dst();
enum { THREAD_SINGLE_STEP = 0x40000 };
int flags = enable ? THREAD_SINGLE_STEP : 0;
Fiasco::l4_thread_ex_regs(tid, ~0UL, ~0UL, flags);
}

View File

@@ -1,10 +0,0 @@
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
vpath platform_services.cc $(GEN_CORE_DIR)

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

@@ -1,42 +0,0 @@
/*
* \brief Capability session service
* \author Stefan Kalkowski
* \date 2011-01-13
*/
/*
* 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__CAP_SESSION_COMPONENT_H_
#define _CORE__INCLUDE__CAP_SESSION_COMPONENT_H_
/* Genode includes */
#include <base/rpc_server.h>
#include <base/allocator.h>
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) {}
Native_capability alloc(Native_capability ep);
void free(Native_capability cap);
static Native_capability alloc(Cap_session_component *session,
Native_capability ep);
};
}
#endif /* _CORE__INCLUDE__CAP_SESSION_COMPONENT_H_ */

View File

@@ -1,254 +0,0 @@
/*
* \brief Core-specific instance of the CPU session/thread interfaces
* \author Christian Helmuth
* \author Norman Feske
* \author Stefan Kalkowski
* \date 2006-07-17
*/
/*
* Copyright (C) 2006-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__CPU_SESSION_COMPONENT_H_
#define _CORE__INCLUDE__CPU_SESSION_COMPONENT_H_
/* Genode includes */
#include <util/list.h>
#include <base/allocator_guard.h>
#include <base/tslab.h>
#include <base/lock.h>
#include <base/pager.h>
#include <base/rpc_server.h>
#include <foc_cpu_session/foc_cpu_session.h>
/* core includes */
#include <platform_thread.h>
#include <trace/control_area.h>
#include <trace/source_registry.h>
namespace Genode {
/**
* RPC interface of CPU thread
*
* We make 'Cpu_thread' a RPC object only to be able to lookup CPU threads
* from thread capabilities supplied as arguments to CPU-session functions.
* A CPU thread does not provide an actual RPC interface.
*/
struct Cpu_thread
{
GENODE_RPC_INTERFACE();
};
class Cpu_thread_component : public Rpc_object<Cpu_thread>,
public List<Cpu_thread_component>::Element
{
public:
typedef Trace::Session_label Session_label;
typedef Trace::Thread_name Thread_name;
private:
Thread_name const _name;
Platform_thread _platform_thread;
bool _bound; /* pd binding flag */
Signal_context_capability _sigh; /* exception handler */
unsigned const _trace_control_index;
Trace::Source _trace_source;
public:
Cpu_thread_component(Session_label const &label,
Thread_name const &name,
unsigned priority, addr_t utcb,
Signal_context_capability sigh,
unsigned trace_control_index,
Trace::Control &trace_control)
:
_name(name),
_platform_thread(name.string(), priority, utcb), _bound(false),
_sigh(sigh), _trace_control_index(trace_control_index),
_trace_source(label, _name, trace_control)
{
update_exception_sigh();
}
/************************
** Accessor functions **
************************/
Platform_thread *platform_thread() { return &_platform_thread; }
bool bound() const { return _bound; }
void bound(bool b) { _bound = b; }
Trace::Source *trace_source() { return &_trace_source; }
void sigh(Signal_context_capability sigh)
{
_sigh = sigh;
update_exception_sigh();
}
/**
* Propagate exception handler to platform thread
*/
void update_exception_sigh();
/**
* Return index within the CPU-session's trace control area
*/
unsigned trace_control_index() const { return _trace_control_index; }
};
class Cpu_session_component : public Rpc_object<Foc_cpu_session>
{
public:
typedef Cpu_thread_component::Session_label Session_label;
private:
/**
* Allocator used for managing the CPU threads associated with the
* CPU session
*/
typedef Tslab<Cpu_thread_component, 1024> Cpu_thread_allocator;
Session_label _label;
Rpc_entrypoint *_thread_ep;
Pager_entrypoint *_pager_ep;
Allocator_guard _md_alloc; /* guarded meta-data allocator */
Cpu_thread_allocator _thread_alloc; /* meta-data allocator */
Lock _thread_alloc_lock; /* protect allocator access */
List<Cpu_thread_component> _thread_list;
Lock _thread_list_lock; /* protect thread list */
unsigned _priority; /* priority of threads
created with this
session */
Affinity::Location _location; /* CPU affinity of this
session */
Trace::Source_registry &_trace_sources;
Trace::Control_area _trace_control_area;
/**
* Exception handler that will be invoked unless overridden by a
* call of 'Cpu_session::exception_handler'.
*/
Signal_context_capability _default_exception_handler;
/**
* Raw thread-killing functionality
*
* This function is called from the 'kill_thread' function and
* the destructor. Each these functions grab the list lock
* by themselves and call this function to perform the actual
* killing.
*/
void _unsynchronized_kill_thread(Cpu_thread_component *thread);
public:
/**
* Constructor
*/
Cpu_session_component(Rpc_entrypoint *thread_ep,
Pager_entrypoint *pager_ep,
Allocator *md_alloc,
Trace::Source_registry &trace_sources,
const char *args, Affinity const &affinity);
/**
* Destructor
*/
~Cpu_session_component();
/**
* Register quota donation at allocator guard
*/
void upgrade_ram_quota(size_t ram_quota) { _md_alloc.upgrade(ram_quota); }
/***************************
** CPU session interface **
***************************/
Thread_capability create_thread(Name const &, addr_t);
Ram_dataspace_capability utcb(Thread_capability thread);
void kill_thread(Thread_capability);
Thread_capability first();
Thread_capability next(Thread_capability);
int set_pager(Thread_capability, Pager_capability);
int start(Thread_capability, addr_t, addr_t);
void pause(Thread_capability thread_cap);
void resume(Thread_capability thread_cap);
void single_step(Thread_capability thread_cap, bool enable);
void cancel_blocking(Thread_capability);
int name(Thread_capability, char *, size_t);
Thread_state state(Thread_capability);
void state(Thread_capability, Thread_state const &);
void exception_handler(Thread_capability, Signal_context_capability);
Affinity::Space affinity_space() const;
void affinity(Thread_capability, Affinity::Location);
Dataspace_capability trace_control();
unsigned trace_control_index(Thread_capability);
Dataspace_capability trace_buffer(Thread_capability);
Dataspace_capability trace_policy(Thread_capability);
/***********************************
** Fiasco.OC specific extensions **
***********************************/
void enable_vcpu(Thread_capability, addr_t);
Native_capability native_cap(Thread_capability);
Native_capability alloc_irq();
};
class Cpu_session_irqs : public Avl_node<Cpu_session_irqs>
{
private:
enum { IRQ_MAX = 20 };
Cpu_session_component* _owner;
Native_capability _irqs[IRQ_MAX];
unsigned _cnt;
public:
Cpu_session_irqs(Cpu_session_component *owner)
: _owner(owner), _cnt(0) {}
bool add(Native_capability irq)
{
if (_cnt >= (IRQ_MAX - 1))
return false;
_irqs[_cnt++] = irq;
return true;
}
/************************
** Avl node interface **
************************/
bool higher(Cpu_session_irqs *c) { return (c->_owner > _owner); }
Cpu_session_irqs *find_by_session(Cpu_session_component *o)
{
if (o == _owner) return this;
Cpu_session_irqs *c = Avl_node<Cpu_session_irqs>::child(o > _owner);
return c ? c->find_by_session(o) : 0;
}
};
}
#endif /* _CORE__INCLUDE__CPU_SESSION_COMPONENT_H_ */

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

@@ -1,57 +0,0 @@
/*
* \brief Core-specific instance of the PD session interface
* \author Christian Helmuth
* \author Stefan Kalkowski
* \date 2006-07-17
*/
/*
* Copyright (C) 2006-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__PD_SESSION_COMPONENT_H_
#define _CORE__INCLUDE__PD_SESSION_COMPONENT_H_
/* Genode includes */
#include <foc_pd_session/foc_pd_session.h>
#include <base/rpc_server.h>
/* core includes */
#include <platform_pd.h>
namespace Genode {
class Pd_session_component : public Rpc_object<Foc_pd_session>
{
private:
Platform_pd _pd;
Parent_capability _parent;
Rpc_entrypoint *_thread_ep;
public:
Pd_session_component(Rpc_entrypoint *thread_ep, const char *args)
: _thread_ep(thread_ep) { }
/**************************
** PD session interface **
**************************/
int bind_thread(Thread_capability);
int assign_parent(Parent_capability);
/**********************************
** Fiasco.OC specific functions **
**********************************/
Native_capability task_cap();
};
}
#endif /* _CORE__INCLUDE__PD_SESSION_COMPONENT_H_ */

View File

@@ -1,168 +0,0 @@
/*
* \brief Fiasco.OC platform
* \author Christian Helmuth
* \author Norman Feske
* \author Stefan Kalkowski
* \date 2007-09-10
*/
/*
* Copyright (C) 2007-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__PLATFORM_H_
#define _CORE__INCLUDE__PLATFORM_H_
/* Genode includes */
#include <base/sync_allocator.h>
#include <base/allocator_avl.h>
#include <base/pager.h>
/* Core includes */
#include <cap_id_alloc.h>
#include <platform_generic.h>
#include <platform_thread.h>
#include <platform_pd.h>
#include <multiboot.h>
namespace Genode {
class Platform : public Platform_generic
{
private:
/**
* Pager object representing the pager of core namely sigma0
*/
struct Sigma0 : public Pager_object
{
/**
* Constructor
*/
Sigma0(Cap_index*);
int pager(Ipc_pager &ps) { /* never called */ return -1; }
};
/*
* Shortcut for the type of allocator instances for physical resources
*/
typedef Synchronized_range_allocator<Allocator_avl> Phys_allocator;
Platform_pd *_core_pd; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Phys_allocator _region_alloc; /* virtual memory allocator for core */
Cap_id_allocator _cap_id_alloc; /* capability id allocator */
Multiboot_info _mb_info; /* multiboot information */
Rom_fs _rom_fs; /* ROM file system */
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
Sigma0 _sigma0;
addr_t _vm_start; /* begin of virtual memory */
size_t _vm_size; /* size of virtual memory */
/*
* We do not export any boot module loaded before FIRST_ROM.
*/
enum { FIRST_ROM = 3 };
/**
* Setup base resources
*
* - Map and provide KIP as ROM module
* - Initializes region allocator
* - Initializes multiboot info structure
*/
void _setup_basics();
/**
* Setup RAM, IO_MEM, and region allocators
*/
void _setup_mem_alloc();
/**
* Setup I/O port space allocator
*/
void _setup_io_port_alloc();
/**
* Setup IRQ allocator
*/
void _setup_irq_alloc();
/**
* Parse multi-boot information and update ROM database
*/
void _setup_rom();
/**
* Setup pager for core-internal threads
*/
void _setup_core_pager();
public:
/**
* Core pager thread that handles core-internal page-faults
*/
struct Core_pager : public Platform_thread, public Pager_object
{
/**
* Constructor
*/
Core_pager(Platform_pd *core_pd, Sigma0*);
int pager(Ipc_pager &ps) { /* never called */ return -1; }
};
/**
* Return singleton instance of core pager object
*/
Core_pager *core_pager();
/**
* Set interrupt trigger/polarity (e.g., level or edge, high or low)
*/
static void setup_irq_mode(unsigned irq_number, unsigned trigger,
unsigned polarity);
/**
* Constructor
*/
Platform();
/**
* Accessor for core pd object
*/
Platform_pd *core_pd() { return _core_pd; }
/********************************
** Generic platform interface **
********************************/
Allocator *core_mem_alloc() { return &_ram_alloc; }
Range_allocator *ram_alloc() { return &_ram_alloc; }
Range_allocator *io_mem_alloc() { return &_io_mem_alloc; }
Range_allocator *io_port_alloc() { return &_io_port_alloc; }
Range_allocator *irq_alloc() { return &_irq_alloc; }
Range_allocator *region_alloc() { return &_region_alloc; }
Cap_id_allocator *cap_id_alloc() { return &_cap_id_alloc; }
addr_t vm_start() const { return _vm_start; }
size_t vm_size() const { return _vm_size; }
Rom_fs *rom_fs() { return &_rom_fs; }
Affinity::Space affinity_space() const;
void wait_for_exit();
};
}
#endif /* _CORE__INCLUDE__PLATFORM_H_ */

View File

@@ -1,121 +0,0 @@
/*
* \brief L4/Fiasco protection domain facility
* \author Christian Helmuth
* \author Stefan Kalkowski
* \date 2006-04-11
*
* Protection domains are L4 tasks under Fiasco.OC and serve as base
* container for the platform.
*/
/*
* Copyright (C) 2006-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__PLATFORM_PD_H_
#define _CORE__INCLUDE__PLATFORM_PD_H_
/* Genode includes */
#include <base/allocator_avl.h>
#include <base/exception.h>
#include <base/sync_allocator.h>
#include <platform_thread.h>
#include <base/thread.h>
/* core includes */
#include <cap_mapping.h>
#include <address_space.h>
/* Fiasco.OC includes */
namespace Fiasco {
#include <l4/sys/consts.h>
}
namespace Genode {
class Platform_thread;
class Platform_pd : public Address_space
{
private:
enum {
THREAD_MAX = (1 << 6),
UTCB_AREA_SIZE = (THREAD_MAX * Fiasco::L4_UTCB_OFFSET),
};
addr_t utcb_area_start()
{
return (Native_config::context_area_virtual_base() +
THREAD_MAX * Native_config::context_virtual_size());
}
Cap_mapping _task;
Cap_mapping _parent;
Platform_thread *_threads[THREAD_MAX];
public:
class Threads_exhausted : Exception {};
/**
* Constructor for core.
*/
Platform_pd(Core_cap_index*);
/**
* Constructor for all tasks except core.
*/
Platform_pd();
/**
* Destructor
*/
~Platform_pd();
/**
* Bind thread to protection domain
*
* \return 0 on success or
* -1 if thread ID allocation failed.
*
* This function allocates the physical L4 thread ID.
*/
int bind_thread(Platform_thread *thread);
/**
* Unbind thread from protection domain
*
* Free the thread's slot and update thread object.
*/
void unbind_thread(Platform_thread *thread);
/**
* Assign parent interface to protection domain
*/
int assign_parent(Native_capability parent);
/*******************************
** Fiasco-specific Accessors **
*******************************/
Native_capability native_task() { return _task.local; }
/*****************************
** Address-space interface **
*****************************/
/*
* On Fiasco.OC, we don't use directed unmap but rely on the
* in-kernel mapping database. See 'rm_session_support.cc'.
*/
void flush(addr_t, size_t) { PDBG("not implemented"); }
};
}
#endif /* _CORE__INCLUDE__PLATFORM_PD_H_ */

View File

@@ -1,183 +0,0 @@
/*
* \brief Fiasco thread facility
* \author Christian Helmuth
* \author Stefan Kalkowski
* \date 2006-04-11
*/
/*
* Copyright (C) 2006-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__PLATFORM_THREAD_H_
#define _CORE__INCLUDE__PLATFORM_THREAD_H_
/* Genode includes */
#include <base/native_types.h>
#include <base/thread_state.h>
#include <base/pager.h>
/* core includes */
#include <platform_pd.h>
#include <cap_session_component.h>
#include <cap_mapping.h>
#include <address_space.h>
namespace Genode {
class Platform_pd;
class Platform_thread
{
private:
enum State { DEAD, RUNNING };
friend class Platform_pd;
State _state;
bool _core_thread;
Cap_mapping _thread;
Cap_mapping _gate;
Cap_mapping _pager;
Cap_mapping _irq;
Native_utcb _utcb;
char _name[32]; /* thread name that will be
registered at the kernel
debugger */
Platform_pd *_platform_pd; /* protection domain thread
is bound to */
Pager_object *_pager_obj;
unsigned _prio;
Affinity::Location _location;
void _create_thread(void);
void _finalize_construction(const char *name);
bool _in_syscall(Fiasco::l4_umword_t flags);
public:
enum { DEFAULT_PRIORITY = 128 };
/**
* Constructor for non-core threads
*/
Platform_thread(const char *name, unsigned priority, addr_t);
/**
* Constructor for core main-thread
*/
Platform_thread(Core_cap_index* thread,
Core_cap_index* irq, const char *name);
/**
* Constructor for core threads
*/
Platform_thread(const char *name);
/**
* Destructor
*/
~Platform_thread();
/**
* Start thread
*
* \param ip instruction pointer to start at
* \param sp stack pointer to use
*
* \retval 0 successful
* \retval -1 thread could not be started
*/
int start(void *ip, void *sp);
/**
* Pause this thread
*/
void pause();
/**
* Resume this thread
*/
void resume();
/**
* Cancel currently blocking operation
*/
void cancel_blocking();
/**
* This thread is about to be bound
*
* \param pd platform pd, thread is bound to
*/
void bind(Platform_pd *pd);
/**
* Unbind this thread
*/
void unbind();
/**
* Override thread state with 's'
*
* \throw Cpu_session::State_access_failed
*/
void state(Thread_state s);
/**
* Read thread state
*
* \throw Cpu_session::State_access_failed
*/
Thread_state state();
/**
* Set the executing CPU for this thread
*/
void affinity(Affinity::Location location);
/**
* Get the executing CPU for this thread
*/
Affinity::Location affinity();
/**
* Return the address space to which the thread is bound
*/
Weak_ptr<Address_space> address_space();
/************************
** Accessor functions **
************************/
/**
* Return/set pager
*/
Pager_object *pager() const { return _pager_obj; }
void pager(Pager_object *pager);
/**
* Return identification of thread when faulting
*/
unsigned long pager_object_badge() {
return (unsigned long) _thread.local.dst(); }
/*******************************
** Fiasco-specific Accessors **
*******************************/
Cap_mapping& thread() { return _thread; }
Cap_mapping& gate() { return _gate; }
const char *name() const { return _name; }
bool core_thread() const { return _core_thread; }
Native_utcb utcb() const { return _utcb; }
};
}
#endif /* _CORE__INCLUDE__PLATFORM_THREAD_H_ */

View File

@@ -1,117 +0,0 @@
/*
* \brief Fiasco.OC utilities
* \author Christian Helmuth
* \author Stefan Kalkowski
* \date 2006-04-11
*
* Is very practical now, but please keep the errors of the l4util pkg in mind.
*/
/*
* Copyright (C) 2006-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__UTIL_H_
#define _CORE__INCLUDE__UTIL_H_
/* Genode includes */
#include <base/stdint.h>
#include <base/printf.h>
#include <rm_session/rm_session.h>
#include <util/touch.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/kdebug.h>
#include <l4/sys/ktrace.h>
}
namespace Genode {
inline void log_event(const char *s)
{
Fiasco::fiasco_tbuf_log(s);
}
inline void log_event(const char *s, unsigned v1, unsigned v2, unsigned v3)
{
Fiasco::fiasco_tbuf_log_3val(s, v1, v2, v3);
}
inline void panic(const char *s)
{
using namespace Fiasco;
outstring(s);
enter_kdebug("> panic <");
}
inline void touch_ro(const void *addr, unsigned size)
{
using namespace Fiasco;
unsigned char const volatile *bptr;
unsigned char const *eptr;
bptr = (unsigned char const volatile *)(((Genode::addr_t)addr) & L4_PAGEMASK);
eptr = (unsigned char const *)(((Genode::addr_t)addr + size - 1) & L4_PAGEMASK);
for ( ; bptr <= eptr; bptr += L4_PAGESIZE)
touch_read(bptr);
}
inline void touch_rw(const void *addr, unsigned size)
{
using namespace Fiasco;
unsigned char volatile *bptr;
unsigned char const *eptr;
bptr = (unsigned char volatile *)(((Genode::addr_t)addr) & L4_PAGEMASK);
eptr = (unsigned char const *)(((Genode::addr_t)addr + size - 1) & L4_PAGEMASK);
for (; bptr <= eptr; bptr += L4_PAGESIZE)
touch_read_write(bptr);
}
inline addr_t trunc_page(addr_t addr)
{
using namespace Fiasco;
return l4_trunc_page(addr);
}
inline addr_t round_page(addr_t addr)
{
using namespace Fiasco;
return l4_round_page(addr);
}
inline addr_t round_superpage(addr_t addr)
{
using namespace Fiasco;
return (addr + L4_SUPERPAGESIZE-1) & L4_SUPERPAGEMASK;
}
inline size_t get_page_size() { return L4_PAGESIZE; }
inline size_t get_page_size_log2() { return L4_LOG2_PAGESIZE; }
inline size_t get_super_page_size() { return L4_SUPERPAGESIZE; }
inline size_t get_super_page_size_log2() { return L4_LOG2_SUPERPAGESIZE; }
inline void print_page_fault(const char *msg, addr_t pf_addr, addr_t pf_ip,
Rm_session::Fault_type pf_type,
unsigned long badge)
{
printf("%s (%s pf_addr=%p pf_ip=%p from %lx)\n", msg,
pf_type == Rm_session::WRITE_FAULT ? "WRITE" : "READ",
(void *)pf_addr, (void *)pf_ip, badge);
}
inline addr_t map_src_addr(addr_t core_local_addr, addr_t phys_addr) {
return core_local_addr; }
inline size_t constrain_map_size_log2(size_t size_log2) { return size_log2; }
}
#endif /* _CORE__INCLUDE__UTIL_H_ */

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

@@ -1,247 +0,0 @@
/*
* \brief Fiasco.OC-specific core implementation of IRQ sessions
* \author Christian Helmuth
* \author Stefan Kalkowski
* \author Sebastian Sumpf
* \date 2007-09-13
*
* FIXME ram quota missing
*/
/*
* Copyright (C) 2007-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.
*/
/* Genode includes */
#include <base/printf.h>
#include <util/arg_string.h>
/* core includes */
#include <irq_root.h>
#include <irq_proxy_component.h>
#include <irq_session_component.h>
#include <platform.h>
#include <util.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/icu.h>
#include <l4/sys/irq.h>
#include <l4/sys/factory.h>
#include <l4/sys/types.h>
}
using namespace Genode;
namespace Genode {
class Interrupt_handler;
class Irq_proxy_component;
}
/**
* Dispatches interrupts from kernel
*/
class Genode::Interrupt_handler : public Thread<4096>
{
private:
Interrupt_handler() : Thread("irq_handler") { start(); }
public:
void entry();
static Native_thread handler_cap()
{
static Interrupt_handler handler;
return handler._thread_cap.dst();
}
};
/**
* Irq_proxy interface implementation
*/
class Genode::Irq_proxy_component : public Irq_proxy_base
{
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) { }
Semaphore *semaphore() { return &_sem; }
void start(long trigger, long polarity)
{
_trigger = trigger;
_polarity = polarity;
_start();
}
bool match_mode(long trigger, long polarity)
{
if (trigger == Irq_session::TRIGGER_UNCHANGED &&
polarity == Irq_session::POLARITY_UNCHANGED)
return true;
if (_trigger < 0 && _polarity < 0)
return true;
return _trigger == trigger && _polarity == polarity;
}
long trigger() const { return _trigger; }
long polarity() const { return _polarity; }
};
/********************************
** 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)
{
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);
}
void Irq_session_component::wait_for_irq()
{
_proxy->wait_for_irq();
}
Irq_session_component::~Irq_session_component() {
_proxy->remove_sharer(); }
/***************************************
** Interrupt handler implemtentation **
***************************************/
void Interrupt_handler::entry()
{
using namespace Fiasco;
int err;
l4_msgtag_t tag;
l4_umword_t label;
while (true) {
tag = l4_ipc_wait(l4_utcb(), &label, L4_IPC_NEVER);
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();
}
}
}

View File

@@ -1,9 +0,0 @@
include $(PRG_DIR)/../target.inc
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

@@ -1,10 +0,0 @@
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
vpath platform_services.cc $(GEN_CORE_DIR)

View File

@@ -1,542 +0,0 @@
/*
* \brief Fiasco platform interface implementation
* \author Christian Helmuth
* \author Stefan Kalkowski
* \date 2006-04-11
*/
/*
* Copyright (C) 2006-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.
*/
/* Genode includes */
#include <base/printf.h>
#include <base/allocator_avl.h>
#include <base/crt0.h>
#include <base/sleep.h>
#include <util/misc_math.h>
/* core includes */
#include <core_parent.h>
#include <platform.h>
#include <platform_thread.h>
#include <platform_pd.h>
#include <util.h>
#include <multiboot.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sigma0/sigma0.h>
#include <l4/sys/ipc.h>
#include <l4/sys/kip>
#include <l4/sys/thread.h>
#include <l4/sys/types.h>
#include <l4/sys/utcb.h>
#include <l4/sys/scheduler.h>
static l4_kernel_info_t *kip;
}
using namespace Genode;
static const bool verbose = true;
static const bool verbose_core_pf = false;
static const bool verbose_region_alloc = false;
/***********************************
** Core address space management **
***********************************/
static Synchronized_range_allocator<Allocator_avl> &_core_address_ranges()
{
static Synchronized_range_allocator<Allocator_avl> _core_address_ranges(0);
return _core_address_ranges;
}
enum { PAGER_STACK_ELEMENTS = 1024 };
static unsigned long _core_pager_stack[PAGER_STACK_ELEMENTS];
/**
* Core pager "service loop"
*/
static void _core_pager_loop()
{
using namespace Fiasco;
bool send_reply = false;
l4_umword_t label;
l4_utcb_t *utcb = l4_utcb();
l4_msgtag_t snd_tag = l4_msgtag(0, 0, 0, 0);
l4_msgtag_t tag;
while (true) {
if (send_reply)
tag = l4_ipc_reply_and_wait(utcb, snd_tag, &label, L4_IPC_NEVER);
else
tag = l4_ipc_wait(utcb, &label, L4_IPC_NEVER);
if (!tag.is_page_fault()) {
PWRN("Received something different than a pagefault, ignoring ...");
continue;
}
/* read fault information */
l4_umword_t pfa = l4_trunc_page(l4_utcb_mr()->mr[0]);
l4_umword_t ip = l4_utcb_mr()->mr[1];
bool rw = l4_utcb_mr()->mr[0] & 2; //TODO enum
if (pfa < (l4_umword_t)L4_PAGESIZE) {
/* NULL pointer access */
PERR("Possible null pointer %s at %lx IP %lx",
rw ? "WRITE" : "READ", pfa, ip);
/* do not unblock faulter */
send_reply = false;
continue;
} else if (!_core_address_ranges().valid_addr(pfa)) {
/* page-fault address is not in RAM */
PERR("%s access outside of RAM at %lx IP %lx",
rw ? "WRITE" : "READ", pfa, ip);
/* do not unblock faulter */
send_reply = false;
continue;
} else if (verbose_core_pf)
PDBG("pfa=%lx ip=%lx", pfa, ip);
/* my pf handler is sigma0 - just touch the appropriate page */
if (rw)
touch_rw((void *)pfa, 1);
else
touch_ro((void *)pfa, 1);
send_reply = true;
}
}
Platform::Sigma0::Sigma0(Cap_index* i) : Pager_object(0, Affinity::Location())
{
/*
* We use the Pager_object here in a slightly different manner,
* just to tunnel the pager cap to the Platform_thread::start method.
*/
cap(i);
}
Platform::Core_pager::Core_pager(Platform_pd *core_pd, Sigma0 *sigma0)
: Platform_thread("core.pager"), Pager_object(0, Affinity::Location())
{
Platform_thread::pager(sigma0);
core_pd->bind_thread(this);
cap(thread().local);
/* stack begins at the top end of the '_core_pager_stack' array */
void *sp = (void *)&_core_pager_stack[PAGER_STACK_ELEMENTS - 1];
start((void *)_core_pager_loop, sp);
using namespace Fiasco;
l4_thread_control_start();
l4_thread_control_pager(thread().local.dst());
l4_thread_control_exc_handler(thread().local.dst());
l4_msgtag_t tag = l4_thread_control_commit(L4_BASE_THREAD_CAP);
if (l4_msgtag_has_error(tag))
PWRN("l4_thread_control_commit failed!");
}
Platform::Core_pager *Platform::core_pager()
{
static Core_pager _core_pager(core_pd(), &_sigma0);
return &_core_pager;
}
/***********************************
** Helper for L4 region handling **
***********************************/
struct Region
{
addr_t start;
addr_t end;
Region() : start(0), end(0) { }
Region(addr_t s, addr_t e) : start(s), end(e) { }
/**
* Returns true if the specified range intersects with the region
*/
bool intersects(addr_t base, size_t size) const
{
return (((base + size) > start) && (base < end));
}
};
/**
* Log region
*/
static inline void print_region(Region r)
{
printf("[%08lx,%08lx) %08lx", r.start, r.end, r.end - r.start);
}
/**
* Add region to allocator
*/
static inline void add_region(Region r, Range_allocator &alloc)
{
if (verbose_region_alloc) {
printf("%p add: ", &alloc); print_region(r); printf("\n");
}
/* adjust region */
addr_t start = trunc_page(r.start);
addr_t end = round_page(r.end);
alloc.add_range(start, end - start);
}
/**
* Remove region from allocator
*/
static inline void remove_region(Region r, Range_allocator &alloc)
{
if (verbose_region_alloc) {
printf("%p remove: ", &alloc); print_region(r); printf("\n");
}
/* adjust region */
addr_t start = trunc_page(r.start);
addr_t end = round_page(r.end);
alloc.remove_range(start, end - start);
}
/**
* Request any RAM page from Sigma0
*/
static inline int sigma0_req_region(addr_t *addr, unsigned log2size)
{
using namespace Fiasco;
l4_utcb_mr()->mr[0] = SIGMA0_REQ_FPAGE_ANY;
l4_utcb_mr()->mr[1] = l4_fpage(0, log2size, 0).raw;
/* open receive window for mapping */
l4_utcb_br()->bdr &= ~L4_BDR_OFFSET_MASK;
l4_utcb_br()->br[0] = L4_ITEM_MAP;
l4_utcb_br()->br[1] = l4_fpage(0, L4_WHOLE_ADDRESS_SPACE, L4_FPAGE_RWX).raw;
l4_msgtag_t tag = l4_msgtag(L4_PROTO_SIGMA0, 2, 0, 0);
tag = l4_ipc_call(L4_BASE_PAGER_CAP, l4_utcb(), tag, L4_IPC_NEVER);
if (l4_ipc_error(tag, l4_utcb()))
return -1;
if (l4_msgtag_items(tag) != 1)
return -2;
*addr = l4_utcb_mr()->mr[0] & (~0UL << L4_PAGESHIFT);
return 0;
}
static Fiasco::l4_kernel_info_t *sigma0_map_kip()
{
using namespace Fiasco;
/* signal we want to map the KIP */
l4_utcb_mr()->mr[0] = SIGMA0_REQ_KIP;
/* open receive window for KIP one-to-one */
l4_utcb_br()->bdr &= ~L4_BDR_OFFSET_MASK;
l4_utcb_br()->br[0] = L4_ITEM_MAP;
l4_utcb_br()->br[1] = l4_fpage(0, L4_WHOLE_ADDRESS_SPACE, L4_FPAGE_RX).raw;
/* call sigma0 */
l4_msgtag_t tag = l4_ipc_call(L4_BASE_PAGER_CAP,
l4_utcb(),
l4_msgtag(L4_PROTO_SIGMA0, 1, 0, 0),
L4_IPC_NEVER);
if (l4_ipc_error(tag, l4_utcb()))
return 0;
l4_addr_t ret = l4_trunc_page(l4_utcb_mr()->mr[0]);
return (l4_kernel_info_t*) ret;
}
void Platform::_setup_mem_alloc()
{
/*
* Completely map program image by touching all pages read-only to
* prevent sigma0 from handing out those page as anonymous memory.
*/
volatile const char *beg, *end;
beg = (const char *)(((Genode::addr_t)&_prog_img_beg) & L4_PAGEMASK);
end = (const char *)&_prog_img_end;
for ( ; beg < end; beg += L4_PAGESIZE) (void)(*beg);
/* request pages of known page size starting with largest */
size_t log2_sizes[] = { L4_LOG2_SUPERPAGESIZE, L4_LOG2_PAGESIZE };
for (unsigned i = 0; i < sizeof(log2_sizes)/sizeof(*log2_sizes); ++i) {
size_t log2_size = log2_sizes[i];
size_t size = 1UL << log2_size;
int err = 0;
addr_t addr = 0;
Region region;
/* request any page of current size from sigma0 */
do {
err = sigma0_req_region(&addr, log2_size);
if (!err) {
/* XXX do not allocate page0 */
if (addr == 0) {
Fiasco::l4_task_unmap(Fiasco::L4_BASE_TASK_CAP,
Fiasco::l4_fpage(0, log2_size,
Fiasco::L4_FPAGE_RW),
Fiasco::L4_FP_ALL_SPACES);
continue;
}
region.start = addr; region.end = addr + size;
if (!region.intersects(Native_config::context_area_virtual_base(),
Native_config::context_area_virtual_size())) {
add_region(region, _ram_alloc);
add_region(region, _core_address_ranges());
}
remove_region(region, _io_mem_alloc);
remove_region(region, _region_alloc);
}
} while (!err);
}
}
void Platform::_setup_irq_alloc() { _irq_alloc.add_range(0, 0x100); }
void Platform::_setup_basics()
{
using namespace Fiasco;
kip = sigma0_map_kip();
if (!kip)
panic("kip mapping failed");
if (kip->magic != L4_KERNEL_INFO_MAGIC)
panic("Sigma0 mapped something but not the KIP");
if (verbose) {
printf("\n");
printf("KIP @ %p\n", kip);
printf(" magic: %08zx\n", (size_t)kip->magic);
printf(" version: %08zx\n", (size_t)kip->version);
printf(" sigma0 "); printf(" esp: %08lx eip: %08lx\n", kip->sigma0_esp, kip->sigma0_eip);
printf(" sigma1 "); printf(" esp: %08lx eip: %08lx\n", kip->sigma1_esp, kip->sigma1_eip);
printf(" root "); printf(" esp: %08lx eip: %08lx\n", kip->root_esp, kip->root_eip);
}
/* add KIP as ROM module */
_kip_rom = Rom_module((addr_t)kip, L4_PAGESIZE, "l4v2_kip");
_rom_fs.insert(&_kip_rom);
/* update multi-boot info pointer from KIP */
void *mb_info_ptr = (void *)kip->user_ptr;
_mb_info = Multiboot_info(mb_info_ptr);
if (verbose) printf("MBI @ %p\n", mb_info_ptr);
/* parse memory descriptors - look for virtual memory configuration */
/* XXX we support only one VM region (here and also inside RM) */
using Fiasco::L4::Kip::Mem_desc;
_vm_start = 0; _vm_size = 0;
Mem_desc *desc = Mem_desc::first(kip);
for (unsigned i = 0; i < Mem_desc::count(kip); ++i)
if (desc[i].is_virtual()) {
_vm_start = round_page(desc[i].start());
_vm_size = trunc_page(desc[i].end() - _vm_start + 1);
break;
}
if (_vm_size == 0)
panic("Virtual memory configuration not found");
/* configure applicable address space but never use page0 */
_vm_size = _vm_start == 0 ? _vm_size - L4_PAGESIZE : _vm_size;
_vm_start = _vm_start == 0 ? L4_PAGESIZE : _vm_start;
_region_alloc.add_range(_vm_start, _vm_size);
/* preserve context area in core's virtual address space */
_region_alloc.remove_range(Native_config::context_area_virtual_base(),
Native_config::context_area_virtual_size());
/* preserve utcb- area in core's virtual address space */
_region_alloc.remove_range((addr_t)l4_utcb(), L4_PAGESIZE * 16);
/* I/O memory could be the whole user address space */
/* FIXME if the kernel helps to find out max address - use info here */
_io_mem_alloc.add_range(0, ~0);
/* remove KIP and MBI area from region and IO_MEM allocator */
remove_region(Region((addr_t)kip, (addr_t)kip + L4_PAGESIZE), _region_alloc);
remove_region(Region((addr_t)kip, (addr_t)kip + L4_PAGESIZE), _io_mem_alloc);
remove_region(Region((addr_t)mb_info_ptr, (addr_t)mb_info_ptr + _mb_info.size()), _region_alloc);
remove_region(Region((addr_t)mb_info_ptr, (addr_t)mb_info_ptr + _mb_info.size()), _io_mem_alloc);
/* remove core program image memory from region and IO_MEM allocator */
addr_t img_start = (addr_t) &_prog_img_beg;
addr_t img_end = (addr_t) &_prog_img_end;
remove_region(Region(img_start, img_end), _region_alloc);
remove_region(Region(img_start, img_end), _io_mem_alloc);
/* image is accessible by core */
add_region(Region(img_start, img_end), _core_address_ranges());
}
void Platform::_setup_rom()
{
Rom_module rom;
for (unsigned i = FIRST_ROM; i < _mb_info.num_modules(); i++) {
if (!(rom = _mb_info.get_module(i)).valid()) continue;
Rom_module *new_rom = new(core_mem_alloc()) Rom_module(rom);
_rom_fs.insert(new_rom);
/* map module */
touch_ro((const void*)new_rom->addr(), new_rom->size());
if (verbose)
printf(" mod[%d] [%p,%p) %s\n", i,
(void *)new_rom->addr(), ((char *)new_rom->addr()) + new_rom->size(),
new_rom->name());
/* zero remainder of last ROM page */
size_t count = L4_PAGESIZE - rom.size() % L4_PAGESIZE;
if (count != L4_PAGESIZE)
memset(reinterpret_cast<void *>(rom.addr() + rom.size()), 0, count);
/* remove ROM area from region and IO_MEM allocator */
remove_region(Region(new_rom->addr(), new_rom->addr() + new_rom->size()), _region_alloc);
remove_region(Region(new_rom->addr(), new_rom->addr() + new_rom->size()), _io_mem_alloc);
/* add area to core-accessible ranges */
add_region(Region(new_rom->addr(), new_rom->addr() + new_rom->size()), _core_address_ranges());
}
Rom_module *kip_rom = new(core_mem_alloc())
Rom_module((addr_t)Fiasco::kip, L4_PAGESIZE, "kip");
_rom_fs.insert(kip_rom);
}
Platform::Platform() :
_ram_alloc(0), _io_mem_alloc(core_mem_alloc()),
_io_port_alloc(core_mem_alloc()), _irq_alloc(core_mem_alloc()),
_region_alloc(core_mem_alloc()), _cap_id_alloc(core_mem_alloc()),
_sigma0(cap_map()->insert(_cap_id_alloc.alloc(), Fiasco::L4_BASE_PAGER_CAP))
{
/*
* We must be single-threaded at this stage and so this is safe.
*/
static bool initialized = 0;
if (initialized) panic("Platform constructed twice!");
initialized = true;
_setup_basics();
_setup_mem_alloc();
_setup_io_port_alloc();
_setup_irq_alloc();
_setup_rom();
if (verbose) {
printf(":ram_alloc: "); _ram_alloc.raw()->dump_addr_tree();
printf(":region_alloc: "); _region_alloc.raw()->dump_addr_tree();
printf(":io_mem: "); _io_mem_alloc.raw()->dump_addr_tree();
printf(":io_port: "); _io_port_alloc.raw()->dump_addr_tree();
printf(":irq: "); _irq_alloc.raw()->dump_addr_tree();
printf(":rom_fs: "); _rom_fs.print_fs();
printf(":core ranges: "); _core_address_ranges().raw()->dump_addr_tree();
}
Core_cap_index* pdi =
reinterpret_cast<Core_cap_index*>(cap_map()->insert(_cap_id_alloc.alloc(), Fiasco::L4_BASE_TASK_CAP));
Core_cap_index* thi =
reinterpret_cast<Core_cap_index*>(cap_map()->insert(_cap_id_alloc.alloc(), Fiasco::L4_BASE_THREAD_CAP));
Core_cap_index* irqi =
reinterpret_cast<Core_cap_index*>(cap_map()->insert(_cap_id_alloc.alloc()));
/* setup pd object for core pd */
_core_pd = new(core_mem_alloc()) Platform_pd(pdi);
/*
* We setup the thread object for thread0 in core pd using a special
* interface that allows us to specify the capability slot.
*/
Platform_thread *core_thread = new(core_mem_alloc())
Platform_thread(thi, irqi, "core.main");
core_thread->pager(&_sigma0);
_core_pd->bind_thread(core_thread);
}
/********************************
** Generic platform interface **
********************************/
void Platform::wait_for_exit()
{
/*
* On Fiasco, Core never exits. So let us sleep forever.
*/
sleep_forever();
}
Affinity::Space Platform::affinity_space() const
{
using namespace Genode;
using namespace Fiasco;
l4_sched_cpu_set_t cpus = l4_sched_cpu_set(0, 0, 1);
l4_umword_t cpus_max;
l4_msgtag_t res = l4_scheduler_info(L4_BASE_SCHEDULER_CAP, &cpus_max,
&cpus);
if (l4_error(res)) {
PERR("could not detect number of CPUs - assuming 1 CPU");
return 1;
}
unsigned cpus_online = 0;
for (unsigned i = 0; i < sizeof(cpus.map) * 8; i++)
if ((cpus.map >> i) & 0x1)
cpus_online ++;
/*
* Currently, we do not gather any information about the topology of CPU
* nodes but just return a one-dimensional affinity space.
*/
return Affinity::Space(cpus_online, 1);
}
void Core_parent::exit(int exit_value) { }

View File

@@ -1,128 +0,0 @@
/*
* \brief Fiasco protection domain facility
* \author Christian Helmuth
* \author Stefan Kalkowski
* \date 2006-04-11
*/
/*
* Copyright (C) 2006-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.
*/
/* Genode includes */
#include <base/native_types.h>
#include <util/misc_math.h>
/* core includes */
#include <util.h>
#include <platform.h>
#include <platform_pd.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/utcb.h>
#include <l4/sys/factory.h>
}
using namespace Fiasco;
using namespace Genode;
static addr_t core_utcb_base() {
static addr_t base = (addr_t) l4_utcb();
return base;
}
/***************************
** Public object members **
***************************/
int Platform_pd::bind_thread(Platform_thread *thread)
{
for (unsigned i = 0; i < THREAD_MAX; i++) {
if (_threads[i])
continue;
_threads[i] = thread;
if (thread->core_thread())
thread->_utcb = (l4_utcb_t*) (core_utcb_base() + i * L4_UTCB_OFFSET);
else
thread->_utcb =
reinterpret_cast<l4_utcb_t*>(utcb_area_start() + i * L4_UTCB_OFFSET);
Native_thread cap_offset = THREAD_AREA_BASE + i * THREAD_AREA_SLOT;
thread->_gate.remote = cap_offset + THREAD_GATE_CAP;
thread->_pager.remote = cap_offset + THREAD_PAGER_CAP;
thread->_irq.remote = cap_offset + THREAD_IRQ_CAP;
/* if it's no core-thread we have to map parent and pager gate cap */
if (!thread->core_thread()) {
_task.map(_task.local.dst());
_parent.map(_task.local.dst());
}
/* inform thread about binding */
thread->bind(this);
return 0;
}
PERR("thread alloc failed");
return -1;
}
void Platform_pd::unbind_thread(Platform_thread *thread)
{
/* inform thread about unbinding */
thread->unbind();
for (unsigned i = 0; i < THREAD_MAX; i++)
if (_threads[i] == thread) {
_threads[i] = (Platform_thread*) 0;
return;
}
}
int Platform_pd::assign_parent(Native_capability parent)
{
if (!parent.valid()) return -1;
_parent.local = parent;
_parent.remote = PARENT_CAP;
return 0;
}
Platform_pd::Platform_pd(Core_cap_index* i)
: _task(Native_capability(i), TASK_CAP)
{
for (unsigned i = 0; i < THREAD_MAX; i++)
_threads[i] = (Platform_thread*) 0;
}
Platform_pd::Platform_pd()
: _task(true, TASK_CAP)
{
for (unsigned i = 0; i < THREAD_MAX; i++)
_threads[i] = (Platform_thread*) 0;
l4_fpage_t utcb_area = l4_fpage(utcb_area_start(),
log2<unsigned>(UTCB_AREA_SIZE), 0);
l4_msgtag_t tag = l4_factory_create_task(L4_BASE_FACTORY_CAP,
_task.local.dst(), utcb_area);
if (l4_msgtag_has_error(tag))
PERR("pd creation failed");
}
Platform_pd::~Platform_pd()
{
for (unsigned i = 0; i < THREAD_MAX; i++) {
if (_threads[i])
_threads[i]->unbind();
}
}

View File

@@ -1,35 +0,0 @@
/*
* \brief Export RAM dataspace as shared memory object (dummy)
* \author Norman Feske
* \date 2006-07-03
*/
/*
* Copyright (C) 2006-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.
*/
/* core-local includes */
#include <ram_session_component.h>
#include <map_local.h>
namespace Fiasco {
#include <l4/sys/cache.h>
}
using namespace Genode;
void Ram_session_component::_export_ram_ds(Dataspace_component *ds) { }
void Ram_session_component::_revoke_ram_ds(Dataspace_component *ds) { }
void Ram_session_component::_clear_ds(Dataspace_component *ds)
{
memset((void *)ds->phys_addr(), 0, ds->size());
if (ds->write_combined())
Fiasco::l4_cache_dma_coherent(ds->phys_addr(), ds->phys_addr() + ds->size());
}

View File

@@ -1,61 +0,0 @@
TARGET = core
REQUIRES = foc
LD_TEXT_ADDR = 0x500000
GEN_CORE_DIR = $(BASE_DIR)/src/core
LIBS += base-common
SRC_CC = cap_session_component.cc \
context_area.cc \
cpu_session_component.cc \
cpu_session_extension.cc \
dataspace_component.cc \
dump_alloc.cc \
io_mem_session_component.cc \
io_mem_session_support.cc \
irq_session_component.cc \
main.cc \
multiboot_info.cc \
pd_session_component.cc \
pd_session_extension.cc \
platform.cc \
platform_pd.cc \
platform_services.cc \
platform_thread.cc \
ram_session_component.cc \
ram_session_support.cc \
rm_session_component.cc \
rm_session_support.cc \
rom_session_component.cc \
signal_session_component.cc \
signal_source_component.cc \
trace_session_component.cc \
thread_start.cc \
core_printf.cc
INC_DIR += $(REP_DIR)/src/core/include \
$(GEN_CORE_DIR)/include \
$(REP_DIR)/src/base/lock \
$(BASE_DIR)/src/base/lock \
$(BASE_DIR)/src/base/thread \
$(REP_DIR)/src/base/console
vpath context_area.cc $(GEN_CORE_DIR)
vpath cpu_session_component.cc $(GEN_CORE_DIR)
vpath dataspace_component.cc $(GEN_CORE_DIR)
vpath dump_alloc.cc $(GEN_CORE_DIR)
vpath io_mem_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_support.cc $(GEN_CORE_DIR)
vpath main.cc $(GEN_CORE_DIR)
vpath multiboot_info.cc $(GEN_CORE_DIR)
vpath pd_session_component.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)
vpath signal_session_component.cc $(GEN_CORE_DIR)
vpath trace_session_component.cc $(GEN_CORE_DIR)
vpath core_printf.cc $(BASE_DIR)/src/base/console
vpath %.cc $(REP_DIR)/src/core
vpath %.cc $(REP_DIR)/src/base/thread

View File

@@ -1,68 +0,0 @@
/*
* \brief Fiasco.OC-specific implementation of core's startup Thread API.
* \author Norman Feske
* \author Stefan Kalkowski
* \date 2006-05-03
*/
/*
* Copyright (C) 2006-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.
*/
/* Genode includes */
#include <base/thread.h>
#include <base/sleep.h>
/* core includes */
#include <cap_session_component.h>
#include <platform.h>
#include <core_env.h>
namespace Fiasco {
#include <l4/sys/debugger.h>
#include <l4/sys/factory.h>
}
using namespace Genode;
void Thread_base::_deinit_platform_thread()
{
PWRN("%s: not implemented yet!", __func__);
}
void Thread_base::_init_platform_thread(Type) { }
void Thread_base::start()
{
using namespace Fiasco;
/* create and start platform thread */
Platform_thread *pt =
new(platform()->core_mem_alloc()) Platform_thread(_context->name);
platform_specific()->core_pd()->bind_thread(pt);
_tid = pt->gate().remote;
_thread_cap =
reinterpret_cap_cast<Cpu_thread>(Native_capability(pt->thread().local));
pt->pager(platform_specific()->core_pager());
_context->utcb = pt->utcb();
l4_utcb_tcr_u(pt->utcb())->user[UTCB_TCR_BADGE] = (unsigned long) pt->gate().local.idx();
l4_utcb_tcr_u(pt->utcb())->user[UTCB_TCR_THREAD_OBJ] = (addr_t)this;
pt->start((void *)_thread_start, stack_top());
}
void Thread_base::cancel_blocking()
{
/*
* Within core, we never need to unblock threads
*/
}

View File

@@ -1,10 +0,0 @@
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
vpath platform_services.cc $(GEN_CORE_DIR)

View File

@@ -1,11 +0,0 @@
include $(PRG_DIR)/../target.inc
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,5 +0,0 @@
REQUIRES = platform_arndale
FIASCO_DIR = $(REP_DIR)/contrib/kernel/fiasco
KERNEL_CONFIG = $(REP_DIR)/config/arndale.kernel
-include $(PRG_DIR)/../target.inc

View File

@@ -1,5 +0,0 @@
REQUIRES = platform_panda
FIASCO_DIR = $(REP_DIR)/contrib/kernel/fiasco
KERNEL_CONFIG = $(REP_DIR)/config/panda.kernel
-include $(PRG_DIR)/../target.inc

View File

@@ -1,22 +0,0 @@
TARGET = fiasco.oc
REQUIRES += foc
FOC_BUILD_DIR = $(BUILD_BASE_DIR)/kernel/$(TARGET)
FIASCO = $(FOC_BUILD_DIR)/fiasco
FIASCO_SRC = $(REP_DIR)/contrib/kernel/fiasco
STARTUP_LIB =
$(TARGET): $(FIASCO)
$(FOC_BUILD_DIR):
$(VERBOSE_MK) $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FIASCO_SRC) BUILDDIR=$@
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(FIASCO): $(FOC_BUILD_DIR)
$(VERBOSE_MK) $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
CC="$(CC)" CXX="$(CXX)" \
$(VERBOSE_DIR) -C $(FOC_BUILD_DIR)
$(VERBOSE)ln -sf $@ $(BUILD_BASE_DIR)/bin/$(TARGET)
clean cleanall:
$(VERBOSE)rm -rf $(FOC_BUILD_DIR)

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_ */

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