|
|
View Full Version : 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: 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
Adam B. 10-05-2007, 12:09 PM Good post.
I really need to start collecting and organizing all the information about porting apps to the iLiad...
Good post.
I really need to start collecting and organizing all the information about porting apps to the iLiad...
I thought the same :D
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
Adam B. 10-05-2007, 01:33 PM Thank again for your tutorials, you'are a sort of inspiration :P
Wow, I don't think I've ever inspired anyone before...:o
jharker 10-05-2007, 09:05 PM Heck, you inspire me all the time!
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
Antartica 10-06-2007, 09:21 AM 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/users/antartica/dillo/libX11-patch-iliad_20061203-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.
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/users/antartica/dillo/libX11-patch-iliad_20061203-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
ericshliao 12-22-2007, 08:31 PM 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.
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
|