LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-29-2009, 10:17 AM   #1
yonnieboy
Member
 
Registered: Apr 2008
Location: sw OR
Distribution: PCLOS, Kubuntu, Lubuntu, Unity
Posts: 143

Rep: Reputation: 15
making use of digital i/o?


I have this old juki card (all-in-one motherboard for multi-slot isa backplane). This board has a plug with several digital i/o available. The bios has a couple of address settings for this starting at (if I remember right) around 220.

Does anybody know how to make use of or access this i/o?
 
Old 10-29-2009, 07:11 PM   #2
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
You could either use ioctl which allows you to write to IO ports, but that is not elegant. Or use Comedi and find a driver which controls IO which is very similar to yours and adapt it to your IO. At least I assume there is no Comedi driver for it. Adapting such a driver is really easy.

jlinkels
 
Old 10-30-2009, 01:08 AM   #3
yonnieboy
Member
 
Registered: Apr 2008
Location: sw OR
Distribution: PCLOS, Kubuntu, Lubuntu, Unity
Posts: 143

Original Poster
Rep: Reputation: 15
Thanks, didn't know this. Would you know of good resources for learning to make use of ioctl and comedi?
 
Old 10-30-2009, 05:30 AM   #4
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 I am not mistaken ioctl is described in the O'Reilly book abot writing Linux device drivers. http://lwn.net/Kernel/LDD3/

Information about Comedi on the web site http://www.comedi.org/

jlinkels
 
Old 10-30-2009, 08:39 AM   #5
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
In Linux, you can access arbitrary x86 IO ports (where the term IO ports implies the IO address space using IN/OUT machine instructions) with the /dev/port pseudo device. You open() the device, select an address to access with lseek(), and then either read() or write() the selected address. When done, naturally, you close() the device. All of this requires root privileges.
I am not sure how ioctl() plays a role in your objective, as it typically is a method of communicating with a device driver, (as opposed to the actual device it is supporting). A comedi driver that supports the IO you have may provide an ioclt() interface, and if so, it should be documented with the driver. The kinds of things you might expect such a driver's ioctl() to perform might be stuff like assigning an input/output bitmask, defining bits or words as either inputs, outputs, or bi-directional; stuff that you can't control or read by simply writing/reading the device address space.
--- rod.
 
Old 10-30-2009, 08:39 AM   #6
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
In Linux, you can access arbitrary x86 IO ports (where the term IO ports implies the IO address space using IN/OUT machine instructions) with the /dev/port pseudo device. You open() the device, select an address to access with lseek(), and then either read() or write() the selected address. When done, naturally, you close() the device. All of this requires root privileges.
I am not sure how ioctl() plays a role in your objective, as it typically is a method of communicating with a device driver, (as opposed to the actual device it is supporting). A comedi driver that supports the IO you have may provide an ioclt() interface, and if so, it should be documented with the driver. The kinds of things you might expect such a driver's ioctl() to perform might be stuff like assigning an input/output bitmask, defining bits or words as either inputs, outputs, or bi-directional; stuff that you can't control or read by simply writing/reading the device address space.
--- rod.
 
Old 10-30-2009, 09:18 AM   #7
yonnieboy
Member
 
Registered: Apr 2008
Location: sw OR
Distribution: PCLOS, Kubuntu, Lubuntu, Unity
Posts: 143

Original Poster
Rep: Reputation: 15
Thanks, this looks like a very good resource, I might learn something. Thank you.
 
  


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
New digital signing sofware usign digital certificates mikelga Linux - Software 1 01-04-2009 09:02 AM
LXer: Digital Freedom: Fighting for your Digital Rights LXer Syndicated Linux News 0 08-18-2007 01:50 AM
Making a digital sender - need help please! sixgunz2 Linux - Software 1 09-01-2006 03:20 AM
Making W-10 digital voice recorder work in Linux Chabbrik Linux - Hardware 0 10-15-2005 12:33 PM
Enable digital output for digital speakers? alphster Linux - Hardware 5 12-26-2004 10:56 PM

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

All times are GMT -5. The time now is 12:32 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