I have been learning about Operating Systems the past few months through MIT's XV6 book (RISC-V edition).<p>One thing that isn't made very clear is how computers in the real world "know" the memory layout for memory mapped i/o (like, which addresses map to which devices in the physical address space).<p>I have a couple of questions:
1. Whose responsibility is it to define the memory layout (is it the ISA's? The MMU's?)
2. Do kernels know beforehand the layout? Or is it more common for them to discover at runtime?<p>Thanks
PCs enumerate hardware with<p><a href="https://en.wikipedia.org/wiki/ACPI" rel="nofollow">https://en.wikipedia.org/wiki/ACPI</a><p>In that process the OS figures out the attached hardware and how to access it.
RISC-V does majorly use the Device Tree[0].<p>[0] <a href="https://en.wikipedia.org/wiki/Devicetree" rel="nofollow">https://en.wikipedia.org/wiki/Devicetree</a>