Sunday, March 23, 2014

Operating System

61.What is virtual memory? 
Virtual memory is a technique that allows the execution of  processes that may not be completely in memory. It is the eparation of user logical memory from physical memory. This separation providesan extremely large virtual memory, when only a smaller physical memory is available.

62.What is Demand paging? 
Virtual memory is commonly implemented by demand paging. In demand paging, the pager brings only those necessary pages into memory instead of swapping in a whole process. Thus it avoids reading into memory pages that will not be used anyway,decreasing the swap time and the amount of physical memory needed.

63.Define lazy swapper. 
Rather than swapping the entire process into main memory, alazy swapper is used. A lazy swapper never swaps a page intomemory unless that page will be needed.

64.What is a pure demand paging?
When starting execution of a process with no pages in memory, the operating system sets the instruction pointer to the first instruction of the process, which is on a non-memory resident page, the process immediately faults for the page. Afterthis page is brought into memory, the process continues to execute, faulting as necessary until every page that it needs isin memory. At that point, it can execute with no more faults. This schema is pure demand paging.

65.Define effective access time. 
Let p be the probability of a page fault (0£p£1). The valueof p is expected to be close to 0; that is, there will be only afew page faults. The effective access time isEffective access time = (1-p) * ma + p * page fault time.ma : memory-access time


66.Define secondary memory. 
This memory holds those pages that are not present in mainmemory. The secondary memory is usually a high speed disk. It is known as the swap device, and the section of the disk used for this purpose is known as swap space.

67.What is the basic approach of page replacement? 
  If no frame is free is available, find one that is notcurrently being used and free it. A frame can be freed by writingits contents to swap space, and changing the page table toindicate that the page is no longer in
memory.Now the freed frame can be used to hold the page for which the process faulted.

68.What are the various page replacement algorithms used for page 
replacement?
• FIFO page replacement
• Optimal page replacement
• LRU page replacement
• LRU approximation page replacement
• Counting based page replacement
• Page buffering algorithm.

69.What are the major problems to implement demand paging? 
The two major problems to implement demand paging is developing
a. Frame allocation algorithm
b. Page replacement algorithm

70.What is a reference string? 
An algorithm is evaluated by running it on a particularstring of memory references and computing the number of pagefaults. The string of memory reference is called a reference string. 

No comments:

Post a Comment