title: Clarifying who decides memory mappings and port IO mappings
body: <p>I studied a bit about port mapped IO and memory mapped IO and I figured out how the first works (not the second yet), so if you have something well-explained about how memory mapped IO is performed (I heard it's about intercepting page faults by the OS to reroute them to the devices) please let me know.</p>
  
  <p>Anyway my question is: communicating with the internal real time clock (RTS) uses an I/O Port mapping and you need to use outb(byte_selected,0x70) and similar functions on the 0x70 port.. who decided the 0x70 port? How can I figure out where are they declared? And what about memory mapping IOs? Who decides what addresses are associated to what devices? And if I added my own device to the system, how would its memory be mapped?</p>
  
  <p>I've still a lot of confusion about OS-hw communications..</p>