GP32 Gp32 Tutorial 01 Hello Gp32linux


ingeras posted on Jul 15 2004 at 10:53 AM said:
#include <stdlib.h>

main()
{
printf("hello world gp");
}

----------------
simple , no ?
#include <stdio.h>

int main( void ){
printf("Hello GP!");
}
 
Last edited by a moderator:
oh
forgot to tell you about the compiler
easy way

dowload and install
http://www.cygwin.com/
using http://www.cygwin.com/setup.exe

then
run it
download also
http://armadillo.atmark-techno.com/downloa...-2.9.5.0.37.tgz
http://armadillo.atmark-techno.com/downloa...gwin-2.95.3.tgz
http://armadillo.atmark-techno.com/downloa...ss-2.1.3-19.tgz
http://armadillo.atmark-techno.com/downloa...ss-2.1.3-19.tgz

put them where you have installed cygwin in the root directory [ with bin, etc, home, ... ]

then do
tar zxvf arm-linux-binutils-cygwin-2.9.5.0.37.tgz
and so on

then you can do a
arm-linux-gcc test.c -I/usr/arm-linux/include -L/usr/arm-linux/lib
and you will have "a.out"

you can then add edit on you smc card
/gpmm/linux/start
and add someting like
" cd /mnt/gpmm/linux"
"./a.out"


mhhh, sorry if the tutorial is not 100 % clear
just ask, if it doesnt work for you
 
now
how to compile fltk [ we are trying to use it for gui]

launch cygwin
$ wget http://belnet.dl.sourceforge.net/sourcefor...1.5rc1-source.t
ar.bz2
$ bzip2 -d fltk-1.1.5rc1-source.tar.bz2
$ tar xvf fltk-1.1.5rc1-source.tar
$ cd fltk-1.1.5rc1
$ ./configure
$ ./make
$ cd test
$ bitmap.exe

--------------
you can design your gui with fluid
cd ..
cd fluid
fluid.exe

----------
next time we will see how to compile fltk for arm [ gp32]
 
Hello Ingeras :)

how to compile something from your opie GP32 Linux distrib (I mean ON the GP32 itself - hummmm but I admit I don't even success to find a way to get a shell on this :-/ ) ??? ;p

thanks :)

ps: my level is ULTRA BEGINNER ;p
 
Tidus posted on Jul 16 2004 at 08:47 PM said:
Hello Ingeras :)

how to compile something from your opie GP32 Linux distrib (I mean ON the GP32 itself - hummmm but I admit I don't even success to find a way to get a shell on this :-/ ) ??? ;p

thanks :)

ps: my level is ULTRA BEGINNER ;p
we are working on several different gui, to see what s best
that s opie
and
kdrive
nano-x
with fltk, gtk , ...
----------------------
right now

kdrive [ alias xfbdev] is used for the flashplayer, because it gives best colors
and good speed
nano-x seems faster, is quite experimental, we can have light [ few memory usage ] ,fast applications
but right now the colors are not 100% accurate

the applications for both are done using fltk or gtk, fltk is easier and lighter
but gtk has more applications

i dont have time to work on it now, but there seems to be a fast browser for nano-x

opie work, but is very slow, the vendor say it s light, but it s not true !!!
------------------
right now we have to work on input problems

opie: mouse work, chatboard : bad key mapping
kdrive: mouse dont work well, cyberic told me chatboard works with his kdrive [ is use ipaq kdrive right now ]
nano-x : mouse work, chatboard : dont know ..
--------
you want to compile on the gp32 itself ? right now, no way
toholl has to work on write support for smc [ but i thinks he s busy with the sound driver right now ( wich works but has some glitches) ]
------------
i assume you have some c/c++ knowledge if you want to compile something
or do you just want to try some applications without knowing c/c++ ???

the best thing is to compile on linux
but you can compile on windows with cygwin too , see above sample [ but it seems there are some problems to cross compile some applications :( , have to work on it]

i just found a project to compress our programs to take less memory , have to test someday
[ it s upx for arm !!! for those who know]
-----------
so i think the best thing is to get a linux distribution first
if you are knew, try maybe knoppix , it s a bootable cd , you dont have to install it

if enough people are interested , we could try to make some tutorial
install/use linux for cross compiling applications for gp32

---------
some links

fltk applications
http://www.fltk.org/links.php?L+P6

a ftlk tutorial for windows, with videos , step by step !!!
http://www3.telus.net/public/robark/#flashvideo

[ so you can make your applications and test, and then if you dont succeed, you can send me the source and i compile it for gp32 ]
 
Last edited by a moderator:
compiling fltk for arm on linux
--------------------------------------

compile for pc linux
./configure
make

then
if you have the zaurus gcc arm toolkit installed in /opt/Embedix/tools

export CROSSCOMPILE=/opt/Embedix/tools
export PATH="$CROSSCOMPILE/bin:$PATH"
export CC=arm-linux-gcc
export CXX=arm-linux-g++
export AS=arm-linux-as
export AR=arm-linux-ar
export NM=arm-linux-nm
export LD=arm-linux-ld
export RANLIB=arm-linux-ranlib
export LDSHARED="arm-linux-gcc -shared"


./configure --prefix=/opt/Embedix/tools --host=i686 --target=arm
make

you will have an error cant execute fluid
you will have to replace it with pc linux fluid

for most of the applications you want to cross compile, it will be the same steps
just copy/paste ;)
 
