Commit Graph

547 Commits

Author SHA1 Message Date
Stefan Kalkowski
746011ee28 blk_cache: fix deadlock in allocator hierarchy
This commit generalizes the bit array in 'base/util/bit_array.h',
so that it can be used in a statically, when the array size is known
at compile time, or dynamically. It uses the dynamic approach of the
bit array for a more generalized version of the packet allocator,
formerly only used by NIC session clients. The more generic packet
allocator is used by the block cache to circumvent the allocation
deadlock described in issue #1059.

Fixes #1059
2014-02-25 14:58:06 +01:00
Sebastian Sumpf
aa4f11905a ldso: Export 'lx_syscall' for base-linux
The syscall library in not linked to dynamic binaries anymore, hence ldso need
to export the required symbols

Follow up to #1017
2014-02-25 14:58:06 +01:00
Sebastian Sumpf
f447fbe1a5 base: Do not link base libs against shared libs
Base libraries are already contained within ldso.lib.so. Remove unnecessary
filtering from 'dep_lib.mk', make ldso depend on base libs.

Issue #1017
Issue #989
2014-02-25 14:58:06 +01:00
Norman Feske
14718401ea nitpicker: Support for dynamic screen resizing
Fixes #1056
2014-02-25 14:58:06 +01:00
Martin Stein
0b64328944 base: setup thread object for main thread in CRT0
For a main thread a thread object is created by the CRT0 before _main gets
called so that _main can already run in a generic environment that, e.g.,
catches stack overflows as a page-fault instead of corrupting the BSS.
Additionally dynamic programs have only one CRT0 - the one of the LDSO -
which does the initialization for both LDSO and program.

ref #989
2014-02-25 14:58:05 +01:00
Norman Feske
276a1775f1 Accessors for Xml_node utility
This patch adds accessors to obtain the buffer of an attribute value,
which is useful to avoid the copying-out of such information by
maintaining pointers into the XML string as meta data.
2014-02-25 14:58:04 +01:00
Norman Feske
c265cfa593 Add 'operator *' to os/volatile_object.h
This operator is needed when we want to create a reference to (the
content of) a volatile object.
2014-02-25 14:58:04 +01:00
Norman Feske
e2d9b31bfe iso9660: Increase entrypoint stack size for 64bit 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
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 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
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
3234e4f775 Make Deallocator::need_size_for_free() pure virtual 2014-01-30 10:05:43 +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
Rolf Sommerhalder
4ac81ad179 Fix run/uart, which fails to run without IO_PORT
Fixes #1031
2014-01-27 18:54:09 +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
9cb603eb5f Dynamic ROM service for automated testing 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
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
Norman Feske
e809192b97 Remove nitpicker_gfx/miscmath.h 2014-01-27 18:54:06 +01:00
Norman Feske
35bfc34db5 Move nitpicker_gfx/geometry.h to util/geometry.h
This patch makes nitpicker's geometry utilities available for the use
by other programs. Thereby, the 'Point', 'Area', and 'Rect' classes
have become templates that take the coordinate type and distance type
as arguments.
2014-01-27 18:54:06 +01:00
Stefan Kalkowski
6a076ff621 block: use new server framework in block drivers
As a side effect, the entrypoints in the USB driver are merged into one thread.

Fixes #1027
2014-01-27 18:53:52 +01:00
Norman Feske
68608bb62d Increase quota for resource_request test
Needed to let the test pass on foc_x86_64.
2014-01-16 18:34:06 +01:00
Stefan Kalkowski
23ce0b2071 block: fix race in generic block driver component
Fixes #1023
2014-01-16 18:34:06 +01:00
Stefan Kalkowski
65291902e0 os: manage/dissolve Signal_rpc_member in class
Instead of, passing responsibility to manage and dissolve Signal_rpc_member
objects at a corresponding entrypoint to the user, hand over entrypoint's
reference to the constructor, and do it in the constructor resp. destructor
of the class.

