Commit Graph

908 Commits

Author SHA1 Message Date
Christian Prochaska
97c3f6599d Noux, libc_terminal: initialize 'stat' buffer
Initialize the 'stat' buffer in the 'stat()' function to avoid potential
non-deterministic program behavior.

Fixes #362.
2012-09-24 09:17:59 +02:00
Alexander Boettcher
8af582fac2 Vancouver: catch exception during module loading
Catch any kind of exception we get from the rm_session during module
loading. Panic if modules can't be processed (too big images and so on)
2012-09-24 09:17:59 +02:00
Alexander Boettcher
7bd0ed7c44 NOVA: fix overflow in address check 2012-09-24 09:17:59 +02:00
Alexander Boettcher
f5efbff19c Vancouver: map solely requested memory region
Don't map all memory of the VM at once, instead only the one permitted
by the memory model. Otherwise memory regions get mapped which must not,
where each instruction and memory access have to cause an exception in
order to emulate it step by step.
2012-09-24 09:17:59 +02:00
Alexander Boettcher
315a8437e3 Vancouver: make debug output configurable 2012-09-24 09:17:59 +02:00
Alexander Boettcher
2fd68105a3 Vancouver: Make sure context area gets reserved 2012-09-24 09:17:58 +02:00
Alexander Boettcher
5566446211 Vancouver: dimension VM size dynamically 2012-09-24 09:17:58 +02:00
Alexander Boettcher
79b0a7a2c9 Vancouver: zero initialize memory of the heap
Classes in Vancouver expect to get zero initialised memory when using memory
from the heap. Some classes don't initialize member variables as they should
do.
2012-09-24 09:17:58 +02:00
Alexander Boettcher
11a262c1af Allocate first heap requests from bss
The exception initialization and handling in gcc_eh allocates early (_main)
memory before executing main. In Vancouver the virtual
region from [0,VM size) must be reserved. Vancouver fails if the memory
allocated by the exception handling and the static objects was allocated
inside the [0, VM size) area.

To circumvent the situation allocate the first memory pieces for the heap
from the bss.
2012-09-24 09:17:58 +02:00
Alexander Boettcher
0d9e5f2daf Vancouver: Reserve VM memory region early
Reserve memory region for VM as early as possible before any other
memory allocation happens. Otherwise it could happen that heap
allocations will use part of the virtual region we require for the VM.
2012-09-24 09:17:58 +02:00
Alexander Boettcher
dbbfab5e7b 64bit fix for region dump 2012-09-24 09:17:58 +02:00
Alexander Boettcher
110a69413d NOVA: move context area
Move the context area close to the end of the virtual user available address,
so that Vancouver can obtain as much as possible of the lower virtual address
range for VMs.
2012-09-24 09:17:58 +02:00
Alexander Boettcher
ed2e610178 NOVA: maximize contiguous virtual space for 32/64
Use virtual regions for memory used during core initialization behind context
area. Enables us to start Vancouver VMs up to 1280 MiB, which requires
large virtual regions of contiguous aligned memory.

