Running David Tait's PIC Programmer on Linux
============================================

Foreword
--------

I adapted PP to run on Linux for my own purposes. I'm giving it to the PIC
community because I think it will run on the majority of Intel boxes
running Linux without any problems. Unfortunately I don't have time to
help people with any problems they are having with it. You can try me, but
I might simply ignore your message.

PP ON LINUX IS UNSUPPORTED AND YOU USE IT AT YOUR OWN RISK, ETC ETC

If you still want to get in touch, mail me at pic@ritc.co.uk



Compiling PP
------------

What you need to compile PP on Linux:
* GNU make
* GCC 2.7.x
* unzip (probably from ziptools)

First, unzip the source files in your PP directory. You can probably do
this with the command:

    unzip LINUXSRC.ZIP

This will list the names of the files, as they are extracted. If the names
are uppercase, then you'll have to rename them (sorry!) with commands
like:

    mv PP.C pp.c
    mv PPHW.C pphw.c

Now say a prayer, and type

    make

This should work without any errors. If so, you will have a file called
'pp' in the current directory, which is the pp main program. In that case,
you're probably OK.

If it doesn't work, any number of things could be wrong, depending on the
error message. If make complains about "No rule to make target ..." , then
you forgot to rename one of the files from uppercase to lowercase, or you
don't have all the files you need, for some reason (maybe the ZIP was
corrupted?).

If you get any other errors, it's likely that there's something seriously
strange about your system, and you'll probably need the help of a Unix
expert to fix them.



Running PP
----------

You need to be ROOT to run pp, because it needs direct access to your
hardware, and this is a privileged operation under Linux. You should NOT
make pp suid root on a multi-user system, because it can be used to
overwrite any file on the system.

PP for Linux should work in exactly the same way as PP for DOS. It has the
same command line arguments and the same environment variables. However,
if David hasn't added AN589 support to PP for DOS, then only the Linux
version will have it. You can select AN589 as your hardware with the
command:

    export PPSETUP=4 

before you run PP. Note that, unlike DOS, you set environment variables
using the 'export' command rather than 'set'.

If you use pp often, then you might want to edit the 'mypp' file to set
the defaults you need. It should look something like this:

    #!/bin/sh
    export PPSETUP=3
    export PPDELAY=5
    export PPLPT=1
    ./pp $*

The values for PPSETUP, PPDELAY and PPLPT are exactly the same as those
used by PP for DOS. However, under Linux I couldn't find a way to
auto-detect what port is used by each printer; PP makes a guess based on
the standard values. If your LPT ports use non-standard addresses, you'll
need to edit pphw.c, and changed the port addresses on this line:

    int ports[] = { 0x378, 0x278, 0x3BC };

You'll also need to remove this section of the code from pphw.c:

    switch ( d_reg ) {                   /* check port address is valid */
        case 0x3BC:
        case 0x378:
        case 0x278: break;
           default: return -1;
    }

Once you've make those changes, run 'make' again to rebuild pp, and pp
should now work for you.

In order to run PP using the mypp batch file, you need to make it
executable:

    chmod u+x mypp

Then you can type:

mypp foo.hex

instead of 'pp foo.hex', to run PP with your own settings. 

--------------------------------------------------------------------------
PP on Linux README v0.1 (C) Chris Wilson 2-Mar-1999 <pic@ritc.co.uk>
