2002-11-07 13:32:45

by Fernando Fraga e Silva

[permalink] [raw]
Subject: Parallel port misbehavior using kernel 2.4.19 and pcchips M810

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;
}
--
And copiled with "gcc -O2 test.c -o test; ./test". running it as superuser
the result should be a "1" logic on pin "2" of parallel port.
Ok it is correct except for this motherboard, it works on Soyo+K6 ,
Gigabyte+Athlon, i810+Celeron, etc. But it doesn't for M810+Duron.
I verified the BIOS setup, changed the kernel source for 2.2.20, changed the
motherboard for M812, recompiled and recompiled the kernel, changed the
distro from Debian/Woody to Debian/Testing. None of this worked.

So I tried to install Win95 and make it using a assembler code ... It worked.

The next thing i've done was start making a kernel module.... it worked for
Gigabyte+Athlon, i810+Celeron, Soyo+K6 and a old PC-Chips board with K6
processor....but nothing happened for the M810+Duron board though.

So I thought it should be a problem with outb call, so I made a module using
assembler instead outb call, it was compiled with success and was installed.
The requested i/o region was reserved with success but didn't work with
M810+Duron. Though It worked with Gigabyte+Athlon and Soyo+K6 again.
So i get the old code (as i listed above) and after testing it with success
again in the Soyo+K6 board i compiled it and linked the program statically. i
brought the executable to the M810+Duron and it didn't work again... though
it always runs without any errors the signals are not present on the parallel
port.

I tried to access the parallel port through /dev/ports using lseek to get the
0x378 address position... and the result was the same... nothing for
M810+Duron

I don't know any more to do, and I'm wondered if anyone here can help me. I
can't believe it will not work on this motherboard if the parallel works
perfectly. If anyone have any information about this parallel port on this
motherboard, any code or any related knowlegment and like to share It would
be a lot appreciated.

Thanks.

Fernando.


2002-11-07 16:10:55

by Richard B. Johnson

[permalink] [raw]
Subject: Re: Parallel port misbehavior using kernel 2.4.19 and pcchips M810

On Fri, 8 Nov 2002, Fernando Fraga e Silva wrote:

> 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