File Manager

Norman Feske norman.feske at ...1...
Thu Oct 30 11:06:21 CET 2014


Hi Ben,

> 1. How do I load executables and libraries from a filesystem?

you cannot load executables or libraries directly a file system. On
Genode, executables and libraries are always requested as so-called ROM
sessions. Let me clarify the difference between ROM sessions and
file-system sessions:

A ROM session provides a single ROM module as dataspace, which can be
mapped in a virtual address space. When creating a new process, the
parent of the new process obtains a ROM dataspace with the ELF binary by
opening a ROM session. When requesting a ROM session, the ROM module
name is given as argument. There is no directory hierarchy and no way to
scan for the available ROM modules. The ROM client has to know what to
ask for. It then maps the different portions of the dataspace (such as
the text segment) to the address space of the new process. In short: A
ROM module is a piece of data that can be memory mapped. When multiple
processes use the same ROM module (i.e., when the ROM module is a shared
library) there exists only a single copy of the ROM-module data in the
system.

A file-system session provides access to a hierarchical file system
where files can be read/written, directories can be scanned, etc.
Compared to the ROM session, it is far more complex. The data contained
in files is copied over the session interface. A file of a file system
can never be memory mapped.

The Genode base system (including the dynamic linker and the init
process) does not rely on the file-system interface at all but only
requires the simple ROM session interface. This way, low-complexity
system scenarios can be realized without any notion of "files". To
facilitate more sophisticated scenarios where executables and libraries
should come from disk, a two-staged approach can be used:

The first stage (the first instance of the init process) contains all
the drivers and services needed to accommodate the second stage. This
static part of the system contains the ACPI driver, the disk driver, the
file system server for accessing the second-stage files and an instance
of the fs_rom component (that I mentioned in one of my previous emails).

The fs_rom component provides a ROM-session interface by reading files
from a file system. In your setup, you would configure cli_monitor such
that "ROM" session requests from the CLI monitor are routed to the
fs_rom server instead of to the parent. The fs_rom server will request a
file-system session. So you have to route the file system session to a
file-system service (such as rump_fs).

> 2. How do I access a specific filesystem on a hard drive?

Are you referring to individual partitions? If yes, please have a look
at the part_blk component (os/src/server/part_blk).

> 3. Can Genode automatically detect a filesystem's type?

There is no out-of-the box solution for this.

Cheers
Norman

-- 
Dr.-Ing. Norman Feske
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth




More information about the users mailing list