Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex > iRex Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-05-2007, 01:05 PM   #1
mind
Member
mind began at the beginning.
 
Posts: 24
Karma: 11
Join Date: Sep 2007
Device: iLiad
First HelloWorld tutorial, a n00b primer First Hello World Tutorial, a n00b primer

(cross posted from iRex forum)
NOTE: this is just and intro. For more please refere to Adam's posts or other threads.

You need a linux distro, a usb key, the shell account actived and the dropbear or a shell on iliad.
Download the last toolchain: http://developer.irexnet.com/pub/Toolchain/ .
Uncompress it and move to the directory /oe-sdk-20070607085328/usr/local/arm/oe/bin . Then open a Terminal and type:
Code:
core2duo bin # echo '#include <stdio.h>
int main(){ printf("Hello World\n"); }
' | ./arm-linux-gcc -x c -o hello -
Note this is just a printf, compiled with a pipe. You can as well make a .c file with the code and compile from that file. (./arm-linux-gcc -o hello hello.c)
The copy hello to your usb key, start your iLiad with usb key inserted, login with ssh, cd to /mnt/usb and run ./hello. This should be print "Hello World"
And that's all folks.
Regards, Gil
mind is offline   Reply With Quote
Old 10-05-2007, 01:09 PM   #2
Adam B.
Addicted to Porting
Adam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the rough
 
Adam B.'s Avatar
 
Posts: 1,695
Karma: 7194
Join Date: Oct 2006
Location: Indianapolis, IN
Device: iRex iLiad, Nokia 770, Samsung i760
Good post.

I really need to start collecting and organizing all the information about porting apps to the iLiad...
Adam B. is offline   Reply With Quote
 
Enthusiast
Old 10-05-2007, 01:48 PM   #3
mind
Member
mind began at the beginning.
 
Posts: 24
Karma: 11
Join Date: Sep 2007
Device: iLiad
Quote:
Originally Posted by Adam B. View Post
Good post.

I really need to start collecting and organizing all the information about porting apps to the iLiad...
I thought the same
Just as I got some time, I'll try to build the toolchain for amd64 and maybe try some nicer programming ^^
Thank again for your tutorials, you'are a sort of inspiration :P
Regards, Gil
mind is offline   Reply With Quote
Old 10-05-2007, 02:33 PM   #4
Adam B.
Addicted to Porting
Adam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the rough
 
Adam B.'s Avatar
 
Posts: 1,695
Karma: 7194
Join Date: Oct 2006
Location: Indianapolis, IN
Device: iRex iLiad, Nokia 770, Samsung i760
Quote:
Originally Posted by mind View Post
Thank again for your tutorials, you'are a sort of inspiration :P
Wow, I don't think I've ever inspired anyone before...
Adam B. is offline   Reply With Quote
Old 10-05-2007, 10:05 PM   #5
jharker
Developer
jharker could sell banana peel slippers to a Deveel.jharker could sell banana peel slippers to a Deveel.jharker could sell banana peel slippers to a Deveel.jharker could sell banana peel slippers to a Deveel.jharker could sell banana peel slippers to a Deveel.jharker could sell banana peel slippers to a Deveel.jharker could sell banana peel slippers to a Deveel.jharker could sell banana peel slippers to a Deveel.jharker could sell banana peel slippers to a Deveel.jharker could sell banana peel slippers to a Deveel.jharker could sell banana peel slippers to a Deveel.
 
Posts: 345
Karma: 3473
Join Date: Apr 2007
Location: Brooklyn, NY, USA
Device: iRex iLiad v1, Blackberry Tour, Kindle DX, iPad.
Heck, you inspire me all the time!
jharker is offline   Reply With Quote
Old 10-06-2007, 04:28 AM   #6
mind
Member
mind began at the beginning.
 
Posts: 24
Karma: 11
Join Date: Sep 2007
Device: iLiad
I was also able to compile the gtk-helloworld, but I still need to figure out how to do the refresh. Did anyone released the source of some port? This would accelerate the process, instead of lurking in the iRex source.

@Adam
What's about a wiki? Or we can update the wiki that already exists (Antartica's one, if I 'm not wrong).

Regards, Gil
mind is offline   Reply With Quote
Old 10-06-2007, 10:21 AM   #7
Antartica
Evangelist
Antartica has learned how to read e-booksAntartica has learned how to read e-booksAntartica has learned how to read e-booksAntartica has learned how to read e-booksAntartica has learned how to read e-booksAntartica has learned how to read e-booksAntartica has learned how to read e-books
 
Posts: 415
Karma: 754
Join Date: Jun 2006
Location: Madrid, Spain
Device: iliad, onhandpc, newton, zaurus
Quote:
Originally Posted by mind View Post
What's about a wiki? Or we can update the wiki that already exists (Antartica's one, if I 'm not wrong).
The wiki is mobileread one. And updating/adding pages on how to program for the iliad would be great :-).

If anyone volunteers for it...

And about the refresh: you can peruse the information in

http://projects.mobileread.com/iliad...0061203-2.diff

It's how the patched libX11 does it. The information on the refresh is in fact based on some early post of scotty1024.

Best regards, Antartica.
Antartica is offline   Reply With Quote
Old 10-06-2007, 01:24 PM   #8
mind
Member
mind began at the beginning.
 
Posts: 24
Karma: 11
Join Date: Sep 2007
Device: iLiad
Quote:
Originally Posted by Antartica View Post
The wiki is mobileread one. And updating/adding pages on how to program for the iliad would be great :-).

If anyone volunteers for it...

And about the refresh: you can peruse the information in

http://projects.mobileread.com/iliad...0061203-2.diff

It's how the patched libX11 does it. The information on the refresh is in fact based on some early post of scotty1024.

Best regards, Antartica.
Many thanks, it worked. When I have some time, I'll post a "Hello World" in gtk and then copy-paste on wiki.
Regards, Gil
mind is offline   Reply With Quote
Old 12-22-2007, 09:31 PM   #9
ericshliao
Guru
ericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enoughericshliao will become famous soon enough
 
Posts: 973
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
Hi,
I tried to build my first app but failed. The attached file is the screent of the source code and the error message by gcc. Please help. Thanks.

I used Fedora Core 8 on a VMWare.


[Edit]
I solved the problem. It's the problem of VMWare. In VMWare, when I type quotation mark, I have to type twice to make it show on the screen. I don't know why. So I edited the "hello.c" in my Windows XP, then transferred it to Linux under VMWare. It works.
Attached Thumbnails
Click image for larger version

Name:	aa.jpg
Views:	455
Size:	208.3 KB
ID:	8359  

Last edited by ericshliao; 12-22-2007 at 10:52 PM.
ericshliao is offline   Reply With Quote
Old 12-28-2007, 04:28 AM   #10
mind
Member
mind began at the beginning.
 
Posts: 24
Karma: 11
Join Date: Sep 2007
Device: iLiad
I did a gtk version too, but I don't have time to search for it, cause university. Anyway it suffices to modify a little bit the hello-gtk and then to link the correct libs.
Regards, Gil
mind is offline   Reply With Quote
Old 09-06-2008, 02:42 PM   #11
siman007
Junior Member
siman007 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Aug 2008
Device: iliad
Does anybody have an example of how to build a GTK version of hello world? I have taken the example gtk hello world (http://bo.majewski.name/bluear/gnu/GTK/plain/) , I get all the way to the make but it falls over a) its using gcc not the arm version and b) it cannot find the gtk libs and I cannot work out how to link to them.
Thanxs for any help
siman007 is offline   Reply With Quote
Old 09-12-2008, 06:19 AM   #12
mind
Member
mind began at the beginning.
 
Posts: 24
Karma: 11
Join Date: Sep 2007
Device: iLiad
Sorry, in the end I didn't write anything. This is cause I don't have time to program, and even to use iLiad! (I prefer plain paper for my mathematical study, and use iLiad for pleasure lectures.)
I don't remember now the correct libs to link, but maybe I still have the binary. If you need it, let me know.
Regards, Gil.
mind is offline   Reply With Quote
Old 09-13-2008, 07:48 AM   #13
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Hi Siman007,

I'm using the scratchbox environment to compile for my Iliad. (see sticky post at the top of this forum). It takes the arm compiler without asking questions :-)

For gtk I use the tutorial at: http://library.gnome.org/devel/gtk-t...able/x111.html
gcc helloworld.c -o helloworld \
`pkg-config --cflags gtk+-2.0`\
`pkg-config --libs gtk+-2.0`

echo `pkg-config --libs gtk+-2.0` will show you the linker flags. The flags depend on the libraries installed, for me it expands to:

-L/usr/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0

Happy coding!
Hansel

Last edited by hansel; 09-13-2008 at 07:52 AM.
hansel is offline   Reply With Quote
Old 09-19-2008, 09:43 AM   #14
mind
Member
mind began at the beginning.
 
Posts: 24
Karma: 11
Join Date: Sep 2007
Device: iLiad
Quote:
Originally Posted by hansel View Post
Hi Siman007,

I'm using the scratchbox environment to compile for my Iliad. (see sticky post at the top of this forum). It takes the arm compiler without asking questions :-)

For gtk I use the tutorial at: http://library.gnome.org/devel/gtk-t...able/x111.html
gcc helloworld.c -o helloworld \
`pkg-config --cflags gtk+-2.0`\
`pkg-config --libs gtk+-2.0`

echo `pkg-config --libs gtk+-2.0` will show you the linker flags. The flags depend on the libraries installed, for me it expands to:

-L/usr/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0

Happy coding!
Hansel
That's similar to what I did. Thanks for providing this information.
Regards, Gil.
mind is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A primer I wrote for my exercise video friends ficbot News 2 10-29-2009 07:13 AM
n00b Q NetSlut Sony Reader 37 09-17-2008 02:05 PM
N00b questions astra iRex 47 08-29-2008 02:54 PM
Illustrated Sony Reader primer TadW Sony Reader 6 09-19-2007 08:44 AM


All times are GMT -4. The time now is 10:32 AM.


MobileRead.com is a privately owned, operated and funded community.