home .. forth .. misc mail list archive ..

P21Forth_tools


Dear MISC readers:

Dave Lowry wrote me:

>Hi Jeff!
>
>Thanks for putting P21Forth in the public domain.
>
>I'm unclear on how to generate a ROM image.  I'm sure you're very busy
>getting ready for the F21 prototype, any hints would be appreciated.  Thanks.

For everyone who is expermenting with the development tools included
please remember I have only documented the P21Forth itself not all
the development tools.  There are a couple of papers at my web site
about the internals of the metacompiler etc, but much of the source
is a historical kludge.   In any event:

I go to the location of the OK ver 1.01 files and run the X.BAT program.
This writes OK (all 2K of it) out the the PCMCIA card drive in D:
at the correct scrambled addresses.

Then I run MPCB.BAT.  This target compiles the P21Forth image which it
writes to a file.  I use the name PCB.P21 for the image for the kit pcb
but you can use any name.  MPCB runs the 2CARD2 utility.  The 2CARD2
utility reads OK from the PCMCIA card and adds P21Forth from the file
you choose.  (So it prompts twice for filenames)  Finally it rewrites
the mixed boot image back to the card.

At that point I can plug the card into the ROM socket on the kit, or
I use a utility in DOS (extended for PCMCIA support) that reads the
card drive as a binary image and writes it to a file.  I call this
SLOW.ROM or FAST.ROM or whatever.  I can burn a rom from the the file.
It is the same binary image as the PCMCIA card for the kit board.

You need FPC to create the target compiler (X21D) and the 2CARD2 tools.
It works better if you make sure you have 2M of EMS, then FPC can
save itself to high mem when it shells to DOS etc.

Sometimes I just run 2CARD2 to reload a .P21 file back to a card, but
making new cards only takes a couple of seconds and is about as fast
as reaching for the drive and removing the PCMCIA card to plug it into
the P21.

The PCMCIA card is just a type of floppy drive as far as my system is
concerned.  If you had a floppy drive in D: you could do everything I
do without much modification.  There is a constant in PCMCIA.SEQ in
the OK files and in 2CARD2 that sets the temporary drive to D:.  If
you did use a floppy instead of a PCMCIA card it would work perfectly
if it was a 128k byte floppy.  However since the addresses on the
card are xored with AAAA this means that you could still just use the 
first 128k bytes of the floppy and xor the addresses with AAAA.  You
would need to write your own utility to read the first 128k of the
floppy as 256 512k sectors and write it out to a 128k byte file on
your hard disk so you could burn proms from the file.

If you do not have a PCMCIA drive and don't want to use a floppy as
a temp drive and write a utility to read the first 128k from your temp
floppy then you have to modify several programs. Since OK and P21Forth
are created with different software they need to be mixed together
somehow and put in the boot image.  

I generate different versions for
1. the simulator (S.P21)
2. the original development system with my custom i/o chip (C.P21)
3. the kit board (PCB.P21)
4. the kit board with fast i/o chips (FASTPCB.P21 ?)

Each of these is compiled with a different batch file, so use MPCB
to make the ROM for the kit.  

However be careful, remember that X.BAT in the OK files and the M---.BAT
files in the P21Forth software write sectors directly to the D: drive.
If you have a hard drive in D:, you will be trashing the disk real fast
if you are not careful.  You can change the temporary drive in the OK
software and P21Forth utility 2CARD2 to A: or B: if D: is not what you
want on your system.

I hope that helps for anyone experimenting with the P21Forth software.

I have been busy with a job and with trying to get F21 ready to go.  I
have not been doing much with P21.  I expect that my enery will be shifting
to doing more with F21 and less with P21.

Since P21Forth is released as shareware there might be a few people looking
at it for the first time.  I think the MISC mail list is  a good place to
ask questions, report bugs, etc.

Jeff Fox