old-www/LDP/LG/issue62/lukens.html

197 lines
10 KiB
HTML

<!--startcut ==============================================-->
<!-- *** BEGIN HTML header *** -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD>
<title>PalmOS Development under Linux LG #62</title>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!-- *** END HTML header *** -->
<CENTER>
<A HREF="http://www.linuxgazette.com/">
<H1><IMG ALT="LINUX GAZETTE" SRC="../gx/lglogo.jpg"
WIDTH="600" HEIGHT="124" border="0"></H1></A>
<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="kasten.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue62/lukens.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../faq/index.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="meek.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
<!-- *** END navbar *** -->
<P>
</CENTER>
<!--endcut ============================================================-->
<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <HR> <P>
<!--===================================================================-->
<center>
<H1><font color="maroon">PalmOS Development under Linux</font></H1>
<H4>By <a href="mailto:dml6@po.cwru.edu">David "Scooter" Lukens</a></H4>
</center>
<P> <HR> <P>
<!-- END header -->
<B>Abstract</B></P>
This document was inspired by my efforts to get a functioning development
environment up and running on a Linux machine. Trying to put a development
environment together under the Cygwin environment infuriated me so I focused
on getting everything working under Linux. This will explain what software
needs to be installed which includes an emulator, compiler, and SDK. This
will also explain what configuration issues need to be addressed.</P>
<B>Introduction</B></P>
A friend and I one day said, "Wouldn't it be great if we could write our own
palm apps?"</P>
It sounded like a great idea, so I started looking into what it would take
to get a development environment put together. He is primarily a win32
user, and I am almost soley a *nix user. Since win32 was a common platform
available to both of us I began this process by looking into available
tools.</P>
For win32 there are two main ways to go for C development. One of these is
Metrowerk's CodeWarrior for Palm, which was expensive for our hobby style
project. The other option was using the PRC tools that would run under the
cygwin environment. If you are not framilliar with the cygwin package, is
it available from
<A HREF="http://sources.redhat.com/cygwin/">http://sources.redhat.com/cygwin/</A> . The cygwin package
makes your win32 machine feel a lot more like a *nix machine and provides
win32 ports of many common *nix tools (ls, dd, gcc, etc.).</P>
After fighting with the tools on win32 for most of a week and getting
nowhere, I decided to scrap the idea of developing on win32. Therefor,
Linux, specifically RedHat 6.0 and 6.2, was the next choice and the ultimate
solution.</P>
There are several pieces that need to be assembled to get everything working
and usable on Linux. Here is a basic list of what is needed:</P>
<UL>
<LI> Palm Emulator (POSE)
<LI> ROM Image for POSE
<LI> PRC tools (GCC with output for PalmOS)
<LI> PilRC (Resource Compiler)
<LI> PalmOS SDK's
</UL>
</P>
<B>Getting Started (Installing the Emulator)</B></P>
The first part of getting everything going is the POSE Palm Emulator. It
can be retrieved from <A
HREF="http://www.palmos.com/dev/tech/tools/emulator/">http://www.palmos.com/dev/tech/tools/emulator/</A>
along with various skins (graphic representations of the hardware). If you
have compiled programs before, than this should be a snap. POSE does
require the FLTK library for its menus and all. FLTK is available at <A
HREF="http://www.fltk.org">http://www.fltk.org</A>. Again, if you have
compiled any other programs, then this will be very straight forward.</P>
OK, you've gotten POSE compiled and installed and you think you're ready to
go now? Well, not quite. POSE does not contain any ROM images in it. ROM
images are the snapshots of PalmOS that reside on the FlashROM in the Palm
itself.</P>
We can do two things to get an ROM image. First, there is a Palm app that
comes with the emulator that will allow POSE to suck the ROM image right off
your PalmOS device. [Pretty cool, huh?] The second way to get a ROM image
is to join palm.com's solution provider program at <A
HREF="http://www.palmos.com/dev/program/">http://www.palmos.com/dev/program/</A>.
Once you have joined you have access to the Provider Pavillion at <A
HREF="http://www.palmos.com/dev/pavilion/">http://www.palmos.com/dev/pavilion/</A>
which contains various ROM images. Some of the images here are testing and
debug versions along with the normal images, so be careful which one you
grab. Also, the images in this development area are NOT usually meant to be
put onto your PalmOS device. There are separate PalmOS upgrades and ROM
upgrades available elsewhere on the site.</P>
Well, now you have the emulator up and running. Right-click, File: New and
specifiy what ROM file to use, device you are emulating, graphical skin, and
ram size. You should see something like this now.</P>
<IMG SRC="misc/lukens/p1.gif">
</P>
<B>Installing the Compiler and Its Dependents</B></P>
A few pieces need to be installed for everything to function. These are the
PRC tools, a SDK from palm, and the PilRC tool. The PRC tools are a port of
the GCC tools we all know and love, but they produce output for the Palm.
The SDK is a few libraries and a whole bunch of header files for the Palm
API. Finally, the PilRC tool is the resource compiler.</P>
The PRC tools can be found at <A
HREF="http://sourceforge.net/projects/prc-tools/">http://sourceforge.net/projects/prc-tools/</A>.
This is a bunch of patches to binutils, gdb, and GCC, and linker tools to
support the PalmOS. RPM's are also available at <A
HREF="http://www.palmos.com/dev/tech/tools/gcc/dist/prc-tools-2.0-1.Linux-i386.rpm">http://www.palmos.com/dev/tech/tools/gcc/dist/prc-tools-2.0-1.Linux-i386.rpm</A>.</P>
Next comes the SDK's. These are available from the palm.com site. The
PalmOS 3.5 SDK (the latest as of this writing) is available only to
registered developers in palm.com's provider pavillion. Earlier SDK's are
available here: <A
HREF="http://www.palmos.com/dev/tech/tools/gcc/dist/palmos-1-2-3.1-sdks-1.tar.gz">http://www.palmos.com/dev/tech/tools/gcc/dist/palmos-1-2-3.1-sdks-1.tar.gz</A>.
The 3.5 SDK contains documentation that covers previous SDK's as well. The
older SDK's do not contain these docs.</P>
The PRC install will make a directory called /usr/local/palmdev . The sdk's
should be untar-ed here. A symbolic link called "sdk" should be made that
points to the SDK that you wish to use. For exmaple, this is what my
/usr/local/palmdev looks like.</P>
<code>
<pre>
[scooter@scooter scooter]# ls -l /usr/local/palmdev/
total 28
drwxr-xr-x 4 root root 4096 Mar 8 2000 Palm OS 3.5 Support
drwxr-xr-x 3 root root 4096 Nov 1 10:03 doc
drwxr-xr-x 2 root root 4096 Dec 21 1999 include
drwxr-xr-x 3 root root 4096 Nov 1 10:02 lib
lrwxrwxrwx 1 root root 7 Nov 1 10:07 sdk -&gt; sdk-3.1
drwxr-xr-x 3 root root 4096 Feb 9 2000 sdk-1
drwxr-xr-x 3 root root 4096 Feb 9 2000 sdk-2
drwxr-xr-x 3 root root 4096 Feb 9 2000 sdk-3.1
</pre>
</code>
</P>
The last tool that is needed is PilRC which compiles all of the resource
files to generate a binary. This has most to do with buttons, menus, and
placement of graphics on the screen. It can be found at <A
HREF="http://www.ardiri.com/index.cfm?redir=palm&cat=pilrc">http://www.ardiri.com/index.cfm?redir=palm&amp;cat=pilrc</A>.</P>
Once all of these tools are put together you have a functional development
environment. We are used to using gcc for compiling C programs on Linux so
the C compiler for PalmOS is m68k-palmos-gcc. Most of the PRC compiler
tools are named m68k-palmos-* .</P>
<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P -->
<H5 ALIGN=center>
Copyright &copy; 2001, David "Scooter" Lukens.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 62 of <i>Linux Gazette</i>, February 2001</H5>
<!-- *** END copyright *** -->
<!--startcut ==========================================================-->
<HR><P>
<CENTER>
<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="kasten.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue62/lukens.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../faq/index.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="meek.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
<!-- *** END navbar *** -->
</CENTER>
</BODY></HTML>
<!--endcut ============================================================-->