Commit Graph

2116 Commits

Author SHA1 Message Date
Norman Feske
f7bdd383e2 Remove base/native_types.h headers
Issue #1993
2016-07-11 12:06:50 +02:00
Adrian-Ken Rueegsegger
d6ba00089b vbox: Increase stack size of periodic_gip thread
Otherwise a pagefault is triggered on hw_x86_64_muen.
2016-07-11 12:06:50 +02:00
Norman Feske
030301d046 gdb_monitor: remove superfluous check
The check for preparation of gdb is now done by the ports mechanism.
2016-07-11 12:06:50 +02:00
Christian Prochaska
29a12ab9a2 base: add 'Thread::mystack() function
The static 'Thread::mystack()' function returns the stack boundaries of
the calling thread. It is useful when a thread uses a diffent stack than
the primary one.

Fixes #2037
2016-07-11 12:06:05 +02:00
Christian Prochaska
bea48b636e lwip: avoid failed assertion on nonblocking connect()
When calling 'connect()' in nonblocking mode and the connection has been
established, don't call 'tcp_connect()' again, which would trigger an
assertion with the message 'tcp_connect: can only connect from state
CLOSED'.

Fixes #2039
2016-07-11 12:06:04 +02:00
Josef Söntgen
1d9f10e3b6 iso9660: fix reading of large directory entries
This commit makes it possible to read directory entries that span
more than one sector.

Fixes #2038.
2016-07-11 12:06:04 +02:00
Josef Söntgen
cad4d4f970 ahci: check DHRS bit during initialization
This is necessary for the AHCI device model in VirtualBox.

Fixes #2035.
2016-07-11 12:04:53 +02:00
Josef Söntgen
c25c4e3411 ram_blk: transition to the new base API
In addition to modernizing the component now also supports using
empty RAM dataspace as backing store.

For example to use an ISO file the component has to be configured
as follows:

! <config file="image.iso" block_size="2048"/>

To use a empty RAM dataspace that is 256MiB large and has a block
size of 4KiB the configuration looks like this:

! <config size="256M" block_size="4096"/>

Either 'size' or 'file' has to specified. If both are declared the
'file' attribute is soley evaluated.

Issue #1987.

Fixes #2031.
2016-07-11 12:04:52 +02:00
Josef Söntgen
a5dd3fa1e9 ahci: make policy checking more fail-safe
Handle cases where no policy is given and/or no policy matches.

Fixes #2033.
2016-07-11 12:04:52 +02:00
Norman Feske
11a4e7888d noux_net_netcat.run: increase usb_drv quota
Use quota large enough so that the USB driver does not attempt to
request further memory. On the Raspberry Pi, init has no slack memory
to respond to such a request.
2016-07-06 13:02:59 +02:00
Alexander Boettcher
0efd89f12b hw_zynq: disable noux_net_netcat test
because of missing uart_drv
2016-07-06 13:02:59 +02:00
Emery Hemingway
e09752a26f noux: pass correct paths for stdio to Vfs_io_channel
Pass both paths, absolute path to the mount point and the relative path
from the mount point to the file, along with an open handle rather than
just an absolute path. Otherwise, fstat fails if the addressed file is
implemented by another VFS plugin.

Fixes #1789
2016-07-06 13:02:59 +02:00
Alexander Boettcher
5f371c9a3d noux: increase stack size
not sufficient for 32bit noux_tool_chain_auto anymore

Issue #2025
2016-07-06 13:02:58 +02:00
Reto Buerki
f241b6e496 Update Muen port to revision c73734d
Issue #2016
2016-07-06 13:02:58 +02:00
Adrian-Ken Rueegsegger
4c5694184c Enable 32-bit Virtualbox scenarios for hw_x86_64_muen
* Announce VM service
 * Disable USB uhci and ehci as only xhci is supported on hw_x86_64_muen

Issue #2016
2016-07-06 13:02:58 +02:00
Reto Buerki
63591160df vbox: Factor out memory config check
Move Genode/vbox memory configuration check to separate
genode_check_memory_config() function and call it in platform-specific
setup machine hook of accloff/nova.

The rationale for this change is to omit the check on Muen since the
guest memory is separate and not allocated from base-hw memory.

Issue #2016
2016-07-06 13:02:57 +02:00
Reto Buerki
68bab6a411 hw_x86_64_muen: Use timed events for guest preemption
Write tick count of next kernel timer to the guest timed events page if
present. This causes the guest VM to be preempted at the requested tick
count and ensures that the guest VM can not monopolize the CPU if no
traps occur.

The base-hw kernel expects a configured switch-event from the guest VM
to base-hw with ID 30 and target vector 32 to be present in the system
policy.

Issue #2016
2016-07-06 13:02:57 +02:00
Reto Buerki
7d00763861 hw_x86_64_muen: Use timed events to implement timer
Switch kernel timer driver to timed event interface. The base-hw kernel
expects a configured self-event with ID 31 and target vector 32 to be
present in the system policy.

ssue #2016
2016-07-06 13:02:57 +02:00
Adrian-Ken Rueegsegger
6d28ea1c5c vbox: Add platform-specific setup machine hook
Add call to genode_setup_machine prior to machine registration in
frontend machine setup code. This enables platform-specific adjustments
to the machine instance.

The new function is used on hw_x86_64_muen to clamp the processor count
to 1 as multiple virtual CPUs are not supported on this platform.

Issue #2016
2016-07-06 13:02:56 +02:00
Adrian-Ken Rueegsegger
e3fbeeb25e vbox: Implement hwaccl support for Muen
* Implement VMMR0_DO_VMMR0_INIT operation for Muen

   - Indicate VT-x support
   - Enable unrestricted guest mode
   - Set CR[0|4] mask to enable masking of guest CR0.[NE,NW,CD] and
     CR4.VMXE bits.

 * Implement VMMR0_DO_GVMM_CREATE_VM on Muen

   Return error if trying to create SMP VM as VMs with multiple CPUs are
   currently not supported on hw_x86_64_muen.

 * Add Muen-specific Mem_region type

   On hw_x86_64_muen the guest memory layout is static, thus regions are
   handed out from an array of memory regions.

   Use sinfo API to calculate the base address of the VM RAM physical
   0x0 region. This allows to dynamically modify the VM RAM size by
   adjusting the Muen policy and Genode vbox files accordingly.

   Zeroize all memory regions apart from VM Ram since Virtualbox expects
   these regions to be cleared.

 * Add Muen subject state struct

   The subject state encompasses the guest VM machine state that is
   transfered between Virtualbox and hardware accelerated execution on
   Muen.

 * Add Muen-specific Vm_handler class
 * Use Vm_handler to run VM
 * Instruct recompiler to flush its code cache
 * Copy the Muen subject state to/from the Vbox PCPUMCTX.
 * Use the VM interruptibility state to inform the recompiler whether
   interrupts are currently inhibited.
 * Explicitly handle control register access

   If a VM-exit occurs due to a control register access, handle it and
   directly continue hardware accelerated execution of guest VM.

   Note: On NOVA control register accesses are handled by the kernel [1].

   [1] - https://github.com/alex-ab/NOVA/blob/master/src/ec_vmx.cpp#L106

 * Reset guest interruptibility state

   Assert that interrupts are not inhibited in the Virtualbox machine
   state and clear Blocking-by-[STI|MOV to SS] guest interruptibility
   flags prior to running a guest VM in hwaccel mode.

 * Set return code depending on exit reason

   Do not unconditionally emulate the next instruction on VM exit. This
   makes sharing the VM FPU state with Virtualbox unnecessary, as FPU
   instructions are not emulated by the recompiler any longer.
   Also, assert that the FPU has not been used by the recompiler

 * Inject pending guest VM interrupts on Muen

   Use mapped subject pending interrupts page of guest VM to perform
   interrupt injection. IRQs are transferred from the Virtualbox trap
   manager state to the pending interrupts region for injection. If an
   IRQ remains pending upon returning to the recompiler, it is copied
   back to the trap manager state and cleared in the subject interrupts
   region.

 * Inform recompiler about changed SYSENTER_[CS|EIP|ESP] values,
   otherwise values set while running the guest VM hardware accelerated
   may get lost.

 * Implement genode_cpu_hz() on Muen

   Determine the CPU frequency dynamically using the sinfo API.

Issue #2016
2016-07-06 13:02:56 +02:00
Adrian-Ken Rueegsegger
738b01d37a vbox: Move pgm to virtualbox-hwaccl library
Issue #2016
2016-07-06 13:02:56 +02:00
Adrian-Ken Rueegsegger
89a6d16d81 vbox: Extract Vmm_memory::Region to separate header
This enables platform-specific implementations of the struct Mem_region
type.

