Commit Graph

3375 Commits

Author SHA1 Message Date
Martin Stein 70ae53fe3c Simplify interface of the MMIO framework, ref #69
Parameterize register and bitfield templates to always take their
bitwidth instead of the according types or width exponents as arguments.
2012-02-23 10:42:12 +01:00
Martin Stein 7044b264e6 Beautify class names in 'register.h' and 'mmio.h'
Replace 'Reg_array' in 'Genode::Mmio' by 'Register_array' and 'Subreg'
in 'Genode::Register', 'Genode::Mmio::Register'and
'Genode::Mmio::Register_array' by 'Bitfield'.

Update and beautify comments in the according headers and test programs.
2012-02-23 10:42:12 +01:00
Martin Stein e1285335ab Replace 'Subreg_array' with 'Reg_array'.
'Reg_array' contains items whose width can be the width of the register
storage type at a max. Nethertheless they can be smaller and iterate all
subregs that are covered by the item width. The array uses as much
successive instances of its storage type as needed.

The test 'run/util_mmio' also tests these new features heavily.
2012-02-23 10:42:12 +01:00
Martin Stein 01bb7536dd Complement test for MMIO framework
The run script 'run/util_mmio.run' runs a test over basic
functionalities of 'Mmio::Register' and 'Mmio::Register::Subreg'. The
test covers the functions 'read' and 'bits', 'set', 'clear' and 'get'.

Inline function in 'Mmio::Register::Subreg' whose definition otherwise
looks ugly.
2012-02-23 10:42:12 +01:00
Martin Stein 9329b91aca Extract more generic parts from 'Genode::Mmio'
To accommodate CPU registers, which have a structured layout but don't
depend on a region base address, this patch introduces the generic
'Genode::Register' and 'Genode::Subreg' to 'register.h'.
'Mmio::Register' and 'Mmio::Subreg' inherit from them.
2012-02-23 10:42:11 +01:00
Martin Stein 1f75ebe9e5 First version of generic MMIO access framework
The MMIO access framework consists of an abstraction for a contiguous
MMIO area with a base address set dynamically. Within this class 'Mmio'
are declarations for 'Register' and 'Subreg'. These two can be
parameterized statically via template parameters to create arbitrary
MMIO structures.

Whereas 'Register' relies to a POD like subregion of 'Mmio', 'Subreg'
relies to a MMIO region within a specific 'Register' and therefore is
smaller or equal then the storage type of its superior 'Register'.

Furthermore with 'Reg_array' and 'Subreg_array', there exists the
possibility to handle arrays of uniform contiguous registers or subregs
by index. 'Subreg_array' therefore abstracts from the width boundary of
its superior 'Register' and handles a steady distance between its
members in addition. Both also check array size limits.

Related to issue #69.
2012-02-23 10:42:11 +01:00
Norman Feske cbd4830977 Propagate new parent cap to forked process
This patch removes the hardcoded parent cap for the new child by
introducing a facility called 'poke' similar to copy-to-user. This
change makes the fork mechanism kernel-agnostic. The 'noux_fork'
test works on L4/Fiasco, OKL4, NOVA, Fiasco.OC, and L4ka::Pistachio.
Linux is not supported yet.
2012-02-23 10:42:11 +01:00
Norman Feske da5b0ff316 Remove unneeded libm from boot modules 2012-02-23 10:42:11 +01:00
Norman Feske 396a9ee273 Hook for re-establishing default LOG session 2012-02-23 10:42:11 +01:00
Norman Feske 1a833ebd30 Allow for overriding time-related libc functions
If using the libc for Noux programs, the default implementation of these
functions cannot be used because they rely on a dedicated
timeout-scheduler thread. Noux programs, however, are expected to
contain only the main thread. By turning the functions into weak
symbols, the noux libc-plugin can provide custom implementations.
2012-02-23 10:42:11 +01:00
Norman Feske fe2addf5b0 Noux: first functional version of fork
The resource virtualization layer has been extended to support sub RM
sessions because this feature is used by the dynamic linker. Currently,
the address space of the forking process is copied eagerly. However,
different dataspace types are treated differently. For example, only RAM
dataspaces are copied but no ROM dataspaces.

