-
Recovery from Deadlock?
Process Termination:->Abort all deadlocked processes.->Abort one process at a time until the deadlock cycle is eliminated.->In which order should we choose to abort?Priority of the process.How long process has computed, and how much longer to completion.Resources the process has used. Resources process needs to complete.How many processes will need to be terminated? Is process interactive...
-
Binding of Instructions and Data to Memory?
Address binding of instructions and data to memory addresses can happen at three different stagesCompile time: If memory location known a priori, absolute code can be generated; must recompile code if starting location changes.Load time: Must generate relocatable code if memory location is not known at compile time.Execution time: Binding delayed until run time if the...
-
What are Dynamic Loading, Dynamic Linking and Overlays?
Dynamic Loading:->Routine is not loaded until it is called->Better memory-space utilization; unused routine is never loaded.->Useful when large amounts of code are needed to handle infrequently occurring cases.->No special support from the operating system is required implemented through program design.Dynamic Linking:->Linking postponed until execution time.->Small piece of code,...
-
What are the different Dynamic Storage-Allocation methods?
How to satisfy a request of size n from a list of free holes?First-fit: Allocate the first hole that is big enough.Best-fit: Allocate the smallest hole that is big enough; must search entire list, unless ordered by size. It produces the smallest leftover hole.Worst-fit: Allocate the largest hole; must also search entire list. Produces the largest leftover hole. First-fit...
-
What is fragmentation? Different types of fragmentation?
Fragmentation occurs in a dynamic memory allocation system when many of the free blocks are too small to satisfy any request. External Fragmentation: External Fragmentation happens when a dynamic memory allocation algorithm allocates some memory and a small piece is left over that cannot be effectively used. If too much external fragmentation occurs, the amount of usable memory is drastically...
-
Explain Segmentation with paging?
Segments can be of different lengths, so it is harder to find a place for a segment in memory than a page. With segmented virtual memory, we get the benefits of virtual memory but we still have to do dynamic storage allocation of physical memory. In order to avoid this, it is possible to combine segmentation and paging into a two-level virtual memory system. Each segment descriptor points to page...
-
Under what circumstances do page faults occur? Describe the actions taken by the operating system when a page fault occurs?
A page fault occurs when an access to a page that has not been brought into main memory takes place. The operating system verifies the memory access, aborting the program if it is invalid. If it is valid, a free frame is located and I/O is requested to read the needed page into the free frame. Upon completion of I/O, the process table and page table are updated and the instruction is restarted.
-
Why are page sizes always powers of 2?
Recall that paging is implemented by breaking up an address into a page and offset number. It is most efficient to break the address into X page bits and Y offset bits, rather than perform arithmetic on the address to calculate the page number and offset. Because each bit position represents a power of 2, splitting an address between bits results in a page size that is a power of 2.
-
On a system with paging, a process cannot access memory that it does not own; why? How could the operating system allow access to other memory? Why should it or should it not?
An address on a paging system is a logical page number and an offset. The physical page is found by searching a table based on the logical page number to produce a physical page number. Because the operating system controls the contents of this table, it can limit a process to accessing only those physical pages allocated to the process. There is no way for a process to refer to a page it does not...
Windows Interview Questions
Ans