GP2X Openembedded And Gp2x


thebohemian

Still Fresh
Joined
Nov 29, 2005
Messages
86
First I just wanted to run JamVM with Classpath on my GP2X and was in need for cross compilation and installation environment that would allow me that.

I was pointed to OpenEmbedded and tried to get it working for the GP2X. To my surprise this worked and I am now able built and install a lot of software.

To share my experience with the community I wrote a manual and posted all the files I used online. You can find the guid in the Wiki: http://wiki.gp2x.org/wiki/OpenEmbedded_GP2...ent_environment

Comments, critics and questions are welcome.
 
Hello

I was involved in GP32Linux, the port of linux+apps to the first GP32.
I think I'm gonna get a GP2x very soon, looks very exciting!

I can give you a few hints on how to save many read/writes to the SD card. For GP32Linux, we used the squashfs filesystem. This is a readonly compressed filesystem. Data on it is uncompressed on the fly. I takes a bit more power from the CPU, but it also reduces the amount of data to read, which could actually make things faster. In order to get squashfs support, you have to patch the kernel and/or compile the squashfs module, which you can find here:
http://squashfs.sourceforge.net/

You can also put a squashfs filesystem into a big file, which would sit on a FAT-formatted card, and which would accept symlinks.

About openembedded, I have used it to build programs for the GP32 as well, but the amount of ram was too small to get it usable...

You could also have a look at scratchbox, here:
http://www.scratchbox.org/
It allows native arm compilation of apps, which is sometimes easier than cross compilation.

You can even test your arm apps directly on your pc.

I am at your disposal if you need any further help/hints/comments.

Do you know some good reviews of GP2x that could convince me to get one?

Thanks and good luck
Cyberic
 
For reviews, just look around the forums here, that's probably a better indication than any as to what it's all about.
 
I was pointed to OpenEmbedded and tried to get it working for the GP2X. To my surprise this worked and I am now able built and install a lot of software.
can you give some examples?
I built JamVM 1.4.1 and a minimal version of GNU Classpath 0.19 (no Midi, no DSSI plugin, no GTK or QT4 -based AWT). That in turn needed zlib.

For the successful installation of libraries I had to install glibc 2.2.5 (the same as from the GPH distribution but with ldconfig), libipkg and ipkg itself.

Finally I now use GNU sed instead of the busybox one.

If you're insterested in building JamVM as well. Here is the bb file for Classpath 0.19:
Code:
DESCRIPTION = "GNU Classpath standard Java libraries"
HOMEPAGE = "http://www.gnu.org/software/classpath/"
LICENSE = "Classpath"
PRIORITY = "optional"
MAINTAINER = "Rene Wagner <rw@handhelds.org>"
SECTION = "libs"
PR = "r1"

DEPENDS = "jikes-native zip-native"
RDEPENDS_${PN} = "${PN}-common (${PV})"

SRC_URI = "${GNU_MIRROR}/${PN}/${P}.tar.gz \
           file://disable-automake-checks.patch;patch=1"

inherit autotools

EXTRA_OECONF = "--with-jikes --disable-alsa \
    --disable-dssi --disable-gtk-peer \
    --disable-examples"

PACKAGES += " ${PN}-common ${PN}-examples"

FILES_${PN} = "${libdir}/${PN}"
FILES_${PN}-common = "${datadir}/${PN}/glibj.zip"

do_stage() {
	install -d ${STAGING_INCDIR}/classpath
	install -m 0755 include/jni* ${STAGING_INCDIR}/classpath/
}

do_install() {
	autotools_do_install
	mv ${D}${libdir}/security ${D}${libdir}/${PN}
}

and for JamVM 1.4.1:
Code:
DESCRIPTION = "A compact Java Virtual Machine which conforms to the JVM specification version 2."
HOMEPAGE = "http://jamvm.sourceforge.net/"
LICENSE = "GPL"
PRIORITY = "optional"
MAINTAINER = "Rene Wagner <rw@handhelds.org>"
SECTION = "interpreters"

DEPENDS = "zlib classpath"
RDEPENDS = "classpath (>= 0.19) classpath-common (>= 0.19)"

SRC_URI = "${SOURCEFORGE_MIRROR}/${PN}/${P}.tar.gz"

