Matt J. Gumbley | Website: http://www.gumbley.me.uk
Blog: On The Edge of Occam's Razor

hForth for EPOC

Table Of Contents



1 Introduction

This project or information is dead. I cannot release any code or further information on it, other than what you'll find on this page. All communication regarding it will be silently deleted. Apologies.

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.
(C) Matt J. Gumbley 1998-2005 - All Tights Reversed