Memory mapped IO: pros/cons?
Posted: Fri Dec 15, 2006 4:57 am
What are the pros/cons of using memory-mapped io? I would have thought it would be slower, and would risk writing to random IO addresses if code somewhere fails.
The Place to Start for Operating System Developers
http://f.osdev.org/
That's what you would use an MMU for. AFAIK there is no difference in speed at all, btw, it's just a different set of instructions.xlq wrote:I would have thought it would be slower, and would risk writing to random IO addresses if code somewhere fails.
Exactly,memory-mapping I/O has got both advantages and disadvantages.xlq wrote:What are the pros/cons of using memory-mapped io?
(I think)It would be no slower than isolated I/O because it's implemented on hardware layer.It may take the I/O module little extra time to process the uniformed opcodes(or commands) and schedule the common resource.I would have thought it would be slower,
If the hardware doesn't provide such checks or protection,the error would occur.It's the softwares' responsibility to avoid its happening.and would risk writing to random IO addresses if code somewhere fails.
Code: Select all
// Read the mouse on my cool YBox 720 platform
int32* pRegMouseXY = (int32*) 0xffff4000;
int32 nMouseX = pRegMouseXY[0];
int32 nMouseY = pRegMouseXY[1];