Fixes #1022
2014-01-16 18:34:06 +01:00
Alexander Boettcher
bf57a5d79c pci: increase memory for device pd
not enough anymore on 32 bit after #989 changes
2014-01-16 18:34:06 +01:00
Christian Prochaska
efd20a7ded loader: fix the 'constrain_geometry()' function
Fixes #1014.
2014-01-16 18:34:06 +01:00
Norman Feske
feedbe4bb9 failsafe test: Fix destruction order 2014-01-07 12:16:16 +01:00
Josef Söntgen
e1370b558e add sync implementation to various fs servers
Fixes #1007.
2013-12-20 15:20:10 +01:00
Josef Söntgen
1c67e3bb43 os: extentend File_system interface with sync RPC
Users of a File_system_session might want to force a file system
to flush or rather to synchronize its internal cache. A concret
default implementation is provided because not all file systems
maintain an internal cache and are not required to synchronize
caches.

Fixes #1007.
2013-12-20 15:20:05 +01:00
Alexander Boettcher
b893968232 base: show size as %zu instead %zd
For big numbers otherwise negative sizes for memory chunks are displayed.

Issue #1011
2013-12-20 15:16:19 +01:00
Sebastian Sumpf
b8beba5bf3 ldso: Support for setting global object values
Make 'set_program_var' accessible outside of 'rtld.c'. Also, compile
dynamically linked programs with the '-fPIC' option. Doing not so,
yields to program-global symbols being put in the '.symtab' section
(which can be stripped) only. In order to get access to global
variables from the dynamic linker, the symbols need to reside within
the '.dynsym' section additionally. Hence the '-fPIC'.

ref #989
fix #1002
2013-12-20 14:48:06 +01:00
Stefan Kalkowski
ea9c0e20ba part_blk: increase ep stack size and bulk buffer
* Increase entrypoint stack size for part_blk server,
  since it crashes on 64 bit
