[nmglug] parallel port address

Sam Noble sam at thepromisedlan.org
Wed Jan 7 08:57:47 PST 2009

On Tue, 2009-01-06 at 06:27 -0700, akaluta wrote:
> The parallel port location found in /proc/ioports/ is 0378-037a,
> what would be the correct entry for: "#define base ..." /* printer
> port
> base address */  ( referenced program, see this page below.)

In the common case where the port is listed in /proc/ioports as
0378-037a. The correct value for the base address seems to be 0x0378.
That's why it's already defined that way.

>  My untutored attempts at correct entry have not located the port as
> indicated by error message "port 17a not found." alternately invalid
> digit 8 in octal constant.

I believe the trick here is to leave it alone :)

I'm not quite sure what this program does, but if you leave the base
defined as default it compiles and runs. Also it's exit status matches
whatever value 0-255 you pass it, In the excerpt below parportkaluta.c
is the program (with white-space correction as previously noted.) 
And the actual parallel port has nothing plugged into it, so if this
prog is passing "123" out the port, I wouldn't notice.

I think my parport looks like yours:
$grep 0378 /proc/ioports
0378-037a : parport0
$grep 0378 parportkaluta.c
#define base 0x0378           /* printer port base address */

So we compile and run it:
$gcc parportkaluta.c -o parport.bin
$chmod +x parport.bin
$sudo ./parport.bin 123
$echo $?

Does that help any?

More information about the nmglug mailing list