Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I'm programming an interface

Status
Not open for further replies.

Bertv100

Programmer
Apr 27, 2000
204
BE
Hi,

I'm programming an interface that is connected to the parallel port of the pc. I know through which ports I can communicate with the interface (status = 379h and control = 37Ah). What I don't know is how it can be done from a C++ program under Linux.
Is it possible to use inline assembler (I only need the IN and OUT opcodes) in gcc 3.0? If so, what's the syntax to do this?
And last but not least, does Linux allow manual port toggling (I know M$ Windows doesn't)? If such direct communication with hardware is impossible, how can I achieve the same results?
The thing came with a DLL and special I/O executable for use under Windows but, since I need very accurate timing and speed, using Windows is entirely out of the question!

Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
Don't worry what people think about you. They're too busy wondering what you think about them.
 
If your program can run as root, you can use inb, outb,... but don't forget to use ioperm in the process/thread before accesing the memory. For more info, consult the man-pages.

Remark: Linux is not real-time either, so it is probably worthwhile to make a kernel-module. Check out "Linux Device Drivers" by Alessandro
Rubini, published by O'Reilly & Associates.

For inline-assembly. I haven't needed it yet, but google gives many results on "linux gcc inline.assembly"

Success,
Stefaan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top