OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:23 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Paging help
PostPosted: Thu Jun 30, 2022 4:08 am 
Offline
Member
Member

Joined: Tue Aug 31, 2021 7:25 am
Posts: 67
I am quite new to paging and I am quite confused by it.
Mainly I am wondering what the first steps should be to enabling paging - what should I do?
How should I handle pages during context switches?
Why do both the page directory and entry want a 12 bit address? What are the differences?
I am getting weird undefined behavior after enabling paging and so I assume I need to perform some kind of kernel mapping - how do I make it map to a physical address by default?
Thanks!


Top
 Profile  
 
 Post subject: Re: Paging help
PostPosted: Thu Jun 30, 2022 5:54 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
Although written with Rust in mind, rather than C, this article https://os.phil-opp.com/paging-introduction/ gives a good introduction to paging and how it is implemented on x86 processors.

As to your specific question about context switches, each process will have its own page table; when switching processes you update cr3 to point to the appropriate table.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 81 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