GP2X Gp2x Devkit And Sdl Libraries Under Linux


timbobsteve

Member
Joined
Oct 4, 2005
Messages
301
Hi All,

I am getting a little annoyed with trying to setup GP2X Development environment for WinblowZ and I thought it would be kool to get it all working under Linux.

I am going to start by making my own LF$ distro and then rebuilding GNU/GCC toolset and SDL for ARM...

I know its a big task, but hopefully once I have fumbled my way through it all I will be able to make a nice little GP2X environment that I can distribute.

I will start building LF$ (linux from scratch) tonight after work, and then I guess its on to building the ARM toolset and SDL-ARMlib.... anyone know any tutorials on either? Would be nice to make sure that is Do'able before I build an entire linux distro.

Anyways.... got any requests for things that I should chuck in the distro? Preferable lightweight apps / libs...

Here is my list so far:

Xorg
Fluxbox
ScITE Editor
GNU/GCC
SDL
SDL Mixer
SDL GFX

For GP2x Specific Development:
GNU/GCC - built for ARM Linux
SDL - recompiled for ARM Linux
SDL_GFX - recompiled for ARM Linux
SDL_Mixer - recompiled for ARM Linux

Anything else that I might have missed?

I think the other than that not much else is required for Development. Let me know what you all think.
 
Sounds cool. If you do it I'll probably run it in a virtual machine so the applications included don't matter too much to me. It sounds like it will be a useful environment to compile programs that I can write using Kate or Ultraedit.

Let us know when it's ready :) (and stick a link in the wiki!)
 
Please, make it bootable as live cd :)

Seconded. Perhaps instead of building Linux from scratch you could simply make a Knoppix remaster? Just my two cents...


I actually looked at this.... IMHO it is actually easier to make LFS than it is to remaster Knoppix..... i know that sounds wierd... but LFS allows for miniscule file sizes.... mainly because I have an old 128Mb USB Key lying around that I want to house my dev env.

Anyways... I have already started building it... just getting all my dependancies in order before I go in for the kill.... will let you know how it all goes.
 
Last edited by a moderator:
Dynamism and I will be releasing a Linux based build environment in about a week that runs in Windows. It is built using CoLinux, Xming and Debian technologies. Most are built from CVS, but is running very stable and faster then expected (due to many advancements available in cvs). It will have a point-and-click installation, but will require at least 3GB of hard disk space. You will NOT need to purchase a GP2X from Dynamism to use. We will be using the same technology to create a build environment for the Sharp Zaurus as well.

The idea is to make it easier for developers to get on board with the GP2X and Sharp Zaurus. Since many of Dynamism's Zaurus customers are also developers, giving them a "like" development environment should make it easier for porting between the two units.


David
 
Dynamism and I will be releasing a Linux based build environment in about a week that runs in Windows. It is built using CoLinux, Xming and Debian technologies. Most are built from CVS, but is running very stable and faster then expected (due to many advancements available in cvs). It will have a point-and-click installation, but will require at least 3GB of hard disk space. You will NOT need to purchase a GP2X from Dynamism to use. We will be using the same technology to create a build environment for the Sharp Zaurus as well.

The idea is to make it easier for developers to get on board with the GP2X and Sharp Zaurus. Since many of Dynamism's Zaurus customers are also developers, giving them a "like" development environment should make it easier for porting between the two units.


David

Hi LordDavon,

I'm looking forward to getting your SDK. In the meantime, do you have any hints on how to go about cross compiling SDL for the arm? Thus far, I've downloaded Dan Kegel's crosscompile stuff and built an arm toolchain, but the next step is to compile SDL so I can use that. At this point I'm stuck (planning to have another bash when I get home later). If you have any pointers, they will be greatly appreciated.
 
Last edited by a moderator:
The idea is to make it easier for developers to get on board with the GP2X and Sharp Zaurus. Since many of Dynamism's Zaurus customers are also developers, giving them a "like" development environment should make it easier for porting between the two units.

well, this sounds cool .. since i have both sl5500 and now gp2x, among other ARM-boxen (they seem to breed like flies), yet another build/dev environment for this surly fleet is going to be interesting to check out ..

in the meantime, i can only add to this thread that it appears to be pretty darn easy to write apps for sl5500/gp2x in OSX .. if i used XCode (i do Makefiles) i bet it'd be pretty easy to add a target/template to XCode for this setup ..

i got SDL/compilers basically working tonight, and can now test on the gp2x, so its all good .. on with the port! :)
 
Please, make it bootable as live cd :)

Seconded. Perhaps instead of building Linux from scratch you could simply make a Knoppix remaster? Just my two cents...


