page table entries in Operating System

So, before going to the page table entries, we first must know that what is actually a page table. We know the process of paging is used in which the processes are divided into pages so that we don't have to bring the whole process in Main Memory at once, and instead we can just bring some part of it, or we can say some pages of it in the Main Memory. Now, we must know that we have Logical Addresses in our programs or processes which the CPU generates and this is of no use for the Main Memory bcz it needs the Physical Address of the process and here comes the role of Page Table. We maintain a table to store the Address of the various pages of the process, by address we mean the Frame Number, as the pages are stored in the Main Memory and every page has a Frame number associated to it, we must know that Frame Number, which we get using the Page Table, that's it!


If you get this, then we can be friends :)

Now, a page table apart from having the Frame Numbers of Pages of a process, it also contains various other things, like protection bit, caching bit, etc. These are only known as Page Table entries and there are 6 of these:-

Frame Number, Protection Bit, Caching Bit, Reference Bit, Modified Bit, and Present/Absent Bit.

The page table stores the Frame Number, and this Frame Number is used to get the Physical Address. In the Physical Address, there are 2 things, The Frame Number in Binary Form and the Frame Offset which is the same as the Page Offset of Logical Address.

Now, coming to the Page Table Entries...

1) Frame Number- Also known as the Address Translation Bit, this is the main part of a Page table and is always present.

2) Present/Absent Bit- Also known as Valid/Invalid Bit, this bit tells whether the page we are looking for is present in the Main Memory or not. 1 if present else you know it.

3) Protection Bit- This basically tells the type of protection that we need in the Page we are looking for, like Read, Execute, Write, etc.

4) Reference Bit- This one is not so clear to me too, but as far as I understood this, it is used to check whether the page was referenced before or not, maybe this will help in Page Replacement Algos, as I remember the LRU and the MRU Algos, could use this.

5) Caching Bit- Simply, you should understand that we need to control the caching of a page and thus this bit will help us to control that.

6) Modified Bit- Also known as Dirty Bit. This just tells whether the Page has been modified or not, most of these Bits can be understood by their names itself, you know, like Reference means Referenced or not, Modified means Modified or not, fairly simple.

Yeah, the thing to remember in Dirty Bit is that we check if page is modified before or not, so that if there were any modifications then we need to make those changes in the Disk too, or we need to Save them somewhere, just to remember, you can relate this with...if you don't save the changes then this would be a Dirty Work....maybe this is the worst Example I could think of, well, it is what it is.

Congrats if you are here, I did Dispatch Latency and Context Switching today and I think most probably I will blog on that, day after Tomorrow, if I get the time to do so...I will! Or will I...

Anyways, Peace!

It's 10:32 p.m. I have got enough Time today for Duo, and Chess is also left for the Day, Well today's problem was a very interesting one, I will be Submitting it's Explanation now, and will blog on that tomorrow.

Comments

Popular Posts