LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-27-2010, 12:13 PM   #1
abakhiet
Member
 
Registered: Apr 2010
Location: Assiut, Egypt
Posts: 166

Rep: Reputation: 15
Lightbulb C program


Hola,
I need to make some C program under linux to make some scripts that can talk to my Server's Parallel port by sending some quare signal as high or low, so what i can do ???
Thanks in advance
 
Old 06-27-2010, 12:22 PM   #2
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
The book, Linux Device Drivers, uses the parallel port as an example. It will get you going quickly. You can view it online. Google for it.

For that matter, most tutorials online that talk about device drivers for Linux also talk about the parallel port.
 
Old 06-27-2010, 12:27 PM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
If your intention is to have a program which controls the parallel port, as opposed to learning to write a device driver, consider the Comedi library.

http://www.comedi.org/doc/

Those are available device driver to be linked to your code, and faily easy to use. It includes a parallel port driver. And it is definitely easier than writing a device driver.

jlinkels
 
Old 06-28-2010, 08:57 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Your project can be accomplished either as a userspace application, or as a kernel driver. The method in each case will be quite different. If timing is critical, especially at higher speeds, then a kernel driver is most likely required, and even then it may be difficult to meet a tight spec. It is not obvious whether you are asking about the details of parallel port hardware functionality, or how to gain access to low-level hardware in general. The PC parallel port was a pretty standard piece of hardware, once upon a time (ISA bus era). These days, you often have to deal with PCI or USB to access the device, and this can make it difficult, maybe impossible, depending on your requirements.
It sounds like you probably intend to write a purely userspace application, so if you have a nice parallel port that is mapped into low IO address space, you can use either the combination of ioperm()/inb()/outb() family of functions, or the /dev/port interface.
More detail about your requirements and the type of hardware you have available will enable people to provide more detailed help.
--- rod.
 
Old 06-28-2010, 12:30 PM   #5
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
hmmm wait .. if all you want is the ability to put a certain byte on the parallel-port data lines -- I already did that. It's a solution with a daemon and a client program:
https://svn.home.palmen-it.de/viewvc/ppshot/trunk/

Source doc is here:
http://home.palmen-it.de/~felix/ppshot/

Last edited by zirias; 06-28-2010 at 12:36 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Can't Program, won't Program? Then Mash the Web with Mozilla's Ubiquity LXer Syndicated Linux News 0 05-01-2010 12:30 PM
open source dvd/cd copy program? burning on the fly program? vieya Linux - Software 3 12-14-2009 09:16 PM
Total recovery: Which program? ghost4linux, YaST2? Best drive imaging program? lagu2653 Linux - Software 1 06-20-2005 01:44 PM
Gtk-Warning but program still works... I close konsole, program closes Laptop2250 Linux - Software 2 11-14-2003 11:18 PM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 08:19 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration