Today I uploaded the newest version of Riscy Pygness (Pygmy Forth for
the ARM) to
http://pygmy.utoh.org/riscy/
the file riscy2-20050108-1856.zip contains the full source code and also
several binaries in Intel Hex format. Two of the hex files are
available for separate download if you would rather take a quick look:
combo.hex
(for a 14.7456 MHz LPC2106, e.g. the Olimex board, 115200 bps)
combotiny.hex
(for a 10 MHz LPC2106, e.g. New Micros tinyARM, 9600 bps)
I run with the Olimex board and haven't tried the New Micros board yet.
If you try it, please let me know how (and whether) it works.
This version runs from any serial terminal. The heads are stored on the
target. The dictionary can be extended interactively into RAM.
If you have an LPC2106 board running at 14.7456 MHz (or probably at 10
MHz) you should be able to run the Forth interactively just by burning
the hex file into the ARM and connecting a serial terminal to the first
serial port. When it boots it says "Hi". Pressing Enter should make it
respond with " ok". Typing
1 3 + .
Should print out 4
See the source code for all the words it knows.
The primitives are assembled using the Gnu ARM tool chain, which
culminates in the file riscy.bin. So, if you want to change the
primitives, you would need access to the Gnu tool chain.
The high-level Forth is compiled and merged with riscy.bin to produced
combo.bin and combo.hex ready for downloading into the ARM. The
compiler is written in Common Lisp. I use CLISP on Linux, but any
Common Lisp should work with, at most, minor changes, either on Linux or
Windows. The main load file is arm.lisp, which is very easy to read
and/or modify, just look for the lines such as
(forth-compile-file "lpc.forth")
(forth-compile-file "riscy.forth")
Included with it is source code for
accessing MMC and SD flash disks (in SPI mode), including FAT16,
using the IAP routines to reprogram LPC flash,
multitasking
The license is MIT/BSD style so you are free to use it in any sort of
project.
The threading model has changed somewhat compared to the previous
version. Previously, code was limited to flash (i.e. the first 128 K
bytes of address space). Now code anywhere in the 32-bit address space
can be executed. This lets it compile interactively into RAM and also
makes it easy to port to other ARM chips regardless of their memory
maps. The "tokens" still take just 16 bits each, so a *lot* of code
fits into the LPC flash.
So, to summarize,
to take a quick look, burn the hex file into the target and
connect a serial terminal at the correct baud rate
to modify the high-level Forth (but use the existing primitives),
install some sort of Common Lisp and edit arm.lisp to include the
Forth files you want to compile.
to change even the primitives, install the Gnu ARM tool chain.
to use it as inspiration for MMC or SD or the IAP routines, for use
with C or assembly, download the source code and read it. I'll be
glad to try to answer questions if Forth is a foreign language.
The main web site leads to a Swiki (a Wiki that you are welcome to use
to post comments, corrections, questions, etc.). It is read only by
default, but you can log in with the name 'forth' and the password
'fourth' to have full access. If that login information changes, please
email me and I'll send you the new login information.
--
Frank
http://pygmy.utoh.orgMessage
Riscy Pygness (Pygmy Forth for the ARM)
2005-01-09 by Frank Sergeant
Attachments
- No local attachments were found for this message.