At the libc side, a setjmp/longjmp-based trampoline mechanism is used to
implement the continuation of the main thread inside the new process.
This procedure is also responsible for re-establishing the relationship
to the new process' parent as well as its Noux session.

This version is still in flux and has many rough edges. It is tied to
OKL4 for now.
2012-02-23 10:42:11 +01:00
Norman Feske 3ddf7d2b1b Let reload_parent_cap take the new cap as agument 2012-02-23 10:42:03 +01:00
Norman Feske decfe7c4bb Let process lib deal with fork semantics
The startup procedure of forked processes differs from Genode's
normal process creation by omitting all steps related to ELF loading
and the start of the main thread. To let the process lib support this
distinction, an invalid ELF-binary capability is handled as valid
argument now.
2012-02-22 15:56:45 +01:00
Norman Feske 759af6d9c1 Accessor to obtain parent cap of child
This is needed for the fork support of Noux.
2012-02-22 15:56:45 +01:00
Norman Feske 869c6e1df2 Noux: dim naming noise using the Genode namespace
Because 'Noux::Child' implements several abstract Genode interfaces, the
'Genode::' prefix became almost ubiquitous, making the code harder to
read. By importing the 'Genode' namespace into the 'Noux' namespace,
this patch remedies this inconvenience.
2012-02-22 15:56:45 +01:00
Norman Feske 5aaf04915c Intercept CPU session of Noux::Child
To implement fork semantics, we need to customize the bootstrapping of
the newly created process, in particular the startup of the main thread.
The CPU session interface provides a suitable hook. By virtualizing the
CPU connection of the process to core, we can defer (and parametrize)
the startup of the main thread. Furthermore, this enables us to detect
illegal attempts by the Noux process to create threads in addition to
the main thread.
2012-02-22 15:56:45 +01:00
Norman Feske 652a4afd51 Intercept RAM and RM of Noux processes
By letting Noux processes talk to service implementations local to the
Noux server, we can track RAM allocations and RM operations. This is
needed as a prerequisite to implement fork.
2012-02-22 15:56:45 +01:00
Norman Feske e4cefe58d5 Make Child's reference RAM session configurable
The 'Child' framework used to perform the transfer of session quota
using 'env()->ram_session()' as hard-wired reference account. When
locally virtualizing the RAM session supplied to the 'Child', this
policy does not work. When closing a session, core would try to transfer
session quota to the virtualized RAM service, which is of course not
possible. This patch makes the reference RAM session configable via the
'Child_policy' interface.
2012-02-22 15:56:45 +01:00
Norman Feske 15f0879402 Noux: skeleton for getpid and fork 2012-02-22 15:56:45 +01:00
Norman Feske f3fcb5f56f Facility for reinitializing Platform_env
The new function 'Platform_env::reload_parent_cap' triggers a reload
of the parent capability and its respective resources. It is needed
during the bootstrap of a new process forked from an existing Noux
process.
2012-02-22 15:56:45 +01:00
Norman Feske b6b05a032b Simple fork test and run script
Currently the test is failing because fork is not yet implemented.
2012-02-22 15:56:45 +01:00
Alexandre Bique 42c21e4582 Console: don't use buf for '-' and '0' padding
As buf is not sized depending on the padding, if a huge padding is put
in buf then we could see an overflow.
2012-02-16 09:11:39 +01:00
Alexandre Bique a3266f8ec7 Log console: flush sooner rather than later 2012-02-16 09:11:13 +01:00
Christian Prochaska 06f155a644 Add 'Native_capability::dst()' accessor for Linux
This patch fixes #118.
2012-02-15 09:26:21 +01:00
Christian Prochaska 4b1f182e61 Unlock guarded lock before sending IPC error reply
Sending a reply message does not return, so the guarded lock needs to get
unlocked manually.

