Support GNAT.IO in Ada programs

This commit is contained in:
Alexander Senier
2019-01-03 13:22:48 +01:00
committed by Norman Feske
parent 119a12cba5
commit 14cd115c82
23 changed files with 240 additions and 6 deletions

View File

@ -0,0 +1,36 @@
--
-- \brief GNAT.IO test program
-- \author Alexander Senier
-- \date 2019-01-03
--
with GNAT.IO;
procedure Main is
use GNAT.IO;
begin
Put (Standard_Output, "Hell");
Put (Standard_Output, 'o');
Put_Line (Standard_Output, " World!");
New_Line (Standard_Output);
Put (Standard_Output, 98765432);
New_Line;
Put ("Integer: ");
Put (123456);
New_Line;
Put_Line ("Character: ");
Put ('X');
Put ('Y');
Put ('Z');
New_Line;
Put ("New_Line with spacing:");
New_Line (Spacing => 5);
Set_Output (Standard_Error);
Put (11223344);
New_Line;
Put_Line ("GNAT.IO test program started successfully.");
end Main;

View File

@ -0,0 +1,23 @@
/*
* \brief Wrapper for Ada main program using Terminal session
* \author Alexander Senier
* \date 2019-01-03
*/
/* Genode includes */
#include <base/component.h>
#include <terminal_session/connection.h>
extern "C" void _ada_main(void);
/* Required in runtime */
Terminal::Connection *__genode_terminal;
void Component::construct(Genode::Env &env)
{
Terminal::Connection _terminal (env, "Ada");
__genode_terminal = &_terminal;
_ada_main();
env.parent().exit(0);
}

View File

@ -0,0 +1,4 @@
TARGET = test-gnatio
SRC_ADB = main.adb
SRC_CC = startup.cc
LIBS = base ada