3

How can I get a list of device bus ports? For example the parallel port is the 0x378. Is there a command to list each port and its device?

On Windows it is possible looking device detail in the device manager. I think there is a way also on Linux.

3
  • 2
    I think that those type of "ports" date back from an era when there existed no such thing as enumerating devices on the bus. Not like PCI and USB where you can just run lspci or lsusb or check /sys/bus/pci or /sys/bus/usb. I'm not sure there's any way to list them. Commented Jul 4, 2015 at 15:14
  • The good news is that there are no new ones being added using such old technology (I think) so the list isn't ever going to grow! Commented Jul 4, 2015 at 15:15
  • @Celada If you have to direct access you need to know the device port number. And it is very usefull if you use the file /dev/port. For example I can play the buzzer in ruby (or with others high level programming languages) with this my program that use /dev/port. github.com/andrea993/pacmantheme Commented Jul 4, 2015 at 15:31

1 Answer 1

4

You can use output of the /proc/ioports:

$ cat /proc/ioports 
0000-0cf7 : PCI Bus 0000:00
  0000-001f : dma1
  0020-0021 : pic1
  0040-0043 : timer0
  0050-0053 : timer1
  0060-0060 : keyboard
  0064-0064 : keyboard
  0070-0077 : rtc0
  0080-008f : dma page reg
  00a0-00a1 : pic2
  00c0-00df : dma2
  00f0-00ff : fpu
  ...

And cat /proc/bus/{input,pci}/devices

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.