Paging Tutorial | Viral Patel >> viralpatel.net
  viralpatel.net
    Viral's home page
    Home     Taj OS     Old Site     Guest Book     Sitemap Admin    

TAJ  An Object Oriented Operating System


Menu
    Home
    FAQ
    Screen Shots
    Download
    Tutorials
 News
       Operating System
       Linux
       GNU
       Google
    Any Comments?




Comments
Timmy
08 Jan 2008
Interesting. I see alot of calls for sou..
>>  show
Jagan
22 Nov 2007
Exlnt................! =D> ..
>>  show
Kaffeefilter
16 Nov 2007
Hi Viral, I must admit I haven't read m..
>>  show

Paging


Introduction

Paging is another memory management technique which widely uses virtual memory concept. When paging is used, the processor divides the linear address space into fixed-size pages (of 4KBytes, 2 MBytes, or 4 MBytes in length) that can be mapped into physical memory and/or disk storage. When a program (or task) references a logical address in memory, the processor translates the address into a linear address and then uses its paging mechanism to translate the linear address into a corresponding physical address.


Linear Page Translation during Paging

If the page containing the linear address is not currently in physical memory, the processor generates a page-fault exception (#14). The exception handler for the page-fault exception typically directs the operating system to load the page from disk storage into physical memory. When the page has been loaded in physical memory, a return from the exception handler causes the instruction that generated the exception to be restarted. The information that the processor uses to map linear addresses into the physical address space and to generate page-fault exceptions (when necessary) is contained in page directories and page tables stored in memory.


Page-Directory & Page-Table Entries




Advantages of paging

  • Address translation: each task has the same virtual address
  • Address translation: turns fragmented physical addresses into contiguous virtual addresses
  • Memory protection (buggy or malicious tasks can't harm each other or the kernel)
  • Shared memory between tasks (a fast type of IPC, also conserves memory when used for DLLs)
  • Demand loading (prevents big load on CPU when a task first starts running, conserves memory)
  • Memory mapped files
  • Virtual memory swapping (lets system degrade gracefully when memory required exceeds RAM size)


Rate This Article
 
Ok Useful Very Useful Excellent
 Ok
                     
                 
52%
 Useful
   
                                 
10%
 Very Useful
     
                                 
13%
 Excellent
           
                           
26%
This Article is viewed 1743 times


Created on: 24 June 2005
Updated on: 27 Jan 2006


 Best Viewed at 1024x768 resolution Copyright © 2005-2006, Viral Patel  

Get High Quality Hosting Starting For Only One Cent At Tomorrow Hosting

These ZendURL Ads Are Not Forced. Click Here To Disable Them Permanently!