[nmglug] parallel port address "one small step for man, a giant leap for mankind"
akaluta at taosnet.com
Wed Jan 7 14:51:45 PST 2009
Dear Glug Persons;
Bob,Aaron,Sam, Thanks to each of you for leading me to the solution. I
have taken a giant leap forward and have been re-inspired.
The book I am reading "HOW TO LEARN C IN TEN YEARS" I look upon with
renewed vigor. and of course,in the future, I will confirm that I do
have execute permission or am root before proceeding.
Thanks all, I look forward to seeing you at a glug meeting and thank the
group for being there,a delight.
Best Regards, Anthony K
On Wed, 2009-01-07 at 09:57 -0700, Sam Noble wrote:
> 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?
> nmglug mailing list
> nmglug at nmglug.org
More information about the nmglug