Paging, Memory-Mapped Hardware, and Reserved RAM.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Izzette
Posts: 22
Joined: Fri Mar 17, 2017 9:37 pm

Paging, Memory-Mapped Hardware, and Reserved RAM.

Post 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?
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

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

Post by Geri »

they would excactly beheave just like generic memory locations
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Ch4ozz
Member
Member
Posts: 170
Joined: Mon Jul 18, 2016 2:46 pm
Libera.chat IRC: esi

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

Post 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.
Izzette
Posts: 22
Joined: Fri Mar 17, 2017 9:37 pm

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

Post by Izzette »

@Ch4ozz, so I'm assuming you remapped reserved regions too? And your computer didn't get mad at you?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

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

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply