LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
LinkBack Search this Thread
Old 11-19-2007, 07:32 AM   #1
hoshangi
Member
 
Registered: Nov 2007
Posts: 88

Rep: Reputation: 15
how finding out the device port number?


Hi

I had write a program using I/O port in it but
i don't know how i can find out the port number to use in my program
spectioally com ports number

if linux has a file to finding out the port number please help me




I have read the /proc/ioports but this file doesn't contain
more information about my problem


thanks
 
Old 11-19-2007, 08:39 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,988

Rep: Reputation: 63
It depends on what you mean by I/O port number.

Typically you mean the hardware port numbers which run from 0000 to ffff and control I/O between the processor and various hardware devices (that's a simplified view). In which case /proc/ioports will list the currently assigned ports.

You mention "com"; do you mean DOS-style COM0, COM1, COM2 etc? In linux these are called serial TTY devices and are listed in ioports as "serial", "serial1" etc. They can also be accessed through /dev/ttyS0, /dev/ttyS1 and so on. You may find it easier to use the device files because then you won't need explicit root access.

If that doesn't help, then perhaps you could explain in more detail what kind of IO port number you are actually wanting (and perhaps what you want it for)?

Hope that helps,

—Robert J Lee
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB to serail port adaptor COM port number areftaidi Linux - Software 2 09-25-2007 02:05 AM
finding the ip number basak Linux - Software 1 07-14-2006 07:47 AM
Finding computer model number paddyjoy Linux - Newbie 3 02-15-2006 12:47 AM
Finding number of CPUs. r_213 Linux - Networking 2 10-08-2004 12:48 AM
finding number of files in a directory pantera Programming 2 08-20-2004 11:17 AM


All times are GMT -5. The time now is 11:48 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration