Author Topic: On Z Developement  (Read 12097 times)

edsav00

  • Newbie
  • *
  • Posts: 5
    • View Profile
On Z Developement
« on: December 13, 2004, 11:14:21 am »
Hi;

Please go easy on me. I need someone to hold my hand with this. I'm new to the Zaurus and Linux. I'm taking C++ programing and would like to install a compiler on my sl-5600 zaurus. I've tried installing zgcc 2.95.1 with no luck and dev_img-1.5 with no luck either. Can someone please tell me what to install and how to install it (simplicticly).

Thank you in advance,

Ed the NEWBEE

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
On Z Developement
« Reply #1 on: December 13, 2004, 01:34:59 pm »
I've found that I prefer ZGCC -- mainly because the installation is less intrusive and easier to clean up should you decide you want to remove it later. If you'd rather go the dev-img route, perhaps someone else can offer guidance on that.

Prerequisites:

The first thing you should do is get the latest ZGCC from this site. You'll need both the binaries image and the include files image. If you got ZGCC from some other site, it may not be the latest version and the instructions below may not work.

You're also going to need an SD card to put this stuff on (cramfs images cause all kinds of problems if you mount them from CF and then suspend your Z). You'll need enough free space for both images (minumum 9MB). The card does not have to be ext2/ext3 formatted -- FAT16/FAT32 will work just fine.

You have an SL-5600 so you shouldn't have to worry too much about your ROM version (unless you're using OZ ... then you'll have to find an OZ person to advise you).

You will have to do a bunch of command line stuff, so you need to have a terminal program (such as EmbeddedKonsole) installed.

Instructions:

Put both images in the root of your SD card and then follow these instructions carefully. You'll most likely want to use the steps described under Option 1 then do the steps under Configuring the Compiler. The process is not simple, but the instructions are very good and if you follow them exactly, everything will work fine. If you have problems, post the details of the step that's tripping you up and the results you're getting, and I'll try to offer suggestions.

Caveats:

Note that there are no fancy IDEs to hold your hand when you're developing C/C++ on the Zaurus. It's good old-fashioned command line development. I don't know how they teach programming courses these days, but the majority of inexperienced programmers I meet seem to be completely lost without a GUI. You're going to have to write your source code in a text editor, save it, then go to a command shell and use a command like "gcc -o foo -lm foo.c" to build your program. If it doesn't work, you'll have to debug the hard way by sprinkling your code with debug printf statements or the slightly-less-hard way by using the GNU debugger (GDB). Don't get me wrong, all this stuff is perfectly usable and I actually prefer developing with command line tools, but it could be tough for a beginner (just learning C++ well is enough to tax most mortal humans  ).

edsav00

  • Newbie
  • *
  • Posts: 5
    • View Profile
On Z Developement
« Reply #2 on: December 13, 2004, 04:15:45 pm »
Kopsis;

I just wanted to thank you for taking the time to respond back with such great detail.  Once I get home from work I'm going to attempt it again.  Actually the first intro course off c++ that I’m taking uses a GUI Borland compiler.  The second advanced course uses Solaris and g++.  Can you recommend any resources for learning g++ and or gcc?  Thanks again, if there were more people like you the world would be a better place.

-Ed

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
On Z Developement
« Reply #3 on: December 13, 2004, 07:26:08 pm »
No need to thank me ... I'm just trying to pay back ZUG karma  I've gotten a ton of good knowledge from other folks here so I try to return the favor when I can.

