Commit Graph

71 Commits

Author SHA1 Message Date
Norman Feske
3049c1004c Turn 'Timer::Session' into asynchronous interface
The 'Timer::Session::msleep' function is one of the last occurrences of
long-blocking RPC calls. Synchronous blocking RPC interfaces turned out
to be constant source of trouble and code complexity. I.e., a timer
client that also wants to respond to non-timer events was forced to be a
multi-threaded process. This patch replaces the blocking 'msleep' call
by a mechanism for programming timeouts and receiving wakeup signals in
an asynchronous fashion. Thereby signals originating from the timer can
be handled along with signals from other signal sources by a single
thread.

The changed interface has been tested on Linux, L4/Fiasco, OKL4, NOVA,
L4ka::Pistachio, Codezero, Fiasco.OC, and hw_pbxa9. Furthermore, this
patch adds the timer test to autopilot.

Fixes #1
2013-02-14 10:36:06 +01:00
Markus Partheymueller
5b1156a3e2 rtc_drv: new service interface 2013-02-13 15:09:23 +01:00
Markus Partheymueller
2d2373a03b vancouver: Timer support
This required usleep to be added to the timer interface.
2013-02-13 15:09:22 +01:00
Norman Feske
5d65308e63 File system: Let session quota depend on word size
By basing the session quota on sizeof(long), we satisfy server-side
quota demands on 64 bit.

Fixes #619
2013-01-27 18:31:35 +01:00
Ivan Loskutov
8eba4440eb Fix OMAP4 uart driver compilation
Fixes #630
2013-01-24 11:04:12 +01:00
Norman Feske
7b11075264 Nitpicker: move 'asci_to<Color>' to public header
This function is worth reusing outside of nitpicker.
2013-01-15 10:18:12 +01:00
Norman Feske
4d8cd2b5c5 Nitpicker: add const qualifiers 2013-01-15 10:18:12 +01:00
Norman Feske
fcca4f3466 Init: handle reconfiguration
With this change, init becomes able to respond to config changes by
restarting the scenario with the new config. To make this feature useful
in practice, init must not fail under any circumstances. Even on
conditions that were considered as fatal previously and led to the abort
of init (such as ambiguous names of the children or misconfiguration in
general), init must stay alive and responsive to config changes.
2013-01-15 10:18:12 +01:00
Norman Feske
fe734272bc Make 'config()' convenience utility more robust
This patch improves the config handling by falling back to a static
string (empty "<config />") if no valid config ROM module could be
found. This can happen initially, but also at runtime when the ROM
module dissapears, e.g., a ROM module accessed via fs_rom where the
corresponding file gets unlinked.
2013-01-15 10:18:11 +01:00
Norman Feske
af66043b79 New Input::Event::FOCUS, rename keycode to code
This patch introduces keyboard-focus events to the 'Input::Event' class
and changes the name 'Input::Event::keycode' to 'code'. The 'code'
represents the key code for PRESS/RELEASE events, and the focus state
for FOCUS events (0 - unfocused, 1 - focused).

Furthermore, nitpicker has been adapted to deliver FOCUS events to its
clients.

Fixes #609
2013-01-15 10:18:11 +01:00
Norman Feske
fca8994584 Introduce notifications to file-system interface
This patch extends the file-system interface with the ability to monitor
changes of files or directories. The new 'File_system::sigh' function
can be used to install a signal handler for an open node.

The 'ram_fs' server has been enhanced to support the new interface. So
any file or directory changes can now be observed by 'ram_fs' clients.

Fixes #607
2013-01-15 10:18:07 +01:00
Norman Feske
7318c5d7d4 Add const version of 'Path::base' accessor 2013-01-12 21:32:07 +01:00
Norman Feske
16e6f4b784 Remove debug message 2013-01-11 21:21:35 +01:00
Sebastian Sumpf
5aea55e417 Audio: Replace old with new audio interface
Issue #602
2013-01-10 23:05:43 +01:00
Sebastian Sumpf
238d6a29c5 Audio: New session interface
Issue #602
2013-01-10 21:57:38 +01:00
Norman Feske
73ab30c22c Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
Norman Feske
277af91376 Omit child-name prefix in <if-args> check
When matching the 'label' session argument using '<if-args>' in a
routing table, we can omit the child name prefix because it is always
the same for all sessions originating from the child anyway. Therefore,
this patch adds a special case for matching session labels. It makes the
expression of label-specific routing more intuitive.
2013-01-10 21:09:07 +01:00
Norman Feske
ecdbdef8ee Loader: reflect faults to client
With this patch, the loader installs an optional client-provided fault
handler as default CPU exception handler and RM fault handler for all
CPU and RM sessions of the loaded subsystem. This way, loader clients
become able to respond to failures occuring within the subsystem.

