Port IO: Difference between revisions

no edit summary
[unchecked revision][unchecked revision]
(Wrote some info on a frequently asked question)
 
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1:
The x86 architecture separates the address space in two programmatically distinct groups: memory and ports. In ancient history, memory was used as the storage of data where reads and writes would not have side-effects, and ports were used to control external hardware, which needed different timings to work. Which is also why accessing ports is so much slower than accessing memory. Many other common architectures have a unified space, where devices run at the same speed as memory, or where the address space is divided into blocks with separately configurable properties.
 
Modern X86x86 hardware tends more and more toward the unified space, but still contains the port for legacy reasons.
 
== How to access ports ==
Line 7:
 
== Which ports belong to this device ==
There are three groups of devices, each requiring a different approach. The first group contains all PC-AT hardware, devices like [[PIT|timers]], [[PIC|interrupt controllers]], [[PS2Keyboard Controller|PS/2]] ports, [[Serial Ports|serial]] and parallel port, floppy and [[IDE|disk drive]], and the [[VGA Hardware|VGA]]. Back in the old days devices were attached to fixed addresses, and they remained there for backwards compatibility. The programming information will tell you the ports used.
 
The second group is plug-and-play hardware. Most modern cards and optional features are PCI, AGP or PCI express. At boot, their requirements are checked, and the BIOS will assign port ranges to each device. Enumerating the [[PCI]] bus will list all these devices, and can also tell you what ports (and memory mapped ranges) they use.
Anonymous user