I/O Interfaces & Buses

How are the registers and memory of a PCI Express device made accessible to the CPU?

  1. AAt boot the OS or firmware reads the size each device requests and assigns an address in its BAR (base address register), making it visible as memory addresses
  2. BEach device has a fixed address set at manufacture
  3. CThe CPU cannot read device registers; everything goes through DMA
Show answer and explanation

Answer: A. At boot the OS or firmware reads the size each device requests and assigns an address in its BAR (base address register), making it visible as memory addresses

A PCI Express device reports the sizes of its registers and memory through its BARs. At boot, the firmware or OS examines every connected device (enumeration) and assigns addresses so they do not collide. Afterward the CPU operates the device by reading and writing those addresses like ordinary memory. A device plugged in later is assigned addresses the same way.

  • A. Correct. They are used as memory-mapped I/O.
  • B. Fixed addresses would collide between devices.
  • C. The CPU reads and writes registers directly.
Practice this topic Back to topic

More I/O Interfaces & Buses questions

  1. What is a characteristic of MSI (message-signaled interrupts) used in PCI Express?
  2. What is the difference between bandwidth and latency in interface performance?
  3. On a link with 10 GB/s bandwidth and 1 µs latency, roughly how long does it take to send 64 bytes once (time = latency + size ÷ bandwidth)?
  4. Which is most effective for speeding up a program that exchanges thousands of small pieces of data with a device one at a time?
  5. Which statement about how USB communication works is correct (for conventional USB, excluding USB4)?