Parallel Port Loopback Test in Linux

I had trouble with a PCI express parallel port card in a modern Linux box not behaving as it should, so I decided to make a test setup. It is based on loopbacking 5 data output signals to 5 status input signals, which is the same as was done in some older DOS software.