World's most popular travel blog for travel bloggers.

Valid-invalid bit in a process page table

, , No Comments
Problem Detail: 

Valid-invalid bit is used to indicate whether a page in a process's page table is valid or not. Why is it needed?

Does that mean that each page table has a certain minimum size, i.e. it can accommodate minimum of n references to pages and if the number of pages being referenced by the process is less than n, then this bit is required to tell that only few entries are valid in the page table?

If the page table is built and populated dynamically, then the page table will only have as many entries as needed by process and there will no need for this bit, as all entries will be valid.

Other tags are page-table, valid-invalid bit

Asked By : user2555595

Answered By : Wandering Logic

Typically the page table is a tree of fixed size pages. So each node of the page table contains a fixed number of entries. Here's the picture of a 32-bit x86 multi-level page table from Wikipedia:

Wikipedia 32-bit x86 page table picture

Each page on x86 is $2^{12}=4096$ bytes. Each page table entry is 4 bytes = 32 bits, and contains a pointer to the beginning of another page. Each page table page contains exactly $2^{10}=1024$ page table entries. Since the pages are aligned we know that the bottom 12 bits of the pointer would all be zeros, so we use those bits for status bits (including the invalid bit). The invalid bit is necessary if you want to make the table sparse in any way.

Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/18293

0 comments:

Post a Comment

Let us know your responses and feedback