comp.lang.ada
 help / color / mirror / Atom feed
From: Rugxulo <rugxulo@gmail.com>
Subject: Re: Ada on Nintendo DS ?
Date: Sun, 29 Apr 2012 11:29:10 -0700 (PDT)
Date: 2012-04-29T11:29:10-07:00	[thread overview]
Message-ID: <2fc07a29-7e2e-41ec-af24-02e9d31da244@9g2000yqp.googlegroups.com> (raw)
In-Reply-To: jngcs6$8u4$1@dont-email.me

Hi,

On Apr 28, 4:22 am, Brian Drummond <br...@shapes.demon.co.uk> 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/crossgcc/

> 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 ...).



  reply	other threads:[~2012-04-29 18:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27 18:56 Ada on Nintendo DS ? Natasha Kerensikova
2012-04-28  7:19 ` Stephen Leake
2012-04-28 13:43   ` Natasha Kerensikova
2012-04-29 13:55     ` Robert A Duff
2012-04-28  9:22 ` Brian Drummond
2012-04-29 18:29   ` Rugxulo [this message]
2012-05-03 12:37   ` Ada on embedded devices (Was: Ada on Nintendo DS ?) Jacob Sparre Andersen
2012-05-04  9:12     ` Brian Drummond
2012-05-04 11:17       ` Britt
2012-05-04 16:36         ` Tero Koskinen
2012-05-09  2:24         ` Ada on embedded devices BrianG
2012-05-04 16:42     ` Ada on embedded devices (Was: Ada on Nintendo DS ?) Tero Koskinen
2012-05-05 14:25     ` Lucretia
2012-05-01  5:34 ` Ada on Nintendo DS ? Micronian Coder
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox