I've just made my own parallel cable embedded into a breadboard for easy programming of chips I can put in my breadboard. Here's a picture:

I made it using an old printer cable which is d25 on the computer end and centronics (36 pins) on the "printer" end. I followed the pinouts from this page and grounded all the ground pins correctly. The problem is that when I try to output something on the data port in a C program, I get a segmentation fault:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/io.h>
#define OUTPUT 0x378 // Parallel port base address
// Each bit of the byte at 0x378 corresponds to a data output pin D0 to D7
#define CONTROL 0x37A // Control pins C0 to C3
int main(int argc, char* argv[])
{
// Check permissions for I/O, usually requires root access
if(ioperm(OUTPUT, 1, 1))
{
printf("Couldn't get the port at %x\n", OUTPUT);
exit(1);
}
if(ioperm(CONTROL, 1, 1))
{
printf("Couldn't get the port at %x\n", CONTROL);
exit(1);
}
// Initial reset
outb(0x0, CONTROL);
outb(0x4, CONTROL);
outb(0xC, OUTPUT);
return 0;
}I thought maybe it was my C program, so I tried using pyParallel instead, but it also crashes when I try to output something to the data port. I think my parallel port isn't set up correctly in Linux, what should I look for in order to fix this? Thanks












