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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fd2f984f8ef238d1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!s9g2000yqd.googlegroups.com!not-for-mail From: Lucretia Newsgroups: comp.lang.ada Subject: Re: Why so hard to come up with a simple embedded Ada system? Date: Sat, 17 Jul 2010 07:25:59 -0700 (PDT) Organization: http://groups.google.com Message-ID: <80709715-dc28-4262-883d-72acc39933bb@s9g2000yqd.googlegroups.com> References: <37da1783-b355-4d43-a9a8-7f0d4ba4da9c@t13g2000prf.googlegroups.com> NNTP-Posting-Host: 90.194.162.175 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1279376760 25592 127.0.0.1 (17 Jul 2010 14:26:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 17 Jul 2010 14:26:00 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s9g2000yqd.googlegroups.com; posting-host=90.194.162.175; posting-account=L2-UcQkAAAAfd_BqbeNHs3XeM0jTXloS User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.2.6) Gecko/20100628 Ubuntu/10.04 (lucid) Firefox/3.6.6,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:12454 Date: 2010-07-17T07:25:59-07:00 List-Id: On Jul 14, 5:55=A0am, use...@scriptoriumdesigns.com wrote: > I'll just come out and say it - for a language that was designed for > as much for embedded applications as for anything, it seems to be > maddeningly difficult to actually get Ada on a modest embedded I have to agree, sort of. I have some comments and some questions regarding this :D > platform. =A0By modest I mean low-end 32 bits, no MMU. =A0ARM7 or Cortex > Mx would be my first choice. =A0I can be up and running on such a > platform with C and a tasking library in a day (Rowley Crossworks, > nice package). =A0Why can't I do the same with Ada? =A0Or rather, to avoi= d > making this about me, why can't an embedded programmer - student, > hobbyist or professional - who's heard about Ada and wants to give it > a spin, including hard-realtime concurrency, just do it? > > If Ada fans (I include myself) want to see Ada get more exposure, this > seems like not only a desirable step but a necessary one. =A0I can run C > on a thousand such boards, and I can't (AFAIK) run Ada on one. > > Maybe this is all available, and I just haven't found out where. =A0Then > that's a problem too, but I'll be happy to hear about it. > > All comments welcome. With GCC, you can set up GCC, Binutils and Newlib/DietC/uClibc and have a tasking environment on bare hardware - I've not tried it myself, so cannot testify to the tasking side of things. With GCC/GNAT you can do the same thing, but depending on hardware, depends on what you get. By building for a target of -elf, you will get gnatbind and gnat1 (compiler), but you won't get an installed runtime. See my site for more info on building these compilers (http:// archeia.com/an-ada95-hello-world-style-kernel.html). At this point you would be where are with a C library (minus the tasking and the large runtime). So, you would need to tinker with the standard.ads package to configure the runtime that you are allowing people to use, copying bits in from the GNAT source as and when GCC asked for it. i.e. do you want the secondary stack available? Do you want it dynamic or static? If so, you need the extra memory for it. Do you want tasking? depending on the CPU, depends on whether the code is there for it. Do you want tasking? See below for exceptions[*]. You'll need to provide primitives that the runtime can use to implement it. You can configure the runtime for what you want, but you have to provide the underlying code to support it. Basic parts of the runtime can be used though, quite easily. For this kind of work, people just work with a compiler targeted for the hardware (the target I mentioned above), but for Ada, should we be creating our own --target=3D so that we can build a runtime within the normal GCC build system? Or should we be creating a port specifically for the board, i.e. adding extra functionality into the build system to support building for -elf? * On ARM, you can have SJLJ exception handling which isn't part of the ARM ABI. For zero cost exceptions (part of the ABI), this needs to be ported as the code just isn't there. I've looked into this recently and I'm not stuck with the code, I'm stuck trying to work out how to get a toolchain. I thought I'd try doing it on Maemo as I have an N900 available, but the SDK is based on Scratchbox and I'm on 64-bit and to be honest, the SB people, point to the Maemo people and the Maemo people don't give a shit, so don't help. I think that made sense :D Luke.