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. Compiling PP ------------ What you need to compile PP on Linux: * GNU make * GCC 2.7.x or higher * GNU tar First, unzip the source files in your PP directory. You can probably do this with the command: tar zxvf pp-0.7.tar.gz Now change to the new directory: cd pp-0.7 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. Your copy of pp-0.7.tar.gz may have been corrupt - try downloading it again. Otherwise, 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. ChangeLog --------- 0.7 (2007-12-03): Thanks to Will Jackson for reporting that PP no longer compiled on more recent Linux systems due to missing . Changed to , not tested but it compiles OK for me. --------------------------------------------------------------------------- PP on Linux README v0.7 (C) Chris Wilson 03-Dec-2007