Virtual addresses, Operating System

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.

Posted Date: 3/12/2013 5:37:38 AM | Location : United States

Related Discussions:- Virtual addresses, Assignment Help, Ask Question on Virtual addresses, Get Answer, Expert's Help, Virtual addresses Discussions

Write discussion on Virtual addresses
Your posts are moderated
Related Questions
What is monolithic and its diagram

How does communication takes place in a distributed system? Distributed systems depend on the networking for their functionality. A network is a communication path among two

What is virtual file system? A Virtual file system switch (VFS) or Virtual file system is an abstraction layer   on top of a more concrete file system. The purpose of a VFS

Problem: a) The CPU can access 2 storage devices directly. What are these 2 storage devices? b) Define 2 key issues involved in memory management. c) How do processes sha

What is graceful degradation? In multiprocessor systems, failure of single processor will not halt the system, but only slow it down by sharing the work of failure system by ot

UNIX Shell and History feature. 1.Creating a child process. 2.Creating a history feature. With the notes under code. Its exactly "programming project 1 - Unix Shell and History Fea

Write a brief note on demand paging. A demand paging is alike to a paging system with swapping. The Processes reside on the secondary memory while we want to implement a proces

Define multithreading The proficiency of an operating system to execute different parts of a program called threads simultaneously is called as multithreading. A thread is a fl

Q. Explain the actions taken by a kernel to context switch between kernel level threads. Answer: Context switching among kernel threads classically requires saving the value

KERNEL ACTIVITY FOR ULTS: The kernel isn't aware of thread activity but it is still managing process activity. When a thread compose a system call the whole process will be bl