Virtual addresses, Operating System

Assignment Help:

Virtual addresses are made up of two parts: the ?rst part is the page number, and the second part is an offset inside that page. Suppose our pages are 4kb (4096 = 212 bytes) long, and that

our machine uses 32-bit addresses. Then we can have at most 232 addressable bytes of memory; therefore, we could ?t at most 232 / 212 = 220 pages. This means that we need 20 bits to address any page. So, the page number in the virtual address is stored in 20 bits, and the offset is stored in the remaining 12 bits.

Now suppose that we have one such page table per process. A page table with 220 entries, each entry with, say, 4 bytes, would require 4Mb of memory! This is somehow disturbing because a machine with 80 processes would need more than 300 megabytes just for storing page tables! The solution to this dilemma is to use multi-level page tables. This approach allows page tables to point to other page tables, and so on. Consider a 1-level system. In this case, each virtual address can be divided into an offset (10 bits), a level-1 page table entry (12 bits), and a level-0 page table entry (10 bits). Then if we read the 10 most signi?cant bits of a virtual address, we obtain an entry index in the level-0 page; if we follow the pointer given by that entry, we get a pointer to a level-1 page table. The entry to be accessed in this page table is given by the next 12 bits of the virtual address.

We can again follow the pointer speci?ed on that level-1 page table entry, and ?nally arrive at a physical page. The last 10 bits of the VA address will give us the offset within that PA page. A drawback of using this hierarchical approach is that for every load or store instruction we have to perform several indirections, which of course makes everything slower. One way to minimize this problem is to use something called Translation Lookaside Buffer (TLB); the TLB is a fast, fully associative memory that caches page table entries. Typically, TLBs can cache from 8 to 2048 page table entries.


Related Discussions:- Virtual addresses

Explain banker''s algorithm, Banker's Algorithm In this analogy ...

Banker's Algorithm In this analogy Customers ≡ processes Units ≡ resources, say, tape drive Ba

PSEUDO CODE FOR PROGRAM, THE PROGRAM WILL CHOOSE TWO RANDOM NUMBERS,THEN PR...

THE PROGRAM WILL CHOOSE TWO RANDOM NUMBERS,THEN PRINT THEM OUT AS AN ADDITION PROBLEM.THE PROGRAM WILL THEN ASK THE USERTO ENTER THE CORRECT ANSWER.IF THE ANSWER IS CORRECT,THE PRO

What are the reasons for process suspension, Q. What are the reasons for pr...

Q. What are the reasons for process suspension? Reasons for process suspension 1.  Swapping 2.  Timing 3.  Interactive user request 4.  Parent process request

Explain about deadlock prevention, Explain about deadlock prevention? I...

Explain about deadlock prevention? In order for the occurrence of deadlock, the four conditions like mutual exclusion, hold and wait, no pre-emption and  circular wait must hap

Define a layer that is not of an io management module, Define a layer that ...

Define a layer that is not of an IO management module  MCS that is Management Control System is not of an IO management module

Analysis of Pseudocode Sempahore Solution, Gopher Gallery consists of a sho...

Gopher Gallery consists of a shopping mall and a cart ride that covers the 150 acre habitat. There are m visitors and n single-person vehicles. Visitors stroll around the mall at

Determine a parser which is a variant of top-down parsing, Determine a pars...

Determine a parser which is a variant of top-down parsing without backtracking Recursive Descend parser is a variant of top-down parsing without backtracking.

Deadlock detection, Deadlocks can be detected while the program is running,...

Deadlocks can be detected while the program is running, by running cycle detection algorithms on the graph that de?nes the current use of resources. De?ne this graph as follows:

How the nested macro calls are expanded, How the Nested Macro calls are exp...

How the Nested Macro calls are expanded LIFO (Last in First out)

Explain the concept of reentrancy, Explain the concept of Reentrancy? I...

Explain the concept of Reentrancy? It is a useful, memory-saving method for multiprogrammed timesharing systems. A Reentrant Procedure is one in which many users can share a si

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd