3 ms·
Ask HN: How does an OS become aware of memory layout?
I have been learning about Operating Systems the past few months through MIT's XV6 book (RISC-V edition).
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).
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?
Thanks
- snvzz 4y agoRISC-V does majorly use the Device Tree[0]. [0] https://en.wikipedia.org/wiki/Devicetree https://en.wikipedia.org/wiki/Devicetree
- PaulHoule 4y agoPCs enumerate hardware with https://en.wikipedia.org/wiki/ACPI https://en.wikipedia.org/wiki/ACPI In that process the OS figures out the attached hardware and how to access it.