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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ad47c3851d906864 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.223.40 with SMTP id qr8mr2243197pbc.0.1335724150908; Sun, 29 Apr 2012 11:29:10 -0700 (PDT) Path: r9ni112914pbh.0!nntp.google.com!news1.google.com!postnews.google.com!9g2000yqp.googlegroups.com!not-for-mail From: Rugxulo Newsgroups: comp.lang.ada Subject: Re: Ada on Nintendo DS ? Date: Sun, 29 Apr 2012 11:29:10 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2fc07a29-7e2e-41ec-af24-02e9d31da244@9g2000yqp.googlegroups.com> References: NNTP-Posting-Host: 65.13.115.246 Mime-Version: 1.0 X-Trace: posting.google.com 1335724150 9924 127.0.0.1 (29 Apr 2012 18:29:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 29 Apr 2012 18:29:10 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 9g2000yqp.googlegroups.com; posting-host=65.13.115.246; posting-account=p5rsXQoAAAB8KPnVlgg9E_vlm2dvVhfO User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-04-29T11:29:10-07:00 List-Id: Hi, On Apr 28, 4:22=A0am, Brian Drummond wrote: > On Fri, 27 Apr 2012 18:56:10 +0000, Natasha Kerensikova wrote: > > > I have been desiring getting a try at developing for embedded platforms > > for a while now. > > (d) Build a native version first. Then build it again, using itself as > the compiler. If it can build itself, THEN use it to build a > crosscompiler. Build the crosscompiler with C support only first, then > build the C library, then turn on Ada support and build again. I'm not exactly big on cross-compiling, but it seems to be better supported on Linux host than others (and faster too). I know that sounds kinda silly or obvious, but it's nevertheless good to know (if you're naive like me and think all things should be equal). > (e) If it goes wrong, the gcc build system is so obscure that I found it > difficult to make any progress, and sometimes had to do things the > completely *wrong* way to move forward, intending to learn the right way > later. e.g. patching a Makefile each time from the script, because I > don't understand how to make the autoconfigure tools generate it > correctly in the first place... You could always check this mailing list: http://sourceware.org/ml/crossg= cc/ > I must say gcc4.7 rc1 seemed to build with fewer problems than the gcc4.6 > version I was trying to build last summer. Dunno, and IIRC they stopped building "core" tarballs, so now it's everything bundled together (including test suites, runtimes, etc., kinda bulky due to Java, etc). > > Moreover, I just happen to own a device that probably qualifies as > > embedded, with two ARM CPUs (one ARM7 and one ARM9), 4 MB RAM and a few > > DSPs. The device is known as Nintendo DS lite. Don't have one, never programmed anything similar, not very skilled. (Then why am I responding? Heh, don't get mad.) Though I'm surprised it has so little RAM, I thought modern developers couldn't live without hundreds of MB. > I know nothing about the runtime support on that system. There are > probably 2 levels of problem : (1) how to get a basic executable to run > (gnatdroid produces console apps that run successfully on the Android) Good to know. > and (2) how to tap into the machine's higher level facilities, gamepad, > GUI etc. This still seems to be a sticking point with Gnatdroid/Android > let alone the Nintendo... What little I do know of Android is that a lot of high-level stuff needs wrappers (facades?) via their internal native (Java?) API. See http://code.google.com/p/android-scripting/. > > As far as I can tell, devkitARM is a toolchain derived from GCC that > > targets my hardware (it seems there is also some libraries to deal with > > DSPs and stuff, but I can care about this later on). > > If its source is available, building it with Ada support may be possible. > But what version of gcc? Bad BAD bad things happen when building gcc4.3.3 > with gcc4.5 for example - like negative enumerations (which 4.3 uses and > 4.5 rejects as errors! I don't really know Ada (sorry, I'm fairly noobish), but I don't think Pascal allowed negative enums either (and Ada is heavily inspired by Pascal, right?). > IMO gcc is frighteningly fragile... Definitely, it's scary and annoying, IMO. But I guess it's their developers' decision, and they prefer POSIX (really Linux, but ...). > > On the other end, > > gnatdroid seems to successfully translate Ada code into binary that can > > be fed to ARM CPUs. So unless I'm missing something, there is nothing > > new to discover, I would only need to merge both derivations. > > A promising approach, I think. Where I fell over was combining gnatdroid'= s > output into the Android NDK build system to use anything more > sophisticated than the console - i.e. open a simple window and display > "Hello World". (I could get it through the linker, but the resulting > executable didn't work) You mean something like makeToast or deviceGetInput? Again, see SL4A, that's as close a guess as I can suggest. (I know you probably knew this, but ....) > >Would anyone have an estimation or a bound on how difficult it can be? > > Difficult. But IMO the more people building Ada for embedded platforms, > the easier it will become, if we share information and feed back fixes > into the process. Well, everything is difficult, but honestly it can't be that hard because I've seen that a lot of people have heavy interest in ARM and Android, Nintendo DS, etc. > Consider having another platform available as another way of moving > forward. (This works on the Raspberry Pi but not the Nintendo... what is > different between them?) > > > Thanks in advance for your insights, > > Natasha Okay, so here's the real tip I wanted to pass along, though it's far from secret: FreePascal's website claims that their ARM support covers Linux, WinCE, GBA, and NDS. So there. I know it's not quite "Ada" per se, but close enough to be comfortable (or at least moreso than C, right?). And it doesn't need (barely any) GNU tools to build or use, i.e. no complex GCC / POSIX muck (no offense!). So it should be self-contained and easy to use (though I've not tried, I neither have nor want a NDS). http://sourceforge.net/projects/freepascal/files/NDS/2.6.0/ arm-nds-fpc-2.6.0.i386-win32.zip 2011-12-31 15.6 MB Hmmm, I'm surprised it doesn't have Linux host binaries, but I blindly assume it's easy to build as FPC is pretty darn portable. Hope this helps (doubt it, but ...).