Issue #2016
2016-07-06 13:02:55 +02:00
Adrian-Ken Rueegsegger
cd6b3b1222 hw_x86_64_muen: Implement Muen Vm_session
* The Vm thread is always paused and on exception to make sure that guest VM
  execution is suspended whenever we handle an interrupt. Also signal the Vm
  session to poke waiting threads (e.g. Virtualbox EMT).

* Implement Vm::proceed
  Switch to the mode transition assembly code declared at the _vt_vm_entry
  label.

Issue #2016
2016-07-06 13:02:55 +02:00
Reto Buerki
082b141e66 hw_x86_64: Add _vt_vm_entry to x86_64 mode transition
The entry enables interrupts and initiates a handover to the guest VM by
invoking event number one. The sti instruction is placed at the start to
allow exits to Muen before handing off to the VM if window exiting is
requested.

Issue #2016
2016-07-06 13:02:55 +02:00
Stefan Kalkowski
e5e1f1261f hw_x86_64_muen: implement VM service skeleton
Issue #2016
2016-07-06 13:02:55 +02:00
Alexander Boettcher
8188e60954 hw_x86: enable building virtualbox
Issue #2016
2016-07-06 13:02:54 +02:00
Emery Hemingway
5dec689b6d remove server/tar_fs
Tar_fs is superseded by the vfs server.

Fixes #2024
2016-07-06 13:02:54 +02:00
Emery Hemingway
ef845edb6e lib/libc_noux: increase execve buffers
Fixes #2025
2016-06-28 11:20:11 +02:00
Sebastian Sumpf
d1eee98012 base-hw: fix data alignment error on RISC-V
Native UTCB data has to be at an machine word boundary.

fixes #2027
2016-06-28 11:17:27 +02:00
Christian Prochaska
22e908e801 vbox: add config option to enforce use of IOAPIC
The virtual PCI model delivers IRQs to the PIC by default and to the
IOAPIC only if the guest operating system selected the IOAPIC with the
'_PIC' ACPI method and if it called the '_PRT' ACPI method afterwards.
When running a guest operating system which uses the IOAPIC, but does
not call these ACPI methods (for example Genode/NOVA), the new
configuration option

<config force_ioapic="yes">

enforces the delivery of PCI IRQs to the IOAPIC.

Fixes #2029
2016-06-28 11:10:45 +02:00
Christian Prochaska
761db4bc73 vbox: config option for the virtual XHCI controller
This commit adds the VirtualBox configuration option

<config xhci="yes">

to enable the virtual XHCI controller.

Fixes #2028
2016-06-28 11:10:29 +02:00
Christian Helmuth
09d43c0708 Fix stack size in fs_rom 2016-06-28 11:09:29 +02:00
Christian Helmuth
7d2a75856f dde_linux: move Format_command class to Lx namespace
Otherwise the class symbols may clash with other global symbols (in base
console.cc).
2016-06-28 11:09:29 +02:00
Norman Feske
17beb9a463 qt_avplay: supply ldso to avplay slave 2016-06-28 11:09:28 +02:00
Josef Söntgen
edf90aec42 wifi_drv: transition to the new base API
Issue #1987.
2016-06-28 11:09:28 +02:00
Christian Helmuth
c8fe0df0ed Overloads for printing signed/unsigned/bool base types
Issue #1942
2016-06-28 11:09:28 +02:00
Christian Prochaska
71183783a2 NOVA: initialize segment and flag registers of local ECs
Make sure that the segment and flag registers of local ECs are initialized
after recall by initializing them at EC creation time.

Fixes #2000
2016-06-28 11:09:28 +02:00
Christian Helmuth
d7ddc83fa9 linux: place alternate signal stack in stack area
The alternate stack must use the stack area as, e.g., Thread::myself()
depends on this property. Hybrid components do not depend on this
property and, therefore, use a static stack buffer.

Fixes #1935
2016-06-28 11:09:28 +02:00
Christian Helmuth
d8c34237bf vfs: default constructor for Dirent and Stat
Fixes #1743
2016-06-28 11:09:27 +02:00
Emery Hemingway
0a01edded2 Path::strip_last_element removes path delimiter
Remove the trailing slash of a path where the path is not "/".
New Path::append_element convenience function.

Fixes #1744
2016-06-28 11:09:27 +02:00
Christian Helmuth
8b78001858 dde_ipxe: remove (non-working) pcnet driver
Also, adapted run scripts to use e1000 NIC model.

Fixes #1821
2016-06-28 11:09:27 +02:00
Stefan Kalkowski
101d052ddb intel_fb_drv: consider aligned pitch value
* Align pitch value to 64 byte (thanks to cnuke for investigation)
* Get rid of extra dataspace retrival and attachment, now that we always buffer
* Consistently name all lx_emul helpers: lx_* (get rid of dde*)
* Add missing file headers

Fix #1997
2016-06-28 11:09:27 +02:00
Stefan Kalkowski
558cc8e00c intel_fb_drv: make buffering mandatory
Instead of providing a buffer to the client and blitting from that
to the "real" framebuffer as an option, with this commit we always do so.
Thereby its possible to immediately destroy the old framebuffer used by
hardware when a configuration change is done, and a new framebuffer
is used. This also simplifies the modesetting.
Moreover, this commit fixes an issue when not using the connector reporting.
Until now the initial mode detection of connectors was only done when
the report was created. this is a regression that entered the driver
when upgrading to the recent Linux kernel version.

Ref #1997
2016-06-28 11:09:27 +02:00
Emery Hemingway
632444ae23 server/rump_fs: transition to the new base API
Use new env, component and logging frameworks.
Sync file system and block device on component entrypoint.
Support for 'root' session argument.
Increase Rump open file descriptor limit.

Issue #1987
Fixes #2011
2016-06-28 11:09:26 +02:00
Alexander Boettcher
f94c2d6aaf vbox: use ahci model in vbox_auto_win7.run
Issue #2006
2016-06-28 11:09:26 +02:00
Alexander Boettcher
e2f1ece0b1 vbox: try to cache RTMemPage* allocation
The ahci model frequently creates and release memory via RTMemPage* functions,
which frequently causes dataspace creation/destruction.

Issue #2006
2016-06-28 11:09:26 +02:00
Alexander Boettcher
4f23e78f10 vbox: add AHCI model
Fixes #2006
2016-06-28 11:09:26 +02:00
Emery Hemingway
ca4f956f21 lib/libc: remove builtin sysctl release information
Fixes #2003
2016-06-28 11:09:25 +02:00
Josef Söntgen
b80939cc0a Noux: add noux-pkg/less
Issue #2014
2016-06-28 11:09:25 +02:00
Alexander Boettcher
7556663e7e acpi_input: transform ACPI events to Genode input
Issue #1962
2016-06-28 11:09:25 +02:00
Sebastian Sumpf
d48219138c usb: transition to the new base API
* remove all 'Genode::env()' calls
* use attached roms to read configuration
* use compoenent framework
* remove all PDBG, PINF, PWRN macros

Issue #1987
Fixes #2019
2016-06-28 11:09:25 +02:00
Sebastian Sumpf
58ef6e3695 lx_kit: optional global env + internal allocator
* make Lx::Malloc a real Genode allocator, so it can be used with 'new' and
  'destroy;
* add optional Lx_kit::Env class

issue #2019
2016-06-28 11:09:23 +02:00
Stefan Kalkowski
a145e6ad70 nic_bridge: transition to the new base API
* use Component::* instead of Server::*
* do not use old printf format anymore
* do not use old Genode::env()->heap() anymore
* avoid pointers where possible, and use references instead
* throw away the thread-safe variants of list and AVL tree,
  nic_bridge became single-threaded in the past
* introduce Ram_session_guard instead of Allocator_guard

Issue #1987
2016-06-28 11:09:23 +02:00
Josef Söntgen
d9f33f7577 linux/audio: transition to the new base API
Issue #1987
2016-06-28 11:08:21 +02:00
Josef Söntgen
0d8d8de42c ahci: transition to the new base API
Issue #1987
2016-06-28 11:08:13 +02:00
Josef Söntgen
c77f146e72 acpi: transition to the new base API
Issue #1987
2016-06-28 11:08:01 +02:00
Josef Söntgen
833c9e01f5 usb_block: transition to the new base API
Issue #1987
2016-06-28 11:06:58 +02:00
Emery Hemingway
f772dfaccd lib/curl: adjust for new spec directories
Fixes #2021
2016-06-22 12:26:33 +02:00
Sebastian Sumpf
b6bc7e0486 usb: fix 'find_next_bit'
Return correct offset for sizes over machine word size.

Fixes #2013
2016-06-22 12:21:42 +02:00
Alexander Boettcher
4e9aeb45ea platform_drv: sync startup between acpica
- platform_drv announces a separate "Acpi" session
- platform_drv waits for ROM "system" to change state to "acpi_ready"
- acpica waits for "Acpi" announcement
- acpica uses the platform driver via "Acpi" to reconfigure PCI devices
- acpica changes "system" state to "acpi_ready" after it ready with initialization
- platform_drv reacts on "system" state change to "acpi_ready" by announcing "Platform" session
- drivers start to operate as usual

