I, in a sober mind and a good memory, tell how, in 2017, to start programming for the disappeared platform.It was on May 12, 2017. Lying snow outside the window and the heating turned on thinking about the eternal, and my eyes fell on the chic industrial PDA running PalmOS.
Data collection terminal')
Once he was given to me, but I never used it. At first, he did not have a lace for the COM port. And then in the process of artificial soldering to the contacts - the cable from the cradle's motherboard to the port of the PDA was cut off. So lay a dead weight.
And I wanted to reanimate this palm, and so that was the motivation, I decided to start to look at what kind of emulators are under linux, in order to see what software is and whether it is worth it. And with the search and installation of the emulator I got a little carried away ... Snow, the cold weather of May affected me so much that I decided to try writing for this PDA. Moreover, the Palm is the CCP of my student youth, then it was an insanely cool gadget. Then I did not know how to program for them, but I really wanted to. After more than 14 years (feel old, yeah) - I decided to try to do it.
If you are interested in how to emulate this PDA, and even better to write software for it, then let's go read further.
What you need to start developing for Palm?
This question may seem simple to someone: they say, download the compiler and go. Yes, it’s easy to start developing under palm trees. The simplicity is the same as in the well-known picture:
The funny thing is that Windows users either need to buy the
Metrowerk's CodeWarrior for Palm compiler, or turn their Windows into UNIX using cygwin and then just about everything as described below for linux. I do not know how things are now with modern Windows, but the path is clearly real perverts and, judging by the many forums and articles, not everyone is in the teeth. So what to do next is described for Linux Mint (read ubuntu 14.04). The way is working.
So, what do we need to develop, debug, test our software:
- Palm emulator (POSE).
- ROM image for POSE.
- PRC tools (GCC compiling software for PalmOS).
- PalmOS SDK.
- PilRC (resource compiler).
Emulator
Palm POSE (Palm Operation System Emulator) - a program that allows you to run all kinds of programs without copying them to Palm. Which is very convenient. Especially for those who do not have Palma, but want to play with different software. But the emulator will not work without the
ROM image - this is the actual firmware image of the live PDA. You can remove it with the same POSE from a real PDA, or download it on the Internet.
PRC tools are, in fact, a set of tools for compiling programs (compiler, linker, debugger). As it is not sad, but PRC tools will not work without
PalmOS SDK for a specific version of PalmOS. To understand this, it took a couple of days to read the manuals. Well, the last thing is the
PilRC compiler and resource
viewer , a thing that allows you to prepare binary files responsible for drawing the menu and replacing pictures on the screen.
What is the difficulty?
All this could be taken on the official website
palmos.com . But alas, oh, the Palm company died in 2010 (absorbed by Hewlett-Packard) and their site died.
Most of the links on the Internet - broken. As a result, the search and installation of all software turned into an interesting quest for finding packages, documentation, instructions, testing, which resulted in this article.
There are a lot of ways to get this software. One of the Jedi Linux paths was to collect everything from source codes and even honestly tried ...
But I realized that this is a completely gemmorous way. Here I will talk about the simplest and fastest way (maybe not optimal).
All the packages, archives and software mentioned in the article were carefully assembled into a single archive. So that you can even stumble upon this article 10 years later, in a fit of nostalgia, start programming for PalmOS.
PalmOS emulator
The most interesting, and probably demanded paragraph in this article. Very few people will be able to assemble programs, but please try to drive old toys or different software.
To install it, we need:
- POSE emulator itself
- skins of various handhelds
- ROM-PDA file that we want to emulate.
The emulator was found by me
here (file pose_3.5-9.1ubuntu2_i386.deb in the archive). Download and install it with the command
sudo dpkg -i pose_3.5-9.1ubuntu2_i386.deb
Skins were found
here along with the POSE sources. This is the file
emulator-skins-19.tar.gz in the archive. Unpack this archive into your home folder and rename it to Skins or skins. As a result, the appearance will correspond to a real piece of iron. This is just a nice bonus, and without it everything will work.
To make the emulator work, you need to give it a file from ROM. Roma were found
here . Personally, I use
palmos40-en-m505.rom . We run POSE from the console, in the folder where to get the ROMs, since this software does not like Russian letters. Right-click on an empty window, select File-New in the window that opens, select ROM file and the file itself.
And click OK. If everything is done correctly, then we get a working emulator, in which you can already run almost any Palm software (except for working with hardware).
Ready emulatorThe most pleasant bonus is that the installation of the programs goes in two clicks and very quickly, unlike the installation on a live PDA. This is important when writing and debugging software.
Tulchain and SDK
In order for everything to start functioning, you need to put a few more things. Namely: PRC tools, SDK for palm and PilRC. PRC tools is the port of our beloved GCC, but with an output format for PalmOS. The SDK contains several libraries and a bunch of headers for the Palm API. Finally, PilRC is needed to compile resources. The following describes how to install PRC tools and the SDK.
Source PRC tools can be found
here . This is a bunch of patches for binutils, gdb, gcc and linker that gives support for PalmOS. I personally put it
according to the instructions . The instructions below are just a copy of it. You can not download packages, but simply install everything from the folder in the prc-tools archive:
cd /tmp
Everything, now we had a working compiler. But it doesn’t compile because it’s just a stub instead of the header files. You need to install the SDK itself. I planned to conduct development for PalmOS 3.5 and took
it here , there it is also for later versions of PalmOS (4th and 5th).
Similarly, you can not do the download of the wget file, but simply go to the sdk-3.0 folder and make everything from it.
The SDK has several useful archives:
- sdk35-docs.tar.gz - archive with documentation. In my opinion, just a godsend!
- sdk35-examples.tar.gz is a great archive with examples. I strongly recommend that you download or take them from the archive.
At this stage, we can even put together a primitive helloword! Create a file hello.c. We write in it
#include <PalmOS.h> UInt32 PilotMain( UInt16 cmd, void *cmdPBP, UInt16 launchFlags) { EventType event; char *message = "Hello, world!"; if ( sysAppLaunchCmdNormalLaunch == cmd) { WinDrawChars( message, StrLen(message), 55, 74 ); do { EvtGetEvent( &event, evtWaitForever); SysHandleEvent( &event); } while (event.eType != appStopEvent); } return 0; }
And compile a sequence of commands
m68k-palmos-gcc HelloWorld.c -o hello m68k-palmos-obj-res hello build-prc Hello.prc "Hello" HELO *.hello.grc
Fill the file
hello.prc in our emulator, run and get
Resource Compiler PilRC
In general, it may seem that truncated can be programmed. That's the way it is, and all programs will now be compiled, compiled and run, but will not work! Since they still need to compile resources. (logical, damn it). To compile resources, we need the PilRC compiler itself, and to view them, PilRCUI. This project is alive and well, the source code lives
here . I strongly recommend downloading the source code (there is in the archive), because there is full of excellent documentation. And the packages themselves were found by me in the old
ubunt repositories . For the package compiler, you need to download the file pilrc_3.2-3_i386.deb (available in the archive) and install it with the command
sudo dpkg -i pilrc_3.2-3_i386.deb
I could not install the resource viewer in my current OS version. More precisely managed, but it crashes with an error (which I could not fix). I give an approximate version of the installation: to install it, you need to install additional libraries. It was spent a couple of days to satisfy all dependencies. In Google, I was just banned.
It is necessary to download files from sites
1 and
2 : ibglib1.2ldbl_1.2.10-19build1_i386.deb, libgtk1.2_1.2.10-18.1build2_i386.deb and libgtk1.2-common_1.2.10-18.1build2_all.deb. All this was folded into the daddy libs in the global archive. After that we put them
sudo dpkg -i libgtk1.2-common_1.2.10-18.1build2_all.deb libglib1.2ldbl_1.2.10-19build1_i386.deb libgtk1.2_1.2.10-18.1build2_i386.deb
But, alas, it all starts a miracle, but when you try to open a project, it crashes with a segmentation error. All this successfully works so far only in ubuntu 8.04 is stably placed from the repositories and I use it for viewing, mounting the project folder on SSHFS.
A real graphic HelloWord!
It is time to show how to write a real graphics program for Palm! I will not reinvent the bicycle and just show an example from
Tutorial .
The program consists of several files:
- hello.bmp - full size icon
- hellosmall.bmp - miniature icon
- hello.c - program source file
- hello.h - header file
- hello.rcp - resource file (text)
- Makefile - and the build script file itself
I will not dwell on the features of development and programming, if it is interesting, you can see these files in a text editor. It is interesting to see the text file of resources, how it will look on the PDA. To do this, and need the PilRCUI program. Screenshot from Ubuntu 8.04
We compile everything with the make command and upload the resulting hello.prc into our emulator.
IconLaunchView informationOkay, you say. The emulator is good, but what about a live PDA? I have them! Walking through friends, I was able to dig out an old friend who served me faithfully in my student days. Palm m100. And there this program works successfully!
Why is all this necessary, and then what?
Why did I do it - I do not know. Because I can, as in the good old picture.
I just pearl here and done. If you think that in our time no one writes for PalmOS, then how is this not true. When I was looking to write a cool one, I thought about the game 2048, into which half the subway car is being chopped. And as it turned out, there are several versions of them. For example,
here .
Written completely recently. So, it's never too late to learn to program for palm trees.
About iron
If you are interested in such posts about the PDA, and you suddenly have old unnecessary PDAs, especially the Palm family, Psion (with a wire for the COM port), then I will gladly accept them as a gift for writing such posts.
Park PDA with linux, which had to be distributed ...For example, you can talk about how to put Debian on Psion, make a local repository and go online to it. In my LiveJournal, you can read all my perversions on the topic on the tag
psion ,
PDA ,
jornada ,
jornada 720 .
Useful links:
1.
The main archive with software that you will not need to search all over the Internet for broken links2.
Very sensible description in Russian PalmOS architecture and sample program3.
A good description of the occurrence of programming for Palm with live links.4.
An excellent tutorial of programming graphics applications from the very beginning to professionalism.5.
Various source code descriptions in Russian