It is currently Thu May 23, 2013 11:13 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: FInd address of parallel port
PostPosted: Fri Apr 13, 2007 4:20 am 
Experienced Zenwalker
Experienced Zenwalker
User avatar

Joined: Fri Apr 06, 2007 2:48 am
Posts: 114
Hello,

I'm currently doing some parallel port programming. I would usually ask the user to enter the base address of the parallel port. Is there a way to write some C code that can find this out,  instead of having the user input it?

thanks.

_________________
"Everybody should program in Java, except those who want reliability, performance, portability and good design."
~JP


 Profile Send private message  
 
 Post subject: Re: FInd address of parallel port
PostPosted: Fri Apr 13, 2007 5:54 am 
Dev team
Dev team

Joined: Fri Mar 10, 2006 11:17 am
Posts: 2099
I'm not sure if I understand you correctly but in linux you should normally read/write to /dev/lp0 and NOT mess with the the base address of your parallel port. The kernel should detect your base adress correctly it is really uncommon for a unix/linux application to deal wit this sort of stuff.


 Profile Send private message  
 
 Post subject: Re: FInd address of parallel port
PostPosted: Fri Apr 13, 2007 6:00 am 
Experienced Zenwalker
Experienced Zenwalker
User avatar

Joined: Fri Apr 06, 2007 2:48 am
Posts: 114
Okay, so if the kernel detects the base address, how do I get it from the kernel? I'm notfamiliar with using /dev/* for outputs. This seems a bit hard as I do alot of bitwise operations an I need access to the base port, base port+1, and base port+2.
I use ioperm() to setup relevant permissions. and inb() anf outb() for reading and writing.

I've heard that another way that I could find the base address is to search /proc/ioports. But I'm not sure how to implement this in C.

_________________
"Everybody should program in Java, except those who want reliability, performance, portability and good design."
~JP


 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


 Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: