From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8295d69277f1696c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.234.38 with SMTP id ub6mr5747536pbc.2.1336984344476; Mon, 14 May 2012 01:32:24 -0700 (PDT) Path: pr3ni24237pbb.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: understanding runtime support Date: Mon, 14 May 2012 01:24:46 -0700 (PDT) Organization: http://groups.google.com Message-ID: <7948724.2.1336983886678.JavaMail.geo-discussion-forums@yneo6> References: <28695516.0.1336708147839.JavaMail.geo-discussion-forums@pbcqw9> <28843126.1576.1336884548623.JavaMail.geo-discussion-forums@ynff7> <31100317.2013.1336922789420.JavaMail.geo-discussion-forums@ynmb39> NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 X-Trace: posting.google.com 1336984344 8825 127.0.0.1 (14 May 2012 08:32:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 14 May 2012 08:32:24 +0000 (UTC) In-Reply-To: <31100317.2013.1336922789420.JavaMail.geo-discussion-forums@ynmb39> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-05-14T01:24:46-07:00 List-Id: Patrick wrote on comp.lang.ada: > Thanks for the clarification and tips. I am sure I have many things > ass backwards in my head. > > I did get some help on the #ada with this and I am not quite as > mixed up as I was when I first posted but do you happen to know if > there is some sort of list that shows the various architectures that > Ada can run on with full support using GNAT GPL ? > > For instances it seems there is gnat on debian arm. Is the support > complete? Is there somewhere this information is recorded? I don't think there is a place where this information is recorded because "embedded" is too broad a term. The first thing you must do when talking about "embedded" is to define "embedded" :) Taking Debian ARM as your example, this is not technically "embedded" because Debian ARM runs the full software stack on fully capable devices: Linux kernel, GNU libc, GNAT run-time library and your programs on top. Thus, Debian ARM does support tasking on ARM exactly as it does on a desktop or server. You can even run GPS on Debian ARM. At the other end of the spectrum, AVR is a typical case of an "embedded" target which has no libc, no kernel, no filesystem and no memory management unit. On such a target you are pretty much on your own; you have to implement all of these features in the GNAT run-time, or not use them at all (i.e. "pragma No_Run_Time"). The three areas where the Ada run-time is necessary (apart from the obvious Ada.Containers, Ada.Text_IO et al) are tasking, exception handling and memory management (i.e. new and Unchecked_Deallocation). On most targets, GNAT implements tasking with POSIX threads, which require both a libc and a kernel supporting POSIX threads. For exception handling, GNAT uses a combination of object code inserted directly into your program and library calls implemented in the GNAT run-time. Here, a kernel is not necessary but if there is a standard ABI for the target platform, GNAT should use it so that exceptions work across language boundaries (GNAT fails to obey the ARM ABI, for that matter). For memory management, GNAT inserts calls to malloc() and free() in your executable code, this obviously relies on a working libc and a kernel too. It is possible to implement tasking, exception handling and memory management without a kernel or a libc, replacing all with a so-called "Board Support Package (BSP)"[1] inside the GNAT run-time library. I'm not sure which targets GNAT supports this way but I think this question must be answered case by case and not in a general way. [1] Note the term "Board Support Package": it supports a "Board" which has one or more CPUs, possibly a Memory Management Unit, possibly various buses to various storage controllers, and network interfaces, etc. The Board Support Package notably contains the bootstrapping code that initializes the processor registers to create a stack and heap before your main procedure can start. HTH -- Ludovic Brenta. The enablers re-imagine our organic yield enhancement.