13. Developping DDC-I OpenAbor Ada projects¶
13.1. Prior Required Tool Installations¶
The GNATbench plug-in for Open Arbor IDE requires DDC-I Open Arbor IDE version 10 or later to be installed prior to installing GNATbench itself.
13.2. Installing GNATbench¶
The file gnatbench-<version>-<platform>-bin.zip is an archive to be installed through the regular Eclipse installation mechanism.
Before installing, GNATbench requires an Eclipse plugin that is not installed by default in OpenArbor (org.eclipse.equinox.p2.iu). To have this plugin installed as part of the GNATbench installation, you first need to add the appropriate Eclipse release repository to OpenArbor.
To add the appropriate Eclipse release repository, first find the Eclipse version used by OpenArbor by selecting ‘Help -> About OpenArbor’.
Click on the ‘Installation Details’ button.
Select in ‘Features’ tab, ‘DDC-I Common Components’ feature.
In the feature details you will get installed Eclipse version, for example:
‘This offering is powered by Eclipse 2020-12-R technology.’ means that installed Eclipse version is ‘2020-12’ Required Eclipse release repository will be located at ‘https://download.eclipse.org/releases/2020-12/’
In this version of OpenArbor we can see that it uses Eclipse ‘2020-12’. If your copy of OpenArbor uses a newer Eclipse release, replace ‘2020-12’ in the instructions below with the appropriate version.
Click ‘Close’ buttons to exit ‘About OpenArbor’ and select ‘Help -> Install New Software’.
Next, click on the ‘Add’ button to add required Eclipse release repository. Enter “2020-12” as the name and “https://download.eclipse.org/releases/2020-12/” as the location.
Click “Add” to finish adding the Eclipse-2020-12 repository.
Next, click on the ‘Add’ button to add GNATbench repository. Select ‘Archive’ and navigate to the zip file downloaded from AdaCore. The Location field will then reference that file. You can optionally enter a repository name for future reference, such as “GNATbench” (without the quotes). Click ‘OK’.
The Eclipse installer will then offer the choice of different versions of GNATbench for installation. For OpenArbor, select the ‘AdaCore Plugins for DDC-I OpenArbor IDE’ item.
Click ‘Next’ and follow the installation wizard to completion. During the installation process, a dialog can be raised asking if you trust the AdaCore certificates. Check the mark next to the GNATbench certificate and press ‘OK’.
Note: the GNATbench Ada Development User Guide could be accessed after installation, along with all other User Guides, through “Help -> Help Contents” menu entry. Please read the “Before You Begin” section before beginning to use the plug-in. .. _creating-ddci-ada-executable-tutorial:
13.2.1. Creating DDCI executable projects containing Ada code¶
13.2.1.1. Audience¶
This document is intended for users already somewhat familiar with DDC-I OpenArbor IDE and GNATbench. Some familiarity with GNAT cross compilers may also be useful.
13.2.1.2. Before You Begin¶
Install GNAT Pro for for Deos.
At the end of the install process on Linux you will be asked to update your environment to add cross compiler binaries path to PATH variable for example. Update your environment prior to launching OpenArbor and using GNATbench menus.
If GNATbench is not reported by Help -> About OpenArbor dialog, see Installing GNATbench section.
Once GNATbench is installed, you can check correct cross compiler installation displaying Ada/Toolchains preferences page. The Deos installed toolchain should be displayed without any error decorator.
13.2.1.3. Create a new DDC-I Executable project¶
If you don’t see ‘DDC-I Project Windows’, ‘Target Manager’and ‘DDC-I Console’ views you need to switch to DDC-I perspective.
Select ‘Window -> Perspective -> Open Perspective -> Other…’ menu and open the DDC-I (default) perspective.
Select ‘File -> New -> DDC-I Executable Project’ menu. Enter ‘hello_world’ name and select ‘ARM’ target.
Click ‘Finish’ button to create ‘hello_world’ project.
13.2.1.4. Convert DDC-I Executable project to use Ada language¶
Select ‘hello_world’ project.
Run ‘File -> New -> Other…’ menu.
Select ‘Ada -> Convert an empty DDC-I Executable Project to use Ada Language’ wizard.
Click ‘Next’ button to configure ada files.
Click ‘Finish’ button to finish conversion.
13.2.1.5. Add required library dependencies to your project¶
Select ‘hello_world’ project.
Run ‘File -> Properties’ menu.
Select ‘DDC-I Options -> Deos -> Dependencies’ tab.
Click ‘Add’ button.
Select ‘ansi’ from the drop menu,
Click ‘OK’
Repeat for ‘gnu-language’ and ‘vfile’ dependencies.
13.2.1.6. Create the executable?s Deos Process Developer XML file¶
Add a new folder by right clicking on the ‘hello_world’ project and select New -> Folder. Call the folder xml.
Right click on the new xml folder and select ‘New -> Other’.
Expand the ‘DDC-I’ folder and select ‘DDC-I Deos Process Developer XML File’. Select ‘Next’.
Name the process ‘hello world’. Click Next.
In the How many 4k pages of stack space this thread need: field enter 20.
Click Finish.
13.2.1.7. Configure the executable?s Deos Process Developer XML file¶
Expand the xml folder and open hello_world.pd.xml.
Change the number of pages assigned to the process. How you do this depends on if the pd.xml has been processed or not (it will be processed automatically if OpenArbor is set to automatically build or if you manually build the project after adding the file):
An unprocessed pd.xml will have an ramPagesQuota attribute.
A processed pd.xml will have a logicalMemoryPools attribute. Expand the logicalMemoryPools attribute and it?s pool attribute. The pool attribute will contain the pagesNeeded attribute.
Set the ramPagesQuota or pagesNeeded attribute to 100.
Change the tlsSpaceInBytes attribute to 128.
Save the file.
13.2.1.8. Build the project¶
Build the executable by right clicking on the ‘hello_world’ project and selecting Rebuild Project.
13.2.1.9. Create the arm-deos DDC-I Deos Platform Project¶
Create a new DDC-I Deos Platform Project from the File -> New menu
Select qemu-arm and click Finish.
Note: This shouldn?t happen, but if you get an Error creating platform project dialog reporting “The file ${DESKHOME}/etc/standard-apps.hyp does not exist!” delete freshly created arm-deos platform project & exit OpenArbor. Add DESKHOME=C:DDC-Idesk variable to your environment and restart arm-deos platform project creation.
13.2.1.10. Configure arm-deos¶
Expand the arm-deos project and expand Deos Components.
Right click on Dependencies and select Add Dependency.
On the Registry Filter drop down, select All.
Select hello_world from the second drop down menu.
Expand Complete Integration and double click on Components.
Right click on vfile and select Debug Variant.
Check in arm-deos project?s Deos/Boot Image properties page that a boot image file will be generated.
Build the Deos Plaftorm by right clicking on qemu-arm project and selecting Rebuild Project.
13.2.1.11. Run the Deos project¶
Click on the Target Manager window on near the top left corner of the screen.
Click the left most button on that window to Create a new target.
Click OK to accept the defaults.
Click the play button.
QEMU will launch and the hello world message will print onto the video monitor.
This concludes the tutorial.