VMware ESXi and vSphere Cluster Management

I/O Ports in Linux

Learn what hardware I/O ports are, how Linux reports I/O port ranges in /proc/ioports, and how ports relate to IRQ and DMA resources.

I/O means input/output communication between a computer processor and hardware devices. A CPU uses I/O mechanisms to exchange commands and data with device controllers such as serial adapters, storage controllers, keyboards, and display hardware.

An I/O port, also called an I/O address, is an address that the CPU uses to access a hardware device's registers. A device may use one address or a contiguous resource range, such as 03f8-03ff. The range is normally written in hexadecimal, and both endpoints are usually inclusive.

How I/O Port Resources Work

When a device is configured, the system assigns it one or more hardware resources. The device controller exposes registers at its assigned I/O addresses. The operating system and its driver read from and write to those registers to perform tasks such as sending a byte, checking device status, or acknowledging a command.

For example, a serial controller might claim the range 03f8-03ff. The driver uses different addresses within that range for registers such as data, status, and control. Reserving the range helps prevent two unrelated devices from trying to use the same addresses at the same time.

Traditional port-mapped I/O uses a dedicated I/O address space. Modern systems may also use, or may primarily use, memory-mapped I/O. With memory-mapped I/O, device registers appear in the normal memory address space, so a driver accesses them through memory addresses rather than a separate port address space. Therefore, a device may be fully functional without appearing in the traditional I/O-port list.

Common Traditional PC I/O Port Ranges

The following ranges are useful when recognizing legacy PC hardware. They are conventions, not guarantees. Actual assignments depend on the machine, firmware, bus, operating system, drivers, and virtualization platform.

I/O port range (hexadecimal)Typical device or functionNotes
0020-0021Primary programmable interrupt controllerLegacy interrupt-controller registers
0040-0043Programmable interval timerHistorical system timer resource
0060 and 0064Keyboard controllerTraditionally associated with keyboard and auxiliary input control
0070-0071CMOS/real-time clockFirmware settings and RTC access
01f0-01f7Primary IDE/ATA controllerLegacy primary ATA channel
0278-027fParallel portCommon LPT2 convention
02f8-02ffSerial portCommon COM2 convention
0376Primary IDE/ATA control portLegacy control register
0378-037fParallel portCommon LPT1 convention
03bc-03beParallel portCommon LPT3 or monochrome-adapter-associated convention
03c0-03dfVGA adapterLegacy display-controller registers
03e8-03efSerial portCommon COM3 convention
03f0-03f5 and 03f7Floppy disk controllerLegacy floppy-controller registers
03f6Primary IDE/ATA alternate status or controlLegacy ATA-related register
03f8-03ffSerial portCommon COM1 convention
cf8-cffPCI configuration access mechanismTraditional x86 PCI configuration ports

Viewing I/O Ports in Linux

Linux exposes the I/O port resources known to the running kernel through the virtual procfs file /proc/ioports. Display it with:

cat /proc/ioports

A typical entry contains a starting hexadecimal address, an ending hexadecimal address, and a device or driver label. For example, an illustrative line might look like this:

03f8-03ff : serial
  03f8-03ff : 0000:00:03.0

The exact names and structure vary. The first address is the beginning of the claimed range, and the second is the last address. A label identifies the kernel resource owner or provides a descriptive device name. Indentation can indicate that a narrower child resource is contained within a broader parent resource.

Output elementMeaning
Starting hexadecimal valueFirst address in the claimed I/O range
Ending hexadecimal valueLast address in the claimed I/O range
Range separatorIndicates the address interval
Device or driver labelKernel resource owner or descriptive name
Indented child lineA subresource belonging within a parent resource range

To search for likely serial-port entries, use:

grep -i -E 'serial|tty|uart' /proc/ioports

A traditional COM1 controller is commonly associated with 0x3f8-0x3ff, but a modern system may use a different mapping or have no legacy serial controller at all.

The listing is a snapshot of resources recognized by the current kernel. It can differ because of hardware, firmware settings, kernel versions, loaded drivers, system architecture, and virtual-machine configuration.