As for references, if you're learning C++, stay away from C books because they'll teach you bad habits. For C++ one of my favorite general references (though it's not gcc/g++ specific) is the Thinking in C++ two volume series by Bruce Eckel. I recommend it partly because it's quite good and partly because there's a free electronic version available. Put a copy on your Zaurus along with ZGCC and you have a complete mobile C++ programming lab

For g++ there's a decent g++ tutorial here and it contains links to some others such as a Linux commands tutorial. It's pretty basic, but that's what you want to get started. For the GNU Debugger (gdb) there's a good tutorial here. The GNU development tools gcc/g++/gdb contain a mountain of features that are documented in the man pages and online references, but it will likely be a while before you need even 1% of the features the tools have to offer

edsav00

  • Newbie
  • *
  • Posts: 5
    • View Profile
On Z Developement
« Reply #4 on: December 15, 2004, 12:32:23 pm »
Kopis;

The instruction are asking me to write a script in my $PATH.  How do I find $PATH?
Should I be loged in as root (su) are as someone else when doing these procedures.  What do I use to write the script (vi or notepad)?  Like I said earlier I'm new to this, the procedure is making the assumption that there is an understanding of linux and or unix.  In which I know just enough to get myself in to trouble.

Thanks,

-Ed

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
On Z Developement
« Reply #5 on: December 15, 2004, 03:00:07 pm »
$PATH is an environment variable that contains a list of directories that are automatically searched to find executables and scripts. When the instructions want you to do is write a script and put it in one of those directories. You can see what directories are in your path by doing and "export" at a shell prompt. However, I can tell you right now that the best place to put the script is /opt/QtPalmtop/bin. You will need to be root ("su" at the shell prompt) to write into that directory.

Your best bet for an editor is vi since it's guaranteed not to do anything strange with file names, end of line characters, etc. So the sequence of operations for this step is:
Code: [Select]
$ su
# cd /opt/QtPalmtop/bin
# vi mntzgcc.sh
If you haven't used vi before, the minimum you need to know is:
  • Hit "i" to get into insert mode
  • Type in the script
  • Hit "Cancel" (ESC) to get out of insert mode
  • Enter "ZZ" (two uppercase Zs) to save the file and exit
Or, if you're doing the cramfs install to SD and prefer the easy way out ...

Grab this IPK and install it and it will create all the scripts for you. This IPK assumes that you've put the two cramfs files in the root of your SD card. If you're trying to do an uncompressed install, you're on your own.

My IPK also has a couple of improvements in the mntzgcc.sh script. First, it automatically checks for the loop devices and creates them if they don't exist. This is handy on Sharp ROMs that only start with 2 loop devices after a reboot. The other thing is it allows you to easily unmount the zgcc filesystems. Just do a "mntzgcc.sh u" as root to unmount. You need to unmount anytime you want to eject your SD card.

Note that the mntzgcc.sh script in this package is executable so you don't have to "source" it, just run the script directly by entering "mntzgcc.sh" as root at a shell prompt. The zgcc.sh script on the other hand always has to be "sourced" (as described in the zgcc instructions).

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1830
    • View Profile
On Z Developement
« Reply #6 on: January 30, 2005, 10:06:24 pm »
Quote
[SNIP]

Or, if you're doing the cramfs install to SD and prefer the easy way out ...

Grab this IPK and install it and it will create all the scripts for you. This IPK assumes that you've put the two cramfs files in the root of your SD card. If you're trying to do an uncompressed install, you're on your own.

My IPK also has a couple of improvements in the mntzgcc.sh script. First, it automatically checks for the loop devices and creates them if they don't exist. This is handy on Sharp ROMs that only start with 2 loop devices after a reboot. The other thing is it allows you to easily unmount the zgcc filesystems. Just do a "mntzgcc.sh u" as root to unmount. You need to unmount anytime you want to eject your SD card.

Note that the mntzgcc.sh script in this package is executable so you don't have to "source" it, just run the script directly by entering "mntzgcc.sh" as root at a shell prompt. The zgcc.sh script on the other hand always has to be "sourced" (as described in the zgcc instructions).
[

Thanks for your providing the IPK..

Installed zgcc per your instructions and zgcc instructions....

However, not quite there yet...

Would greatly appreciate some help to finish up please!

What directory do I need to be in order to compile?

Now when I try to test compiling, I get message "gcc: not found".

Thanks for any input!

Mark
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

freizugheit

  • Sr. Member
  • ****
  • Posts: 409
    • View Profile
    • http://
On Z Developement
« Reply #7 on: January 30, 2005, 10:39:22 pm »
ArchiMark,

Upon successful installation, you should have two directories, namely .zgcc and .include with all files included.  If no files are found, i.e. the installation was not successful.

Try using "souce mntzgcc.sh" and post  the contents of env here by issuing the following command:

  env > env.tx
« Last Edit: January 31, 2005, 10:11:37 am by freizugheit »

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1830
    • View Profile
On Z Developement
« Reply #8 on: January 31, 2005, 10:22:51 am »
Quote
ArchiMark,

Upon successful installation, you should have two directories, namely .zgcc and .include with all files included.  If no files are found, i.e. the installation was not successful.

Try using "souce mntzgcc.sh" and post  the contents of env here by issuing the following command:

  env > env.tx

Thanks for your freizugheit!

Well....as usual, strange situation...those 2 directories are there on my SD card, but empty now. I know I saw files in them yesterday. However, my C3000 did freeze up last night and did have to reboot...

Tried using 'source mntzgcc.sh' and response was 'source: not found'.

No response to 'env > env.tx'.....

 

Any suggestions?

Since I have a C3000 with lots of storage should I try the uncompressed install method or wait till I get this situation working first?

Thanks,

Mark
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1830
    • View Profile
On Z Developement
« Reply #9 on: January 31, 2005, 01:41:02 pm »
UPDATE:

Managed to get things working such that I can report on the 'env.tx' file says.....

LOGO = 1
DEFYEAR = 2005
MACHTYPE = arm-unknown-linux-gnu
USER = zaurus
CONSOLE = /dev/console
HOSTNAME = zaurus
SHLVL = 1
HOME = /home/root
EQUIPMENT = 4
QTDIR = /home/QtPalmtop
CRL_DIC_PATH = /home/QtPalmtop/dic
UNICODEMAP_JP = open-19970715-ms, cp932, nec-vdc, ibm-vdc, udc
COLORTERM = 0
QPEUSER = zaurus
QPEGROUP = qpe
INITVERSION = sysvinit-2.78
LOGNAME = zaurus
_ = mntzgcc.sh
LOGOLANG = 1
TERM = vt100
LAUNCH = q
PATH = /home/QtPalmtop/bin:/root/bin:/bin:/sbin:/usr/bin:/usr/bin:/usr/local/bin
RUNLEVEL = 5
PREVLEVEL = N
LANG = en
SHELL = /bin/sh
QWS_DISPLAY = Transformed:Rot270:Vga:0
OSTYPE = linux-gnu
QPEDIR = /home/QtPalmtop
PWD = /home/zaurus
TZ = America/LosAngeles
HOSTTYPE = arm
RTC_RESET = 1

Also, I do see files in the '.include' and '.zgcc' directories.....

However, when I try typing 'source zgcc.sh' I get message 'source zgcc.sh: Not found'. How can I get this working?

Hope this helps!

Thanks,

Mark
« Last Edit: January 31, 2005, 01:58:43 pm by ArchiMark »
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1830
    • View Profile
On Z Developement
« Reply #10 on: January 31, 2005, 09:29:34 pm »
UPDATE:

OK, don't know why, but now zgcc seems to be working I think....  

Maybe it's because I turned off my Z and turned it back on....who knows??...  

I tried compiling a test file and I get compiler error messages. So it seems to be working now.

Now, hopefully, I can fix those errors and actually get something to compile properly!

Thanks,

Mark
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

freizugheit

  • Sr. Member
  • ****
  • Posts: 409
    • View Profile
    • http://
On Z Developement
« Reply #11 on: January 31, 2005, 10:02:21 pm »
If Zgcc is working, the Path should show:

PATH = /mnt/card/.zgcc/bin:/home/QtPalmtop/bin:/root/bin:/bin:/sbi
n:/usr/bin:/usr/bin:/usr/local/bin

If it does not show the .zgcc/bin in the PATH string, you need to activate "source zgcc.sh" again.
« Last Edit: January 31, 2005, 10:02:55 pm by freizugheit »

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1830
    • View Profile
On Z Developement
« Reply #12 on: February 01, 2005, 12:13:41 pm »
OK, got it, Freizugheit!

I see my PATH as you showed it:

PATH = /mnt/card/.zgcc/bin:/home/QtPalmtop/bin:/root/bin:/bin:/sbi
n:/usr/bin:/usr/bin:/usr/local/bin

UPDATE:

Just tested and successfully compiled a test app!!

Now just need to install Perl per the instructions to automate the build process using 'tmake' and I'm all set I think....  

Thanks again for your help!!

Mark
« Last Edit: February 01, 2005, 04:15:54 pm by ArchiMark »
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/

freizugheit

  • Sr. Member
  • ****
  • Posts: 409
    • View Profile
    • http://
On Z Developement
« Reply #13 on: February 01, 2005, 10:53:50 pm »
I think perl 5.80 should be in /mnt/card after successful installation.

ArchiMark

  • Administrator
  • Hero Member
  • *****
  • Posts: 1830
    • View Profile
On Z Developement
« Reply #14 on: February 01, 2005, 11:14:17 pm »
That's good to know, freigzugheit!

Definitely saves some time installing Perl...

However, looked on /mnt/card and don't see it...checked various directories....

Meanwhile....had to reboot my Z this afternoon.

So do I have to run 'mntzgcc.sh' and 'zgcc.sh' again?

If so, then given that I have a C3000 with all that storage space, I should try doing an 'uncompressed install' on the Z.....

Thanks,

Mark
« Last Edit: February 02, 2005, 12:04:32 am by ArchiMark »
Silicon Valley Digerati - * Please see my Mini Laptops For Sale Listing *
Cosmo Communicator / One-Netbook One Mix Yoga 3S (Win 10/Manjaro 18)
Banana Pi Zero UMPC/Armbian
MacBookPro
Sold: C3200/N900/OQO/N5/Dell Mini9/Netwalker/UMID M1/