ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.