

		NFPT: No-Frills Parallel Transfer
		---------------------------------
		A quick-and-dirty pseudo-ECP mode
		parallel cable transfer utility

	     http://www.geocities.com/keinhong/nfpt/
	Copyright (c) 2002,2003 K.H. Man <mkh@pl.jaring.my>
		     Kuala Lumpur, Malaysia

+--------------------------------------------------------------------+
|This program is free software; you can redistribute it and/or modify|
|it under the terms of the GNU General Public License as published by|
|the Free Software Foundation; either version 2, or (at your option) |
|any later version. See the file 'LICENSE' for the details.          |
+--------------------------------------------------------------------+


Introduction
------------

This is a ALPHA prototype of a pseudo-ECP mode parallel cable transfer
utility. I use it in conjunction with double-checking file integrity
using a zip program. If you want to use it, it is AT YOUR OWN RISK. I
am not responsible for corrupted data, but if you are careful to check
the integrity of your data files, then it should be quite trouble-free.
Ideally, you should be familiar with using and compiling programs with
DJGPP, i.e. you should be able to fix any system-specific bugs on your
own if and when they arise.


Compatibility Note
------------------

My machines run Windows 98/ME which allows an MS-DOS Prompt box to
access the parallel port registers directly under DJGPP. I've no idea
if it will work on new versions of Windows or Windows NT, so you might
need to run NFPT in FreeDOS or an old MS-DOS boot disk.


ECP Cable
---------

Directions to make your own pseudo-ECP cable is supplied on the Web
site for NFPT, on a separate page. Note that if you don't use resistors
to protect the bidirectional data lines, you run the risk of having two
low impedance output drivers frying each other. Recent parallel ports
should have circuitry that protects against such an event. You also
have to ensure that both computers have a ground that is as close
together as possible, to avoid ground loops.

The risk to your machines and your machines' printer ports is yours to
assess, and the decision is yours to make.

This connection arrangement is given in a Microsoft document on the
ECP specification, but in that document it is only used for a sort of
"loopback" test -- meaning both ports are on the same machine. It is
NOT a proper ECP cable, the latter which has circuitry for isolation
and protection.

My homemade cable is 2 metres in length but is quite noisy. Transfer
rates are still acceptable, though, far better than 4-bit wide parallel
I/O speed (see below.)


Performance
-----------

Since this is really a throw-away proof-of-concept prototype, the
protocol used is terribly dodgy. At packet level, it is a single
duplex send and acknowledge scheme with multiple retries. Conservative
settings for timeouts is the main stumbling block. At port level, the
protocol relies on a not very robust signalling scheme. Here are some
performance numbers:

	Actual performance (approx.)	220 KB/s
	Free running, single direction	333 KB/s

The drop in performance is mainly due to poor design of timeouts.
There is no data compression, but packet headers are protected by
checksums and data blocks are protected by CRC (copied from zlib.)
The low level routines are located in a self-contained pair of
source files.


Port Detection
--------------

ECP port detection is not very good; it defaults to a fixed value for
some settings, as long as the situation is not fatal. If you are sure
you have an ECP port, but NFPT cannot detect it, you'll have to hack
the detection and initialization code to suit your system.

Before running NFPT with a new cable, do try out the connection with
the accompanying test program, ecp-test. It allows you to check the
signal lines manually with simple key presses, and it also does a
transmission test using pseudo-random numbers and CRC to test data
integrity.


Usage Notes
-----------

File transfer is by using the command line. First, run NFPT on the
receiving side without arguments. Then, run NFPT with the files you
want to transfer as arguments. Wildcards can be used; the program will
run a globbing routine on them as per default DJGPP program behaviour.
For example:

receiver -->	nfpt
sender -->	nfpt *.tar.gz

After that, look at the output and follow the simple directions.


Compilation Notes
-----------------

A simple Makefile is supplied. Run make like this to build them:

	make ecp-test.exe
	make nfpt.exe

The supplied executables were compiled using gcc 3.2, stripped and
compressed using UPX (available on SourceForge.)

I intend to produce a better version, but it's currently low-priority.

--
Kein-Hong Man
mkh@pl.jaring.my
KL, Malaysia
2003-07-16