# This uses 32 bit arm, so force the instruction set to arm, not thumb
ARM_INSTRUCTION_SET = "arm"

inherit autotools update-alternatives

EXTRA_OECONF = "--with-classpath-install-dir=${prefix}"
CFLAGS += "-DDEFAULT_MAX_HEAP=16*MB"

PROVIDES = "virtual/java"
ALTERNATIVE_NAME = "java"
ALTERNATIVE_PATH = "${bindir}/jamvm"
ALTERNATIVE_PRIORITY = "10"

In another forum someone said that the tuning for arm9tdmi is not good and one should use tune-arm920 instead. You can change that in the local.conf .
 
Last edited by a moderator:
sorry for the noobish question, but I dont own a gp2x (if that is an excuse :p):

Do you compile the programs on your pc and then transfer them to the gp2x, or is it possible to compile on the gp2x itself?

And how complicated is it, can you just type "configure" then "make", "make install" and done?
 
sorry for the noobish question, but I dont own a gp2x (if that is an excuse :p):

Do you compile the programs on your pc and then transfer them to the gp2x, or is it possible to compile on the gp2x itself?

And how complicated is it, can you just type "configure" then "make", "make install" and done?
haha no.
 
Last edited by a moderator:
sorry for the noobish question, but I dont own a gp2x (if that is an excuse :p):
Asking question is the way to get an expert. :)

Do you compile the programs on your pc and then transfer them to the gp2x, or is it possible to compile on the gp2x itself?
No. The programs are compiled on my GNU/Linux box. Theoretically it is possible to compile the gcc, make and friends as packages for the gp2x and install them on it. However you do not want to do that because:
a) the box is dog slow at compiling
B) the access to the files are way slower than on your PC
c) frequent writes on your flash memory (NAND + SD card) will wreck it earlier

And how complicated is it, can you just type "configure" then "make", "make install" and done?
If you follow the instructions in the wiki you can compile apps by doing: "bitbake jikes". This will not only compile jikes but all programs and libraries which are needed for it. Eg. a crosscompiler if it has not been built already and the standard c++ library which has to be installed on the gp2x.

When it succeeds you will have nice little .ipk files which are equivalent to .debs and .rpms.

Installing these packages on the gp2x is done by doing: ipkg install jikes_1.21_arm.ipk . Normally ipkg needs internet connection and would resolve dependencies on its own but in the current state we do not have networking on the gp2x. So you have to install the files by hand.

Btw: I was asked what programs I built. Now that I regularly login to my gp2x I was missing a few of the usual gnu/linux apps I know from my desktop box.

Here is what ipkg list tell me:
Code:
classpath - 0.19-r1 -
classpath-common - 0.19-r1 -
ipkg - 0.99.154-r2 -
jamvm - 1.4.1-r0 -
jikes - 1.21-r1 -
ldd - 2.2.5-r5 -
less - 382-r0 -
libc6 - 2.2.5-r5 -
libgcc1 - 3.4.4-r3 -
libipkg0 - 0.99.154-r2 -
libstdc++6 - 3.4.4-r3 -
libz1 - 1.2.3-r0 -
nano - 1.3.9-r0 -
ncurses - 5.4-r8 -
ncurses-terminfo - 5.4-r8 -
procps - 3.2.5-r4 -
sed - 4.1.2-r1 -
(/usr/lib and /usr/share are actually on the sd card. Otherwise the 24MB of flash would have been exhausted already.)

procps gives me top, which is very nice. :)
nano does not work very good atm. It seems like the terminal emulation is messed up. Hopefully someone can find a solution for this. (I found a way to get a real serial login with getty. I will write english instructions soon. If you can read german look here: http://forum.gp2x.de/viewtopic.php?t=830)
 
Last edited by a moderator:
"If you follow the instructions in the wiki you can compile apps by doing: "bitbake jikes". This will not only compile jikes but all programs and libraries which are needed for it. Eg. a crosscompiler if it has not been built already and the standard c++ library which has to be installed on the gp2x.

When it succeeds you will have nice little .ipk files which are equivalent to .debs and .rpms.
Installing these packages on the gp2x is done by doing: ipkg install jikes_1.21_arm.ipk . "

wow, thats cool :D

and thanks for the usefull answer :).
 
Back
Top