Exclude used virtual regions of echo and of pager thread in core.
2012-09-24 09:17:57 +02:00
Alexander Boettcher
ea38aad30e Move context area definition to native_type 2012-09-24 09:17:54 +02:00
Stefan Kalkowski
62d81ae487 Timer: make ram_quota and stack platform-dependent 2012-09-19 14:28:36 +02:00
Stefan Kalkowski
2e1bfe5d9b Fiasco.OC: always use fixed priority scheduler
The alternative weighted scheduler might lead to some threads don't make
any progress anymore (take for example the signal test). So we have to use
the fixed priority scheduler also in the kernel configuration for 64 Bit.
2012-09-19 14:27:42 +02:00
Norman Feske
b57c629449 Adapt timer quota to change in 'Allocator_avl' 2012-09-18 17:14:28 +02:00
Stefan Kalkowski
689c08e411 Make first block of allocator_avl 64bit fit
The first metadata-block, which is inherent part of the allocator object
itself has a fixed size which isn't suitable enough for some 64bit platforms
(e.g. core's RAM-allocator on a 64bit platform with lots of different regions).
This commit let the block size be address-width aware.
2012-09-18 16:47:59 +02:00
Stefan Kalkowski
361a67d749 Fiasco.OC: fix io-port fault answer in sigma0
In sigma0 normally no answer tag to a request/fault is created. It simply uses
the message tag received with the request. This doesn't work out when I/O ports
are requested. This patch constructs an appropriate answer tag. Moreover,
we have to enable I/O port protection in the kernel configuration.
2012-09-18 16:47:59 +02:00
Norman Feske
3e406a1077 Increase quota of USB driver
The memory allocation heuristics in the usb driver provided by dde_linux
changed with the recent commit 71b2b42936.
Apparently, the new variant requires a larger memory pool. Increasing
the quota is a temporary fix until the memory allocator gets revisited.
2012-09-18 10:53:17 +02:00
Stefan Kalkowski
efe3b8af74 L4Linux: update to recent version (svn rev. 25) 2012-09-18 10:53:16 +02:00
Stefan Kalkowski
1e87ef627b Fiasco.OC: update to recent version (svn rev. 40) 2012-09-18 10:53:16 +02:00
Josef Söntgen
6259fcf736 libports: add lwIP tests for Pandaboard on foc 2012-09-18 10:52:57 +02:00
Norman Feske
b22920c3a7 Enable noux_bash and noux_gdb on Pandaboard 2012-09-17 15:18:34 +02:00
Stefan Kalkowski
760f37fc86 Fiasco.OC: enable SMP for L4Linux
This commit comprises the following changes to enable L4Linux to use several
CPUs:
* change default configuration for x86 and ARM
* add atomic cmpxchg operation to l4re library
* implement l4_sleep (per thread)
* enable setting affinity for VCPUs and IRQs
* move "per CPU" section within linker-script (x86 only)
* introduce SMP run-script for pandaboard
* deactivate direct scheduler (Fiasco.OC syscall) access by L4Linux
2012-09-14 12:30:29 +02:00
Stefan Kalkowski
c63f3c07de Fiasco.OC: implement thread-affinity function 2012-09-14 12:29:58 +02:00
Josef Söntgen
83dd1640fc Noux: fix SYSCALL_READ return value
There is an error if reading from a Io_channel returns -1. In this
case the syscall should fail.

Fixes #356.
2012-09-14 12:24:13 +02:00
Christian Prochaska
97308f963a ffat_fs: work with absolute paths
The recently added 'Genode::Path' class makes it easy to create absolute
paths. With this patch the 'ffat_fs' server uses the 'Genode::Path' class
where possible instead of working with 'f_chdir()' and relative paths.
This also solves the problem reported in issue #355, which was caused by
storing a relative file name in the 'File' node.

Fixes #355.
2012-09-14 12:23:26 +02:00
Christian Prochaska
d6402041bc Noux: return dummy time in 'gettimeofday()'
The 'find' program can abort if the 'gettimeofday()' function returns -1,
which it currently does. With this patch the 'gettimeofday()' returns a
dummy time instead to prevent such a termination.

Fixes #353.
2012-09-14 12:21:54 +02:00
Christian Prochaska
4b81cf3e63 Noux: fix 'Vfs_io_channel::lseek()' calculations
With this patch the 'Vfs_io_channel::lseek()' function takes the offset
argument into account when calculating the new seek offset in the SEEK_CUR
and SEEK_END cases.

Fixes #352.
2012-09-14 12:21:16 +02:00
Christian Prochaska
4ab9782b8b Noux: use correct member in Vfs_io_channel::size()
Fixes #351.
2012-09-14 12:20:33 +02:00
Christian Prochaska
3cfc691c77 libc_fs: handle 'Packet_alloc_failed' exception
With this patch, when a 'Packet_alloc_failed' exception occurs in the
'write()' function, the function waits for a packet acknowledgement and
the release of the packet and then tries the packet allocation again.

Fixes #348.
2012-09-14 12:13:05 +02:00
Alexander Boettcher
6994f6a8c5 Fix binary size for 64bit
Every 64-bit binary is effectively 4M too big currently [0]. The GNU linker ld
aligns the text section of the binary to the maximum page size. On i386
the default section alignment is fixed typically to 4K.

Avoid wasting mainly 4M on x86_64 by telling the linker the max page size to
be 4K.

[0] http://sourceware.org/ml/binutils/2009-04/msg00099.html
2012-09-05 15:06:52 +02:00
Norman Feske
83bdfea9b0 Extend Cpu_session with thread-affinity API
This patch introduces the functions 'affinity' and 'num_cpus' to the CPU
session interface. The interface extension will allow the assignment of
individual threads to CPUs. At this point, it is just a stub with no
actual platform support.
2012-09-05 10:25:04 +02:00
Norman Feske
43db231e77 Adapt Qt4 to change of stdcxx, issue #339
The new C++ standard library provided by libports is a shared library.
We need to include it in each run script that uses Qt4.
2012-09-04 12:38:06 +02:00
Norman Feske
9651974448 Add stdcxx-4.6.1 to libports, fix #339
This patch adds libstdc++ to libports. With the previous version of the
stdcxx library, the build system used the C++ standard library that
comes with the compiler. This mechanism was prone to inconsistencies of
types defined in the header files used at compile time of the tool chain
and the types provided by our libc. By building the C++ standard library
as part of the Genode build process, such inconsistencies cannot happen
anymore.

Note that the patch changes the meaning of the 'stdcxx' library for
users that happened to rely on 'stdcxx' for hybrid Linux/Genode
applications. For such uses, the original mechanism is still available,
in the renamed form of 'toolchain_stdcxx'.
2012-09-04 12:37:56 +02:00
Josef Söntgen
f7dd8aa688 libports: adjust lwip's TCP_SND_BUF size
The old values were much too small and the current ones are probably to
large but the TCP send throuhgput has increased noticeable (a few MiB/s
on the Pandaboard).

Fixes #343.
2012-09-03 11:10:39 +02:00
Taru Karttunen
bff86ab74d libc_terminal: TIOCGETA return always echo on 2012-09-03 11:05:23 +02:00
Taru Karttunen
27bbaf75ba libc_terminal: add fstat and fake some ioctls, fix #344 2012-09-03 11:05:00 +02:00
Stefan Kalkowski
28614ce518 Fiasco.OC: fix capability ref-counter issue in core
The Cap_mapping abstraction in core shouldn't use a Cap_index directly, but
use Native_capability instead, as it can break reference-counting, as long as
the same Cap_index gets used in a Cap_mapping and a Native_capability. This
commit finally fixes #208.
2012-09-03 11:00:09 +02:00
Stefan Kalkowski
a5ea6765d1 Fiasco.OC: several capability ref-counter fixes.
This commit fixes several issues that were triggered e.g. by the
'noux_tool_chain' run-script (fix #208 in part). The following problems
are tackled:
* Don't reference count capability selectors within a task that are actually
  controlled by core (all beneath 0x200000), because it's undecideable which
  "version" of a capability selector we currently use, e.g. a thread gets
  destroyed and a new one gets created immediately some other thread might
  have a Native_capability pointing to the already destroyed thread's gate
  capability-slot, that is now a new valid one (the one of the new thread)
* In core we cannot invalidate and remove a capability from the so called
  Cap_map before each reference to it is destroyed, so don't do this in
  Cap_session_component::free, but only reference-decrement within there,
  the actual removal can only be done in Cap_map::remove. Because core also
  has to invalidate a capability to be removed in all protection-domains
  we have to implement a core specific Cap_map::remove method
* When a capability gets inserted into the Cap_map, and we detect an old
  invalid entry with the dame id in the tree, don't just overmap that
  invalid entry (as there exist remaining references to it), but just remove
  it from the tree and allocate an new entry.
* Use the Cap_session_component interface to free a Pager_object when it
  gets dissolved, as its also used for allocation
2012-09-03 10:59:54 +02:00
Stefan Kalkowski
b71c1649d6 Fiasco.OC: check invoked capability (fix #341)
Let the Fiasco.OC base platform succeed the cap_integrity run-script meaning
that it is not feasible anymore to fake a capability by using a valid one
together with a guessed local_name.
2012-08-30 11:15:27 +02:00
Sebastian Sumpf
c98a80251c USB: Sync interrupts
On systems that use multiple UHCI/EHCI controllers, synchronize access to low
level interrupt handler. Let 'device_may_wakeup' return 1, so suspended
controllers will send interrupts upon device connection. Make sure URBs are
shutdown upon disconnect.

Fixes #332
2012-08-30 11:12:49 +02:00
Sebastian Sumpf
71b2b42936 USB: Dimension back-end allocators dynamically
Use avaible ram session quota to determine the size of the memory allocators.

Fixes #331
2012-08-30 11:12:32 +02:00
Christian Prochaska
78b0bd57f7 Noux: store environment variables zero-separated
With this patch environment variables always get stored as zero-separated
strings in buffers of type 'Sysio::Env'. This fixes the problem that
environment variables with non-alphanumeric characters did not get set
correctly in child processes.

Fixes #340.
2012-08-30 10:44:53 +02:00
Josef Söntgen
1b9c356aa3 Noux: override uid/gid in SYSCALL_STAT
Change the uid/gid entries in the stat syscall to have the same values
on all filesystems that are used in the current noux-instance according
to the specified values in noux' config.

Fixes #338.
2012-08-30 10:44:22 +02:00
Josef Söntgen
9cff243f42 Noux: add proper errno handling to network funcs
Programs use the errno value to check which error exactly occured.
It is mandatory for non-blocking I/O, e.g. connect() gets the current
state of the connection by looking at the returned errno values.

Fixes #337.
2012-08-30 10:44:06 +02:00
Alexander Boettcher
aae3ce348e NOVA: add single-step support used by gdb
Fixes #336
2012-08-30 10:42:38 +02:00
Alexander Boettcher
3b0e4372fe NOVA: setup all exception handlers of a thread 2012-08-30 10:42:38 +02:00
Alexander Boettcher
fcd62729d4 NOVA: tunnel thread start parameters via state()
The cpu_session interface fails to be virtualized by gdb_monitor because
platform-nova uses an extended nova_cpu_session interface.

The problem was that threads have been created directly at core without
knowledge of gdb_monitor. This lead to the situation that gdb_monitor didn't
know of all threads to be debugged.

Tunnel the additional parameters required on base-nova through the state()
call of the cpu_session interface before the thread actual is started.
2012-08-30 10:42:26 +02:00