Issue #2009
2016-06-22 12:21:42 +02:00
Norman Feske
2030ae678e Supplement base/log.h with raw output function
This patch introduces the Genode::raw function that prints output
directly via a low-level kernel mechanism, if available.

On base-linux, it replaces the former 'raw_write_str' function.
On base-hw, it replaces the former kernel/log.h interface.

Fixes #2012
2016-06-22 12:21:42 +02:00
Norman Feske
ebdb1c6892 sel4: reduce initial memory demand of PD session
This is a follow-up commit to "slab: throw exception if initial
allocation fails". It is needed because on seL4, the PD session quota is
used as backing store for the meta data of the PD's virtual memory. For
this reason, PD sessions on seL4 require more session quota compared to
the other kernels. Apparently, the default quota is too scarce to
complete the PD-session construction. By shrinking the number of
supported page-table entries, we reduce the size of the PD session
component so that the creation succeeds.

Issue #1983
2016-06-22 12:21:42 +02:00
Alexander Boettcher
868bf6c9d0 noux-pkg: port of diffutils 3.3
Fixes #2005
2016-06-22 12:21:42 +02:00
Emery Hemingway
8ae2f65da8 uniform XML boolean attribute access
Replace 'attribute(...).has_value("yes")`
with 'attribute_value(..., false)'.

This allows for boolean configuration to be set with values such as
"true", "false", "yes", "no", or "1", "0".

Fixes #2002
2016-06-22 12:21:42 +02:00
Emery Hemingway
51e8f05fb6 Ajdust run scenarios for strict policy matching
Issue #1901
2016-06-22 12:21:41 +02:00
Emery Hemingway
877676c29f Make label-based policy selection more strict
A configuration policy must match against a policy node label,
label_prefix, or label_suffix atttribute. A fallback to
<default-policy/> is provided as a label wildcard.

Fixes #1901
2016-06-22 12:21:41 +02:00
Adrian-Ken Rueegsegger
c1bb82fb6b base-hw: make Muen sinfo API publicly available
The sinfo function declared in sinfo_instance.h creates a static sinfo
object instance and returns a pointer to the caller.

- kernel timer and platform support to use sinfo() function to
  instantiate sinfo object
- address and size of the base-hw RAM region via the sinfo API
- log_status() function in sinfo API
2016-06-22 12:19:21 +02:00
Adrian-Ken Rueegsegger
2f11caa8d6 vbox_win: Set priority of audio_drv to -1
Helps against choppy sound in Windows guest VMs.
2016-06-22 12:17:18 +02:00
Reto Buerki
963ca0e6b5 vbox: Provide implementation of RTErrCOMGet
The generated errmsgvboxcomdata.h is currently empty, but the
'main.e.l.f' log group seems to work for now.
2016-06-22 12:17:18 +02:00
Adrian-Ken Rueegsegger
8dbf449b91 Add fake usb_devices report ROM to virtualbox.run 2016-06-22 12:17:18 +02:00
Adrian-Ken Rueegsegger
dbb0978ea5 vbox: Fix name of 'rem_disas' log group 2016-06-22 12:17:18 +02:00
Alexander Boettcher
1b7b43c886 vbox: handle bogus statvfs values gracefully
Otherwise Windows guest additions may trigger divison by 0 in the kernel,
which causes BSOD.

Fixes #1873
2016-06-22 12:17:18 +02:00
Alexander Boettcher
db1d6568fb libc: vfs_plugin - initialize fstatfs members
Issue #1873
2016-06-22 12:17:17 +02:00
Alexander Boettcher
c26f91ea00 platform_drv/x86: avoid quota leaking
Fixes #1980
2016-06-22 12:17:17 +02:00
Christian Helmuth
470757cf15 lxip: implement ffz() with __ffs()
Unfortunately, ffs() returns bit positions starting at 1 while ffz()
needs the semantics of __ffs(), which starts bit positions at zero.
2016-06-22 12:17:17 +02:00
Stefan Kalkowski
0c13effaa8 intel_fb: enable polling for connector changes
To circumvent problems on platforms with shaky hotplug interrupt notification
introduce a "poll" configuration option to the driver, which enables
polling for connector changes.

Fix #2004
2016-06-22 12:17:17 +02:00
Stefan Kalkowski
11bead1811 intel_fb_drv: componentize
Issue #1987
2016-06-22 12:17:16 +02:00
Sebastian Sumpf
1cfa14b2f2 os: add stack based backtrace support
Fixes odyssey #2001
2016-06-22 12:17:16 +02:00
Christian Helmuth
49f7d02f80 lxip: add missing memmove() to emulation library 2016-06-10 14:46:01 +02:00
Emery Hemingway
d9c48847db lib/libc: set initial directory if VFS initialized
Fixes #1984
2016-06-07 08:06:59 +02:00
Emery Hemingway
930e2638b2 lib/libc: remove internal use of getcwd at fstatat
The implementation and behaviour of 'getcwd' is externally defined.

Add move operators to Genode::Path.

Issue: #1984
2016-06-07 08:06:35 +02:00
Sebastian Sumpf
597cdc846c usb: use hardware timer to update jiffies
This takes a lot of load away because we don't need to call the time server on
each IRQ.

Fixes #1999
2016-06-06 14:26:32 +02:00
Emery Hemingway
5e6c3a979e virtualbox: unique Nic session labels
Append the network adapter index to Nic session labels.

Fixes #1966
2016-06-06 12:30:05 +02:00
Emery Hemingway
f06087625f server/rump_fs: skip . and .. directory elements
Do not return elements for '.' and '..' during directory reads.

Fixes #1998
2016-06-06 12:12:54 +02:00
Alexander Boettcher
56890733af nova: handle cap count error if IPC dst invalid
Fixes #1995
2016-06-06 09:38:30 +02:00
Stefan Kalkowski
1e5c08bb1a base: invert hex value padding to correct meaning
Fix #1996
2016-06-06 09:38:29 +02:00
Christian Helmuth
cf771c10d6 Improve tokenizing to support XML comments
The whole XML comment has to be parsed as one XML tag to support strange
but valid combinations like

  <!---->
  <!--invisible-tag></invisible-tag-->

Fixes #1424
2016-06-06 09:37:47 +02:00
Josef Söntgen
941a71346a base: add print method for unsigned long long
Fixes #1991.
2016-06-04 13:45:27 +02:00
Stefan Kalkowski
7f0c3eee6d rump_fs: set inode in Directory::read accordingly
Fix #1989
2016-06-04 13:45:26 +02:00
Sebastian Sumpf
4994616346 os: packets without playload in packet stream
issue #1988
2016-06-04 13:45:26 +02:00
Josef Söntgen
37fb4309b3 wifi_drv: use relative timeout in poll function
The vanilla 'schedule_timeout()' Linux function expects a relative
timeout value. The first implementation of the wifi_drv, however, used
an absolute timeout value. This mismatch was overlooked when the
lx_kit, which adheres to the vanilla Linux semantics, was incoporated
in the driver.

Fixes #1990.
2016-06-01 12:28:35 +02:00
Josef Söntgen
f41a0aea38 lx_kit: handle multiple timer at once
Issue #1986.
2016-05-31 15:12:17 +02:00
Josef Söntgen
294c7e5076 lx_kit: handle truncation of hrtimer timeouts
Fixes #1986.
2016-05-31 15:11:55 +02:00
Stefan Kalkowski
964e9e91c7 base-hw: eliminate the need to $(BASE_HW_DIR)
Instead of introducing a $(BASE_HW_DIR) variable that has to be defined in each
core makefile for the different base-hw targets, this commit replaces the
$(REP_DIR) variable usage in core.inc files with $(BASE_DIR)/../base-hw.

Ref #1955
2016-05-31 15:09:53 +02:00
Alexander Boettcher
54b47535f8 run: adapt trace.run
Issue #1983
2016-05-31 12:02:05 +02:00
Alexander Boettcher
6289a2379d base: deny session creation if quota insufficient
Quota_exceeded message are of no use during session construction, since
the arguments of the ram_quota are used and no upgrade can take place (the
session construction failed and is so not available for upgrade)

