GP2X Is It Possible To Port Command Line Apps With Only A Little C++ Knowle


atomicthumbs

I am the king of the collectors, with hospital bed
Joined
Apr 17, 2006
Messages
2,827
Age
32
Location
XK-Masada
Website
printeronfire.org
I can basically understand how C++ and SDL apps work looking at the source code, but when it actually comes to making code from scratch, I'm hopeless. Can I port command line programs with only basic tweaks to the code?

Also, would the ACOVEA (Analysis of Compiler Options via Evolutionary Algorithm) program work with GP2X programs? I suppose someone would have to port it to the GP2X to get it to work (different architecture and all, it tests programs using all the different compiler options and sees how fast the executables run each time), but it might show a speed increase with some apps.
 
It depends on what the app in question does. Some things require no porting at all - if they're written portably. Other things need porting because they're not portably written, for trivial reasons - e.g. using system-specific headers, e.g. conio.h, which only exist on some platforms. Finally, there are apps that are hard to port because they make extensive use of system-specific functionality - e.g. a program to manage Windows network settings wouldn't be easy to port to Unix because the way you deal with network settings is totally different.

I don't know ACOVEA, but it sounds like it needs to compile a program, then run it and see how well it performs, repeatedly. There are two ways to approach that on the GP2X - either you run the compiler on the GP2X itself, in which case the port will be straightforward, or you run the compiler on your PC, which is simple if ACOVEA supports it already but harder if not.

However, running the compiler on the GP2X involves building a compiler *for* the GP2X which also runs *on* the GP2X, and I'm not aware of anyone having done that yet. It's also unlikely that the GP2X will perform well at it.

So it's probably worth checking out whether ACOVEA already supports running the application remotely, and whether you can hook that support up to the GP2X, perhaps through the telnet server or by porting an rsh server.

I'm afraid it might be a lot of work.
 
Porting command-line apps is fairly simple. I won't go into the details here. As long as they're in C/C++. use no assembler, and run on Linux, it should take little more than a recompile. It would however be much more difficult if the app depends on a few libraries that we don't have, you'll have to get those working as well. The same conditions apply to the libraries.

It seems it would be possible to make ACOVEA work with your toolchain by making a new config file, although I may have misread something.

But the problem lies when it has to execute the test program. There are at least 2 ways you could modify it to work.

1. Have it build the programs on the pc and then test them through telnet.
2. Have it build and test the programs on the gp2x. This would require a GP2X port of the toolchain. That is possible though (it has been done), but it would be slow as hell.
 
Back
Top