Skip to content

Commit

Permalink
Remove PalmOS support.
Browse files Browse the repository at this point in the history
Reasons:

- PalmOS is discontinued since 2009.
- doc/mimic.texi from flite stated that the code had not been
  recently tested
- If nobody is able to test mimic on PalmOS we can't provide
  reliable support for it.
- git has the history, so we can bring PalmOS support back if required.
  • Loading branch information
zeehio committed May 31, 2016
1 parent 11ec6d1 commit 6eb58e3
Show file tree
Hide file tree
Showing 32 changed files with 26 additions and 891 deletions.
9 changes: 0 additions & 9 deletions config/common_make_rules
Expand Up @@ -45,9 +45,6 @@
include $(TOP)/config/config

INCLUDES = -I$(TOP)/include
ifeq ($(TARGET_OS),palmos)
INCLUDES += -I$(TOP)/palm/include
endif

CPPFLAGS += $(LOCAL_INCLUDES) $(INCLUDES)
CFLAGS += $(EXTRA_CC_FLAGS) $(OPT) $(DBG)
Expand Down Expand Up @@ -87,12 +84,6 @@ ifeq ($(HOST_PLATFORM),$(TARGET_PLATFORM))
OTHER_BUILD_DIRS = $(HOST_ONLY_DIRS)
ALL += $(HOST_ONLY_BUILDS)
endif
# When target is palm add the palm directory at the top level
ifeq ($(DIRNAME),)
ifeq ($(TARGET_OS),palmos)
OTHER_BUILD_DIRS += palm
endif
endif

all: $(BUILDDIRS) $(OTHER_BUILD_DIRS) $(OBJDIR)/.make_build_dirs $(ALL) nothing

Expand Down
27 changes: 3 additions & 24 deletions configure
Expand Up @@ -4222,22 +4222,6 @@ esac
fi
case "$target_os" in
palmos*)
shared=false
CFLAGS="$CFLAGS -DCST_NO_SOCKETS"
# PalmOS Apps are always in M68K
M68KCC=/usr/m68k-palmos/bin/gcc
# Generic build is ARM or M68K (probably ARM though)
CC="/usr/$TARGET_CPU-palmos/bin/gcc"
if test "$target_cpu" = "arm"
then
CC="$CC -fPIC -march=armv4t"
fi
RANLIB=/usr/$TARGET_CPU-palmos/bin/ranlib
AR=/usr/$TARGET_CPU-palmos/bin/ar
LEXDEFS="-DCST_NO_STATIC_LEX -DCST_NO_STATIC_LTS_MODEL"
VOXDEFS="-DCST_NO_STATIC_VOX"
;;
wince*)
# For the CEGCC environment (mingw32ce)
# http://cegcc.sourceforge.net/
Expand Down Expand Up @@ -4499,16 +4483,11 @@ fi
if test "$target_os" = "palmos"
if test "$target_os" = "wince"
then
STDIOTYPE=palmos
STDIOTYPE=wince
else
if test "$target_os" = "wince"
then
STDIOTYPE=wince
else
STDIOTYPE=stdio
fi
STDIOTYPE=stdio
fi
Expand Down
38 changes: 4 additions & 34 deletions configure.ac
Expand Up @@ -121,31 +121,6 @@ esac
fi

case "$target_os" in
palmos*)
shared=false
CFLAGS="$CFLAGS -DCST_NO_SOCKETS"
# PalmOS Apps are always in M68K
M68KCC=/usr/m68k-palmos/bin/gcc
# Generic build is ARM or M68K (probably ARM though)
CC="/usr/$TARGET_CPU-palmos/bin/gcc"
if test "$target_cpu" = "arm"
then
CC="$CC -fPIC -march=armv4t"
fi
RANLIB=/usr/$TARGET_CPU-palmos/bin/ranlib
AR=/usr/$TARGET_CPU-palmos/bin/ar
LEXDEFS="-DCST_NO_STATIC_LEX -DCST_NO_STATIC_LTS_MODEL"
VOXDEFS="-DCST_NO_STATIC_VOX"
;;
dnl wince*)
dnl # For the GNUWINCE environment
dnl # http://win-ce.voxware.com:28575/Development%20Tools/
dnl shared=false
dnl CFLAGS="$CFLAGS -DCST_NO_SOCKETS -march=armv4 -mapcs-32 -malignment-traps -DNEWLIB -DSARM -DWIN32 -DGNUWINCE"
dnl CC="/usr/local/wince/bin/arm-wince-pe-gcc"
dnl RANLIB=/usr/local/wince/bin/arm-wince-pe-ranlib
dnl AR=/usr/local/wince/bin/arm-wince-pe-ar
dnl ;;
wince*)
# For the CEGCC environment (mingw32ce)
# http://cegcc.sourceforge.net/
Expand Down Expand Up @@ -389,17 +364,12 @@ AC_ARG_WITH( mmap,

AC_SUBST(MMAPTYPE)

dnl stdio type, palmos/wince are different
if test "$target_os" = "palmos"
dnl stdio type, wince is different
if test "$target_os" = "wince"
then
STDIOTYPE=palmos
STDIOTYPE=wince
else
if test "$target_os" = "wince"
then
STDIOTYPE=wince
else
STDIOTYPE=stdio
fi
STDIOTYPE=stdio
fi
AC_SUBST(STDIOTYPE)

Expand Down
181 changes: 0 additions & 181 deletions doc/mimic.texi
Expand Up @@ -322,187 +322,6 @@ deltas (and stddev) from the predicted parameter clusters and makes it
as if those were the sizes of parameters that were used to the train
the voice.

@section PalmOS Support

@emph{NOTE: as PalmOS is somewhat rare now, we do not guarantee this
still works.}

Support for PalmOS was removed from 1.9, I no longer have any working
PalmOS devices. But this section remains for people who do, but they
may need to update something to make this work.

Starting with 1.3 we have initial support for PalmOS using the free
development tools. The compilation method assumes the target device
is running PalmOS 5.0 (or later) on an ARM processor. Following
convention in the Palm world, the app that the user interacts with is
actually a m68k application compiled with the m68 gcc cross compiler,
the resulting code is interpreted by the PalmOS 5.0 device. The core
flite code is in native ARM, and hence uses the ARM gcc cross
compiler. An interesting amout of support code is required to
get all this work properly.

The user app is called @code{flop} (FLite on Palm) and like most apps
written by awb, is functional, but ugly. You should not let a
short-sighted Scotsman, who still thinks command line interfaces are
cool, design a graphical app. But it does work and can read typed-in
text. The @file{armflite.ro} resources are designed with the idea
that proper applications will be written using it as a library.

The @file{flop.prc} application is distributed separately so it can be used
without having to install all these tools. But if you want to PalmOS
development here is what you need to do to compile Flite for PalmOS and
the flop application.

There are number of different application development environments for
Palm, here I only describe the Unix based one as this is what was
used. You will need the PalmOS SDK 5.0 from palmOne
@url{http://www.palmone.com/us/developers/}. This is
free but does require registration. Out of the lots of different
files you can get for palmOne you will eventually find
@file{palmos-sdk-5.0r3-1.noarch.rpm}, install that on your linux
machine
@example
rpm -i palmos-sdk-5.0r3-1.noarch.rpm
@end example
You will also need the various gcc based cross compilers
@url{http://prc-tools.sourceforge.net/}
@example
prc-tools-2.3-1.i386.rpm
prc-tools-arm-2.3-1.i386.rpm
prc-tools-htmldocs-2.3-1.noarch.rpm
@end example
The Palm Resource compiler
@url{http://pilrc.sourceforge.net/}
@example
pilrc-3.1-1.i386.rpm
@end example
And maybe the emulator
@url{http://www.palmos.com/dev/tools/emulator/}
@example
pose-3.5-2.i386.rpm
pose-skins-1.9-1.noarch.rpm
pose-skins-handspring-3.1H4-1.noarch.rpm
@end example
Though as POSE doesn't support ARM code, @file{Simulator} does but
that only works under Windows, POSE is only useful for debugging the
m68k parts of the app.

Install these
@example
rpm -i prc-tools-2.3-1.i386.rpm
rpm -i prc-tools-arm-2.3-1.i386.rpm
rpm -i prc-tools-htmldocs-2.3-1.noarch.rpm
rpm -i pilrc-3.1-1.i386.rpm
rpm -i pose-3.5-2.i386.rpm
rpm -i pose-skins-1.9-1.noarch.rpm
rpm -i pose-skins-handspring-3.1H4-1.noarch.rpm
@end example
We also need the prc-tools to know which SDK is available
@example
palmdev-prep
@end example
In addition we use Greg Parker's PEAL
@url{http://www.sealiesoftware.com/peal/} ELF ARM loader. You need to
download this and compile and install it yourself, so that
@code{peal-postlink} is in your path. Greg was very helpful and even
added support for large data segments for this work (though in the end
we don't actually use them). Some peal code is in our distribution
(which is valid under his licence) but if you use a different version
of peal you may need to ensure they are matched, by updating
the peal code in @file{palm/}. We used version @file{peal-2004-12-29}.

The other palm specific function we require is @code{par}
@url{http://www.djw.org/product/palm/par/} which is part of the
@code{prc.tgz} distribution. We use @code{par} to construct resources
from raw binary files. There are other programs that can do this but
we found this one adequate. Again you must compile this and ensure
@code{par} is in your path. Note no part of @code{par} ends up
in the distributed system.

Given all of the above you should be able to compile the
Palm code and the @code{flop} application.
@example
./configure --target=arm-palmos
make
@end example
The resulting application should be in @file{palm/flop/flop.prc}
which can then be installed on your Plam device
@example
pilot-xfer -i palm/flop/flop.prc
@end example
Setting up the tools, and getting a working Linux/Palm conduit is not
particularly easy but it is possible. Although some attempt was made
to use the Simulator, (PalmOS 5.0/ARM simulator) under Windows, it
never really contributed to the development. The POSE (m68k) emulator
though was use to develop the @code{flop} application itself.

@subsection Some notes on the PalmOS port

Throughout the PalmOS developer documentation they continually remind
you that a Palm device is not a full computer, its an extention of the
desktop. But seeing devices like the Treo 600 can easily make one
forget and want the device to do real computational work. PalmOS is
designed for small light weight devices so it is easy to start hitting
the boundaries of its capabilities when trying to port larger
aplications.

PalmOS5.0 still has interesting limitations, in the m68k domain,
@code{int}'s are 16 bit and using memory segments greater than 65K
require special work. Quaint as these are, they do significantly
affect the port. At first we thought that only the key
computationally expensive parts would be in ARM (so-called
@code{armlets}) but trying to compile the whole flite code in m68k
with long/short distinctions and sub-64K code segment limitations was
just too hard.

Thus all the Flite code, USEnglish, Lexicon and diphone databases
actually are compiled in the ARM domain. There is however no system
support in the ARM domain so call backs to m68k system functions are
necessary. With care calls to system functions can be significantly
limited so only a few call backs needed to be written. These are in
@file{palm/pocore/}. I believe CodeWarrior has better support for
this, but in this case we rolled our own (though help from other open
source examples was important).

We manage the m68k/ARM interface through PEAL, which is basically a
linker for ARM code and calling mechanism from m68k. PEAL deals with
globals and spliting the code into 65K chunks automatically.

Flite does however have a number of large data segments, in the
lexicon and the voice database itself. PEAL can deal with this but it
loads large segments by copying them into the dynamic heap, which on
most Palm device is less than 2M. This isn't big enough.

Thus we changed Flite to restrict the number of large data sgements it
used (and also did some new compression on them). The five segments: the
lts rules, the lexical entries, the voice LPC coefficients, the voice
residuals and the voice residual index are now treated a data segments
that are split into 65400 sized segments and loaded into feature
memory space, which is in the storage heap and typically much bigger.
This means we do need about 2-3 megabyte free on the device to run.
We did look into just indexing the 65400 byte segments directly but
that looked like being too much work, and we're only going to be able
to run on 16M sized Palms anyway (there aren't any 8M ARM Palms with
audio, expect maybe some SmartPhones).

Using Flite from m68k land involves getting a @code{flite_info}
structure from @code{flite_init()}. This contains a bunch of fields
that be set and sent to the ARM domain Flite synthesizer proper within
which other output fields may be set and returned. This isn't a very
general structure, but is adequate. Note the necessary byte swapping
(for the top level fileds) is done for the this structure, before
calling the ARM native @code{arm_flite_synth_text} and swapped back
again after returning.

Display, playing audio, pointy-clicky event thingies are all done in
the m68K domain.

@subsection Using the PalmOS

There are three basic functions that access the ARM flite
functions: @code{flite_init()}, @code{flite_synth_text()} and
@code{flite_end()}.

@node Flite Design, APIs, Installation, Top
@chapter Flite Design

Expand Down
4 changes: 0 additions & 4 deletions flite_notes/Flite_Dependencies.mm
Expand Up @@ -304,7 +304,6 @@
<icon BUILTIN="folder"/>
<node CREATED="1454709288252" ID="ID_711036175" MODIFIED="1454709296652" TEXT="cst_alloc.h"/>
<node CREATED="1454707759819" ID="ID_1680378320" MODIFIED="1454709054406" TEXT="cst_string.h"/>
<node CREATED="1454709297660" ID="ID_1511038848" MODIFIED="1454709306492" TEXT="cst_math.h"/>
<node CREATED="1454707770724" ID="ID_355511581" MODIFIED="1454707778168" TEXT="cst_track.h"/>
<node CREATED="1454707778422" ID="ID_1522154562" MODIFIED="1454707795901" TEXT="cst_wave.h"/>
</node>
Expand All @@ -315,7 +314,6 @@
<icon BUILTIN="folder"/>
<node CREATED="1454709288252" ID="ID_153952007" MODIFIED="1454709296652" TEXT="cst_alloc.h"/>
<node CREATED="1454707759819" ID="ID_1490258895" MODIFIED="1454709054406" TEXT="cst_string.h"/>
<node CREATED="1454709297660" ID="ID_82365098" MODIFIED="1454709306492" TEXT="cst_math.h"/>
<node CREATED="1454707770724" ID="ID_1090931646" MODIFIED="1454707778168" TEXT="cst_track.h"/>
<node CREATED="1454707778422" ID="ID_1714686240" MODIFIED="1454707795901" TEXT="cst_wave.h"/>
<node CREATED="1454707796735" ID="ID_556970448" MODIFIED="1454707805986" TEXT="cst_audio.h"/>
Expand All @@ -338,14 +336,12 @@
<node CREATED="1454710121996" ID="ID_1378387714" MODIFIED="1454710131369" TEXT="cst_utt_utils.h"/>
<node CREATED="1454709297660" ID="ID_181378112" MODIFIED="1454709306492" TEXT="cst_math.h"/>
</node>
<node CREATED="1454710151013" ID="ID_1098671803" MODIFIED="1454710164451" TEXT="cst_spamf0.h"/>
</node>
<node CREATED="1454710304981" ID="ID_861820616" MODIFIED="1454710453852" TEXT="cst_vc.c">
<node CREATED="1454708850804" ID="ID_10375906" MODIFIED="1454708855878" TEXT="include">
<icon BUILTIN="folder"/>
<node CREATED="1454709288252" ID="ID_944638300" MODIFIED="1454709296652" TEXT="cst_alloc.h"/>
<node CREATED="1454707759819" ID="ID_1640597829" MODIFIED="1454709054406" TEXT="cst_string.h"/>
<node CREATED="1454709297660" ID="ID_102393724" MODIFIED="1454709306492" TEXT="cst_math.h"/>
</node>
<node CREATED="1454709379696" ID="ID_1809326707" MODIFIED="1454709389348" TEXT="cst_vc.h"/>
</node>
Expand Down
1 change: 0 additions & 1 deletion include/Makefile
Expand Up @@ -51,7 +51,6 @@ H = cst_alloc.h \
cst_file.h \
cst_hrg.h \
cst_item.h \
cst_math.h \
cst_lexicon.h \
cst_lts.h \
cst_lts_rewrites.h \
Expand Down
16 changes: 1 addition & 15 deletions include/cst_error.h
Expand Up @@ -48,21 +48,7 @@
#else
#define cst_error() abort()
#endif
#elif __palmos__
#ifdef __ARM_ARCH_4T__

typedef long *jmp_buf[10]; /* V1-V8, SP, LR (see po_setjmp.c) */
extern jmp_buf *cst_errjmp;
extern char cst_error_msg[];
int setjmp(register jmp_buf env);
void longjmp(register jmp_buf env, register int value);

#define cst_error() (cst_errjmp ? longjmp(*cst_errjmp,1) : 0)
#else /* m68K */
/* I've never tested this or even compiled it (Mimic is ARM compiled) */
#define cst_error() ErrFatalDisplayIf(-1, "cst_error")
#endif
#else /* not palmos */
#else /* not DIE_ON_ERROR */
#include <setjmp.h>
extern jmp_buf *cst_errjmp;
#define cst_error() (cst_errjmp ? longjmp(*cst_errjmp,1) : exit(-1))
Expand Down

0 comments on commit 6eb58e3

Please sign in to comment.