This patch fixes #117.
2012-02-15 09:26:21 +01:00
Christian Prochaska e6f6defaca Test capability integrity
The test application tries to print a message using init's own LOG
session without permission.

This patch fixes #106.
2012-02-15 09:26:21 +01:00
Norman Feske 7ed13b3920 News entry about slides of FOSDEM 2012 2012-02-15 09:26:17 +01:00
Julian Stecklina c7890c9423 Set ENOSYS for all libc dummies
This is a brute-force approach to issue #102. This might be a bit too
much. I don't know if we can clobber errno for all of those?
2012-02-14 16:44:43 +01:00
Julian Stecklina 9508cc0ed5 Fixed wrong sign extension in printf on 64 bit
This patch fixes printf errors caused by sign extension of values that
were supposed to be unsigned. Fixes #6. Also handles the case where
sizeof(long long) != sizeof(long).
2012-02-14 16:44:43 +01:00
Norman Feske 38ab3c50a5 Minor alterations made to the documentation
Thanks to ukn for reporting! Fixes #108.
2012-02-14 16:44:43 +01:00
Alexandre Bique 9adb24244a Update zlib to 1.2.6
Bump version from 1.2.5 to 1.2.6, as 1.2.5 is no more available at
zlib.net.
2012-02-14 16:44:43 +01:00
Alexandre Bique f3a5b78d28 Explicitly specify use of python2 for gallium-aux
Without this fix, the library will fail to build on systems where
python3 is used by default.
2012-02-14 16:44:43 +01:00
Alexandre Bique a6f0067e7f Hard-wire OKL4 elfweaver to python2
On executing "make prepare", patch elfweaver to specify python2 instead
of python, fix #107
2012-02-14 16:44:43 +01:00
Norman Feske 3c09a06620 Interactive browsing through a PDF
This patch introduces the basic key handling required to browse through
a multi-page PDF document ([page-up] or [enter] -> next page,
[page-down] or [backspace] -> previous page).
2012-02-14 16:44:42 +01:00
Norman Feske ea8b113303 Moved code from main into 'Pdf_view' class
This way, we can register a meaningful 'user_data' pointer to at the
'pdfapp_t' structure and avoid the use of singletons for 'Framebuffer'
and 'pdfapp'.
2012-02-14 16:44:42 +01:00
Norman Feske 810654f45b Let MuPDF render a single page of a PDF document 2012-02-14 16:44:42 +01:00
Norman Feske 8201075671 Initial port of MuPDF application
This version of MuPDF will use Genode's framebuffer session and input
session to display a PDF file. At the current stage, the program is
merely a skeleton that compiles and starts. Neither the actual rendering
not the response to user input are implemented. To try it out, there
is a ready-to-use run script at 'libports/run/mupdf.run'.
2012-02-14 16:44:42 +01:00
Norman Feske 54cb49583b Libc plugin for using file I/O on ROM dataspaces 2012-02-14 16:44:42 +01:00
Norman Feske dc4f6871c3 Make argument types of min and max more flexible 2012-02-14 16:44:42 +01:00
Norman Feske 8495a5fc96 Convenience helper for attached ROM dataspaces
In the line of the 'Attached_ram_dataspace' and
'Attached_io_mem_dataspace' classes, this new helper simplifies the
access to ROM dataspaces.
2012-02-14 16:44:42 +01:00
Julian Stecklina a6bac95fbd Fix possible NULL-pointer dereference in _stat
When given NULL pointers as buffers to _stat, return EFAULT, just as
Linux and FreeBSD. Fixes #101.
2012-02-14 16:44:42 +01:00
Christian Prochaska 97b978c6c8 Fix sector calculation in GRUB's stage2_eltorito
The sector number was not calculated correctly for sector sizes < 2048
bytes. This commit updates the stage2_eltorito binary file, which was
created from CVS GRUB legacy (tag 'release_0_97') after applying Adam
Lackorzynski's 'os.8' patch
(http://os.inf.tu-dresden.de/~adam/grub/0.97/grub-0.97-os.8.diff.gz)
and the following patch:

diff --git a/stage2/asm.S b/stage2/asm.S
--- a/stage2/asm.S
+++ b/stage2/asm.S
@@ -98,7 +98,7 @@
        .string VERSION
 VARIABLE(config_file)
 #ifndef STAGE1_5
-       .string "(nd)/tftp/menu.lst"
+       .string "/boot/grub/menu.lst"
 #else   /* STAGE1_5 */
        .long   0xffffffff
        .string "/boot/grub/stage2"
diff --git a/stage2/fsys_iso9660.c b/stage2/fsys_iso9660.c
--- a/stage2/fsys_iso9660.c
+++ b/stage2/fsys_iso9660.c
@@ -81,12 +81,12 @@
   if (byte_len <= 0)
     return 1;

-  sector += (byte_offset >> sector_size_lg2);
-  byte_offset &= (buf_geom.sector_size - 1);
   asm volatile ("shl%L0 %1,%0"
            : "=r"(sector)
            : "Ic"((int8_t)(ISO_SECTOR_BITS - sector_size_lg2)),
            "0"(sector));
+  sector += (byte_offset >> sector_size_lg2);
+  byte_offset &= (buf_geom.sector_size - 1);

 #if !defined(STAGE1_5)
   if (disk_read_hook && debug)

This patch fixes #97.
This patch fixes #98.
2012-02-14 16:44:41 +01:00
Christian Prochaska 7690e5ad07 Fix QtScriptTools compilation
Make the 'moc_*.cpp' and '*.moc' files dependencies of '$(SRC_CC:.cpp=.o)'
to make sure that they get built. This patch fixes #99.
2012-02-14 16:44:22 +01:00
Christian Prochaska f72ab94853 GDB monitor test for automatic testing
The following features are tested (currently on Fiasco.OC only):

- breakpoint in 'main()'
- breakpoint in a shared library function
- stack trace when not in a syscall
- thread info
- single stepping
- handling of segmention fault exception
- stack trace when in a syscall

This patch fixes #105.
2012-02-10 18:46:41 +01:00
Christian Prochaska 8b7252cdde Fix a typo in GDB monitor
This patch fixes #104.
2012-02-10 18:45:36 +01:00
Norman Feske 349dccd46d Make signal test more robust wrt scheduling 2012-02-10 10:09:55 +01:00
Norman Feske b8f88c035a Support for prefetching a static list of ROM files
The ROM prefetcher service can be used to prefetch complete ROM files,
which is handy when using the iso9660 server (which normally reads file
content block-wise on demand). The server used to perform the
prefetching upon request of the respective ROM session. This patch adds
a facility for prefetching a predefined list of files. It is primarily
intended for eagerly fetching live-CD content in the background after
having passed the first boot stage.
2012-02-08 19:35:25 +01:00
Norman Feske b11bbd30c2 Work-around of running Genode with PaX enabled
Thanks to Torsten Hilbrich for reporting. Fixes #91.
2012-02-08 19:30:55 +01:00
Christian Prochaska ec09842fc7 Define struct 'generic_settings_operations'
The definition is needed to compile nic_drv with -O0 for Fiasco.OC.

This patch fixes #96.
2012-02-08 12:07:24 +01:00
Norman Feske 9399800c65 Limit width of launchpad window
Without limiting the size of the launchpad window, the application
prepares itself for the worst case, taking the screen size as maximum
size to allocate its pixel buffers. Limiting the maximum width to a
reasonable value reduces the memory footprint.
2012-02-01 15:18:31 +01:00