> Hi Guys
> I'm working for 4 days on a parallel port misbehavior problem without having
> any sucess. I have to control a device with SPP mode using a pcchips M810, a
> Duron processor and a kernel 2.4.19.
> So I made the following simple code :
> --
> #include <asm/io.h> //i've tried <sys/io.h> too
> int main ()
> {
> ioperm( 0x378, 3, 1);
> outb (0x01, 0x378 );
> ioperm (0x378, 3, 0);
> return 0;
> }
> --
I modified your code to check some things an to easily change
the port:
#include <stdio.h>
#include <asm/io.h> //i've tried <sys/io.h> too
#define PORT 0x378
int main ()
{
ioperm( PORT, 3, 1);
outb (0xaa, PORT );
printf("%02x\n", inb(PORT));
outb (0x55, PORT );
printf("%02x\n", inb(PORT));
ioperm (PORT, 3, 0);
return 0;
}
It works here. You need to make sure that no printer-driver is
loaded since you are using the printer port. If you have two
or more printer ports, the port you use may be 0x278, 0x378, or
0x3bc. You may need to try them all to see what one actually
goes to your connector.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
Bush : The Fourth Reich of America
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/