Understanding Apparent Resource Conflicts

Two independent devices should not claim the same I/O port range. If a driver cannot reserve the range it needs, the device may fail to initialize or may behave incorrectly. Possible causes include an incorrect legacy configuration, a device already claimed by another driver, or firmware that assigned resources differently than expected.

However, apparent overlap in /proc/ioports is not automatically an error. A broad controller resource can contain narrower child resources, and the indentation and labels may show this parent-child relationship. Examine the structure before concluding that two devices collide.

Kernel messages are useful when investigating a suspected conflict:

dmesg | grep -i -E 'resource|conflict|ioport|serial'

Look for messages stating that a region is busy, could not be reserved, or was assigned to a particular driver. On modern plug-and-play systems, manually changing port assignments is not a normal first solution. Begin by checking firmware configuration, driver support, kernel messages, and whether the hardware actually uses traditional port-mapped I/O.

Troubleshooting Examples

A familiar legacy range is missing: The computer may not contain that controller, firmware may use another assignment, the driver may not be loaded, or the device may use memory-mapped I/O. Review the complete listing and inspect device and driver messages.

Two entries appear to overlap: Compare indentation and labels. A parent range with a child range is normal kernel resource bookkeeping. Treat it as a conflict only when logs or device behavior provide supporting evidence.

A driver cannot reserve an I/O region: Check the requested range and its current owner in /proc/ioports, then inspect dmesg. Verify manual settings only for hardware that actually supports manual resource configuration, particularly older legacy devices.

I/O Ports, IRQs, and DMA

An I/O port is only one category of hardware resource. Devices may also need an IRQ and, especially on older hardware, a DMA channel.

  • IRQ: An interrupt request is a hardware signal asking the CPU to pay attention. A device can use an IRQ to notify the kernel that input arrived, a transfer completed, or an error occurred.
  • DMA: Direct memory access allows a device to transfer data to or from system memory with less direct CPU involvement.
  • I/O port range: This identifies the register addresses through which the CPU and driver communicate with the device controller.

These are separate resources. A device can have an I/O port range, an IRQ, and a DMA channel, but the numbers in one category do not describe the others. For example, an I/O range such as 03f8-03ff is not an IRQ number and is not a DMA channel.

Resource typePurposeTypical Linux inspection sourceExample
I/O port rangeDevice register access/proc/ioports03f8-03ff
IRQHardware notification to the CPU/proc/interruptsKeyboard or network-device interrupt
DMADevice data transfer involving memory/proc/dma where availableLegacy DMA channel use

For comparison, IRQ activity can be viewed with:

cat /proc/interrupts

Older ISA devices often required administrators to coordinate I/O ranges, IRQs, and DMA channels manually. PCI and newer hardware generally use firmware and plug-and-play allocation to assign resources automatically. Linux then receives or discovers those assignments and makes them available to drivers.

Exam-Relevant Points

  • An I/O port, or I/O address, is a hardware-access address or address range, not a TCP or UDP network port.
  • /proc/ioports lists I/O port resources known to the running Linux kernel.
  • Port ranges are normally displayed in hexadecimal and describe inclusive start and end addresses.
  • Nested entries may represent a parent resource and its child resource rather than an error.
  • IRQ signals request CPU attention; DMA transfers data between a device and memory; I/O ports provide device register access.
  • Legacy PC ranges are useful conventions, but they are not guaranteed on every modern Linux system.
  • Modern hardware may use memory-mapped I/O instead of, or in addition to, traditional port-mapped I/O.

Summary

Hardware I/O ports are address locations used by the CPU and device drivers to communicate with physical controllers. Linux reports registered port-mapped resources in /proc/ioports, where hexadecimal ranges and owner labels describe the kernel's current resource view. Legacy ranges can help identify traditional PC hardware, but actual assignments vary. When diagnosing a device, consider its I/O ranges together with its IRQ and DMA resources, and use kernel logs to distinguish a real conflict from normal parent-child resource nesting.