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

Describe the buddy system of memory allocation, Buddy system of memory allo...

Buddy system of memory allocation Free memory is used to maintain in linked lists, each of similar sized blocks. Every block is of size 2^k. When some memory is needed by a th

Define a set of methods that allow executing a program, A set of methods th...

A set of methods that allow executing a program which is not completely in memory   is called A set of methods that allow executing a program which is not completely in memory

Define an assembly language, Define an assembly language  Assembly lan...

Define an assembly language  Assembly language stands for a Low level programming language

Explain how a domain user account is authenticated, Question: a) The fo...

Question: a) The following questions pertain to User and Group accounts in Windows XP: i) Give four differences between a Power User and a Guest User account. ii) Explain h

Is disk scheduling except fcfs scheduling, Q. Is disk scheduling except FC...

Q. Is disk scheduling except FCFS scheduling useful in a single-user environment? describe your answer. Answer: In a single-user environment the I/O queue typically is empty.

Process, what common event leads to the creation of a process?

what common event leads to the creation of a process?

SYSTEM PROGRAMMING, advantages and disadvantages of monolithic and layered ...

advantages and disadvantages of monolithic and layered approach

What problems arise if the directory is a general graph, What problems aris...

What problems arise if the directory structure is a general graph? Searching for a particular file may result in searching the similar directory many times. Deletion of the fil

State critical section problem, State critical section problem? Discuss thr...

State critical section problem? Discuss three solutions to solve the critical section problem. C-S Problem:- n processes all competing to use some shared data Every

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