The new feature is provided via the added 'Loader::fault_handler' RPC
function.

The 'run/failsafe' test covers two cases related to the loader, which
are faults produced by the immediate child of the loader and faults
produced by indirect children.
2013-01-07 16:31:27 +01:00
Ivan Loskutov
5b8a0e5423 Add OMAP4 UART driver
Fixes #444
2012-12-20 14:40:18 +01:00
Norman Feske
0dbb5e1696 Propagate 'Range_allocator::alloc_aligned' errors
This patch reflects eventual allocation errors in a more specific way to
the caller of 'alloc_aligned', in particular out-of-metadata and
out-of-memory are considered as different conditions.

Related to issue #526.
2012-11-28 22:51:09 +01:00
Sebastian Sumpf
7d8f446475 OSS: Open Sound System server
Currently supports Intel HDA, AC97, and ES1370 audio cards. See README
for further details.
2012-11-27 15:32:39 +01:00
Norman Feske
0bcf55800f Eagerly map DMA buffers
This patch is a work-around for issue #452.
2012-11-26 09:45:20 +01:00
Ivan Loskutov
5e66b6d5ed Add OMAP4 GPIO driver
Add Gpio session interface. Add test for Pandaboard.

Fixes #427
2012-11-23 12:20:27 +01:00
Norman Feske
959df5d46b Generalize handling of PD-session arguments
On Linux, we want to attach additional attributes to processes, i.e.,
the chroot location, the designated UID, and GID. Instead of polluting
the generic code with such Linux-specific platform details, I introduced
the new 'Native_pd_args' type, which can be customized for each
platform. The platform-dependent policy of init is factored out in the
new 'pd_args' library.

The new 'base-linux/run/lx_pd_args.run' script can be used to validate
the propagation of those attributes into core.

Note that this patch does not add the interpretation of the new UID and
PID attributes by core. This will be subject of a follow-up patch.

Related to #510.
2012-11-21 20:04:07 +01:00
Martin Stein
612735732a base_hw & omap4: Timer driver.
Fix bug regarding idle thread in thread scheduling in
'base-hw/src/core/kernel.cc'.

Fix regarding signal submit in signal framework in
'base-hw/src/core/kernel.cc'.
2012-11-14 16:36:50 +01:00
Martin Stein
31d57a6257 Nested init on i.MX31 via base_hw. Rework base_hw.
Implies support for the ARMv6 architecture through 'base-hw'.

Get rid of 'base/include/drivers' expect of 'base/include/drivers/uart'.

Merge with the support for trustzone on VEA9X4 that came from
Stefan Kalkowski.

Leave board drivers in 'base/include/platform'.

Rework structure of the other drivers that were moved to
'base_hw/src/core' and those that came with the trustzone support.

Beautify further stuff in 'base_hw'.

Test 'nested_init' with 'hw_imx31' (hardware) and 'hw_panda_a2' (hardware),
'demo' and 'signal' with 'hw_pbxa9' (qemu) and 'hw_vea9x4'
(hardware, no trustzone), and 'vmm' with 'hw_vea9x4'
(hardware, with trustzone).
2012-11-14 16:36:41 +01:00
Norman Feske
5b4edeb031 Introduce 'Uart::Session' interface
The new 'Uart::Session' interface is an extension of the
'Terminal::Session' interface that allows for configuring UART-specific
parameters, i.e., the baud rate.
2012-11-07 13:43:09 +01:00
Norman Feske
bb8d090922 Resolve possible ambiguity of 'strcmp' 2012-11-06 09:35:47 +01:00
Norman Feske
b45242c50f Add chroot support to core
Since the recent move of the process creation into core, the original chroot trampoline
mechanism implemented in 'os/src/app/chroot' does not work anymore. A
process could simply escape the chroot environment by spawning a new
process via core's PD service. Therefore, this patch moves the chroot
support into core. So the chroot policy becomes mandatory part of the
process creation.  For each process created by core, core checks for
'root' argument of the PD session. If a path is present, core takes the
precautions needed to execute the new process in the specified chroot
environment.

