What are the relationships between memory, registers, and ports? What are the differences between them? Do you know them?
1. Differences between registers and memory
Both registers and memory can be used for reading and writing, but register operations have side effects)
Reading a register may change the content in the register. For example, in some device interrupt status registers, the registers are automatically cleared after being read.
Second, I/O space and memory space
Not all architectures have the definition of I/O space. I only know x86 systems, but ARM architecture does not,
On x86, the I/O space and memory are independent. They each have their own bus, and the I/O space is usually 64 KB, that is, 16 bits, and the memory space is 4 GB.
The difference is that
Third, I/O port and I/O memory
With the concept of I/O space, I/O Ports and I/O memory are available.
When a register or memory is in the IO space, it is called an IO port.
When a register or memory is in the memory space, it is called Io memory.
This ing maps virtual addresses to physical addresses through the mmu of the OS.
I may not understand this explanation. It may be better to look at the figure below.
When you are wondering why pointers can be reduced but cannot be added, you may understand page table ing!
For differences between the two in Linux driver development, refer to the following article.
Http://www.360doc.com/content/10/1011/07/1317564_60018145.shtml
Article Source: http://blog.csdn.net/seanyxie/article/details/5946219
[Reprinted] To understand registers, memory, Io space, IO port, Io memory