Commit Graph

63 Commits

Author SHA1 Message Date
Stefan Kalkowski 6484edb657 nic_bridge: cache card's MAC address (Fixes #869) 2013-09-02 19:42:06 +02:00
Norman Feske 6d837c9e26 Attach affinity information to session requests
This patch extends the 'Parent::session()' and 'Root::session()'
functions with an additional 'affinity' parameter, which is inteded to
express the preferred affinity of the new session. For CPU sessions
provided by core, the values will be used to select the set of CPUs
assigned to the CPU session. For other services, the session affinity
information can be utilized to optimize the locality of the server
thread with the client. For example, to enable the IRQ session to route
an IRQ to the CPU core on which the corresponding device driver (the IRQ
client) is running.
2013-08-13 17:08:25 +02:00
Christian Prochaska 02c0fa85cf nic_bridge: increase entrypoint stack size
Issue #782
2013-07-05 12:37:43 +02:00
Norman Feske b7e553d4db nic_bridge: Documentation update 2013-07-05 12:37:41 +02:00
Martin Stein 9d23cdc27f part_blk: raise max packet size to 1 MiB
This is because the old packet size of 128 KiB slowed
down l4linux AHCI benchmark on arndale with large block sizes.
2013-06-26 15:05:20 +02:00
Stefan Kalkowski 853d541340 Let the nic_bridge work event driven (fix #749) 2013-06-12 11:35:13 +02:00
Stefan Kalkowski 8fae7131c8 Unify buffer sizes of RX and TX in nic_session
In fact, the sizes were the same the whole time, but by using
the same enum in both cases to instantiate the Packet_stream_tx
and Packet_stream_rx members of the e.g. RPC object, it allows
for more flexible generalization between e.g. source or, sink
objects, when programming event-driven, and implementing generic
handlers for their signals.
2013-06-12 11:35:13 +02:00
Alexander Boettcher d1f40b86d9 fix use-after-free bug in loader 2013-05-10 11:16:12 +02:00
Norman Feske cc5fddb0a2 Loader: Free entries of parent-service registry
The parent-service registry is populated on demand by the
'Loader::Child' whenever a prior unknown service is requested. Since the
number of parent services is limited, we expect the registry to settle
after a while. However, each loader session has a private instance of
a parent-service registry. So when creating and destroying loader
sessions, parent registries will be populated again and again. We
have to make sure to discard the entries along with the destruction
of a loader session to avoid the leakage of memory.

Issue #717
2013-05-07 21:56:06 +02:00
Christian Prochaska 1500d59d0d nic_bridge: drop 'gratuitous ARP' messages
'Gratuitous ARP' broadcast messages are used to announce newly created
IP<->MAC address mappings to other hosts. nic_bridge-internal hosts
would expect a nic_bridge-internal MAC address in this message, whereas
external hosts would expect the NIC's MAC address in this message.
The simplest solution to this problem is to just drop those messages,
since they are not really necessary.

Fixes #709.
2013-04-08 18:48:40 +02:00
Norman Feske fae63f4fa9 Merge base libraries into a single library
This patch simplifies the way of how Genode's base libraries are
organized. Originally, the base API was implemented in the form of many
small libraries such as 'thread', 'env', 'server', etc. Most of them
used to consist of only a small number of files. Because those libraries
are incorporated in any build, the checking of their inter-dependencies
made the build process more verbose than desired. Also, the number of
libraries and their roles (core only, non-core only, shared by both core
and non-core) were not easy to capture.

Hereby, the base libraries have been reduced to the following few
libraries:

- startup.mk contains the startup code for normal Genode processes.
  On some platform, core is able to use the library as well.
- base-common.mk contains the parts of the base library that are
  identical by core and non-core processes.
- base.mk contains the complete base API implementation for non-core
  processes

Consequently, the 'LIBS' declaration in 'target.mk' files becomes
simpler as well. In the most simple case, only the 'base' library must
be mentioned.

Fixes #18
2013-02-19 14:45:55 +01:00
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
Ivan Loskutov bc18e2991b nic_bridge: Add static IP address configuration 2013-01-24 11:35:56 +01:00
Norman Feske e5b30847db tar_rom: let unkown file throw Root::Invalid_args 2013-01-24 11:12:10 +01:00
Norman Feske 2dba94eba9 Nitpicker: avoid potential dangling pointer 2013-01-15 10:18: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 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 267817c2c5 Add new 'fs_rom' service
The 'fs_rom' service provides files stored on a file system as ROM
modules via the ROM-session interface.

Fixes #606
2013-01-15 10:18:11 +01:00
Norman Feske 7217ea14d8 nit_fb: Respond to config changes at runtime
This patch enables 'nit_fb' to respond to dynamic changes of its
configuration, in particular the view position and refresh rate.
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
Sebastian Sumpf 5aea55e417 Audio: Replace old with new audio interface
Issue #602
2013-01-10 23:05:43 +01:00
Sebastian Sumpf 47bb48bdd6 Audio: Adjust components to new audio interface
OSS driver, ALSA driver, audio-out test, avplay, and mixer

Issue #602
2013-01-10 23:05:37 +01:00
Norman Feske 73ab30c22c Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
Norman Feske 13d4108fea Unify 'Signal_dispatcher' interfaces
Several users of the signal API used custom convenience classes to
invoke signal-handling functions on the reception of incoming signals.
The 'Signal_dispatcher' pattern turned out to be particularly useful. To
avoid the duplication of this code across the code base, this patch
adds the interface to 'base/signal.h'.

Furthermore, the patch changes the 'Signal::num()' return type from int
to unsigned because negative numbers are meaningless here.

Fixes #511
2013-01-10 21:09:14 +01:00
Alexander Boettcher c2d3543e62 base: replace obj_by_* by lookup_and_lock
Add functionality to lookup an object and lock it. Additional the case is
handled that a object may be already in-destruction and the lookup will deny
returning the object.

The object_pool generalize the lookup and lock functionality of the rpc_server
and serve as base for following up patches to fix dangling pointer issues.
2013-01-10 11:13:13 +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
Norman Feske dfaecfb5ab Make quota-upgrading message more clear
Fixes #592
2012-12-22 13:04:04 +01:00
Martin Stein 8c3d044928 rom_loopdev: missing 'semaphore.h' include
Fix #545
2012-11-30 16:23:16 +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 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 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
Norman Feske d1de48e4a4 Fix narrowing issue reported by gcc-4.7 2012-11-01 17:04:03 +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
Stefan Kalkowski 4a92eb5660 Implement VMM for Linux in VEA9x4 normal-world 2012-10-29 10:08:30 +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 4a1b545770 Move 'Child' API implementation to library 2012-10-09 13:45:33 +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 56243820ee ram_fs: always set '_length' in 'File::truncate()'
Fixes #381.
2012-10-08 15:07:58 +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 3084c6f500 TAR file system service
This patch implements a service which provides the contents of a tar
archive via the 'File_system::Session' interface.

Configuration:

<config>
	<archive name="tar_archive.tar" />
	<policy label="label_of_client" root="/rootdir/for/client" />
</config>

Fixes #333.
2012-08-22 09:51:31 +02:00
Norman Feske d7300e882b tar_rom: Ignore leading './' in tar archives 2012-08-17 11:52:02 +02:00
Christian Prochaska dcfcbce856 libc: add support for 'ftruncate()'
Fixes #307.
2012-08-09 11:09:43 +02:00
Sebastian Sumpf 3736b8b2f2 Nic_bridge: Use Nic::Packet_allocator
Calculate TX and RX dataspace sizes correctly.
2012-08-07 22:23:00 +02:00
Christian Prochaska d6d45f870e ram_fs: fix recursive 'lookup_and_lock()' calls
With this patch the 'Directory::lookup_and_lock()' function passes its
'return_parent' argument to recursive calls of itself.

Fixes #306.
2012-08-01 12:45:10 +02:00
Sebastian Sumpf 5f33704155 part_blk: Improve multiple client support
Increase size of block session backing store so it can handle maximum supported
packet size. Synchronize client threads during packet allocation.

Fixes #276
2012-07-16 14:49:55 +02:00
Ivan Loskutov 3cfbc53754 Extend nic_bridge to support internal traffic
Fixes #156
2012-07-10 16:30:29 +02:00
Norman Feske 7ce16922ac Let part_blk export writeable partitions 2012-07-10 15:00:16 +02:00
Christian Prochaska d6e418b5ed README file for 'terminal_crosslink'
Fixes #257.
2012-07-02 14:14:00 +02:00
Christian Prochaska ba0b20054e Cross-link terminal
This patch implements a service which allows two clients to communicate
with each other using the 'Terminal' interface.

Fixes #242.
2012-06-20 10:19:19 +02:00
Norman Feske 288fd4e56e Add support for allocating DMA memory
This patch extends the RAM session interface with the ability to
allocate DMA buffers. The client specifies the type of RAM dataspace to
allocate via the new 'cached' argument of the 'Ram_session::alloc()'
function. By default, 'cached' is true, which correponds to the common
case and the original behavior. When setting 'cached' to 'false', core
takes the precautions needed to register the memory as uncached in the
page table of each process that has the dataspace attached.

Currently, the support for allocating DMA buffers is implemented for
Fiasco.OC only. On x86 platforms, it is generally not needed. But on
platforms with more relaxed cache coherence (such as ARM), user-level
device drivers should always use uncacheable memory for DMA transactions.
2012-06-20 09:17:48 +02:00