Commit Graph

2231 Commits

Author SHA1 Message Date
Norman Feske
676c3830f9 d3m: Adaptation to USB driver config change 2014-02-25 14:58:03 +01:00
Norman Feske
e2d9b31bfe iso9660: Increase entrypoint stack size for 64bit 2014-02-25 14:58:03 +01:00
Norman Feske
9947c3d33b d3m: Fix deadlock of usb_drv
This deadlock was introduced by the change of USB driver to the server
API.

Fixes #1052
2014-02-25 14:58:03 +01:00
Norman Feske
6f9e15aff8 base: Add 'construct_at' utility
This utility allows for the manual placement of objects without the need
to have a global placement new operation nor the need for type-specific
new operators.

Issue #989
2014-02-25 14:58:03 +01:00
Christian Helmuth
cdb5030cbb Fix several format string warnings 2014-02-25 14:58:03 +01:00
Josef Söntgen
bdec3dd668 os: initial version of trace_fs
The trace_fs server provides access to a Trace_session by using a
File_system_session as frontend.

Each trace subject is represented by a directory ('thread_name.subject')
that contains specific files ('active', 'cleanup', 'enable', 'events',
'buffer_size' and 'policy'), which are used to control the tracing
process of the thread as well as storing the content of its trace
buffer.

The tracing of a thread is only activated if there is a valid policy
installed and the intend to trace the subject was made clear by writing
'1' to the 'enable' file.

The tracing of a thread may be deactived by writing a '0' to the
'enable' file.

A policy may be changed by overwriting the currently used one. In this
case the old policy is replaced by the new policy and is automatically
utilize.

Writing a value to the 'buffer_size' file changes the appointed size of
the trace buffer. This value is only evaluted by reactivating the
tracing process.

The content of the trace buffer may be accessed by reading from the
'events' file. Throughout all tracing session new trace events are
appended to this file.

Nodes of UNTRACED subjects are kept as long as they do not change their
tracing state to DEAD. In this case all nodes are removed from the
file system. Subjects that were traced before and are now UNTRACED will
only be removed by writing '1' to the 'cleanup' file - even if they
are DEAD by now.

To use the trace_fs a config similar to the following may be used:

! <start name="trace_fs">
! 	<resource name="RAM" quantum="128M"/>
! 	<provides><service name="File_system"/></provides>
! 	<config>
! 		<policy label="noux -> trace" interval="1000" subject_limit="512" trace_quota="64M" />
! 	</config>
! </start>

'interval' sets the periode in which the Trace_session is polled. The
time is given in milliseconds.
'subject_limit' speficies how many trace subject should by acquired at
most when the Trace_session is polled.
'trace_quota' is the amount of quota the trace_fs should use for the
Trace_session connection. The remaing amount of RAM quota will be used
for the actual nodes of the file system and the 'policy' as well as the
'events' files.
In addiition there are 'buffer_size' and 'buffer_size_limit' that define
the initial and the upper limit of the size of a trace buffer.
Tracing of parent processes or rather threads may be enabled by setting
'parent_levels' to a value greater than '0' (though this attribute is
available, the trace session component within core still lacks support
for it).

A ready-to-use runscript can by found in 'ports/run/noux_trace_fs.run'.

Fixes #1049.
2014-02-25 14:58:02 +01:00
Josef Söntgen
e79044d16a core: change policy incrementation to prefix op
Using prefix incrementation makes sure a policy with id == 0 is
invalid.

