Wednesday, September 4, 2019

Linux: How to check the IO address space on your Linux machine

The parallel port is at address 0x0378?
This is the IO address space and this information is provided under the /proc file system as:

$> cat /proc/ioports

Sample output is as follows:
$ 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
  0200-020f : pnp 00:05
  03c0-03df : vga+
  03f8-03ff : serial
  0400-0453 : pnp 00:05
    0400-0403 : ACPI PM1a_EVT_BLK
    0404-0405 : ACPI PM1a_CNT_BLK
    0408-040b : ACPI PM_TMR
    0410-0415 : ACPI CPU throttle
    0420-042f : ACPI GPE0_BLK
    0430-0433 : iTCO_wdt
    0450-0450 : ACPI PM2_CNT_BLK
  0454-0457 : pnp 00:07
  0458-047f : pnp 00:05
    0460-047f : iTCO_wdt
  04d0-04d1 : pnp 00:0b
  0500-057f : pnp 00:05
  0680-069f : pnp 00:05
  0a10-0a1f : pnp 00:08
  0a20-0a3f : pnp 00:08
0cf8-0cff : PCI conf1
0d00-ffff : PCI Bus 0000:00
  164e-164f : pnp 00:05
  d000-dfff : PCI Bus 0000:03
    d000-d01f : 0000:03:00.0
  e000-efff : PCI Bus 0000:01
    e000-e0ff : 0000:01:00.0
  f000-f01f : 0000:00:1f.3
  f020-f03f : 0000:00:1f.2
    f020-f03f : ahci
  f040-f05f : 0000:00:19.0
  f060-f063 : 0000:00:1f.2
    f060-f063 : ahci
  f070-f077 : 0000:00:1f.2
    f070-f077 : ahci
  f080-f083 : 0000:00:1f.2
    f080-f083 : ahci
  f090-f097 : 0000:00:1f.2
    f090-f097 : ahci
  f0a0-f0a7 : 0000:00:16.3
    f0a0-f0a7 : serial
  ffff-ffff : pnp 00:05
    ffff-ffff : pnp 00:05