OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 17, 2024 8:22 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How do I access pages
PostPosted: Wed Jun 03, 2020 1:46 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
Hello,
I am currently improving my paging code. I was curious as to how I should access the tables themselves, since the cpu can only use physical address for these tables. I have been accessing them via physical addresses, as the first 4MB are identity mapped. Thank you for your help.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: How do I access pages
PostPosted: Wed Jun 03, 2020 6:17 pm 
Offline
Member
Member

Joined: Mon Feb 02, 2015 7:11 pm
Posts: 898
Map the pages you want to access in your page table. Then you can access them using virtual addresses.

_________________
https://github.com/kiznit/rainbow-os


Top
 Profile  
 
 Post subject: Re: How do I access pages
PostPosted: Wed Jun 03, 2020 11:57 pm 
Offline
Member
Member

Joined: Thu May 25, 2017 10:41 pm
Posts: 29
You might want to look into recursive paging.


Top
 Profile  
 
 Post subject: Re: How do I access pages
PostPosted: Thu Jun 04, 2020 7:56 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
This article: https://os.phil-opp.com/paging-implementation/ discusses the problem, and various solutions. I favour the "Map the Complete Physical Memory" approach.


Top
 Profile  
 
 Post subject: Re: How do I access pages
PostPosted: Fri Jun 05, 2020 9:54 am 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
Thank you for your help. I have decided to use recursive paging and it works quite well for me.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


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: SemrushBot [Bot] and 342 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