This conceptual change implies minor changes with respect to the Genode
API and the configuration of the init process. The API changes are the
enhancement of the 'Genode::Child' and 'Genode::Process' constructors to
take the root path as argument. Init supports the specification of a
chroot per process by specifying the new 'root' attribute to the
'<start>' node of the process. In line with these changes, the
'Loader::Session::start' function has been enhanced with the additional
(optional) root argument.
2012-11-05 17:31:05 +01:00
Torsten Hilbrich
06ce0a8ef1 loader: Fix warnings about uninitialized variable
g++ 4.4.5 outputs the following warnings in our code using the loader
session:

.../base/include/base/capability.h: In member function 'typename Genode::Trait::Call_return<typename IF::Ret_type>::Type Genode::Capability<RPC_INTERFACE>::call() const [with IF = Loader::Session::Rpc_view_geometry, RPC_INTERFACE = Loader::Session]':
.../base/include/base/capability.h:207: warning: 'ret.Genode::Capability<Loader::Session>::Return<Loader::Session::Rpc_view_geometry>::_value.Loader::Session::View_geometry::width' may be used uninitialized in this function
.../base/include/base/capability.h:207: warning: 'ret.Genode::Capability<Loader::Session>::Return<Loader::Session::Rpc_view_geometry>::_value.Loader::Session::View_geometry::height' may be used uninitialized in this function
.../base/include/base/capability.h:207: warning: 'ret.Genode::Capability<Loader::Session>::Return<Loader::Session::Rpc_view_geometry>::_value.Loader::Session::View_geometry::buf_x' may be used uninitialized in this function
.../base/include/base/capability.h:207: warning: 'ret.Genode::Capability<Loader::Session>::Return<Loader::Session::Rpc_view_geometry>::_value.Loader::Session::View_geometry::buf_y' may be used uninitialized in this function

This is easily fixed with providing a default constructor.

Because of the C++ rules regarding initialer lists code that used
them for View_geometry had to be modified to use a normal construction
call.  In my tests only Nitpicker had to be changed.
2012-11-01 14:48:18 +01:00
Norman Feske
fb452ce6ba Add const qualifiers 2012-10-30 12:25:19 +01:00
Stefan Kalkowski
94ea3a0acb Move away drivers from generic base-repository
Driver definitions which are used by kernel/core in base-hw, and also by other
drivers (e.g. from the os repository) have to reside in the generic
base-repository, for instance some uart drivers. All drivers which are
interesting for one of the sites only (sp804 for timer driver, or
cortex_a9 cpu driver for base-hw) should reside in the respective repos.

Factorize cpu context out of Cortex A9 specific definitions. Moreover, there
is already a Cpu_state object containing all common ARM registers. We use
this as a base for the cpu context switching done by the base-hw kernel.
The Cpu_state class get extended by a cpu-exception field, that stores the kind
of exception raised when the corresponding context got interrupted. This
information is used not only by the base-hw kernel, but also by the TrustZone
VMM that is build currently.
2012-10-29 10:08:29 +01:00
Stefan Kalkowski
d3902e8538 Make nic_bridge's MAC address range configurable
By adding a "mac=XX:XX:XX:XX:XX:XX" attribute/value pair to the nic_bridge's
configuration one can define the first MAC address from which the nic_brigde
will allocate MACs for it's clients. Note: that the least relevant byte will
be ignored, and ranges from 0-255. Fixes #424.
2012-10-24 16:39:02 +02:00
Norman Feske
b62492837d Move 'Static_root' to public place
The 'Static_root' class template has proven to be useful for more than
one program. So we expose it as part of the API in the os repository.
2012-10-08 15:08:26 +02:00
Christian Prochaska
e9ac4b653b Add support for symbolic links
This patch adds support for symbolic links in libc, libc plugins, file
system servers and Noux.