here is another way
thanks to my friend shen [ working on ipaq for his thesis ]


Getting the X11 and GTK+ 2.2 cross-compilation tool-chain for Linux/ARM
-----------------------------------------------------------------------
inspired by http://www.roebling.de/embedded.html


This tool-chain allows cross-compilation of X11 as well as GTK+ 2.2 based apps for the Linux/ARM architecture such as most iPaq supported by the Familiar distribution. It is based on GCC 3.3.2 and includes all X11 and GTK+ 2.2 and gpewidget libraries required for creating cross-compiled apps for Familiar 0.7.2.

Download the archive here:
http://www.roebling.de/arm.tar.gz (100 Mb)

and copy it (as root) into

/usr/local

Unpack it by calling
tar -zxvf arm.tar.gz



which will create a new directory called arm.
Using the cross-compilation tool-chain
Set paths and environment variables like this:

export PKG_CONFIG_PATH=/usr/local/arm/3.3.2/lib/pkgconfig
export PATH=/usr/local/arm/3.3.2/bin:$PATH
export LDFLAGS=-L/usr/local/arm/3.3.2/lib

Getting fltk source
-------------------

Download the archive here:
http://belnet.dl.sourceforge.net/sourcefor...-source.tar.bz2

and copy it (for example) into

/home/(your username)

Unpack it by calling

tar -xjvf fltk-1.1.5rc1-source.tar.bz2

Configure fltk like this with:

./configure --prefix=/usr/local/arm/3.3.2 --x-includes=/usr/local/arm/3.3.2/include/X11 --x-libraries=/usr/local/arm/3.3.2/lib --host=arm-linux --build=i586-linux

To cross-compile your own apps:
arm-linux-g++ -o foo -foo.cxx -I /home/(your username)/fltk-1.1.5rc1 -L /home/(your username)/fltk-1.1.5rc1/lib -lfltk -L /usr/local/arm/3.3.2/lib -lX11

------------
a sample compiled for ipaq
by shen [working on gp ]
http://members.chello.be/sema.rugovac/hello
fltk02.jpg
 
ingeras posted on Jul 17 2004 at 08:12 AM said:
i just found a project to compress our programs to take less memory , have to test someday
[ it s upx for arm !!! for those who know]
I think it will eat the same amount of memory, because progs are uncompressed on the fly when executed. However, it could allow a better loading speed if there is less to read from the SMC. I don't know if it compresses better than squashfs...
 
Last edited by a moderator:
nah
silly boy
i think you are right :(

http://upx.sourceforge.net/#examples

Application Format Executable Original Compressed Ratio

Netscape 4.06 win32/pe netscape.exe 2,934,336 1,124,352 0.383

Descent 2 watcom/le descent2.exe 1,448,873 652,832 0.451

MAME 0.36 djgpp2/coff mame.exe 8,214,016 1,810,056 0.220

OneOhOne dos/exe 101.exe 438,144 179,566 0.410

Emacs 20.2 linux/386 emacs-20.2 2,772,657 925,543 0.334

g++ 2.8.1 atari/tos cc1plus.ttp 1,595,049 655,508 0.411

Total 17,403,075 5,347,857 0.307
 
ingeras posted on Jul 22 2004 at 06:14 AM said:
not much people interested here :(

a friend [ who s a total newbie on gui ] design this
with fltk on ipaq

http://members.chello.be/sema.rugovac/100_0652.MOV

it s a application to test mobile ipv6 feature
it s a simulation of the health status of someone
I actually think FLTK is just as good as wxWidgets for basic stuff. Mainly because it makes smaller code. Really good to show this because I would never have found it otherwise.
 
Last edited by a moderator:
Did I miss something? I try to configure fltk and get this
Code:
configure:1930: error: C compiler cannot create executables
See `config.log' for more details.
And from config.log...
Code:
configure:1537: checking for arm-linux-gcc
configure:1553: found /usr/local/arm/3.3.2/bin/arm-linux-gcc
configure:1563: result: arm-linux-gcc
configure:1845: checking for C compiler version
configure:1848: arm-linux-gcc --version </dev/null >&5
/usr/local/arm/3.3.2/bin/arm-linux-gcc: 1: Syntax error: "(" unexpected
configure:1851: $? = 2
configure:1853: arm-linux-gcc -v </dev/null >&5
/usr/local/arm/3.3.2/bin/arm-linux-gcc: 1: Syntax error: "(" unexpected
configure:1856: $? = 2
configure:1858: arm-linux-gcc -V </dev/null >&5
/usr/local/arm/3.3.2/bin/arm-linux-gcc: 1: Syntax error: "(" unexpected
configure:1861: $? = 2
configure:1885: checking for C compiler default output
configure:1888: arm-linux-gcc    conftest.c  >&5
/usr/local/arm/3.3.2/bin/arm-linux-gcc: 1: Syntax error: "(" unexpected
configure:1891: $? = 2
configure: failed program was:
| #line 1864 "configure"
Something I missed?
 
Please include the output of:
file /usr/local/arm/3.3.2/bin/arm-linux-gcc:

and

cat config.log
 
Back
Top