Fixes #1049.
2014-02-25 14:58:02 +01:00
Martin Stein
e68eadf57b hw: fix bug in IPC message-size calculation
ref #989
2014-02-25 14:58:02 +01:00
Martin Stein
a9747825fc hw: use descriptive bool value names in ipc.cc
ref #989
2014-02-25 14:58:02 +01:00
Martin Stein
901b3e2bb4 hw: ease usage of the kernel log
ref #989
2014-02-25 14:58:02 +01:00
Stefan Kalkowski
eeb2d95b1f block: prevent from dereferencing invalid pointers
Until now, block drivers had to deal with a pointer to the client
session component, e.g.: to acknowledge block packets already processed.
When a session was closed, the driver object wasn't informed explicitly,
which leads to defensive programming, or lastly to a race-condition in
test-blk-srv. To prevent from this class of errors, the pointer is now
private to the generic block driver base class, and not accessible to
the concrete driver implementation. Moreover, the driver gets explicitly
informed when a session got invalidated.

Ref #113
2014-02-25 14:58:02 +01:00
Stefan Kalkowski
ca513113f6 block: cache between one client and one device
This block cache component acts as a block device for a single client.
It uses fixed 4K blocks as caching granularity, thereby implicitly reads
ahead whenever a client requests lesser amount of blocks. Currently,
it only supports a least-recently-used replacement policy.

Fixes #113
2014-02-25 14:58:02 +01:00
Stefan Kalkowski
0bc012eb79 os: handle ipc error in server framework
When using the server framework, it might happen that the main thread
tries to forward a signal to the entrypoint, while the context of that
signal is already destroyed. In that case the main thread will get an
ipc error exception as result.

Related to #113
2014-02-25 14:58:01 +01:00
Christian Helmuth
41d5959ae5 base: extend thread test for stack alignment 2014-02-25 14:58:01 +01:00
Bjoern Doebel
9c9f67d0d6 Check for all missing tools at once
Instead of terminating tool/tool_chain when finding the first
missing tool, this patch runs all checks to completion before
bailing out. This eases finding missing programs, because the
user has to run the script only once to get a list of all missing
software.

Fixes #1046
Fixes #1047
2014-02-06 15:20:14 +01:00
Christian Prochaska
7008013625 Qt5: decrease memory amount needed for QtQWebkit
On 64-bit platforms Qt's JavaScript engine tries to reserve 1GiB of
virtual memory via 'mmap()', to be backed by physical memory on demand.
Genode's 'mmap()' implementation currently does not support on-demand
allocation of physical memory and tries to allocate the whole amount at
once, which is usually far more than needed.

With this patch, the amount to be reserved gets decreased to 32MiB.

Fixes #1041.
2014-02-03 11:37:47 +01:00
Christian Prochaska
4b420f6e71 Fix stack pointer alignment for x86_64 platforms
The x86_64 ABI requires the stack pointer to be 16-byte aligned before the
call of a function and decreased by 8 at the function entrypoint (after
the return address has been pushed to the stack).

Currently, when a new Genode thread gets created, the initial stack
pointer is aligned to 16 byte. On Genode/Linux, the thread entry function
is entered by a 'call' instruction, so the stack pointer alignment at the
function entrypoint is correct. On Fiasco.OC and NOVA, however, the thread
entry function gets executed without a return address being pushed to the
stack, so at the function entrypoint the stack pointer is still aligned to
16 byte, which can cause problems with compiler-generated SSE
instructions.

With this patch, the stack pointer given to a new thread gets aligned to
16 bytes and decreased by 8 by default, since most of the currently
supported base platforms execute the thread entry function without pushing
a return address to the stack. For base-linux, the stack pointer gets
realigned to 16 bytes before the thread entry function gets called.

Fixes #1043.
2014-02-03 11:34:30 +01:00
Norman Feske
a19d491fbd doc: Genode Porting Guide + news item 2014-01-30 10:05:44 +01:00
Christian Helmuth
f91b1b6258 base: test for races in thread-context allocation
Related to #1024.
2014-01-30 10:05:44 +01:00
Christian Prochaska
40aa553fa9 part_blk.run: build components before block image
With this patch, the components get built before the creation of the block
image to ensure that the 'bin' directory exists.

Fixes #1038.
2014-01-30 10:05:44 +01:00
Christian Prochaska
27ff408985 Noux: POSIX signal improvements
- 'kill()' syscall added
- 'wait()' gets unblocked when a signal occurs
- syscalls can get called from a signal handler without corrupting the 'sysio' object
- the child's exit status gets correctly reported to 'wait()'
- SIGCHLD gets ignored by default
- pending signals survive 'execve()'

Fixes #1035.
2014-01-30 10:05:44 +01:00
Stefan Kalkowski
7876dfcb5e block: free packet stream dataspace on destruction
Fixes #1033
2014-01-30 10:05:44 +01:00
Stefan Kalkowski
c888ff0d76 pci_session: add free_dma_buffer call (Fix #1037) 2014-01-30 10:05:44 +01:00
Christian Helmuth
aa02fb8256 Revise delete with allocators
Delete operators with additional allocator reference/pointer parameters
are needed if the constructor of an 'new(allocator)' allocated object
throws an exception. Also, destroy now uses the operator to free memory
and provides variants with allocator reference and pointer.

The commit includes a simple test scripts 'run/new_delete', which
exercises the several 'delete' cases.

Related to #1030.
2014-01-30 10:05:44 +01:00
Christian Helmuth
3234e4f775 Make Deallocator::need_size_for_free() pure virtual 2014-01-30 10:05:43 +01:00
Christian Helmuth
32f6d75cdb Fix compiler warnings 2014-01-28 09:27:09 +01:00
Christian Helmuth
b803375863 Fix ram-fs chunk test
The script was missing RM service and had color codes in output to
compare.
2014-01-28 09:27:09 +01:00
Christian Prochaska
ddc79d5563 base-linux: fix race condition in IPC code
Fixes #1013.
2014-01-27 18:54:09 +01:00
Stefan Kalkowski
5447c406e5 thread: rearrange thread context management
Use a bit allocator for the allocation management of thread contexts,
instead of holding allocation information within the Thread_base objects,
which lead to race conditions in the past.

Moreover, extend the Thread_base class interface with the ability to
to add additional stacks to a thread, and associate the context they're
located in with the corresponding Thread_base object. Additional stacks
can be used to do user-level scheduling with stack switching, without breaking
Genode's API.

Fixes #1024
Fixes #1036
2014-01-27 18:54:09 +01:00
Stefan Kalkowski
66c5887bd3 Move Bit_allocator from base-nova to base
Change the template parameter for Bit_allocator, and Bit_array. Instead of
assigning words to be used by the bit array, you can now tell the count of
items that shall be used.

Moreover, some dead code, previously using the Bit_allocator, was removed.

Related to #1024
2014-01-27 18:54:09 +01:00
Christian Helmuth
1645587b6a pistachio: Explicitly require autoconf >= 2.50
'make -C base-pistachio prepare' produces the following error otherwise

  autoconf: Undefined macros:
  configure.in:117:AC_CONFIG_HEADERS([config.h])
  configure.in:129:Please[AC_HELP_STRING([--with-comport=PORT],
  configure.in:138:Please[AC_HELP_STRING([--with-comspeed=SPEED],
  configure.in:147:Please[AC_HELP_STRING([--with-kickstart-linkbase=BASE],
  configure.in:152:Please[AC_HELP_STRING([--with-s0-linkbase=BASE],
  configure.in:157:Please[AC_HELP_STRING([--with-roottask-linkbase=BASE],
  configure.in:162:Please[AC_HELP_STRING([--with-kerneldir=DIR],
  configure.in:341:AC_CONFIG_FILES([
  configure.in:36:AC_CONFIG_SRCDIR([serv/sigma0/sigma0.cc])

Fixes #1034.
2014-01-27 18:54:09 +01:00
Christian Helmuth
8ed2e150a4 gdb_monitor: inhibit .gdbinit in unattended test 2014-01-27 18:54:09 +01:00
Rolf Sommerhalder
4ac81ad179 Fix run/uart, which fails to run without IO_PORT
Fixes #1031
2014-01-27 18:54:09 +01:00
Christian Helmuth
7e517179c9 Unify stack alignment among all platforms
The alignment is now done in Thread_base::Context. Implementations are
forced to use Context::stack_top(), which aligns the stack top.
2014-01-27 18:54:08 +01:00
Norman Feske
6ec36350d6 base: New Genode::Deallocator interface
Splitting the new Genode::Deallocator interface from the former
Genode::Allocator interface enables us to restrict the accessible
operations for code that is only supposed to release memory, but not
perform any allocations.

Additionally, this patch introduces variants of the 'new' operator
that takes a reference (as opposed to a pointer) to a Genode::Allocator
as argument.
2014-01-27 18:54:08 +01:00
Norman Feske
99979e09ed Xml_node::Attribute::value_size accessor 2014-01-27 18:54:08 +01:00
Norman Feske
a60966150e Service for reflecting reports as ROM modules
Issue #1026
2014-01-27 18:54:08 +01:00
Norman Feske
7c23d6cd81 nitpicker: Report pointer position 2014-01-27 18:54:08 +01:00
Norman Feske
2a576da2b0 Infrastructure for posting status reports
This commit introduces the "Report" session interface and a simple
service to forward reports to the LOG service.

Fixes #1026
2014-01-27 18:54:08 +01:00
Norman Feske
f32a97da38 Use filename as default label for ROM connections
By assigning the file name as label, we may become able to remove the
filename argument in the future by just interpreting the last part of
the label as filename. By keeping only the label, we won't need to
consider conditional routing (via <if-arg>) based on session arguments
other than the label anymore.
2014-01-27 18:54:07 +01:00
Norman Feske
9cb603eb5f Dynamic ROM service for automated testing 2014-01-27 18:54:07 +01:00
Norman Feske
332aeba844 util/string.h: String::operator == 2014-01-27 18:54:07 +01:00
Norman Feske
bdfbe9f20e New 'os/attached_dataspace.h' utility
The new Attached_dataspace complements the existing Attached_*
utilities with a simple version that can be used with any kind of
dataspaces. It may be even useful as a common base type for the other
variants. For example, this patch simplifies Attached_rom_dataspace
and removes the Terminal::Client::Io_buffer.
2014-01-27 18:54:07 +01:00
Norman Feske
759e11f9af Add Attached_rom_dataspace::update
This patch enhances the 'Attached_rom_dataspace' utility to support
dynamic updates of ROM modules.
2014-01-27 18:54:07 +01:00
Norman Feske
b6f59fb9be XML generator and test
Fixes #1019
2014-01-27 18:54:07 +01:00
Norman Feske
865f2b263f New utility for managing volatile class members
Fixes #1025
2014-01-27 18:54:07 +01:00
Norman Feske
3394be9464 Clean up scout widgets
This patch integrate the scout widgets with Genode's new API headers
'util/geometry.h', 'os/surface.h' and 'os/texture.h'. Thereby, we get
almost rid of the platform-abstraction shim that was never used anyway.

Furthermore, it extracts the parts that are worth reusing from the
scout implementation to the public location 'demo/include/scout'.
2014-01-27 18:54:06 +01:00
Norman Feske
8c8d53777f Generalization of nitpicker's graphics backend
This patch re-arranges nitpicker's graphics backend in a more modular
and expandable way. Generalized versions of the 'Canvas',
'Chunky_canvas', and 'Pixel_*' classes have been moved to
'os/include/util/' and 'os/include/os'. The only remaining parts that
are specific to nitpicker's needs are a few drawing functions, each
located in a distinct header at 'os/include/nitpicker_gfx/'.
2014-01-27 18:54:06 +01:00
Norman Feske
765053ea94 Remove nitpicker_gfx/nitpicker_types.h 2014-01-27 18:54:06 +01:00
Norman Feske
0063f217ca Move nitpicker_gfx/color.h to util/color.h 2014-01-27 18:54:06 +01:00