|
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
|