fprintf(stderr, ...) fails

Martin Pohlack mp26 at os.inf.tu-dresden.de
Tue Nov 29 15:44:10 CET 2005

Hi Arthur,


> Maybe, it's because I am using a older drops version (I'll update it 
> right now),

Always a good idea ...

> but when I'm compiling it in l4env - mode, I get following error messages:
>     ../../../lib/libxvidcore.a(xvid.o): In function `sigill_check':
>     xvid.c:(.text+0x30): undefined reference to `signal'
>     xvid.c:(.text+0x68): undefined reference to `signal'
>     collect2: ld returned 1 exit status
>     make[1]: *** [Program] Fehler 1
> (I use the xvid-library, which is using the signal - function).
> If I use the l4env_base - mode, another additional error occurs:
>     xvid.c:(.text+0x4e): undefined reference to `_setjmp'
> Seems, that these system functions are not implemented yet.
> Is there any problem using the l4env_freebsd - mode?

Someone else jump in here ...

> I also can turn the signal-function of.
>>You might want to look into l4/pkg/l4vfs/examples/l4vfs_test which uses
>>the l4env_base MODE.  Note that you must switch to dietlibc or uclibc in
>>l4 type 'make config'.
> But still I can't use the fprintf-function. If I compile a simple 
> test-program like
>     #include <stdio.h>
>     int main (int argc, char **argv) { fprintf(stderr, "Error\n"); 
> return 0; }
> in l4env-mode, I get the error message
>     testprg | L4RM: [PF] read at 0x00000000, eip 0180e0ae, src 9.02
>     testprg | [9.0] l4rm/lib/src/pagefault.c:78:__unknown_pf():
>     testprg |  unhandled page fault
> in l4env-mode, I get the error message
>     simplets| Configured for 64 tasks.
>     testprg | l4vfs_get_name_server_threadid(): 'name_server' not known 
> at RMGR!
>     simplets| l4_ts_exit_component(): Exit 9.02
> starting with -l name_server:
>     simplets| Configured for 64 tasks.
>     simplets| l4_ts_exit_component(): Cannot exit A.02 (reserved or 
> terminating)
> Is there any library, that I can include or any program I have to start, 
> to get
> this simple program started?

For such a simple program I'd advise you to use the 'sigma0' mode which
directly puts out writes to stdout and stderr to (text-)screen and
serial, if configured.  The 'l4env' mode works similarly but uses
logserver functions for output.

More complex programms should use the l4env_base mode which uses more
sophisticated output backends.  But here you need someone implementing
the output channels, for example l4vfs_log.

Using fiasco-ux I start this up as follows:


#! /bin/bash

. ${0%/*}/generic.inc

fiasco \
        -G $UXRES                                                      \
        -l names                                                       \
        -l log                                                         \
        -l dm_phys                                                     \
        -l simple_ts                                                   \
        -l name_server                                                 \
        -l l4vfs_log                                                   \
        -l "fstab -c /server -c /server/log -v10 -b/ -m/server/log"    \
        -l "l4vfstest --stdout /server/log/l4vfstest                   \
                      --stderr /server/log/l4vfstest"                  \
        -n9 "$@"


 - name_server is the l4vfs name server to resolve names like
 - l4vfs_log wrappes write calls to logserver functions, while keeping a
   clientspecific log prefix
 - fstab initially populates the name space and mounts l4vfs_log to
 - l4vfstest is your example program compiled with MODE = l4env_base,
   the client lib catches the special parameters --stdout and --stderr
   and connects them the file "/server/log/l4vfstest", which works as
   your "output terminal".  This is a "poor man's" inheritance of open
   filedescriptors ;-)

We also have terminal servers for l4con and DOpE, these could even
provide input using "--stdin".  Have a look into l4vfs/term_server for this.

Note: The MODE variables in Makefiles define a set of libs etc. to use,
if you want to know what is going on, call make with "make VERBOSE=" or
have a look into l4/mk/modes.inc.


More information about the l4-hackers mailing list