Source-code repositories
As briefly introduced in Section Source-tree structure, Genode's source tree is organized in the form of several source-code repositories. This coarse-grained modularization of the source code has the following benefits:
-
Source codes of different concerns remain well separated. For example, the platform-specific code for each base platform is located in a dedicated base-<platform> repository.
-
Different abstraction levels and features of the system can be maintained in different source-code repositories. Whereby the source code contained in the os repository is free from any dependency from 3rd-party software, the components hosted in the libports repository are free to use foreign code.
-
Custom developments and experimental features can be hosted in dedicated source-code repositories, which do not interfere with Genode's source tree. Such a custom repository can be managed independently from Genode using arbitrary revision-control systems.
The build-directory configuration defines the set of repositories to incorporate into the build process. At build time, the build system overlays the directory structures of all selected repositories to form a single logical source tree. The selection of source-code repositories ultimately defines the view of the build system on the source tree.
Note that the order of the repositories as configured in the build configuration (in etc/build.conf) is important. Front-most repositories shadow subsequent repositories. This makes the repository mechanism a powerful tool for tweaking existing repositories: By adding a custom repository in front of another one, customized versions of single files (e.g., header files or target description files) can be supplied to the build system without changing the original repository.
Each source-code repository has the principle structure shown in Table 1.
Directory | Description |
---|---|
doc/ | Documentation, specific for the repository |
etc/ | Default configuration for the build system |
mk/ | Build-system supplements |
include/ | Globally visible header files |
src/ | Source codes and target build descriptions |
lib/mk/ | Library build descriptions |
lib/import/ | Library import descriptions |
lib/symbols/ | Symbol lists provided by shared libraries |
ports/ | Port descriptions of 3rd-party software |
recipes/ | Package descriptions for depot content |
run/ | System scenarios in the form of run scripts |
Table 1: Structure of a source-code repository. Depending on the repository, only a subset of those directories may be present.