I actually looked at this.... IMHO it is actually easier to make LFS than it is to remaster Knoppix..... i know that sounds wierd... but LFS allows for miniscule file sizes.... mainly because I have an old 128Mb USB Key lying around that I want to house my dev env.

Anyways... I have already started building it... just getting all my dependancies in order before I go in for the kill.... will let you know how it all goes.
maybe slax is an option?, it is really easy to add modules :).

http://slax.linux-live.org/
 
Last edited by a moderator:
I'm looking forward to getting your SDK. In the meantime, do you have any hints on how to go about cross compiling SDL for the arm? Thus far, I've downloaded Dan Kegel's crosscompile stuff and built an arm toolchain, but the next step is to compile SDL so I can use that. At this point I'm stuck (planning to have another bash when I get home later). If you have any pointers, they will be greatly appreciated.

I didn't recompile it. I downloaded the libs and added the includes from my Zaurus environment. I am going to clean up the environment before release and will most likely rework SDL since I prefer them unstripped and bloated when I test. I hear there is an IRC channel that is great at helping and you may want to look there (#gp32dev ?). Also, I noticed that Open2X is working SDL into their stuff.

LD
 
SLAX was also an option.... I am really looking at a Small Environment.... All it needs is X, GCC, SDL (for ARM and Linux) and a text editor.

LordDavon: More than happy that someone already had this idea. I actually came across a distribution of linux that was built for dev'ing SL5500... had a look and it seemed alright to me.

I am sure you won't mind if I continue to go ahead with my own build environment... just as an alternative... perhaps I could ask you some questions on crosscompiling stuff when I get to that point???

Anyways... got all my resources/sources to start building... will let you all know once I make some more progress.
 
I am sure you won't mind if I continue to go ahead with my own build environment... just as an alternative... perhaps I could ask you some questions on crosscompiling stuff when I get to that point???

Not at all. It looks like we are going in different directions. I was already developing _and_ for release so this work is just creating a clean environment, adding the proper development stuff and creating a new installer. There are several different directions this work could go in and this is only one of them. Besides, there are already so many tools available... what are a few more.

When Dynamism contacted me about ways of improving the GP2X, we discussed new kernels, application ports, game ports and drivers. With any of these, an environment needed to be created for internal use. This is just taking one step further and releasing it publicly. Having it public allows the community to help with improvements, suggestions, testing and support. It is a win-win all around.


David

For those looking for more information, here is what I wrote about it on Emuboards:

For those unaware of who I am, I have been working with Dynamism on various projects for close to 3 years. These projects include Sharp Zaurus localization, Zaurus application ports (MAxMAME, MaxMESS, MaxMiga, pdaXrom work, etc...), PalmOS Localizations, WinCE Localization, etc... I have been approached from Dynamism recently on porting applications to the GP2X.

Currently, I use a build environment for my projects called _and_ Linux. _and_ is a Debian based Linux environment that runs in Windows using CoLinux, Xming, Debian and other various technologies. I have been reworking _and_ for public release and Dynamism has asked that I create a version for GP2X and Zaurus development (development libraries and stucture included).

Please understand that these two environments are being developed with the hope that is will make it easier for Zaurus and GP2X developers to ports applications to either environment. We hope to have a release in about a week and the software will be available to ANYONE and not just Dynamism customers.

CoLinux and Xming are compiled from recent cvs check-outs and are running more stable and faster then prior versions. Debian is based off of the unstable branch.

Please note that these environments are not for anyone. Cygwin, full Linux systems and LiveCD's (in certain instances) will compile and run faster. _and_ Linux is merely a convenience environment that allows for a simple point-and-click setup of Linux without the need for setup. _and_ has full NTFS support and can attach to Linux partitions.

This environment is based off of _and_, but will be renamed. Current testing has concluded that it is stable enough for beta release although it is fit for daily use. Before release we would like to hear of software that the GP2X development community would like to see added and tested in the environment.

Please do not contact Dynamism at this time with questions, suggestions and comments about the environment. Please direct these to davsolomon@gmail.com.
 
Last edited by a moderator:
I'm looking forward to getting your SDK. In the meantime, do you have any hints on how to go about cross compiling SDL for the arm? Thus far, I've downloaded Dan Kegel's crosscompile stuff and built an arm toolchain, but the next step is to compile SDL so I can use that. At this point I'm stuck (planning to have another bash when I get home later). If you have any pointers, they will be greatly appreciated.

I didn't recompile it. I downloaded the libs and added the includes from my Zaurus environment. I am going to clean up the environment before release and will most likely rework SDL since I prefer them unstripped and bloated when I test. I hear there is an IRC channel that is great at helping and you may want to look there (#gp32dev ?). Also, I noticed that Open2X is working SDL into their stuff.

LD

