OSDev.org
https://forum.osdev.org/

Paging help
https://forum.osdev.org/viewtopic.php?f=1&t=56344
Page 1 of 1

Author:  YDeeps1 [ Thu Jun 30, 2022 4:08 am ]
Post subject:  Paging help

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!

Author:  iansjack [ Thu Jun 30, 2022 5:54 am ]
Post subject:  Re: Paging help

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.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/