Fixes #1983
2016-05-31 12:02:05 +02:00
Alexander Boettcher
5c10653d8a slab: throw exception if initial allocation fails
Issue #1983
2016-05-31 12:02:04 +02:00
Alexander Boettcher
74030a2e38 nova: kernel fix for more than 4096 processes
Fixes #1951
2016-05-27 09:34:23 +02:00
Christian Helmuth
468ebebbda doc: update README, components.txt etc. 2016-05-26 15:54:17 +02:00
Josef Söntgen
ee804a84fa usb: do not allocate raw packets without size
Allocating a packet in the packet stream without a payload is not
allowed. Therefore we have to allocate CTRL message packets, that do
not have a payload, with a bogus length instead.
2016-05-26 15:54:17 +02:00
Emery Hemingway
b80428abf6 server/vfs: fix file leaf path pointer
Directory_service::leaf_path returns a pointer offset from its argument
so pass member data rather than a constructor argument to leaf_path.

Issue #1775
2016-05-26 15:54:17 +02:00
Stefan Kalkowski
c48e13e1c0 platform_drv: return quota when freeing dma memory
This is an interim fix for solving the quota leakage problem of
the platform driver on x86 platforms. To properly fix that problem
one has to track which dataspaces where created by the platform driver,
so that freeing the dataspace and reversing the quota transfer is done
on correct dataspaces only.

Refer #1980
2016-05-26 15:54:17 +02:00
Alexander Boettcher
46a7b2ea66 ahci: disable atapi support by default
If needed it has to be enabled explicitly as documented in the README.

Related to issue #1906
2016-05-26 15:54:17 +02:00
Alexander Boettcher
16adc852a5 dde_ipxe: enable Intel I219-LM PCI-ID 2016-05-26 15:54:16 +02:00
Christian Prochaska
1e4672db4a Noux: support PD session upgrade
Fixes #1979
2016-05-26 15:54:16 +02:00
Norman Feske
97a41394b4 Documentation changes on account of the book
This patch removes the outdates doc/architecture.txt since the
topics are covered by the book. We keep repos/os/doc/init.txt
because it contains a few details not present in the book (yet).
The patch streamlines the terminology a bit. Furthermore, it
slightly adjusts a few source-code comments to improve the book's
functional specification chapter.
2016-05-26 15:54:16 +02:00
Christian Prochaska
957fe694c5 Noux: provide separate configuration for child processes
Instead of passing on the Noux 'config' ROM dataspace to child processes,
provide a separate configuration for each Noux child, which is either
'<config/>' or '<config ld_verbose="yes"/>', depending on the
configuration of this attribute for the Noux process. This is also a
workaround to prevent multiple insertion of the same 'config' ROM
dataspace capability into the dataspace registry.

Issue #1978
2016-05-26 15:54:16 +02:00
Norman Feske
92a10541aa Update of the hello tutorial 2016-05-26 15:54:16 +02:00
Norman Feske
357b84835a base: add modern Root_component constructor 2016-05-26 15:54:15 +02:00
Martin Stein
1208d14681 hw: use kernel timer for timer driver
* Adds public timeout syscalls to kernel API
  * Kernel::timeout installs a timeout and binds a signal context to it that
    shall trigger once the timeout expired
  * With Kernel::timeout_max_us, one can get the maximum installable timeout
  * Kernel::timeout_age_us returns the time that has passed since the
    calling threads last timeout installation

* Removes all device specific back-ends for the base-hw timer driver and
  implements a generic back-end taht uses the kernel timeout API

* Adds assertions about the kernel timer frequency that originate from the
  requirements of the the kernel timeout API and adjusts all timers
  accordingly by using the their internal dividers

* Introduces the Kernel::Clock class. As member of each Kernel::Cpu object
  it combines the management of the timer of the CPU with a timeout scheduler.
  Not only the timeout API uses the timeout scheduler but also the CPUs job
  scheduler for installing scheduling timeouts.

* Introduces the Kernel::time_t type for timer tic values and values inherited
  from timer tics (like microseconds).

Fixes #1972
2016-05-26 15:54:15 +02:00
Martin Stein
722fd85bc1 hw: higher names for core restricted syscalls
To avoid the need for adapting the names of the core restricted syscalls
each time we add a public syscall (restricted names must always be
greater than public names), let restricted syscall names simply start at
100 (we should never have more than 100 public syscalls).

Ref #1972
2016-05-26 15:54:15 +02:00
Martin Stein
608df38402 hw: add dummy config to kernel tests
Building a kernel test produced an error about a missing config
apparently because of recent changes in the run tool. So, we add
a dummy XML node as config.

Ref #1972
2016-05-26 15:54:15 +02:00
Alexander Boettcher
6b94e761f8 input/ps2: add volume up/down/mute, sysrq, screenlock
This commit renames KEY_COFFEE to KEY_SCREENLOCK, which is more
descriptive.

Issue #1962
2016-05-26 15:54:15 +02:00
Alexander Boettcher
66b7a01d58 nova: show pd info during unresolvable faults
Fixes #1977
2016-05-26 15:54:14 +02:00
Alexander Boettcher
57f47db823 platform_drv/x86: support ACPI reset
Evaluate fadt xml node in report from acpi_drv. If the io ports in the range
of 0xcf8+4 are necessary for the reset than the platform driver will
react on the 'system' state 'reset' and reboot.

Issue #1962
2016-05-26 15:54:14 +02:00
Alexander Boettcher
38c5abbaad libports: add acpica library
Fixes #1962
2016-05-26 15:54:14 +02:00
Alexander Boettcher
ee7f965061 platform_drv/x86: use new component and new env
Issue #1962
2016-05-26 15:54:13 +02:00
Alexander Boettcher
db20e1d87b acpi_drv: report ACPI reset configuration
Will be/can be used by the platform driver to reset the machine, iif the
platform driver owns the resources, e.g. the I/O ports of PCI config access.

Issue #1962
2016-05-26 15:54:13 +02:00
Alexander Boettcher
6b0022f032 platform_drv: drop deprecated config syntax
- policy entry without deprecated rom node
- skip if_arg and use label directly for routing

see Issue #1801

Issue #1962
2016-05-26 15:54:13 +02:00
Alexander Boettcher
b9b8114a4e nova: support fixed ACPI event delivery by kernel
Issue #1962
2016-05-26 15:54:13 +02:00
Stefan Kalkowski
e1c451f19a dde_linux: update intel_fb to 4.4.3
Issue #1974.
2016-05-26 15:54:13 +02:00
Stefan Kalkowski
5424628ebd intel_fb: add Framebuffer controller example
Issue #1974.
2016-05-26 15:54:12 +02:00
Stefan Kalkowski
63e6dc05cd os: add dynamic Framebuffer test
Issue #1974.
2016-05-26 15:54:12 +02:00
Sebastian Sumpf
369ff2a001 dde_linux: update usb to 4.4.3
Issue #1974.
2016-05-26 15:54:12 +02:00
Josef Söntgen
bcefc874d6 dde_linux: update lxip to 4.4.3
Issue #1974.
2016-05-26 15:54:11 +02:00
Josef Söntgen
b9e7fb1edf dde_linux: update wifi to 4.4.3
Issue #1974.
2016-05-26 15:54:11 +02:00
Josef Söntgen
0106045bad lx_kit: add modular lx_emul backend
The modular lx_kit seperates the required back end functionality of the
Linux emulation environment from the front end. Thereby each driver can
reuse specific parts or supply more suitable implementations by itself.
It is used to reduce the amount of redundant code in each driver.

The lx_kit is split into several layers whose structure is as follows:

The first layer in _repos/dde_linux/src/include/lx_emul_ contains those
header files that provide the structural definitions and function
declarations of the Linux API, e.g. _errno.h_ provides all error code
values. The second layer in _repos/dde_linux/src/include/lx_emul/impl_
contains the implementation of selected functions, e.g. _slab.h_
provides the implementation of 'kmalloc()'. The lx_kit back end API is
the third layer and provides the _Lx::Malloc_ interface
(_repos/dde_linux/src/include/lx_kit/malloc.h_) which is used to
implement 'kmalloc()'. There are several generic implementations of the
lx_kit interfaces that can be used by a driver.

A driver typically includes a 'lx_emul/impl/xyz.h' header once
directly in its lx_emul compilation unit. The lx_kit interface files
are only included in those compilation units that use or implement the
interface. If a driver wants to use a generic implementation it must
add the source file to its source file list. The generic
implementations are located in _repos/dde_linux/src/lx_kit/_.

The modular lx_kit still depends on the private _lx_emul.h_ header file
that is tailored to each driver. Since the lx_kit already contains much
of the declarations and definitions that were originally placed in
these private header files, those files can now ommit a large amount
of code.

Fixes #1974.
2016-05-26 15:54:10 +02:00
Sebastian Sumpf
ee05fb9259 base: Remove dynamic segment check from Elf_binary
Don't check for supported segment types of dynamic binaries, it is to
restrictive. If something goes wrong the dynamic linker will throw an error.
2016-05-23 15:52:51 +02:00
Josef Söntgen
47990f37d7 dde_bsd: update audio driver to OpenBSD 5.9
In addition to updating the contrib sources the driver now uses the
new Component API and will report the internal mixer state.

