[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

A. Bareboard and Custom Kernel Topics

This chapter describes how to use the GNAT Pro cross tools to build programs that do not require support from any kernel running on the target hardware. It uses the PowerPC with ELF object module format as the target platform to illustrate these issues.

A.1 Introduction  
A.2 Examples  

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

A.1 Introduction

Since version 7.3, bareboard run-times for powerpc-elf, p55-elf, leon-elf, leon3-elf and arm-elf are provided as customized run-times. They target only one specific board and unless you are using the same board they must be ported to your target. This simplifies the build of a user program as explained in this appendix. However this requires (as before) an initial port effort and the change must be ported if you update the compiler. See O. Customized Run-Time Topics for adapting a run-time to your board.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

A.2 Examples

Given the many variations on the host and target environment that you may be using, it is not possible to formulate a universally applicable sequence of commands for building, loading, and running a program. Instead, this section presents a series of scenarios reflecting various levels of sophistication in the target tools, with enough detail to allow you to prepare the necessary setup. For illustration purposes the examples will assume a Freescale QorIQ P2020 board, and occasionally may reflect a Unix host.

Let's start with a simple hello world program:

with Ada.Text_IO; use Ada.Text_IO;

procedure Hello is
   Put_Line ("Hello zfp world");
end Hello;

Let's also have a project file `hello.gpr' for this program:

project hello is
   for Main use ("hello.adb");
end hello;

Use gprbuild to build the application. You need to specify both the target and the run-time to use.

$ gprbuild --target=powerpc-eabispe --RTS=powerpc-eabispe/zfp-p2020 -P hello.gpr

This creates an ELF executable `hello' that can be loaded in RAM on the p2020 target. This run-time assumes:

In other words, the monitor on the target board is relatively "smart". To run a program that you've built with GNAT Pro Cross (an executable ELF file) you just need to load the program and "go" -- the monitor program keeps track of the start address recorded in the ELF file.

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by GNAT Mailserver on September, 22 2014 using texi2html