Fixes #322.
2012-10-08 15:05:02 +02:00
Christian Prochaska
9dc213b296 'Genode::Path': Remove superfluous slashes first
Fixes #367.
2012-09-25 13:18:36 +02:00
Stefan Kalkowski
5c36639031 Fix UDP checksum calculation (fixes #360)
Missing parantheses around the calculation of last byte address in a UDP
Packet led to dereferencing the wrong value, thereby the UDP checksum
calculation failed, whenever an odd byte-count UPD packet was calculated.
Many thanks to Markus Partheymueller who discovered this issue and its
resolution.
2012-09-24 09:17:59 +02:00
Stefan Kalkowski
62d81ae487 Timer: make ram_quota and stack platform-dependent 2012-09-19 14:28:36 +02:00
Norman Feske
fab7b514e3 Move path utility from noux to 'os/include/os'
It turns out that the path-handling utility is valuable not only for
Noux. By moving it to a public header, we can use it for the libc.
2012-08-16 10:03:06 +02:00
Sebastian Sumpf
18d005264e Nic: Added 'Nic::Packet_allocator'
This is a bitmap-range allocator that can be used in packet streams.
2012-08-07 22:22:06 +02:00
Norman Feske
7e0a1cc0eb Allocate DMA buffer for block packet stream
By allocating the packet-stream dataspace for block sessions as
uncached, we can use DMA to directly read and write into the client
buffer. Currently, the OMAP4 SD-card driver is using this feature.
2012-07-25 19:14:06 +02:00
Norman Feske
0ca47e8963 Support uncached 'Attached_ram_dataspace'
The enable the use of 'Attached_ram_dataspace' objects as DMA buffers,
we need to pass the 'cached' flag to the constructor. By default, the
dataspace is cached, which corresponds to the original behaviour.
2012-07-25 19:14:06 +02:00
Norman Feske
847c8cccd9 Add 'Timer::Session::elapsed_ms' function
This function allows a timer-session client to request a wall-clock
time value from the timer.
2012-07-25 19:14:06 +02:00
Christian Prochaska
30dc1d83da FAT file system service
This patch implements a service which provides access to files and
directories of a FAT file system via the 'File_system' interface.

Fixes #251.
2012-07-10 16:30:26 +02:00
Norman Feske
12f2572155 Resolve ambiguity of size_t
This patch replaces the first attempt to resolve the ambiguity of using
the size_t type that occurred when 'loader_session.h' was included
alongside libc headers. Instead of explicitly qualifying each occurrence
of the type, the new solution defines 'size_t' within the 'Loader' namespace.

Fixes #253
2012-07-02 14:25:04 +02:00
Torsten Hilbrich
2da030d22e loader: Qualify size_t usages
The compiler complained about ambigous references when compiling a
lx_hybrid program using the loader session.  Here are some error
messages:

genode/os/include/loader_session/loader_session.h:72: error: reference to 'size_t' is ambiguous
/usr/lib/gcc/i486-linux-gnu/4.4.5/include/stddef.h:211: error: candidates are: typedef unsigned int size_t
genode/base/include/base/stdint.h:25: error:                 typedef unsigned int Genode::size_t
genode/os/include/loader_session/loader_session.h:72: error: reference to 'size_t' is ambiguous
/usr/lib/gcc/i486-linux-gnu/4.4.5/include/stddef.h:211: error: candidates are: typedef unsigned int size_t
genode/base/include/base/stdint.h:25: error:                 typedef unsigned int Genode::size_t
...

This commit qualifies size_t using the Genode namespace which fixes
the compilation.
2012-06-22 11:38:14 +02:00
Christian Prochaska
8a7fbe3973 Fix ring buffer interface description
The maximum number of elements in the ring buffer is QUEUE_SIZE - 1.

Fixes #240.
2012-06-20 10:17:50 +02:00
Norman Feske
17b60f8d41 Propagate loader-session errors as exceptions 2012-06-06 17:30:06 +02:00
Christian Prochaska
06fdc7b897 Qt-based media player
This patch implements a simple Qt-based media player which is actually a
graphical user interface for the SDL-based 'avplay' media player from
'libav'. It starts 'avplay' as a child and shows its graphical output in a
'QNitpickerViewWidget'. The widgets for controlling the player state send
the according keyboard and mouse input events to 'avplay'.

The 'qt_avplay' player supports the following configuration options:

<mediafile name="..."/>
-> name of the media file to play

<framebuffer_filter name="..." ram_quota="..."/> (may appear multiple times)
-> name of a framebuffer filter service to filter the video output

Fixes #222.
2012-05-29 13:55:00 +02:00
Christian Prochaska
c2f23de2e7 Introduce server-role member to 'Child' class
This patch is needed to use children as services in a dynamic
way (closing and reopening sessions).
2012-05-29 13:54:59 +02:00