Reporting of the mixer state is enabled by adding the 'report_mixer'
attribute to the drivers configuration and setting its value to 'yes'.

The following snippets illustrates the format of the report:

!<mixer_state>
!  <mixer field="inputs.beep" value="108"/>
!  <mixer field="outputs.hp_sense" value="plugged"/>
!  <mixer field="outputs.master" value="128,128"/>
!  <mixer field="outputs.mic_sense" value="unplugged"/>
!  <mixer field="outputs.spkr_muters" value="hp,mic"/>
!</mixer_state>

The mixer state may expose other mixer fields as well, depending on the
used sound card. The naming scheme of the attributes intentionally
matches the naming scheme of OpenBSD's mixerctl(1) program.

Each 'mixer' node can be used to configure the audio driver by using it
in its configuration, e.g.:

!<config report_mixer="yes">
!  <mixer field="outputs.master" value="255,255"/>
!</config>

This configuration will set the output volume to the highest possible
value. Although it is now also possible to update the configuration
at run-time it should not be done while the driver is currently playing
or recording because it may provoke the generation of artefacts.

Fixes #1973.
2016-05-23 15:52:51 +02:00
Christian Prochaska
44648bb5c7 tool_chain/cxx: use '__cxa_demangle()' for exception names
Fixes #1976
2016-05-23 15:52:50 +02:00
Christian Helmuth
111d74744d hw_x86_64: remove aligment attribute from FPU context
We do not ensure that the Fpu::Context is 16-byte aligned and,
therefore, should not tell the compiler that we did. Otherwise, the GCC
may optimize operations regarding the addresses of members as it did for

  if ((addr_t)_fxsave_area & 0xf) ...

With the declared 16-byte alignment the condition will never become
true.
2016-05-23 15:52:50 +02:00
Christian Prochaska
638db70b94 GDB monitor: nova_x86_64 platform support
Fixes #1971
2016-05-23 15:52:49 +02:00
Christian Prochaska
ff76e69542 GDB monitor: x86_64 support
General support for the x86_64 architecture.

Fixes #1970
2016-05-23 15:52:49 +02:00
Christian Prochaska
5842b2065e GDB monitor: stability improvements
Fixes #1969
2016-05-23 15:52:49 +02:00
Christian Prochaska
2cde1d36c1 base: changes for GDB monitor
- add a new function 'binary_ready_hook_for_gdb()' in ldso. GDB can set a
  breakpoint at this function to know when ldso has loaded the binary
  into memory.
- get the thread state from the NOVA kernel immediately on 'pause()'

Fixes #1968
2016-05-23 15:52:49 +02:00
Sebastian Sumpf
30e57d4581 foc: update port revision and hash
Issue ssumpf/foc#15
2016-05-23 15:52:48 +02:00
Norman Feske
807be83b1b Remove inconsistent use of 'is_' prefix
Fixes #1963
2016-05-23 15:52:39 +02:00
Norman Feske
15141f3ca7 Remove hand-crafted Rpc_functions typedefs 2016-05-23 15:52:39 +02:00
Norman Feske
ef9a7d2230 base: remove length limit of Type_list 2016-05-23 15:52:39 +02:00
Norman Feske
a99989af40 Separation of thread operations from CPU session
This patch moves the thread operations from the 'Cpu_session'
to the 'Cpu_thread' interface.

A noteworthy semantic change is the meaning of the former
'exception_handler' function, which used to define both, the default
exception handler or a thread-specific signal handler. Now, the
'Cpu_session::exception_sigh' function defines the CPU-session-wide
default handler whereas the 'Cpu_thread::exception_sigh' function
defines the thread-specific one.

To retain the ability to create 'Child' objects without invoking a
capability, the child's initial thread must be created outside the
'Child::Process'. It is now represented by the 'Child::Initial_thread',
which is passed as argument to the 'Child' constructor.

Fixes #1939
2016-05-23 15:52:39 +02:00
Josef Söntgen
59aec6114b vfs_block: remove diagnostic warnings
These warnings are triggered by requests either using byte offsets or
reading a number of bytes that is not a multiple of the block size as
well as by components using the plugin with a different block size than
the backend block session provides.

Fixes #1964.
2016-05-23 15:52:38 +02:00
Christian Helmuth
3ba61a2ddf Move rust support to libports
Issue #1899
2016-05-23 15:52:38 +02:00
Alexander Boettcher
bb3e9300f6 nova: disable ACPI GPE events during kernel boot
Issue #1962
2016-05-23 15:52:38 +02:00
Adrian-Ken Rueegsegger
69e9929f71 hw_x86_64: Change IRTE_COUNT to designate number of IRTEs
Adjust IRTE_COUNT to specify the number of IRTEs and not the index of
the last IRTE entry. This fixes an off-by-one error in the toggle_mask()
function, where the range check for I/O APIC IRQs wrongly ignored IRQ
23.
2016-05-23 15:52:38 +02:00
Adrian-Ken Rueegsegger
61572263d7 hw_x86_64: Drop unneded Pic dummy functions 2016-05-23 15:52:38 +02:00
Norman Feske
0fae8fe9c3 hw: remove custom Cpu_connection
The custom version merely differs from the generic one with respect to
the session quota. Since we support the dynamic upgrading of sessions,
we don't need to provide the big amount (128KiB) defined by the custom
version.
2016-05-23 15:52:37 +02:00
Norman Feske
a7b3072cc2 Pass Env & as first argument to connection objects
This patch supplements each existing connection type with an new
constructor that is meant to replace the original one. The new
one takes a reference to the component's environment as argument and
thereby does not rely on the presence of the globally accessible
'env()' interface.

The original constructors are marked as deprecated. Once we have
completely abolished the use of the global 'env()', we will remove them.

Fixes #1960
2016-05-23 15:52:37 +02:00
Norman Feske
3361651e9e base: remove dependency from deprecated config lib
Issue #1959
2016-05-23 15:52:37 +02:00
Norman Feske
f19b269360 window layouter: use Attached_rom_dataspace::xml
Issue #1959
2016-05-23 15:52:37 +02:00
Norman Feske
8da737acfd base: add Attached_rom_dataspace::xml method
Issue #1959
2016-05-23 15:52:36 +02:00
Norman Feske
e0c0794f33 base: supplement comment of Xml_node constructor 2016-05-23 15:52:36 +02:00
Norman Feske
8d797105b3 Move Attach_*dataspace utils from os to base
Fixes #1958
2016-05-23 15:52:36 +02:00
Christian Helmuth
16914bddc8 Implement affinity test as component
This enables the use of the current Thread API to set thread affinity on
construction.
2016-05-23 15:52:36 +02:00
Norman Feske
cb232891bf Fix noux.run on base-linux
The recent move of the initial three region maps into the PD session
breaks the noux.run test on Linux because the address spaces are locally
managed on this platform but the generic code of Noux still tries to
execute the regular procedure of creating the virtualized PD session for
a new Noux process. This patch handles a corner case that occurs on
Linux but no other platform. It enables the successful creation of the
virtualized PD session so that the test runs to completion. Still noux
on Linux remains to be limited to non-forking programs.

Issue #1938
2016-05-23 15:52:36 +02:00
Alexander Boettcher
dccad4c526 nova: kernel support for more than 4096 processes
Fixes #1951
2016-05-23 15:52:36 +02:00
Alexander Boettcher
77c4510787 nova: support dropping caps just locally
without revocation of all subsequent delegations.

Fixes #1950
2016-05-23 15:52:36 +02:00
Emery Hemingway
0ac1d1774d lib/libc_noux: check for invalid system call buffers
Issue #1931
2016-05-23 15:52:35 +02:00
Christian Prochaska
ea726a1f48 libc: pipe plugin
A libc plugin which implements pipes using a ring buffer.

Fixes #1947
2016-05-23 15:52:35 +02:00
Johannes Schlatow
f81867f208 base-hw: refactor core.mk and core.inc files
All core.inc files now use $BASE_HW_DIR instead of $REP_DIR. The former
is defined by the core.mk file. This allows including core.inc files
from other repositories (e.g. genode-world) for additional platform
support.

Fixes #1955
2016-05-23 15:52:35 +02:00
Johannes Schlatow
27a73b89f0 net: write accessors for Ipv4_packet
Also adds header-checksum calculation function.

Fixes #1915
2016-05-23 15:52:34 +02:00
Johannes Schlatow
bed870ead4 net: fix header_length field in Ipv4_packet
Replace size_t by uint8_t in accessors for the IPv4 header fields
'version' and 'header_length' - uint8_t is the smallest integral type
for 4 bit of information. Note, as the _internet header length_ field is
defined to reflect the number of 32-bit words the header occupies, we
also stick to the specification with our accessor.