Thanks for your help! I hadn't twigged that the gp2xlibs.tar.gz included the SDL stuff that I needed. Once I'd sorted that out, I managed to find a crosstools build that works and I now have a setup which allows me to build simple SDL programs which actually work on the GP2X. Emphasis on simple!
 
Last edited by a moderator:
Just an update... it turns out that I suck.... didn't make it past chapter 5 in "Linux From Scratch".... So I started remastering DSL. I have a working environment with the standard GNU compiler... now I just need to know how to cross-compile a 2nd version of the GNU Compiler kit to work with ARM-Linux.... anyone have any experience with this or point me in the right direction?

Once this is done I will setup Linux-SDL and ARM-Linux-SDL... the reason I am doing both is so that we can dev for both *nix and GP2X in the same environment.

So yeh... anyone know where to start with cross-compiling gcc and g++ for ARM/GP2X ?
 
Just an update... it turns out that I suck.... didn't make it past chapter 5 in "Linux From Scratch".... So I started remastering DSL. I have a working environment with the standard GNU compiler... now I just need to know how to cross-compile a 2nd version of the GNU Compiler kit to work with ARM-Linux.... anyone have any experience with this or point me in the right direction?

Once this is done I will setup Linux-SDL and ARM-Linux-SDL... the reason I am doing both is so that we can dev for both *nix and GP2X in the same environment.

So yeh... anyone know where to start with cross-compiling gcc and g++ for ARM/GP2X ?

This should go on the wiki, but I've no idea how to create a new page and then link into it from the rest of the stuff. Sorry.

Using crosstool to Build a Linux-Hosted Compiler for GP2X Programs

I did this using Dan Kegel's excellent crosstool. Together with the SDL library package, it's possible to build simple SDL games like Pong.

My System
My PC is a Shuttle SN85G4 box with Kubuntu 5.04 (aka Hoary Hedgehog) installed on it. I don't know how relevant this is to what I did. My PC has an AMD64 3200+ CPU, which is pretty quick even today. This is just as well, as there is a LOT of compiling to do!

Downloads
First step was to download crosstool (I used v0.38) from Dan Kegel's site. This is supplied as a tar.gz bundle, which I unpacked into /home/andrew/crosstool or whatever. Previously, I had downloaded the gp2xlibs.tar.gz (which contains the SDL development libraries and headers etc) from http://gp2x.org/gp2x/libs/. These I unpacked under /opt - obviously, I had to do this as root.

Process
This bit is easy. It requires simple reading skills and a lot of time. The crosstool howto is your friend. I only needed to read the Quick Start bit. Following the steps there (carefully!) worked just fine, although it took several attempts to identify the correct version to build. Hopefully I will be able to save you that step. I built this one:

demo-arm-softfloat.sh ...

... and inside this shell script, I uncommented this line:

eval `cat arm-softfloat.dat gcc-3.4.1-glibc-2.3.3.dat` sh all.sh --notest

Running the script took something over an hour (I didn't check how long exactly).

If all goes to plan, the toolchain is installed under
/opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-softfloat-linux-gnu/bin and I added this to my path by adding this line to my .bash_profile:

PATH=/opt/crosstool/gcc-3.4.1-glibc-2.3.3/arm-softfloat-linux-gnu/bin:"${PATH}"

I then logged out and logged back in. Once that was done, I was able to compile my pong program like this:

arm-softfloat-linux-gnu-g++ *.cpp -o thing.gpe -static -L/opt/local/gp2x/lib -I/opt/local/gp2x/include/SDL -lSDL

(NB That should all be on one line).

I've actually put that into a script called buildit, to save time. I've messed around a bit with a makefile, but for some reason it wasn't linking properly. To be honest, I just lost patience so started tinkering around at the command line. Any competent developer with an attention span longer than a two-yearold's should be able to make a makefile out of that and make it work properly!

I realise that this is very sketchy and I'm happy to try to fill in the gaps if anyone has questions.
 
Last edited by a moderator:
Thanks Evening, most appreciated !!!!

Will finish cleaning up my DSL knock-off and then I will do this.

Just a question, does the Crosscompile tool compile a version of SDL as well or does that have to be done seperately?

Thanks again. Will let you know how I go!
 
Thanks Evening, most appreciated !!!!

Will finish cleaning up my DSL knock-off and then I will do this.

Just a question, does the Crosscompile tool compile a version of SDL as well or does that have to be done seperately?

Thanks again. Will let you know how I go!

The SDL libs are all in the gp2xlibs.tar.gz download. So you don't need to recompile them. However, I have been unable to get programs which use SDL_mixer or SDL_image working as yet. I will get back to that when I have some time! Good luck with the cross compile.
 
Last edited by a moderator:
Back
Top