Subex Sample Technical Placement Paper
Subex Sample Technical Placement Paper
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
4. What is a Map? ANS: A Map is an Array, which contains the addresses of the free space in the swap device that are allocatable resources, and the number of the resource units available there. This allows First-Fit allocation of contiguous blocks of a resource. Initially the Map contains one entry address (block offset from the starting of the swap area) and the total number of resources. Kernel treats each unit of Map as a group of disk blocks. On the allocation and freeing of the resources Kernel updates the Map for accurate information. 5. What is the main goal of the Memory Management? ANS: It decides which process should reside in the main memory, Manages the parts of the virtual address space of a process which is non-core resident, Monitors the available main memory and periodically write the processes into the swap device to provide more processes fit in the main memory simultaneously. 6. What is the difference between an Interface and an Abstract class? ANS: An Abstract class declares have at least one instance method that is declared abstract which will be implemented by the subclasses. An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior. 7. What scheme does the Kernel in Unix System V follow while choosing a swap device among the multiple swap devices? ANS: Kernel follows Round Robin scheme choosing a swap device among the multiple swap devices in Unix System V. 8. What do you mean by u-area (user area) or u-block? ANS: This contains the private data that is manipulated only by the Kernel. This is local to the Process, i.e. each process is allocated a u area.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
9. What is a Region? ANS: A Region is a continuous area of a processs address space (such as text, data and stack). The kernel in a Region Table that is local to the process maintains region. Regions are sharable among the process. 10. Is the Process before and after the swap are the same? Give reason. ANS: Process before swapping is residing in the primary memory in its original form. The regions (text, data and stack) may not be occupied fully by the process, there may be few empty slots in any of the regions and while swapping Kernel do not bother about the empty slots while swapping the process out. After swapping the process resides in the swap (secondary memory) device. The regions swapped out will be present but only the occupied region slots but not the empty slots that were present before assigning. While swapping the process once again into the main memory, the Kernel referring to the Process Memory Map, it assigns the main memory accordingly taking care of the empty slots in the regions. 11. What are the events done by the Kernel after a process is being swapped out from the main memory? ANS: When Kernel swaps the process out of the primary memory, it performs the following: Kernel decrements the Reference Count of each region of the process. If the reference count becomes zero, swaps the region out of the main memory, Kernel allocates the space for the swapping process in the swap device, Kernel locks the other swapping process while the current swapping operation is going on, The Kernel saves the swap address of the region in the region table. 12. What is Expansion swap?
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
ANS: At the time when any process requires more memory than it is currently allocated, the Kernel performs Expansion swap. To do this Kernel reserves enough space in the swap device. Then the address translation mapping is adjusted for the new virtual address space but the physical memory is not allocated. At last Kernel swaps the process into the assigned space in the swap device. Later when the Kernel swaps the process into the main memory this assigns memory according to the new address translation mapping. 13. What is Fork swap? ANS: Fork () is a system call to create a child process. When the parent process calls fork() system call, the child process is created and if there is short of memory then the child process is sent to the read-to-run state in the swap device, and return to the user state without swapping the parent process. When the memory will be available the child process will be swapped into the main memory. 14. What are the criteria for choosing a process for swapping into memory from the swap device? ANS: The resident time of the processes in the swap device, the priority of the processes and the amount of time the processes had been swapped out. 15. How the Swapper works? ANS: The swapper is the only process that swaps the processes. The Swapper operates only in the Kernel mode and it does not uses System calls instead it uses internal Kernel functions for swapping. It is the archetype of all kernel process. 16. What are the bits that support the demand paging? ANS: Valid, Reference, Modify, Copy on write, Age. These bits are the part of the page table entry, which includes physical address of the page and protection bits. Page address Age Copy on write Modify Reference Valid Protection.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
17. What are the criteria for choosing a process for swapping out of the memory to the swap device? ANS: The processs memory resident time, Priority of the process and The nice value. 18. What is the working set of a process? ANS: The set of pages that are referred by the process in the last n, references, where n is called the window of the working set of the process. 19. How the Kernel handles the fork () system call in traditional Unix and in the System V Unix, while swapping? ANS: Kernel in traditional Unix makes the duplicate copy of the parents address space and attaches it to the childs process, while swapping. Kernel in System V Unix, manipulates the region tables, page table, and pfdata table entries, by incrementing the reference count of the region table of shared regions. 20. What is the principle of locality? ANS: Its the nature of the processes that they refer only to the small subset of the total data space of the process. I.e. the process frequently calls the same subroutines or executes the loop instructions. 21. Difference between the fork () and vfork () system call? ANS: During the fork () system call the Kernel makes a copy of the parent processs address space and attaches it to the child process. But the vfork () system call do not makes any copy of the parents address space, so it is faster than the fork () system call. The child process as a result of the vfork () system call executes exec () system call. The child process from vfork () system call executes in the parents address space (this can overwrite the parents data and stack () which suspends the parent process until the child process exits.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
22. What is the window of the working set of a process? ANS: The window of the working set of a process is the total number in which the process had referred the set of pages in the working set of the process. 23. What is BSS (Block Started by Symbol)? ANS: A data representation at the machine level, that has initial values when a program starts and tells about how much space the kernel allocates for the un-initialized data. Kernel initializes it to zero at runtime. 24. What are conditions for a machine to support Demand Paging? ANS: Memory architecture must base on Pages, The machine must support the restartable instructions. 25. What is called a page fault? ANS: Page fault is referred to the situation when the process addresses a page in the working set of the process but the process fails to locate the page in the working set. And on a page fault the kernel updates the working set by reading the page from the secondary device. 26. What is Page-Stealer process? ANS: This is the Kernel process that makes rooms for the incoming pages, by swapping the memory pages that are not the part of the working set of a process. Page-Stealer is created by the Kernel at the system initialization and invokes it throughout the lifetime of the system. Kernel locks a region when a process faults on a page in the region, so that page stealer cannot steal the page, which is being faulted in. 27. What are data structures that are used for Demand Paging? ANS: Kernel contains 4 data structures for Demand paging. They are, Page table entries, Disk block descriptors,
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
Page frame data table (pfdata), Swap-use table. 28. Name two paging states for a page in memory? ANS: The two paging states are: The page is aging and is not yet eligible for swapping, The page is eligible for swapping but not yet eligible for reassignment to other virtual address space. 29. When is a system in safe state? ANS: The set of dispatchable processes is in a safe state if there exists at least one temporal order in which all processes can be run to completion without resulting in a deadlock. 30. What are the phases of swapping a page from the memory? ANS: Page stealer finds the page eligible for swapping and places the page number in the list of pages to be swapped. Kernel copies the page to a swap device when necessary and clears the valid bit in the page table entry, decrements the pfdata reference count, and places the pfdata table entry at the end of the free list if its reference count is 0. 31. Explain Belady's Anomaly. ANS: Also called FIFO anomaly. Usually, on increasing the number of frames allocated to a process' virtual memory, the process execution is faster, because fewer page faults occur. Sometimes, the reverse happens, i.e., the execution time increases even when more frames are allocated to the process. This is Belady's Anomaly. This is true for certain page reference patterns. 32. What is page fault? Its types? ANS: Page fault refers to the situation of not having a page in the main memory when any process references it. There are two types of page fault : Validity fault, Protection fault.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
33. Explain the concept of Reentrancy. ANS: It is a useful, memory-saving technique for multiprogrammed timesharing systems. A Reentrant Procedure is one in which multiple users can share a single copy of a program during the same period. Reentrancy has 2 key aspects: The program code cannot modify itself, and the local data for each user process must be stored separately. Thus, the permanent part is the code, and the temporary part is the pointer back to the calling program and local variables used by that program. Each execution instance is called activation. It executes the code in the permanent part, but has its own copy of local variables/parameters. The temporary part associated with each activation is the activation record. Generally, the activation record is kept on the stack. Note: A reentrant procedure can be interrupted and called by an interrupting program, and still execute correctly on returning to the procedure. 34. In what way the Fault Handlers and the Interrupt handlers are different? ANS: Fault handlers are also an interrupt handler with an exception that the interrupt handlers cannot sleep. Fault handlers sleep in the context of the process that caused the memory fault. The fault refers to the running process and no arbitrary processes are put to sleep. 35. What is validity fault? ANS: If a process referring a page in the main memory whose valid bit is not set, it results in validity fault. The valid bit is not set for those pages: That are outside the virtual address space of a process, that are the part of the virtual address space of the process but no physical address is assigned to it. 36. At what mode the fault handler executes? ANS: At the Kernel Mode.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus
37. What does the swapping system do if it identifies the illegal page for swapping? ANS: If the disk block descriptor does not contain any record of the faulted page, then this causes the attempted memory reference is invalid and the kernel sends a Segmentation violation signal to the offending process. This happens when the swapping system identifies any invalid memory reference. 38. What do you mean by the protection fault? ANS: Protection fault refers to the process accessing the pages, which do not have the access permission. A process also incur the protection fault when it attempts to write a page whose copy on write bit was set during the fork () system call. 39. What is cycle stealing? ANS: We encounter cycle stealing in the context of Direct Memory Access (DMA). Either the DMA controller can use the data bus when the CPU does not need it, or it may force the CPU to temporarily suspend operation. The latter technique is called cycle stealing. Note that cycle stealing can be done only at specific break points in an instruction cycle. 40. What is meant by arm-stickiness? ANS: If one or a few processes have a high access rate to data on one track of a storage disk, then they may monopolize the device by repeated requests to that track. This generally happens with most common device scheduling algorithms (LIFO, SSTF, C-SCAN, etc). Highdensity multisurface disks are more likely to be affected by this than low density ones.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus