niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl » modules
Perl interface to direct port I/O functions (inb(), outb() and friends)
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
Andrew Ho
*nix forums beginner


Joined: 20 Feb 2005
Posts: 2

PostPosted: Sun Feb 20, 2005 3:00 am    Post subject: Perl interface to direct port I/O functions (inb(), outb() and friends) Reply with quote

Hello,

On Linux or BSD systems, you can do direct port I/O from C/C++ using
the inb() and outb() functions. In addition, on Linux and glibc based
systems you may have to use ioperm() to get access to a port, and the
BSDs have equivalents (I've been using /dev/io on FreeBSD and sysarch()
and iopl on OpenBSD).

Typically, you want to do this to do some sort of ad hoc hardware
interfacing: for example, using your joystick port or parallel port for
random hackery.

I've written some XS glue--it's pretty simple--to provide Perl access
to these functions; it's four simple exported functions:

port_open($portnum);
write_byte($portnum, $value);
$value = read_byte($portnum);
port_close($portnum);

I have a few questions. First, is there already a module that does this
for me? I note at least one port-specific module, Device::ParallelPort,
but no general interface to inb() and outb() and equivalents (it could
almost be, though, the API is pretty much the same, so perhaps it just
bears renaming!).

If there is not such a module, I'd like to contribute one. I'm thinking
the Sys:: namespace is the right place for it, so I'd suggest something
like Sys::PortIO. I'm quite open to alternate suggestions.

I'm already registered with PAUSE, so if I don't hear back from anybody
in a week or so, I'll probably just go ahead with packaging up and
submitting the code I've got working. Thanks!

Humbly,

Andrew

-----------------------------------------------------------------------
'Twas brillig, and the slithy toves Andrew Ho
Did gyre and gimble in the wabe. andrew@zeuscat.com
All mimsy were the borogoves,
And the mome raths outgrabe. http://www.zeuscat.com/andrew/
-----------------------------------------------------------------------
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Wed Jan 07, 2009 7:43 pm | All times are GMT
navigation Forum index » Programming » Perl » modules
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Need Help with Program in Perl on a Netware Server fhadzocos@gmail.com Perl 3 Fri Jul 21, 2006 1:57 pm
No new posts Bug#379103: ITP: complearn-gui -- 3D drag-and-drop interf... Rudi Cilibrasi devel 0 Fri Jul 21, 2006 11:00 am
No new posts changing port in vsftp henk@oegema.com Suse 2 Fri Jul 21, 2006 10:42 am
No new posts problems using oddmuse with mod_perl2 inside apache2.2 pe... Fergus McMenemie Perl 0 Fri Jul 21, 2006 9:48 am
No new posts does squid 2.6 support setting cache_peer port in redirec... Victor Tsang Squid 0 Fri Jul 21, 2006 8:16 am

Best Credit Cards | Web Advertising | MPAA | Web Advertising | Personal Car Finance
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2023s ][ Queries: 16 (0.1312s) ][ GZIP on - Debug on ]