* Consider packet alignment in bulk buffer size calculation of test-blk-cli
2013-12-19 11:34:05 +01:00
Stefan Kalkowski
af86e33c3f part_blk: re-design to work event driven
Fix #750
2013-12-19 11:34:05 +01:00
Stefan Kalkowski
35bb156972 block: extend block session test framework 2013-12-19 11:34:05 +01:00
Stefan Kalkowski
e73a71be12 packet stream: clean range allocator in destructor 2013-12-19 11:34:05 +01:00
Stefan Kalkowski
56a7d00a44 block: extend generic driver API (Ref #750)
* allow to handle a maximum of packets in parallel
  that fits free slots in the ack queue
* stop processing packets, when the driver can't handle
  more requests in parallel, and resume packet handling,
  when the driver is ready again
2013-12-19 11:34:04 +01:00
Stefan Kalkowski
b10b9e20a2 block: support for block number >32 bit (Fix #968) 2013-12-19 11:34:04 +01:00
Josef Söntgen
1bc16f3a23 ahci: missing shift when setting FIS adress
Fixes #997.
2013-12-12 08:49:41 +01:00
Josef Söntgen
038fcf032a os: dissolve contexts in Packet_stream
Fixes #1003.
2013-12-11 08:25:44 +01:00
Stefan Kalkowski
cc3b1599b8 Follow-follow-up fix for "hw: basic support..." 2013-12-09 14:05:53 +01:00
Christian Helmuth
eaed3ba207 acpi: print RMRR region (not just base) 2013-12-09 10:49:16 +01:00
Christian Helmuth
b24f48b125 framebuffer test: acpi_drv and pci_device_pd 2013-12-09 10:49:16 +01:00
Stefan Kalkowski
8b7c67976d Follow-up fix for "hw: basic support for ODROID" 2013-12-09 10:49:16 +01:00
Stefan Kalkowski
c3c643bcf1 block: let generic driver API work asynchronously
Fix #990
2013-12-04 11:14:18 +01:00
Stefan Kalkowski
7b49dbf2f3 hw: basic support for ODROID XU board (Fix #991) 2013-12-03 11:30:07 +01:00
Martin Stein
c4068c4001 FB & omap4: fix mix-up of _fb_height and _fb_width
fix #983
2013-12-03 10:40:23 +01:00
Martin Stein
d57319bbcb FB test: add stripes to detect line-shift bugs
ref #983
2013-12-03 10:40:23 +01:00
Martin Stein
576b9389cb FB test: fix wrong FB access-widths
ref #983
2013-12-03 10:40:22 +01:00
Stefan Kalkowski
adc63ef2a6 rom_blk test: abort if test fails
Instead of printing the success message at the end of the test,
abort as soon as two blocks differ.

Ref #966
2013-12-03 10:40:22 +01:00
Stefan Kalkowski
fec51620f7 fb_block_adapter: use generic block component/driver
Ref #966
2013-12-03 10:40:21 +01:00
Stefan Kalkowski
1b7b0b2050 atapi_drv: use generic block component/driver
Ref #966
2013-12-03 10:40:21 +01:00
Stefan Kalkowski
4c74af274b rom_loopdev: rename to rom_blk to be consistent
Ref #966
2013-12-03 08:33:26 +01:00
Stefan Kalkowski
1256b01867 rom_loopdev: use generic block component/driver
Ref #966
2013-12-03 08:33:26 +01:00
Stefan Kalkowski
0c8a4f9f3a block: extend interface of generic driver class
To support read-only devices like CDROMs, or rom_blk the supported
block operations have to be stated by specific the device driver.

Ref #966
2013-12-03 08:33:26 +01:00
Stefan Kalkowski
5a4cb7fcfb block: eliminate thread in generic block_component
Instead of using an additional thread in each Session_component of a
block server, which uses the generic block component and driver classes,
replace it with signal dispatchers.

Ref #113
2013-12-03 08:33:26 +01:00
Stefan Kalkowski
c70bc350e8 tz_vmm: make scenario reproducible by everyone 2013-11-28 08:22:25 +01:00
Stefan Kalkowski
39efbafb54 TrustZone vmm: rename to tz_vmm due to ambiguity 2013-11-28 08:22:24 +01:00
Josef Söntgen
c6ed7f13bf os: initial preparation for 64Bit AHCI support
The AHCI driver seems to work on x86_64, though it should be treated
carefully because for now all adresses involved are <= 32Bit.
2013-11-26 16:50:52 +01:00
Norman Feske
45a4d59e07 Whitespace fix 2013-11-26 14:32:08 +01:00
Christian Prochaska
4e9303ff6e ldso: increase MEM_SIZE in 'mmap()'
MEM_SIZE needs to get increased for the 64-bit 'linux_x86' platform when
building with -O0 on the current master branch.

Fixes #970.
2013-11-26 14:32:07 +01:00
Norman Feske
0d3f5be95b Dissolve sig contexts in rm_fault and signal tests 2013-11-26 14:32:07 +01:00
Christian Helmuth
eda44d6154 base-linux: hybrid file-system server
The current implementation is missing support for symbolic links.

Fixes #944.
2013-11-26 14:32:06 +01:00
Christian Helmuth
1bbd54c9b7 ram_fs: use server skeleton library
Related to #944.
2013-11-26 14:32:06 +01:00
Christian Helmuth
76cd788479 Fix some typos 2013-11-26 14:32:06 +01:00
Stefan Kalkowski
50d73e7890 block_session: extend interface with sync() call
To support components, which implement the block session's server side
rpc object, and which doesn't write data to their device backend immediately,
an additional synchronization call is needed. Thereby, clients like for
instance a file system can tell these components, when a synchronization is
required.

Ref #113
2013-11-25 12:12:31 +01:00
Norman Feske
a984c2342e demo.run: Support for Raspberry Pi 2013-11-25 09:46:28 +01:00
Norman Feske
148206d757 rpi: Framebuffer and platform drivers
The platform driver is used to access the features provided by the
Videocore mboxes, i.e., power configuration and framebuffer setup. The
framebuffer driver uses the platform interface to setup a screen mode of
1024x768.
2013-11-25 09:46:09 +01:00
Stefan Kalkowski
debec59e30 imx53: add missing break to input driver (fix #957) 2013-11-25 09:46:08 +01:00
Stefan Kalkowski
a7d7337b16 vmm: add i.MX53 platform as target (ref #954) 2013-11-25 09:46:08 +01:00
Norman Feske
b3ccac63c3 launchpad: Support configuration of launch entries
This patch enables the recursive startup of launchpad instances, which
was not possible since the recent removal of launchpad's built-in
default configuration.
2013-11-25 09:45:30 +01:00
Norman Feske
2f483500b0 Add 'Xml_node::has_sub_node' accessor 2013-11-25 09:45:30 +01:00
Martin Stein
b88d7e3370 vea9x4: centralize spec of interrupt names
ref #874
2013-11-14 19:56:39 +01:00
Martin Stein
7c70a9bf7d rpi: centralize spec of interrupt names
ref #874
2013-11-14 19:56:39 +01:00
Martin Stein
493ea55a72 omap4 & gpio_drv: add config lib
ref #874
2013-11-14 19:56:39 +01:00
Martin Stein
cc17d82d92 panda: centralize spec of interrupt names
ref #874
2013-11-14 19:56:39 +01:00
Martin Stein
e849cce39e pbxa9: centralize spec of interrupt names
ref #874
2013-11-14 19:56:39 +01:00
Martin Stein
ba1a82b485 arndale: centralize spec of interrupt names
ref #874
2013-11-14 19:56:39 +01:00
Norman Feske
f51c4be5d2 Server for writing terminal output to LOG session
Fixes #947
2013-11-12 17:59:29 +01:00
Norman Feske
ac05a5efdd Spelling fix 2013-10-30 12:27:44 +01:00
Stefan Kalkowski
fde93c3284 init: don't call Rom_session::dataspace() twice
In general, requesting a dataspace from a server twice is no good
idea. The server might react in a unrecoverable fashion. E.g. the rom_fs
service always throws away the corresponding dataspace from the first call
of dataspace(), and constructs a new one.
2013-10-29 18:08:30 +01:00
Christian Prochaska
27aeecf5d1 cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.

The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).

So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.

The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:

- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
  the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
  two functions

The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).

The 'gdb' command supports the following command line options:

- --ram: the initial RAM quota provided to the whole subsystem
         (including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
                      for itself

Fixes #928.
2013-10-29 18:08:29 +01:00
Stefan Kalkowski
fc1005c7ee foc: re-dimension UTCB area in core (fixes #927)
Take the whole UTCB area out of core's region map to circumvent mapping errors.
With this fix, the HDMI quirks are getting unnecessary.
2013-10-22 08:00:17 +02:00
Stefan Kalkowski
2329184ddb cli_monitor: make preservation limit a hard limit
When a child requests more ram resources, it gets blocked immediately when
the preservation limit is reached. Otherwise, it might happen that the
cli_monitor runs out of memory.
2013-10-22 08:00:17 +02:00
Stefan Kalkowski
e0be6b9ed6 cli_monitor: ensure blocked children are waked up
When a command was executed, it is necessary to check not only whether the
preservation limit of the ram quota is reached, but also whether new ram quota
is available (e.g.: consequence of the kill command), and children are waiting
for additional resources.
2013-10-22 08:00:17 +02:00
Stefan Kalkowski
15741f73c0 cli_monitor: don't withdraw all ram quota from child
When a yield request is responded by a child, don't withdraw all ram
quota currently available from the child, but let it keep hold a bit to live.
2013-10-22 08:00:17 +02:00
Stefan Kalkowski
e559fb7df9 cli_monitor: limit request yields to children
Don't request resource yieldings from children that are in a resource request
themselfs to lower needless system load.
2013-10-22 08:00:17 +02:00