Issue #1915
2016-05-23 15:49:57 +02:00
Christian Helmuth
abed38e8ac net: transform packet data accessor into template
Supports stronger typing of raw accesses and const correctness.

Issue #1915
2016-05-23 15:49:56 +02:00
Johannes Schlatow
3df03fbc41 base-hw: fix SCU initialization for zynq-based boards
The old implementation cleared all other bits in the SCU control
register when enabling the SCU, which broke the kernel startup on zynq-
based boards.
By only raising the enable bit, we can keep the initial/default state
e.g. as set up by uboot.

Fixes #1953
2016-05-23 15:49:56 +02:00
Norman Feske
f6dec901bb base: remove Component::name from API
It turns out that the name function does not have much use in practice
except for naming the thread of the component's initial entrypoint. For
dynamically linked components, this thread is created by the dynamic
linker. It is named "ep" in these cases. Considering that we will
eventually turn all regular components into dynamically linked
executables, the additional information provided by the
Component::name() function remains unused. So it is better to not bother
the component developers with adding boilerplate code.
2016-05-23 15:49:56 +02:00
Waylon Cude
1e95af5bab Fixed linking and memory allocation for rust
Now rlibs are actually linked to programs. Target files have been
modified to not generate code that requires compiler-rt. Added a target
for libstd-rust, but it's very broken right now. Moved alloc_system to
the libports folder because either a memory allocator needs to be
written in rust or posix_memalign needs to be implemented. Changed
liblibc to use freebsd as the OS instead of netbsd. Added a library with
unwind dummy functions.

Rust relies on atomic builtins, which are not implemented in libgcc for
ARM. One was implemented in rust, which was sufficient to get the
current rust test to run. Rust libs were added into the group of libs
for the linker so order no longer matters. The raspberry pi now uses an
armv6 target.
2016-05-23 15:49:56 +02:00
Norman Feske
ab88599682 base: document the return value of String::length 2016-05-23 15:49:56 +02:00
Norman Feske
fd401bdf53 Thread API cleanup
This patch cleans up the thread API and comes with the following
noteworthy changes:

- Introduced Cpu_session::Weight type that replaces a formerly used
  plain integer value to prevent the accidental mix-up of
  arguments.
- The enum definition of Cpu_session::DEFAULT_WEIGHT moved to
  Cpu_session::Weight::DEFAULT_WEIGHT
- New Thread constructor that takes a 'Env &' as first argument.
  The original constructors are now marked as deprecated. For the
  common use case where the default 'Weight' and 'Affinity' are
  used, a shortcut is provided. In the long term, those two
  constructors should be the only ones to remain.
- The former 'Thread<>' class template has been renamed to
  'Thread_deprecated'.
- The former 'Thread_base' class is now called 'Thread'.
- The new 'name()' accessor returns the thread's name as 'Name'
  object as centrally defined via 'Cpu_session::Name'. It is meant to
  replace the old-fashioned 'name' method that takes a buffer and size
  as arguments.
- Adaptation of the thread test to the new API

Issue #1954
2016-05-23 15:49:55 +02:00
Norman Feske
7b73d1d823 heap: add new-fashioned constructor 2016-05-09 13:25:11 +02:00
Norman Feske
1f395ae780 base: new interface for textual output
Issue #1942
2016-05-09 13:25:01 +02:00
Norman Feske
3bceefc9cf Omit superfluous use of "CAP"/"SIGNAL" services
The functionality of the former "CAP" and "SIGNAL" services is now
provided by core's "PD" service.
2016-05-09 13:24:51 +02:00
Norman Feske
dc8690ae37 Modularize base-internal headers
Issue #1952
2016-05-09 13:24:39 +02:00
Norman Feske
40a5af42eb Clean up base-library structure
This patch moves the base library from src/base to src/lib/base,
flattens the library-internal directory structure, and moves the common
parts of the library-description files to base/lib/mk/base.inc and
base/lib/mk/base-common.inc.

Furthermore, the patch fixes a few cosmetic issues (whitespace and
comments only) that I encountered while browsing the result.

Fixes #1952
2016-05-09 13:24:11 +02:00
Emery Hemingway
52cc50174f Amend File_system session with SEEK_TAIL support
Used to read or write from the end of a file when multiple packets may
be in transit.

Supported by ram_fs, rump_fs, and vfs servers.

Fixes #1775
2016-05-09 13:10:53 +02:00
Christian Helmuth
b38c5006d8 vfs: support UNLINK_ERR_NO_ENTRY in TAR file system
We report UNLINK_ERR_NO_PERM only for files in TAR archive, otherwise
UNLINK_ERR_NO_ENTRY is returned. This permits the arbitrary layering of
file systems with support for proper ENOENT reporting, for example,
when using 'rm -f non_existent_file' that aborts if EPERM is wrongly
reported.
2016-05-09 13:10:53 +02:00
Norman Feske
b8cd56cb90 Tweak slab allocators to use whole pages
Most slab allocators in core use a sliced heap as backing store. Since
sliced-heap allocations are performed at page-granularity, it is
sensible to dimension the slab blocks to fill whole pages.
2016-05-09 13:10:53 +02:00
Norman Feske
ba0545de07 Clean up 'Sliced_heap'
This patch cleans up the implementation of the sliced heap, adds a
constructor that takes references instead of pointers, and adds the
function 'meta_data_size' to determine the meta-data overhead per block.
The latter can be used to dimension slab allocators such that slab
blocks use whole pages.
2016-05-09 13:10:53 +02:00
Norman Feske
4f69772ecc Replace 'Env' interface with modern one
The original 'Env' interface as returned by 'Genode::env()' has been
renamed to 'Env_deprecated' and moved to deprecated/env.h. The new version
of base/env.h contains the interface passed to modern components that
use the component API via base/component.h.

Issue #1832
2016-05-09 13:10:52 +02:00
Norman Feske
7274ca997d Remove Genode::Process from API
This patch makes the former 'Process' class private to the 'Child'
class and changes the constructor of the 'Child' in a way that
principally enables the implementation of single-threaded runtime
environments that virtualize the CPU, PD, and RAM services. The
new interfaces has become free from side effects. I.e., instead
of implicitly using Genode::env()->rm_session(), it takes the reference
to the local region map as argument. Also, the handling of the dynamic
linker via global variables is gone. Now, the linker binary must be
provided as constructor argument.

Fixes #1949
2016-05-09 13:10:52 +02:00
Norman Feske
b49e588c1c Assign threads to PD at its creation time
This patch replaces the former 'Pd_session::bind_thread' function by a
PD-capability argument of the 'Cpu_session::create_thread' function, and
removes the ancient thread-start protocol via 'Rm_session::add_client' and
'Cpu_session::set_pager'. Threads are now bound to PDs at their creation
time and implicitly paged according to the address space of the PD.

Note the API change:

