OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 4:55 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Paging, Memory-Mapped Hardware, and Reserved RAM.
PostPosted: Fri May 12, 2017 3:13 pm 
Offline

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


Top
 Profile  
 
 Post subject: Re: Paging, Memory-Mapped Hardware, and Reserved RAM.
PostPosted: Fri May 12, 2017 4:38 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
they would excactly beheave just like generic memory locations

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Paging, Memory-Mapped Hardware, and Reserved RAM.
PostPosted: Fri May 12, 2017 5:15 pm 
Offline
Member
Member
User avatar

Joined: Mon Jul 18, 2016 2:46 pm
Posts: 170
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.


Top
 Profile  
 
 Post subject: Re: Paging, Memory-Mapped Hardware, and Reserved RAM.
PostPosted: Fri May 12, 2017 6:12 pm 
Offline

Joined: Fri Mar 17, 2017 9:37 pm
Posts: 22
@Ch4ozz, so I'm assuming you remapped reserved regions too? And your computer didn't get mad at you?


Top
 Profile  
 
 Post subject: Re: Paging, Memory-Mapped Hardware, and Reserved RAM.
PostPosted: Fri May 12, 2017 11:16 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: DotBot [Bot], Google [Bot] and 139 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group