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.125.201 with SMTP id ms9mr2586395pbb.3.1337099952899; Tue, 15 May 2012 09:39:12 -0700 (PDT) Path: pr3ni2054pbb.0!nntp.google.com!news1.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: understanding runtime support Date: Tue, 15 May 2012 16:38:56 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: 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> <7948724.2.1336983886678.JavaMail.geo-discussion-forums@yneo6> <32791890.97.1336995087800.JavaMail.geo-discussion-forums@yneo6> <8547012.586.1337020482714.JavaMail.geo-discussion-forums@ynlq12> <28034736.36.1337025896359.JavaMail.geo-discussion-forums@ynll26> <10099625.0.1337029342748.JavaMail.geo-discussion-forums@yneh4> <878vgtrilb.fsf@adaheads.sparre-andersen.dk> Mime-Version: 1.0 Injection-Date: Tue, 15 May 2012 16:38:56 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="DkTdSjxOCm6DqG+Uf7eArg"; logging-data="16076"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rhUYaQZXbkOTEjqMneKuI0Q1nmyqoxfg=" User-Agent: Pan/0.135 (Tomorrow I'll Wake Up and Scald Myself with Tea; GIT 30dc37b master) Cancel-Lock: sha1:FTxDcRD5KsVS+EgC4FVHu2Vy1jM= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2012-05-15T16:38:56+00:00 List-Id: On Tue, 15 May 2012 09:47:44 +0200, Jacob Sparre Andersen wrote: > mjsilva@scriptoriumdesigns.com writes: >> On Monday, May 14, 2012 1:04:56 PM UTC-7, Patrick wrote: > >>> Now it seems I am supposed to roll my own runtime or other low level >>> solution, [...] Good discussion, and you are not alone in finding this frustrating. I have also started learning how to build gcc with Ada support for embedded targets. There are other interested parties, for platforms including the Nintendo DS, and Android. > If you want to use Arduino as your target system, there is a > ready-to-compile GNAT version (AVR-Ada), which doesn't support the > Ravenscar profile yet, but is likely to get there. >> Sadly, there does not seem to be a cookbook as to how to create such a >> bare metal port for other devices/families. > > Apparently not. - Maybe it is time to write one? Or port one. http://wiki.osdev.org/Bare_Bones This shows it's quite a complicated process even in C, where support for different targets is more pervasive despite the relative merits of the languages. Translating this tutorial to Ada looks (a) feasible to me, and (b) a good way to discover the answers to some of the questions in this thread. It shows how the C "main" is linked to a minimal C rts (written partly in assembler, specific to x86 but very small) and accesses basic services through that rts. Part of the problem is that Ada expects more from a rts than C does. One approach is to expect less (for example get simple examples to build and do something with "pragma no-run-time"). Then use that as a basis for creating a minimal runtime for a new platform. The AVR-Ada rts would be a useful starting point, as would the (Gnat 3.15 era) run time documentation which was discussed here recently. - Brian