Paging

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
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Paging

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:12 pm, edited 2 times in total.
rdragon

Re:Paging

Post by rdragon »

well.... the website you referenced actually has a few articles describing what paging is, what it does, how to implement it, etc... have you taken a look at them? maybe you could be more specific as to just what you dont understand?
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:Paging

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:12 pm, edited 1 time in total.
rdragon

Re:Paging

Post by rdragon »

"Pagetables":
http://osdev.neopages.net/tutorials/pagetables.php

"Implementing basic Paging" :
http://osdev.neopages.net/tutorials/paging.php

There is a subsection "Memory Management" on that page... take a read through those, it should explain it fairly well.
whyme_t

Re:Paging

Post by whyme_t »

Perica Senjak wrote: Could you please tell me the Name of the tutorials that Explain what Paging is and what it does?
This kind of question is going to rub people up the wrong way. You've seen the site, each subject is in a separate categories, how hard would it be to spend a while looking through the tutorials. You might ask because you don't want to waste precious time looking when you could just ask, but it makes you appear lazy, and no one wants to help a lazy person.

With that said, read through the memory management docs on the above mentioned site. It shouldn't take you long to see implementing basic paging, memory management 1 & 2, and page tables, to name a few.
DarylD

Re:Paging

Post by DarylD »

Yes, read through the tutorials there, they are very good and fairly easy to read, remember if you don't understand something read it again, then use google and come on here as a last result.

This forum is more for design decisions and for questions when people are stuck assuming they have already done their best to figure out the answer.

And Perica, I know you don't listen but paging/segmentation etc is explained thoroughly in books, it may only be at a theoretical level but it maps almost exactly to actual processors. I didn't fully understand it until I read about it (and I re-read the chapter about 10 times!). You really can't do without, they are not *that* expensive and believe me by the end you will feel much more confident of what you are doing.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:Paging

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:12 pm, edited 1 time in total.
whyme_t

Re:Paging

Post by whyme_t »

Perica Senjak wrote: i have already looked and i don't see a tutorial that explains what it is or what it does - I only see tutorials on how to implement it.
Both of Tim's memory management docs explain paging (and other important topics), what it is, but not how to implement it (at a low level). But you do have to take a long time to read and digest it!
DarylD

Re:Paging

Post by DarylD »

I personally prefer the Silbershatz book but that and the tanenbaum one are very similar in what they describe.

Both explain paging and segmentation including virtual memory.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Paging

Post by Pype.Clicker »

Perica Senjak wrote: Could you please tell me the Name of the tutorials that Explain what Paging is and what it does?

Well, i don't understand what Paging Does? What Effect does it make on an OS? How is it used?
The main goal of paging is to allow virtual memory management. Each process can get a 4GB address space and the OS will decide what is physically available and what is on disk. It also gives you the ability to share memory between several process etc.

Imagine that you give several person a empty note pad and provide sheet of paper on demand and you get an idea of what paging is. When you have no more sheet, you (the OS) can decide to get back some sheet you gave, commit their content in your Big Book (the HDD), wipe the sheet and give it back to someone else which needs a fresh, new sheet to continue writing ...

You (the OS) know which sheet is allocated to which "virtual page" of each notepad : this mapping is the PAGE TABLE.

Hope this will help you .
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:Paging

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:13 pm, edited 1 time in total.
DarylD

Re:Paging

Post by DarylD »

To use the pages of memory normally it would make calls to a memory manager using malloc/free and the like. The memory manager will keep tracks of which pages are where. Some pages will be used for application code for examples, others may be used for caching.

Its actually quite conceptually simple once you get your head around it.

Just remember, every byte of memory will need to be speficically allocated before it can be used. I.e. you need to fill page tables and the page directory accordingly.
Post Reply