shared dataspace for l4re_kernel/ registering additional caps in ned

Stark, Josef j.stark at tum.de
Thu Mar 12 00:00:30 CET 2015


>>To tell the second Ned about your new FS, you will have to link it
>>with libmount (l4/pkg/libc_backends/lib/mount) and provide an fstab
>>file during startup in the Lua config as this:
>>
>>ldr:startv( { caps = {},
>>              log = { "myapp", "red" }
>>            },
>>            "rom/myapp",
>>            {
>>                FSTAB_FILE="rom/myfstab.fstab"
>>            });
>>
>>This lib will then mount the new file system locally into your
>>application (e.g., the second ned instance).
>
>Ned doesn't need to know about this filesystem,
>but my manager application and the l4re thread of
>the new task do.
>
>Linking and using the manager with libmount works fine.
>
>But I have some problems linking l4re with libmount.
>Mostly undefined references:
>
>Initially, I tried simply adding libmount to  REQUIRES_LIBS
>of the makefile, but that gave a lot of linker errors.
>So I replaced most of the minimal lib versions with the full-
>fledged ones:
>REQUIRES_LIBS  := libc l4re-util libstdc++ libloader \
>cxx_libc_io libc_be_minimal_log_io
>
>Without libmount, this also builds fine.
>But after adding libmount, this leads to undefined references of
>open, fstat, mount and close.
>After adding libc_be_l4refile to the list (since it seems to contain the
>missing symbols), l4re_env_posix_vfs_ops is undefined.
>And since this is AFAIK only found in libl4re-vfs, I tried adding it,
>but then the build stops with this error:
>"src/l4/mk/binary.inc:335: *** Never include 'libl4re-vfs'!.  Stop."


Ok, so I worked around this error message by removing the sanity
check from src/l4/mk/binary.inc; l4re then gets linked with libmount.

I then also linked libl4revfs-fs-l4fs successfully to l4re.

However, whenever I supply a fstab-file to a new task 
(via FSTAB_FILE=...), mounting with libmount still fails,
and the target task then even stops without executing main().
Error displayed:
" test   | mmap() called without MAP_ANON flag, not supported!
  test    | libmount: Parsing 'rom/fstab'
MOE[rm]: unhandled read page fault at 0x0 pc=0xb000eeb4"

Anyway, then I tried to let l4re mount the filesystem without
libmount, by inserting mount("none","/tmp","l4fs",0,0);
just after the line
boot.printf("load binary '%s'\n", Global::l4re_aux->binary);.

However, the mount fails; a perror("mount") after simply
yields "mount: Invalid argument". The same mount
command however works fine in conventional threads.
(Note that a l4fs/libfs-server is running and the needed
IPC-Gate has been given to the task. "Normal" tasks/
threads can actually use this server.)

Any ideas how I could convince l4re (l4re_kernel) to
mount a libfs/l4fs-type FS?


Thanks in advance,
Josef


P.S.: If you view this mail via the mailinglist-archive,
the first half of this thread can be found in 2014,
since it began there.


More information about the l4-hackers mailing list