mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-30 16:14:13 +00:00
7ac32ea60c
This patch introduces a new scheme of handling ioctl operations that maps ioctls to pseudo-file accesses, similar to how the libc maps socket calls to socket-fs operations. A device file can be accompanied with a (hidden) directory that is named after the device file and hosts pseudo files for triggering the various device operations. For example, for accessing a terminal, the directory structure looks like this: /dev/terminal /dev/.terminal/info The 'info' file contains device information in XML format. The type of the XML node corresponds to the device type. E.g., If the libc receives a 'TIOCGWINSZ' ioctl for /dev/terminal, it reads the content of /dev/.terminal/info to obtain the terminal-size information. In this case, the 'info' file looks as follows: <terminal rows="25" columns="80/> Following this scheme, VFS plugins can support ioctl operations by providing an ioctl directory in addition to the actual device file. Internally, the mechanism uses the 'os/vfs.h' API to access pseudo files. Hence, we need to propagate the Vfs::Env to 'vfs_plugin.cc' to create an instance of a 'Directory' for the root for the VFS. Issue #3519
This directory contains ports of popular 3rd-party software to Genode. Usage ----- The tool './tool/ports/prepare_port' in the toplevel directory automates the task of downloading and preparing the library source codes. You can select individual packages that have to be prepared by specifying their base names (without the version number) as command-line argument. For example, the following command prepares both the C library and the Freetype library: ! ./tool/ports/prepare_port libc freetype To compile and link against 3rd-party libraries of the 'libports' repository, you have to include the repository into the build process by appending it to the 'REPOSITORIES' declaration of your '<build-dir>/etc/build.conf' file. Under the hood -------------- For each library, there is a file contained in the 'libports/ports/' subdirectory. The file is named after the library and contains the library-specific rules for downloading the source code and installing header files. How does 'libports' relate to the other repositories? ----------------------------------------------------- Most libraries hosted in the 'libports' repository expect a complete C library, which is provided with the 'libc' package. Please do not forget to prepare the libc package when using any of the other libports packages. The libc, in turn, depends on the 'os' repository for its back end. Because the 'os' repository is the home of the dynamic linker, libraries contained in 'libports' are safe to assume the presence of the dynamic linker and, thus, should be built as shared libraries.