Ceci n'est ce pas Matt Gumbley

Updated Mon Dec 30 22:03:28 2002

Site Map
Site Home page
Matt's home page
Angela's home page
Natasha's home page
Hannah's home page
Our Wedding Pages

Online CV
Family history

Latest News
The Crypt
(Old, Dead Projects)
HTML Macro System
Home Page Sync
Psion EPOC
Mixed Language Programming
GDB Debug Stub
hForth Port
Psion SIBO
All SIBO projects are in
The Crypt
Toshiba 40xx & Linux
Network-RS232 Bridge
Psion Protocol Analyser
Serial Line Analyser
Work on plptools
Psion .img tools
Happy Badger Linux
Linux Psion Link Ideas
Amateur Radio
Amateur Radio Software


accesses so far..

Matt J. Gumbley - http://www.gumbley.demon.co.uk

hForth for EPOC

Table Of Contents

1 Introduction

This project is an attempt to port a version of the Forth programming language to the Symbian EPOC architecture.

The finished product will be released under the GNU General Public License. It should run on all EPOC kit, although I'll only be able to test it on the Series 5.

1.1 Project status

I have a code bundle available for you to look at; it doesn't build for EPOC yet. See below to download it.

Today's problem is: getting macro expansion of 'hello, world',45,23 to see three parameters, not four (it splits on commas, and sees the one in the middle of the string as a delimiter. Not difficult to fix, but it's too late tonight...

I am starting from Neal Crook's StrongARM port of hForth, and porting it to EPOC. This is written in MASM-style assembler, so I have to do the following:

  • Write a converter to change this to inline gcc assembler, as per the Mixed Language Programming notes. This is progressing nicely - I expect it'll take a while to get the code assembling properly, especially since hForth makes extensive use of macros, and the version of gas in the Symbian toolchain does not support them. however, macro processing in perl is easy.
  • Remove any hardware assumptions; the code assumes it'll be in complete control of the hardware, with no OS. We have EPOC to contend with. Most of the hardware-specific code has been removed, although I need to cross-check with the 8086 port of hForth (with which I am more familiar) to ensure I have the memory map correct. I have removed some StrongARM-specific code: anything that deals with the MMU and halfword load/store instructions.
  • Debug the code conversion!
  • Write interface code to EPOC: console and serial I/O are first. I already have serial I/O code from the GDB Remote Debug Stub project. Console code shouldn't be difficult, although again, hForth expects to be in complete control of the hardware, and I need to interface it to EPOC, which is probably synchronous in nature.
  • Add an Object Oriented extension to hForth that'll be compatible with EPOC. I know very little about OO in Forth, and haven't fully grokked Symbian's OS and class hierarchy (OO itself is not a problem). I've got Dick Pountain's book on OO in Forth, so when the time comes, I should be able to overcome this.
  • Allow programmers to write "proper" EPOC applications - this means providing interfaces to the whole class hierarchy. This could be a large amount of work - or it could be quite simple. I don't know just yet.
This could take some time! Watch this space....

1.2 Acknowledgements

I'd like to thank:
  • Chris Jakeman, and the UK Forth Interest Group, for publicising the SIBO version of this project in Issue 101 of ForthWrite.
  • The denizens of comp.lang.forth for advice on which Forth to choose.
  • Leo Brodie, Alan Wakefield, Elizabeth Rather and Edward Conklin for the books I've used for re-learning Forth.
  • Dr. Wonyong Koh, for hForth.
  • Neal Crook, for originally porting hForth to the StrongARM, thus saving me a lot of work.
  • ARM Ltd., for the ARM Architecture Reference Manual.
  • Symbian Ltd., for the wise choice of GNU development tools.

1.3 Related Work

There is another project underway to build a metacompiler for EPOC. No details available yet.

2 Download hForth

You may download it here. (199082 bytes). It isn't finished; it doesn't fully build, but you can see my progress so far.

3 Building hForth

hForth builds in two stages:
  • The assembler code is converted from MASM format to inline gcc assembler. This uses a script, masm2gas.pl (provided).
  • The C/C++ code is built using the usual Symbian tools.
Type 'nmake' to do the first stage, then 'nmake -f hfepoc.marm' to do the second.
Matt J. Gumbley - matt <at> gumbley <dot> demon <dot> co <dot> uk