Page 1 of 1

Paging, Memory-Mapped Hardware, and Reserved RAM.

Posted: Fri May 12, 2017 3:13 pm
by Izzette
Do the page tables alter the addresses of memory mapped hardware, can I leave them unmapped?
Do I need to ensure my page tables map the same virtual addresses to reserved/unusable RAM regions?

Re: Paging, Memory-Mapped Hardware, and Reserved RAM.

Posted: Fri May 12, 2017 4:38 pm
by Geri
they would excactly beheave just like generic memory locations

Re: Paging, Memory-Mapped Hardware, and Reserved RAM.

Posted: Fri May 12, 2017 5:15 pm
by Ch4ozz
What I did is even re-mapping all my devices to a special address so I can make use of the whole memory linear without any used blocks in between.
So yes, it behaves exactly like normal memory too.

Re: Paging, Memory-Mapped Hardware, and Reserved RAM.

Posted: Fri May 12, 2017 6:12 pm
by Izzette
@Ch4ozz, so I'm assuming you remapped reserved regions too? And your computer didn't get mad at you?

Re: Paging, Memory-Mapped Hardware, and Reserved RAM.

Posted: Fri May 12, 2017 11:16 pm
by Brendan
Hi,
Izzette wrote:Do the page tables alter the addresses of memory mapped hardware, can I leave them unmapped?
Paging is a "virtual address to physical address" conversion. It doesn't alter the physical addresses of anything (but allows you to map whatever you like at whatever virtual addresses you like).
Izzette wrote:Do I need to ensure my page tables map the same virtual addresses to reserved/unusable RAM regions?
You need to ensure that you map whatever you like at whatever virtual addresses you like.

For example, for a device with memory mapped registers, a micro-kernel would probably create a new virtual address space when starting the device driver, and that device driver might tell the micro-kernel where it wants its device's registers to be mapped in its virtual address space, and the device's memory mapped registers shouldn't/wouldn't be mapped anywhere else.

Also note that this applies to normal RAM too. For example, my OS is currently doing something I call "physical address space randomisation" (to reduce the risk of various security problems, like this) where it's extremely impractical to pre-determine which physical page of RAM the OS will use for any virtual page of RAM (starting from extremely early during boot, such that it's impossible for me to determine which physical pages will be used by my own kernel's code).


Cheers,

Brendan