I got a strange text by 'catting' the /proc/ioports file of my PC linux,
0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0070-007f : rtc0
...
What I dont understand is the anterior part of each entry, look at the first entry for example, does it mean 31(0x1f in hex) ports occupied by dma1? If true, I cannot imagine how many ports on x86 processor, since I know there are only several 8bit ports on a 8bit-MCU.
Can anyone detail the meaning of the number, and the io ports of x86 processor?
It's the list of I/O ports regions that have been claimed by kernel drivers using the request_region
kernel function. So it's not the complete list of I/O ports or devices available, only the ones that have been claimed by various kernel drivers. The request_region
mechanism allows the kernel to prevent multiple drivers from talking to the same device.
/proc/ioports lists the ranges and names of ioports provided by device drivers in the Linux kernel of ports of the port ranges claimed and handled by said drivers.
As an example, io ports 0070 - 007f are claimed by the RTC Linux kernel driver.
One would assume that said port ranges claimed by the driver correspond to the appropriate port ranges offered by the respective hardware but you should note that there is actually no mechanism that ensures that indeed they are.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With