1.

What do you understand about demand paging in Operating Systems?

Answer»

Demand paging in Operating Systems is a technique for loading pages (In a virtual memory operating system, a page is the smallest unit of data for memory management. A page frame is the smallest fixed-length contiguous unit of physical memory into which the operating system maps memory pages) into memory only when they are needed. Virtual Memory is a storage allocation system that allows secondary memory to be addressed as if it were the main memory. The addresses used by a program to refer to memory are distinct from the addresses used by the memory system to designate physical storage sites, and program generated addresses are automatically translated to machine addresses. The capacity of virtual storage is limited by the computer system's addressing METHOD, and the amount of secondary memory available is determined by the number of main storage sites available rather than the actual number of main storage locations.

A page is only brought into memory in this case when a position on the page is addressed during execution. In general, the steps for bringing a page into the main memory or demand paging are as FOLLOWS:

  • The operating system makes an attempt to access the page.
  • The CPU continues PROCESSING instructions as usual if the page is valid (in memory).
  • A page FAULT trap is done by the operating systems when a page is incorrect.
  • The operating system then checks to see if the memory reference is a legitimate reference to a secondary memory location. If this is not the case, the process will be terminated (illegal memory access). The operating system will have to READ the page in the main memory otherwise.
  • To read the desired page into the main memory, the operating system schedules a disc operation.
  • After that, the operation that was halted due to the operating system trap is restarted or continued.


Discussion

No Comment Found