This patch changes the signature of the 'Child' and 'Process' constructors.
There is a new 'address_space' argument, which represents the region map
representing the child's address space. It is supplied separately to the
PD session capability (which principally can be invoked to obtain the
PD's address space) to allow the population of the address space
without relying on an 'Pd_session::address_space' RPC call.
Furthermore, a new (optional) env_pd argument allows the explicit
overriding of the PD capability handed out to the child as part of its
environment. It can be used to intercept the interaction of the child
with its PD session at core. This is used by Noux.

Issue #1938
2016-05-09 13:10:52 +02:00
Norman Feske
2bc8a0f76a Move XML util from os to base repository
Since the dynamic linker depends on the XML utils and we plan to replace
the ancient 'Arg_string' with XML, it is time to move the 'Xml_node' and
'Xml_generator' to base/include.
2016-05-09 13:10:52 +02:00
Norman Feske
73b463cdbb Signal_handler: remove num argument from handler
We will eventually remove the delivery of the number of occurred signals
to the recipient. There haven't been any convincing use cases for this
feature. In the contrary, it actually led to wrong design choices in the
past where the rate of signals carried information (such as the progress
of time) that should better be obtained via an explicit RPC call.

The old 'Signal_rpc_member' template retains the old interface for now.
But the new 'Signal_handler' omits the 'unsigned' argument from the
handler function.
2016-05-09 13:10:52 +02:00
Christian Helmuth
861508ad68 Always recreate library archives
GNU ar only uses a flat module (object) name space but supports multiple
instances of objects with the same name. As we use subdirectories with
source file names that may clash (e.g., signal/common.cc and
server/common.cc in the base library) some of our static library
archives have multiple object instances. This is not an issue on archive
creation but works not as expected when updating archives. To avoid
updates of library archives we delete the files before calling GNU ar.
2016-05-09 13:10:52 +02:00
Emery Hemingway
549f77eafe Catch exceptions when creating VFS
Catch exceptions at File_system_factory::create.
Print error message in Dir_file_system.

Fixes #1786
2016-05-09 13:10:51 +02:00
Emery Hemingway
4aafa882d8 XML node type and attribute name string accessors
Issue #1786
2016-05-09 13:10:51 +02:00
Christian Helmuth
d891016632 lwip: prevent warnings
Thanks to Menno Valkema for the patch.
2016-05-09 13:10:51 +02:00
Norman Feske
511acad507 Consolidate RM service into PD session
This patch integrates three region maps into each PD session to
reduce the session overhead and to simplify the PD creation procedure.
Please refer to the issue cited below for an elaborative discussion.

Note the API change:

With this patch, the semantics of core's RM service have changed. Now,
the service is merely a tool for creating and destroying managed
dataspaces, which are rarely needed. Regular components no longer need a
RM session. For this reason, the corresponding argument for the
'Process' and 'Child' constructors has been removed.

The former interface of the 'Rm_session' is not named 'Region_map'. As a
minor refinement, the 'Fault_type' enum values are now part of the
'Region_map::State' struct.

Issue #1938
2016-05-09 13:10:51 +02:00
Norman Feske
e20bbe7002 base: remove integer return codes from PD-session
The return code of assign_parent remained unused. So this patch
removes it.

The bind_thread function fails only due to platform-specific limitations
such as the exhaustion of ID name spaces, which cannot be sensibly
handled by the PD-session client. If occurred, such conditions used to
be reflected by integer return codes that were used for diagnostic
messages only. The patch removes the return codes and leaves the
diagnostic output to core.

Fixes #1842
2016-05-09 13:09:56 +02:00
Emery Hemingway
93b82c14ac libc: read sysctl info from /.sysctl/...
Fixes #1931
2016-05-09 13:09:56 +02:00
Martin Stein
19b3824bfb libav: update to version 11.6
Enables also the use of the avresample library.

Fixes #1910
2016-05-09 13:09:55 +02:00
Martin Stein
7c1235ff34 avplay.run: Remove mixer server
The mixer is not directly necessary for the avplay demo. But it implies
additional maintenance work. E.g., in the current state, it complains about
the missing Report server and mutes audio output by default.

Ref #1910
2016-05-09 13:09:55 +02:00
Alexander Boettcher
1fc707d9dc nova: fix copy-paste bug in oom code
Fixes #1944
2016-05-09 13:09:54 +02:00
Josef Söntgen
3195311b53 usb_drv: fix nullptr access in EP stop cmd
Issue #1945.
2016-05-09 13:09:54 +02:00
Josef Söntgen
2dfbfd7173 qemu-usb: handle STALL_ERROR
Issue #1945.
2016-05-09 13:09:54 +02:00
Josef Söntgen
133c46a784 usb_drv: handle EP stall in Usb_session
Fixes #1945.
2016-05-09 13:09:54 +02:00
Alexander Boettcher
463b39fc73 xml reporter: support different start node name
Currently the report name is used implicitly as first xml node name for the
report.  This is inconvenient if one component wants to generate various xml
reports under various names (e.g. to steer consumers/clients slightly
differently) but with the same xml node tree structure.

Fixes #1940
2016-05-09 13:09:54 +02:00
Martin Stein
ab9fe9cc6c tz_vmm usb_armory: update binary URIs
The binaries were moved to the genode.org webserver as free bandwidth of the
previous Github LFS was depleted.

Fixes #1902
2016-04-25 11:12:38 +02:00
Roman Iten
1ba1980727 libc, vfs: extend rename testing
Issue #1900
2016-04-25 11:02:03 +02:00
Emery Hemingway
ccd50cc9f5 Vfs::Dir_file_system: adjust rename error priority
CROSS_FS error must not propagate before NO_PERM.
New order is OK, NO_PERM, CROSS_FS, NO_ENTRY.

Fixes #1900
2016-04-25 11:02:02 +02:00
Christian Helmuth
da0c467518 Deallocation in slab backend of ported drivers 2016-04-25 10:48:03 +02:00
Adrian-Ken Rueegsegger
cd420b05ec hw_x86_64_muen: Use Bitset template for MSI address handle
Use Bitset_2 to represent MSI address handle which renders the
Msi_handle type unnecessary.
2016-04-25 10:48:03 +02:00
Adrian-Ken Rueegsegger
f5f8011d02 dde_bsd: Switch mirror of dde_bsd.port
The previous mirror has removed OpenBSD version 5.7.
2016-04-25 10:48:03 +02:00
Christian Helmuth
9cd26c4d61 Prevent compiler warnings 2016-04-25 10:48:02 +02:00
Christian Helmuth
dd90cb3bfe trace_fs: prevent compilter warning 2016-04-25 10:48:02 +02:00
Christian Helmuth
ff4033c6b0 noux: prevent compiler warning 2016-04-25 10:48:02 +02:00
Martin Stein
cba6f5f298 base: no exit handler for libc stdout log console
We don't want Genode environment objects that register their destructor
for program exit as it is mostly unnecessary and easily produces
dangling pointers. Thus, use unmanaged_singleton instead of the static
keyword.

Fixes #1941
2016-04-25 10:48:02 +02:00
Christian Helmuth
bf5df7d88d libc: qualify Plugin_context as base class
...by defining a virtual destructor.
2016-04-25 10:48:02 +02:00
Christian Helmuth
43cf789371 vfs: report zero-length read from server 2016-04-25 10:48:02 +02:00
Christian Helmuth
642ce6ca77 lxip: correct return type in send/recv socketcall
Now, error cases are reported correctly and not as gigantic ssize_t
values on 64-bit.
2016-04-25 10:48:01 +02:00
Christian Helmuth
579f4d4991 vfs: count of written bytes in Fs_file_system 2016-04-25 10:48:01 +02:00
Christian Helmuth
7a64e0bb80 ldso: dump link map of loaded shared objects
Also log the link-map information of shared objects loaded after startup
if 'ld_verbose' is configured.
2016-04-25 10:48:01 +02:00
Martin Stein
4ef2b0ed2e hw arm: avoid shared cache lines during MP init
When bringing up the kernel on multiple cores, there is a time span
where some cores already have caches enabled and some don't. Core-local
storage that may be used during this time must be aligned at least to
the maximum line size among global caches. Otherwise, a cached core may
unintentionally prefetch data of a yet uncached core into a global
cache. This may corrupt the view of the uncached core as soon as it
enables caches. However, to determine the exact alignment for every
single ARM platform isn't sensible. Instead, we can align to the minimum
page size assuming that a cache never wants to prefetch from multiple
pages at once and thus fulfills "line size <= page size".

Fixes #1937
2016-04-25 10:48:01 +02:00
Martin Stein
9508f397a2 ldso: use get_page_size_log2 instead of "12"
Ref #1941
2016-04-25 10:48:01 +02:00
Martin Stein
d5d891a227 libports: raise stack size of libc apps
Triggered by cc1plus in noux_tool_chain_auto on hw_arndale that caused
an overflow on its 64K stack.

Ref #1941
2016-04-25 10:48:01 +02:00
Martin Stein
a96130f20b base: get rid of alloc align default value
When using the Allocator interface, one can't tell which alignment
resulting allocations fulfill. However, at least on ARM, given the
architectural alignment requirements of ARM memory accesses, one wants
memory allocations (what allocators are for in most cases) to be word
aligned automatically. Previously, at least the AVL allocator simply
called alloc_aligned without defining align in its alloc implementation.
This led to unaligned access faults (the default was 0) when using the
AVL allocator as Allocator (as done in the metadata management of a SLAB
of an AVL that uses the AVL as backing store). To avoid such pitfalls
in the future, we force users of alloc_aligned to always specify align
(why use alloc_aligned without align anyway).

Ref #1941
2016-04-25 10:48:01 +02:00
Christian Prochaska
cdf57b60f9 noux: keep cap of last pager 2016-04-25 10:48:00 +02:00
Norman Feske
df272c90ec noux: keep caps of secondary threads 2016-04-25 10:48:00 +02:00
Martin Stein
e6061a794f hw: word-width sensitive kernel-stack size
Ref #1937
2016-04-25 10:48:00 +02:00
Johannes Schlatow
5b12034531 hw_zynq: refactor specs
This is a generalisation approach of the hw_zynq target. As the boards
typically use UART1 instead of UART0 (used by qemu), we have to
distinguish between those. Moreover, in general hw_zynq does not imply
zynq_qemu anymore, so that the support of particular boards can be
placed in third-party or community repositories (e.g. Genode world).

Fixes #1926
2016-04-25 10:48:00 +02:00
Norman Feske
05e09a6116 Improve warning message 2016-04-25 10:48:00 +02:00
Johannes Schlatow
0709340788 Component writing a ROM into a file-system session
Fixes #1917
2016-04-25 10:47:59 +02:00
Norman Feske
f186587cab Unify ipc_msgbuf.h across base platforms
Besides unifying the Msgbuf_base classes across all platforms, this
patch merges the Ipc_marshaller functionality into Msgbuf_base, which
leads to several further simplifications. For example, this patch
eventually moves the Native_connection_state and removes all state
from the former Ipc_server to the actual server loop, which not only
makes the flow of control and information much more obvious, but is
also more flexible. I.e., on NOVA, we don't even have the notion of
reply-and-wait. Now, we are no longer forced to pretend otherwise.

Issue #1832
2016-04-25 10:47:59 +02:00
Norman Feske
0c299c5e08 base: separate native CPU from CPU session
This patch unifies the CPU session interface across all platforms. The
former differences are moved to respective "native-CPU" interfaces.

NOVA is not covered by the patch and still relies on a custom version of
the core-internal 'cpu_session_component.h'. However, this will soon be
removed once the ongoing rework of pause/single-step on NOVA is
completed.

Fixes #1922
2016-04-25 10:47:57 +02:00
Norman Feske
e9dec93f4b base: optimized slab allocator
This patch changes the organization of the slab blocks within the slab
allocator. Originally, blocks were kept in a list sorted by the number
of free entries. However, it turned out that the maintenance of this
invariant involves a lot of overhead in the presence of a large number
of blocks. The new implementation manages blocks within a ring in no
particular order and maintains a pointer to the block where the next
allocation is attempted. This alleviates the need for sorting blocks
when allocating and deallocating.

Fixes #1908
2016-04-25 10:47:56 +02:00
Norman Feske
fbc35cb796 base: hide slab implementation details from API
Issue #1908
2016-04-25 10:47:56 +02:00
Norman Feske
db5969e6cc Stress test for the slab allocator
Issue #1908
2016-04-25 10:47:55 +02:00
Norman Feske
7cf40a0971 allocator_avl: hand back meta data when destructed
This patch ensures that the 'Allocator_avl' releases all memory obtained
from the meta-data allocator at destruction time. If allocations are
still dangling, it produces a warning, hinting at possible memory leaks.
Finally, it properly reverts all 'add_range' operations.
2016-04-25 10:47:55 +02:00
Norman Feske
ed37c2ecff core: use copy of region metadata in detach
This patch fixes a use-after-free problem raised by the recent ability of
the slab allocator to dynamically release empty slab blocks. The
Rm_session_component::detach function used to rely on the assumption
that the region metadata co-located with the allocator metadata of the
'_map' would stay intact even after a 'free' if the region.
2016-04-25 10:47:55 +02:00
Norman Feske
329ab80d1d libc: never destruct the file-descriptor allocator
This patch prevents the destruction of the fd allocator when the program
exists. Otherwise, the meta data for file descriptors that were not
manually closed would vanish, which may cause problems in subsequent
destructors.
2016-04-25 10:47:55 +02:00
Norman Feske
8971bb25ce heap: release ds pool meta data when destructed
This patch makes sure that the dataspace pool is flushed before
destructing the heap-local allocator-avl instance. With the original
destruction order, the allocator would still contain dangling
allocations on the account of the dataspace pool when destructed. In
practice, this caused no problem because the underlying backing store is
eventually freed on the destruction of the pool. But it triggers a
runtime warning of the allocator since it has become more strict with
regard to dangling allocations.
2016-04-25 10:47:55 +02:00
Norman Feske
357dbdd64b sel4: allocate vm-space meta data statically
This patch removes the dynamically growing slab allocator from the
page-table registry. This has two benefits. First, we alleviate the
corner cases where the slab allocator needed to extend its backing store
while establishing a core-local memory mapping, thereby triggering a
nested core-local mapping. Without this corner case, no reentrant lock
is needed any longer. Second, it removes the dependency from the overly
large old API of the slab allocator. So we can tighten the slab
interface.
2016-04-25 10:47:54 +02:00
Emery Hemingway
1d301e9c14 lib/vfs: consistent device and inode enumeration
Issue #1751
2016-04-25 10:47:54 +02:00
Emery Hemingway
b8e52189d5 lib/vfs: new permissions errors
New errors STAT_ERR_NO_PERM, DIRENT_ERR_NO_PERM, and READLINK_NO_PERM to
distinguish lookup errors from permissions or other errors.

Issue #1751
2016-04-25 10:47:54 +02:00
Emery Hemingway
14ca140135 lib/vfs: fix disappearing <dir><dir/></dir>
Issue #1751
2016-04-25 10:47:53 +02:00
Emery Hemingway
4a58154e07 server/vfs: refactor for client isolation
VFS handles are allocated from per-session heaps.

Fixes #1751
2016-04-25 10:47:53 +02:00
Emery Hemingway
d1dc5a9071 utility to retrieve aligned sizes from arg strings
Issue #1751
2016-04-25 10:47:52 +02:00
Emery Hemingway
e22cd98a4f File_system::Connection: session upgrading
Upgrade the File_system session RAM quota when an Out_of_metadata
exception is caught.

Issue #1751
Issue #1909
2016-04-25 10:47:52 +02:00
Emery Hemingway
cb952d2087 obscure File_system::Out_of_node_handles exception
Replace the Out_of_node_handles exception with Out_of_metadata.
Clients need to know when the server is out of internal resources,
but not why.

Cleanup and sort the errors at file_system_session.h.
Remove 'Size_limit_reached exception' from File_system, which was
internal to ram_fs.

Issue #1751
Fixes #1909
2016-04-25 10:47:52 +02:00
Emery Hemingway
58632ab8b5 lib/vfs: improve memory safety at ram file system
Reference count files to prevent dangling handles.
Catch out-of-memory conditions and throw NO_SPACE.

Issue #1751
2016-04-11 12:56:54 +02:00
Emery Hemingway
82a7799638 lib/vfs: pass handle allocator to open(...)
Opening a VFS handle previously involved allocating from the global heap
at each VFS file system. By amending open with an allocator argument,
dynamic allocation can be partitioned.

A new close method is used to deallocate open handles.

Issue #1751
Issue #1891
2016-04-11 12:56:54 +02:00
Timo Wischer
3e1fa54c61 sd_card: generalise RPi sd card driver
This enables to reuse the driver for zynq (and other platforms) in the
future.

Fixes #1925
2016-04-11 12:12:23 +02:00
Timo Wischer
036f3b5702 sd_card: add card version information to interface
Issue #1925
2016-04-11 12:06:08 +02:00
Johannes Schlatow
338cfe5a94 sd_card: return capacity in 512kByte blocks
The returned capacity had different semantics dependent on the card
type. For HIGH_CAPACITY cards, the memory capacity is specified in 512kB
blocks. So we should also return 512kB blocks for STANDARD_CAPACITY
cards.

Issue #1925
2016-04-11 12:04:34 +02:00
Johannes Schlatow
063a603948 zynq: fix NIC phy detection
Fixes #1924
2016-04-11 12:01:31 +02:00
Johannes Schlatow
44fe44e8b6 init: invalidate child-provided service on kill
When init destroys a child server with an open session, the client must
be updated as it will otherwise store a pointer to a no-more existing
service object which will be dereferenced when the child client is
destroyed.

Fixes #1912
2016-04-11 11:58:15 +02:00
Emery Hemingway
b07be42e9f noux: fix leak in pipe ring buffer
Fixes #1923
2016-04-11 11:55:01 +02:00
Christian Helmuth
14f1ac497e linux: improve exception-signal handling
First, we use an alternate stack for signal handling now. The stack is
shared among all threads of the component, which is okay as we only
handle exceptions with log output and pass on to the default handler
(that terminates the execution). The primary motivation for the
alternate stack is the detection of SIGSEGV due to stack overflows.

Also, hybrid components now handle exception signals by logging and the
support for multi-threaded applications was improved.

Fixes #1935
2016-04-11 11:53:00 +02:00
Norman Feske
051e84c4b4 Move server API concept to base framework
This commit introduces the new `Component` interface in the form of the
headers base/component.h and base/entrypoint.h. The os/server.h API
has become merely a compatibilty wrapper and will eventually be removed.
The same holds true for os/signal_rpc_dispatcher.h. The mechanism has
moved to base/signal.h and is now called 'Signal_handler'.

Since the patch shuffles headers around, please do a 'make clean' in the
build directory.

Issue #1832
2016-04-11 11:51:46 +02:00
Alexander Boettcher
4ac7127f89 nova: avoid memory leak in kernel 2016-04-11 11:51:45 +02:00
Christian Prochaska
b6afee344f Noux: upgrade RAM quota in Rm_session_component::add_client()
Fixes #1933
2016-04-11 11:51:44 +02:00
Christian Prochaska
17401d6a63 Noux: increase tool_chain_auto run script timeout for Fiasco.OC
Fixes #1932
2016-04-11 11:51:44 +02:00