mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-20 06:07:59 +00:00
ca971bbfd8
This patch changes the top-level directory layout as a preparatory step for improving the tools for managing 3rd-party source codes. The rationale is described in the issue referenced below. Issue #1082 |
||
---|---|---|
.. | ||
add.cc | ||
main.adb | ||
README | ||
startup.cc | ||
target.mk | ||
test_package.ads |
This directory contains a test for using freestanding Ada code with Genode. The program relies on the normal startup procedure of a Genode process. Execution starts at the 'crt0' assembly entry provided by the startup library. The 'crt0' code sets up the stack of the main thread and calls the '_main' function implemented in the C++ portion of Genode's startup library. In turn, the '_main' function calls 'main' of the actual program. The main function of this example calls the Ada main procedure. The test further exercises the call of C functions from Ada code. So the integration of Ada and C code is almost seamless. For building the Ada test program, you must have installed the GNU GNAT Ada compiler. Right now, we are using the host version of this compiler, which is save as long as we do not use advanced Ada features such as exceptions. To enable building the test program, add 'gnat' to the 'SPECS' declaration of your '<builddir>/etc/specs.conf'. Otherwise, the Genode build system will skip the target. Please note that the current version of this program does not use 'gnatbind'. Therefore, package elaboration is not executed.