UNIT – 1 TWO MARKS 1. What is an operating system? An operating system is a program that manages the computer hardware. it act as an intermediate between a users of a computer and the computer hardware. It controls and coordinates the use of the hardware among the various application programs for the various users. 2. List the objectives of an operating system. The three main objectives of an operating system are: Convenience: It makes a computer more convenient to use. Efficiency: An operating system allows the system resources to be used in an efficient manner. Ability to evolve: It must permit introduction of new system functions without interfacing with service. 3.What is the kernel? A more common definition is that the OS is the one program running at all times on the computer ,usually called the kernel, with all else being application programs. 4. What is meant by dual mode of operation? To ensure protection two separate modes of executions are carried out. They are: 1.User mode 2.Monitor mode (or) System mode (or) Supervisor mode. 5. Define Batch processing. To speed up processing jobs with similar needs were grouped together and were run through the computer as a group. 6. What is called multiprocessor operating system? The connection of multiple CPU’s into a single system increases the power of computing . Depending on how they are connected and what is shared ,these systems are called as parallel computer or multiple processor. 7. List the advantages of distributed systems. The advantages are: 1.Resource sharing. 2.Computation Speed –Up. 3.Reliability. 4.Communication. 5.Incremental growth. Operating systems 8. What are the two categories of distributed systems? The two categories of distributed system are: Loosely coupled systems: Each processor has its own local memory. They communicate with one another through various communication lines. Tightly coupled systems: Processors share memory and a clock. Communication takes place through the shared memory. 9. Differentiate Tightly coupled systems and loosely coupled systems? Loosely coupled systems 1. Each processor has its own local memory Tightly coupled systems 1. Common memory is shared by many processors 2. Each processor can communicate with 2. No need of any communication lines other all through communication lines 10. What is graceful degradation? In multiprocessor systems, failure of one processor will not halt the system, but only slow it down by sharing the work of failure system by other systems. This ability to continue providing service is proportional to the surviving hardware is called graceful degradation. 11. Define multitasking. Multitasking is a logical extension of multiprogramming. Multiple jobs are executed by the CPU switching between them, but the switches occur so frequently that the users may interact with each program while it is running. 12.What is real time system? A real time system has well defined ,fixed time constraints. Processing must be done within the defined constraints, or the system will fail. It is often used as a control device in a dedicated application. 13. Explain the hard real time system. A hard real time operating system has well-defined, fixed time constraints. Processing must be done within the defined constraints. A hard real time system is often used as a control device in a dedicated application. 14. Write the factors included in the design of an operating system. The OS depends on two factors: Architectural features of the computer system which it executes. Features of its application domain. 15. What are previliged instructions? Operating systems Some of the machine instructions that may cause harm to a system are designated as privileged instructions. The hardware allows the privileged instructions to be executed only in monitor mode. 16.What are system calls? System calls provide an interface between the user and the OS .The user can request the OS to perform some tasks through system calls. When a system call is executed, it is treated as by the hardware as software interrupt. 17. List the five categories of system calls. The five major categories of system calls are: 1. Process control system calls 2. File manipulation system calls 3. Device maintenance system calls 4. Information maintenance system calls 5. communication system calls. 18. What are system programs? System programs provide a convenient environment for program development and execution. They are provided to satisfy many common user requests. 19. List all the categories of system programs. There are several categories of system programs .They are: File manipulation Status information File modification Programming language support Program loading and execution communications Application programs. 20. List the services of an operating system. The Operating system services are: Program execution I/O operations File-system manipulation Error detection. Resource allocation Accounting Protection 21. Give the applications of mainframe systems. The applications are: 1.High end web servers Operating systems 2. Servers for large –scale electronic commerce sites. 3. Servers for business to business transactions. 22. What is program management and memory management? The program management deals with initiation and termination of programs, program scheduling and dispatching. The memory management deals with virtual memory management ,allocation and deallocation of memory. 23.What is I/O and file management? The I/O management deals with I/O interrupt processing, scheduling and I/O initiation operations. The file management performs the creation, storage, data access and program in files. 24. How to define the goals and specification of the system? At the highest level the system design is affected by the choice of hardware and system type: batch, time shared, single user, multiuser, distributed , real time or general purpose. Beyond this, the requirement are much harder to specify .They can be divided into two basic groups viz user goals and system goals. 25. What is meant by a process? A process is a program in execution. A process is more than the program code. It is an active entity and it includes the process stack, containing temporary data and the data section contains global variables. 26. Mention the events that are involved in the creation of a process. The events that are involved in the creation of a process are: Initialization of a system Execution of a process creation system call by a running process. The user’s request to create a new process. Batch job initiation. 27. What are called daemons? The process that stay in the background to handle some activities such as email, web pages, news, printing are called as daemons. 28. Differentiate process and a program Program 1. A static object or passive entity Process 1.A dynamic object or active entity. that can exist in a file. 2. A sequence of instructions . 2. A sequence of instruction executions. Operating systems 3. Exist at a single place in space 3.A process exists in a limited span of time and continues to exist as time goes forward. 29.Give the states of a process. Each process may be in one of the following states: New: The process is being created. Running: Instructions are being executed. Waiting: The process is waiting for some event to occur. Ready: The process is waiting to be assigned to a processor. Terminated: The process has finished execution. 30. What is process control block? Each process is represented in the OS by a process control block. It contain many pieces of information associated with a specific process. 31. Discuss the process table entries. The process table entry contains information such as the process state , program counter value , stack pointer value, memory allocation details, open file status, accounting information and scheduling information. 32. What is scheduler? What are the types of schedulers? Generally a process migrates between the various scheduling queues throughout its lifetime . That part of the OS that selects a process from that queues in some fashion is called as a scheduler. The types of schedulers are: Long term scheduler Short term scheduler. Medium term scheduler 33.What are the uses of job queues, ready queues and device queues? As a process enters a system they are put in to a job queue. This queues consist of all jobs in the system. The processes that are residing in main memory and are ready and waiting to execute are kept on a list called ready queue. The list of processes waiting for a particular I/O devices kept in the device queue. 34.What is meant by context switch? Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process. This task is known as context switch. 35.What is independent process? A process is independent it cannot affect Or be affected by the other processes executing in the system. Any process does not share data with other process is a independent process. 36.What is co-operative process? A process is co-operating if it can affect or be affected by the other processes executing in the system. Any process that share data with other process is a co-operating process. Operating systems 37. What are the benefits OS co-operating process? Information sharing. Computation speed up. Modularity. Convenience. 38.How can a user program disturb the normal operation of the system? Issuing illegal I/O operation. By accessing memory locations with in the OS itself. Refusing to relinquish the CPU. 39.State the advantage of multiprocessor system? Increased throughput. Economy of scale. Increased reliability. 40. What is the use of inter process communication. Inter process communication provides a mechanism to allow the co-operating process to communicate with each other and synchronies their actions without sharing the same address space. It is provided a message passing system. 41.What is a thread? A thread otherwise called a lightweight process (LWP) is a basic unit of CPU utilization, it comprises of a thread id, a program counter, a register set and a stack. It shares with other threads belonging to the same process its code section, data section, and operating system resources such as open files and signals. 42. What are the benefits of multithreaded programming? The benefits of multithreaded programming can be broken down into four major categories: Responsiveness Resource sharing Economy Utilization of multiprocessor architectures 43.Compare user threads and kernel threads. User threads: User threads are supported above the kernel and are implemented by a thread library at the user level. Thread creation & scheduling are done in the user space, without kernel intervention. Therefore they are fast to create and manage blocking system call will cause the entire process to block Kernel threads: Kernel threads are supported directly by the operating system .Thread creation, scheduling and management are done by the operating system. Therefore they are slower to create & manage compared to user threads. If the thread performs a blocking system call, the kernel can schedule another thread in the application for execution. Operating systems 44. What is the use of fork and exec system calls? Fork is a system call by which a new process is created. Exec is also a system call, which is used after a fork by one of the two processes to place the process memory space with a new program. 45. Define thread cancellation & target thread. The thread cancellation is the task of terminating a thread before it has completed. A thread that is to be cancelled is often referred to as the target thread. For example, if multiple threads are concurrently searching through a database and one thread returns the result, the remaining threads might be cancelled. 46. What are the different ways in which a thread can be cancelled? Cancellation of a target thread may occur in two different scenarios: Asynchronous cancellation: One thread immediately terminates the target thread is called asynchronous cancellation. Deferred cancellation: The target thread can periodically check if it should terminate, allowing the target thread an opportunity to terminate itself in an orderly fashion. 16 MARKS 1. Explain the various types of computer systems. Mainframe systems o Batch systems o Multiprogrammed systems o Time-Sharing systems Desktop systems Multiprocessor systems o Symmetric Multiprocessing o ASymmetric Multiprocessing Distributed systems o Client-server systems o Peer-to-peer systems Clustered systems o Asymmetric clustering o Symmetric clustering Real- Time systems o Hard real-time system o Soft real-time system Handheld systems 1. i) Explain how hardware protection can be achieved and discuss in detail the dual mode of operations. (8 Marks) (AU – NOV 2010) - Dual-Mode operation a. User mode b. Monitor mode Operating systems - I/O Protection Memory Protection CPU Protection (ii) Explain in detail any two operating system structures. (8 Marks) - Simple Structure a. MS-DOS Layer structure b. UNIX system structure - Layered Approach - Microkernel Approach 2. Explain the concept of Virtual Machine with neat sketch - System model: virtual machine - Implementation - Benefits - Java - Java Virtual Machine (JVM) 3. What is meant by a process? Explain states of process with neat sketch and discuss the process state transition with a neat diagram. - program in execution - Process states: a. New b. Running c. Waiting d. Ready e. Terminated 4. (i) Explain Process Control Block. (4 Marks) (AU – APR/MAY 2010) - used to represent each process in the OS - also called task control block - It includes: a. Process state b. Program counter c. CPU registers d. CPU-scheduling information e. Memory-management information f. Accounting information g. I/O status information (ii) Describe the differences among short-term, medium-term, and long-term scheduling. (4 Marks) - short-term scheduler Job scheduler (from job pool to memory) - long-term scheduler CPU scheduler (from memory to CPU) - medium-term scheduler swapping (iii) Describe the Inter Process communication in Linux. (8 Marks) - Synchronization and signals - Passing of data among processes a. Pipe Operating systems b. Shared memory c. Shared memory with IPC 6. Explain about inter process communication (IPC). - Message–Passing system - Naming - Direct communication - Symmetric & Asymmetric communication - Indirect communication - Synchronization - Buffering 7.Explain about cooperating processes in detail. - A process is co-operating if it can affect or be affected by the other processes executing in the system. - Reasons: a. Information sharing b. Computation speedup c. Modularity d. Convenience - Producer-consumer problem 8. Explain Client-Server communication with an example. - Sockets - RPC (Remote Procedure Call) - RMI (Remote Method Invocation) 9. (i) Define thread and list the benefits of multithreading. Explain user and kernel threads. (8 Marks) - light weight process (LWP) - Benefits of multithreading: a. Responsiveness b. Resource Sharing c. Economy d. Utilization of multiprocessor architectures - User threads supported above the kernel and are implemented by a thread library at the user level - Kernel threads supported directly by the OS. (ii) Explain the various multithreading models. (8 Marks) - Many-to-one model - One-to-one model - Many-to-many model 10. Explain the various threading issues. - fork and exec system calls - Cancellation a. Asynchronous cancellation b. Deferred Cancellation - Signal Handling Operating systems - Thread pools Thread-specific data UNIT – 2 TWO MARKS 1.What is called throughput? The number of processes that are completed per time unit is known as throughput. It is nothing but a measure of work.. 2. Define CPU scheduling. CPU scheduling is the process of switching the CPU among various processes. CPU scheduling is the basis of multiprogrammed operating systems. By switching the CPU among processes, the operating system can make the computer more productive. 3. What is preemptive and nonpreemptive scheduling? Under nonpreemptive scheduling once the CPU has been allocated to a process, the process keeps the CPU until it releases the CPU either by terminating or switching to the waiting state. Preemptive scheduling can preempt a process which is utilizing the CPU in between its execution and give the CPU to another process. 4. Define turnaround time. The interval from the time of submission of a process to the time of completion is known as the turnaround time. 5.Define response time. The time from the submission of a request until the first response is produced is known as a response time. 6.What is dispatcher? The dispatcher is the module that gives control of the CPU to the process selected by the short-term scheduler. This function involves: Switching context Switching to user mode Jumping to the proper location in the user program to restart that program. 7. What is dispatch latency? The time taken by the dispatcher to stop one process and start another running is known as dispatch latency. 8. List the various CPU scheduling criteria. Operating systems - CPU utilization - Throughput - Response time - Waiting time - Turnaround time 9. Give the basic idea for the priority scheduling. A priority is associated with each process and the CPU is allocated to the process with the highest priority. 10.Give the functions of the dispatcher. The functions are: Switching context Switching to user mode Jumping to the proper location in the user program to restart that program. 11. Mention the circumstances where the CPU scheduling takes place. When a process switches from the running state to the waiting state . When a process switches from the running state to the ready state. When a process switches from the waiting state to the ready state. when a process terminates. 12. What is called a time quantum? The small time unit is called a time quantum. The time quantum is generally from 1 to 100 milliseconds. 13. What is meant by aging? Aging is a technique of gradually increasing the processes priority that wait in the system for a long time. Thereby indefinite waiting or starvation can be prevented. 14. What is the function of short-term scheduler? This scheduler selects from the process in memory that are ready to execute and allocates the CPU to one of them. 15. What is meant by mutual exclusion? Some way of making sure that if one process is using the shared variable of the file, the other process is excluded from doing the something is called mutual exclusion. 16. What is called critical section? Each process has a segment of code ,in which it may be changing common variables, updating a table, writing a file and so on. That segment of code is called as critical section. Operating systems 17. What is meant by race condition? When several process access and manipulate the same data concurrently, the outcome of the execution depends on the particular order in which the access takes place. This is known as race condition. 18. What is called busy waiting and spin lock? If a variable is tested continuously until some value appears, then it is called busy waiting. The lock that uses busy waiting is called a spin lock. 19. Mention the requirements that must be satisfied by any solution to critical section problem. A solution to the critical section problem must satisfy the following three requirements: Mutual exclusion Progress Bounded waiting. 20. Define entry section and exit section. The critical section problem is to design a protocol that the processes can use to cooperate. Each process must request permission to enter its critical section. The section of the code implementing this request is the entry section. The critical section is followed by an exit section. The remaining code is the remainder section. 21. Give two hardware instructions and their definitions which can be used for implementing mutual exclusion. TestAndSet { target = true; return rv; } Swap void Swap (boolean &a, boolean &b) { boolean temp = a; a = b; b = temp; } 22. What are semaphores? Operating systems A semaphore is a synchronization tool. It is an integer variable(s) that apart from initialization is accessed only through two standard atomic operations they are :wait and signal. 23.What are binary semaphores? A binary semaphore with an integer value that can range only between 0 and 1.A binary semaphore can be easily implemented depending on the underlying hardware and architecture. 24.Explain the monitor. The monitor is a collection of procedures, variables and data structures that are graphed together in a special kind of module or package. 25.Define deadlock. A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set can cause. 26. What are the conditions that are necessary for the occurrence of deadlock? The four conditions that are necessary for the occurrence of deadlock are: Mutual exclusion Hold and wait No preemption Circular wait 27. What is meant by circular wait condition? A situation where there is a circular chain of two (or) more process, each of which is waiting for a resource held by the next member in the chain. 28. What is the sequence in which resources may be utilized? Under normal mode of operation, a process may utilize a resource in the following sequence: Request: The process made a request to the system for the resource. Use: The process can operate on the resource. Release: The process releases the resource. 29. What is a resource-allocation graph? Deadlocks can be described more precisely in terms of a directed graph called a system resource-allocation graph. This graph consists of a set of vertices V and a set of edges E. The set of vertices V is partitioned into two different types of nodes; P the set consisting of all active processes in the system and R the set consisting of all resource types in the system. Operating systems 30. Define request edge and assignment edge. A directed edge from process Pi to resource type Rj is denoted by Pi Rj; it signifies that process Pi requested an instance of resource type Rj and is currently waiting for that resource. A directed edge from resource type Rj to process Pi is denoted by Rj Pi, it signifies that an instance of resource type has been allocated to a process Pi. A directed edge Pi Rj is called a request edge. A directed edge Rj Pi is called an assignment edge. 31. Mention the method for handling deadlocks. There are three different methods for dealing with deadlock. They are: (i) We can use a protocol to ensure that the system will never enter a deadlock state (ii) We can allow the system to enter a deadlock state and then recover (iii) We can ignore the problem all together and pretend that deadlocks never occur in the system. 32. Give the classes of resources The classes of resources are: Internal resources: Resources used by the system such as process control block(PCB),I/O channels. Central memory: Memory used by a user program Job resources: Assignable devices and files. Swappable space: Memory blocks on secondary storage for use in swapping process. 33. What are the methods for handling deadlocks? The deadlock problem can be dealt with in one of the three ways: a. Use a protocol to prevent or avoid deadlocks, ensuring that the system will never enter a deadlock state. b. Allow the system to enter the deadlock state, detect it and then recover. c. Ignore the problem all together, and pretend that deadlocks never occur in the system. 34.What is called a safe state and an unsafe state? A state is safe if the system can allocate resources to each process in some order and still avoid a deadlock. A system is in safe state only if there exists a safe sequence. A sequence of processes <P1,P2,….Pn> is a safe sequence for the current allocation state if, for each Pi, the resource that Pi can still request can be satisfied by the current available resource plus the resource held by all the Pj, with j<i. if no such sequence exists, then the system state is said to be unsafe. 35. Define deadlock avoidance. An alternative method for avoiding deadlocks is to require additional information about how resources are to be requested. Each request requires the system consider the Operating systems resources currently available, the resources currently allocated to each process, and the future requests and releases of each possible future deadlock. 36.Give the advantages of deadlock avoidance The deadlock avoidance are: (i) It is not necessary to preempt and rollback processes as in deadlock detection (ii) It is less restrictive than deadlock prevention. 37. Define deadlock prevention. Deadlock prevention is a set of methods for ensuring that at least one of the four necessary conditions like mutual exclusion, hold and wait, no preemption and circular wait cannot hold. By ensuring that that at least one of these conditions cannot hold, the occurrence of a deadlock can be prevented. 38. What is Banker’s algorithm? Banker’s algorithm is a deadlock avoidance algorithm that is applicable to a resourceallocation system with multiple instances of each resource type. The two algorithms used for its implementation are: a. Safety algorithm: The algorithm for finding out whether or not a system is in a safe state. b. Resource-request algorithm: if the resulting resource-allocation is safe, the transaction is completed and process Pi is allocated its resources. If the new state is unsafe Pi must wait and the old resource-allocation state is restored. 39.Define safe allocation state A resource allocation state is said to be a safe allocation state if there exists atleast one sequence of resource allocations and releases by which all processes in the system can 16 MARKS 1. (i) Distinguish between preemptive and non-preemptive scheduling. Explain each type with an example. (8) (APRIL/MAY 2010) - Preemptive scheduling - Non-preemptive scheduling - Example (ii) What is synchronization? Explain how semaphores can be used to deal with n-process critical section problem. (8) (APRIL/MAY 2010) - Synchronization - Semaphore - Solution to n-process critical section problem using semaphore Operating systems 2. (i) Discuss the issues in Multiple-processor and real-time scheduling. (8) (APRIL/MAY 2010) - Multiprocessor scheduling - Real-time scheduling (ii) Explain Banker’s deadlock-avoidance algorithm with an illustration. (8) (APRIL/MAY 2010) - Safety Algorithm - Resource Request Algorithm 3. Write about the various CPU scheduling algorithms. - First-come, first-served scheduling - Shortest-job-first scheduling - Priority Scheduling - Round-robin scheduling - Multilevel queue scheduling - Multilevel feedback queue scheduling 4. What is critical section problem and explain two process solutions and multiple process solutions? - Critical section problem definition - Two process solutions - Algorithm 1, 2 & 3 5. Explain what semaphores are, their usage, implementation given to avoid busy waiting and binary semaphores. - Semaphore definition - Usage for mutual exclusion and process synchronization - Implementation to avoid spinlock using block and wakeup - Binary semaphores 5. Explain the classic problems of synchronization. - The bounded-buffer problem with structure - The readers-writers problem with structure - The dining-philosophers problem with structure 6. Write about critical regions and monitors. - Critical region definition - Implementation of the conditional-region construct - Monitor definition - Syntax of monitor - Schematic view of monitors - Monitor with condition variables - Monitor solution to dining-philosopher problem Operating systems 7. Give a detailed description about deadlocks and its characterization - Deadlock definition - Deadlock conditions a. Mutual exclusion b. Hold and wait c. No pre-emption d. Circular wait - Resource allocation graph 8. Write in detail about deadlock avoidance. - Safe state and safe sequence - Diagram for safe, unsafe & deadlock states - Resource-allocation graph algorithm - Banker’s Algorithm a. Safety Algorithm b. Resource Request Algorithm 9. Explain the Banker’s algorithm for deadlock avoidance. - Deadlock avoidance definition - Data structures used - Safety algorithm - Resource request algorithm - Example 10. Give an account about deadlock detection. - Single instance of each resource type - Wait-for graph - Several instances of a resource type - Detection-algorithm usage 11. What are the methods involved in recovery from deadlocks? - Process termination - Resource pre-emption Operating systems UNIT – 3 TWO MARKS 1. Define logical address and physical address. An address generated by the CPU is referred as logical address. An address seen by the memory unit that is the one loaded into the memory address register of the memory is commonly referred to as physical address. 2. What is logical address space and physical address space? The set of all logical addresses generated by a program is called a logical address space; the set of all physical addresses corresponding to these logical addresses is a physical address space. 3. What is the main function of the memory-management unit? The runtime mapping from virtual to physical addresses is done by a hardware device called a memory management unit (MMU). 4. Define dynamic loading. To obtain better memory-space utilization dynamic loading is used. With dynamic loading, a routine is not loaded until it is called. All routines are kept on disk in a relocatable load format. The main program is loaded into memory and executed. If the routine needs another routine, the calling routine checks whether the routine has been loaded. If not, the relocatable linking loader is called to load the desired program into memory. 5. Define dynamic linking. Dynamic linking is similar to dynamic loading, rather that loading being postponed until execution time, linking is postponed. This feature is usually used with system libraries,such as languagesubroutine libraries. A stub is included in the image for each library-routine reference. The stub is a small piece of code that indicates how to locate the appropriate memory-resident library routine, or how to load the library if the routine is not already present. 6.What are overlays? To enable a process to be larger than the amount of memory allocated to it, overlays are used. The idea of overlays is to keep in memory only those instructions and data that are needed at a given time. When other instructions are needed, they are loaded into space occupied previously by instructions that are no longer needed. 7. Define swapping. A process needs to be in memory to be executed. However a process can be swapped temporarily out of memory to a backing store and then brought back into memory for continued execution.This process is called swapping. 8. What are the common strategies to select a free hole from a set of available holes? The most common strategies are Operating systems a. First fit b. Best fit c. Worst fit 9. What do you mean by best fit? Best fit allocates the smallest hole that is big enough. The entire list has to be searched, unless it is sorted by size. This strategy produces the smallest leftover hole. 10.What do you mean by first fit? First fit allocates the first hole that is big enough.Searching can either start at the beginning of the set of holes or where the previous first-fit search ended. Searching can be stopped as soon as a free hole that is big enough is found. 11.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 separation of user logical memory from physical memory. This separation provides an extremely large virtual memory, when only a smaller physical memory is available. 12.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. 13. Define lazy swapper. Rather than swapping the entire process into main memory, a lazy swapper is used. A lazy swapper never swaps a page into memory unless that page will be needed. 14. 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. After this page is brought into memory, the process continues to execute, faulting as necessary until every page that it needs is in memory. At that point, it can execute with no more faults.This schema is pure demand paging. 15. List the requirements of memory management The five requirements of the memory management are: Relation Protection Sharing Logical organization Physical organization 16. Define effective access time. Let p be the probability of a page fault (0£p£1). The value of p is expected to be close to 0; that is, there will be only a few page faults. The effective access time is Effective access time = (1-p) * ma + p * page fault time, where ma : memory-access time Operating systems 17. Define secondary memory. This memory holds those pages that are not present in main memory. The secondary memory is usually a high speed disk. It is known as the swap evice, and the section of the disk used for this purpose is known as swap space. 18. What is the basic approach of page replacement? If no frame is free is available, find one that is not currently being used and free it. A frame can be freed by writing its contents to swap space, and changing the page table to indicate that the page is no longer in memory. Now the freed frame can be used to hold the page for which the process faulted. 19. 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. 20. 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 21. What is a reference string? An algorithm is evaluated by running it on a particular string of memory references and computing the number of page faults. The string of memory reference is called a reference string. 22. What is called internal fragmentation? The space at the partition end that is unused process by a process is wasted. The partition that has a wasted space is called internal fragmentation. 23. What is called external fragmentation? When there are more memory unallocated than the size of the wasting process that memory cannot be used for the process. This space wasted not allocated to any partition is called external fragmentation. 24. What is meant by compaction? Compaction is one solution to the external fragmentation. This techniques shuffles the memory contents to place all the free memory together in one large block. 25. What is meant by page frames and pages? Physical memory is broken into fixed size blocks called frames ,Logical memory is broken into blocks of the same size called pages. Operating systems 26. Define segmentation. Segmentation is a memory management technique. In this method, the program and its associated data are divided into a number of smaller blocks are called segments. 27.What is meant by TLB? TLB stands for Translation Look aside Buffer .It is a special high speed cache for storing page table entries. 28. What is called as page fault? When the process tries to access locations that are not in memory, an error is generated known as page fault. 29. What is known as dynamic relocation? A process that assigns new absolute addresses to a computer program during execution so that the program may be executed from a different area of main storage. 30. What is known as Thrashing? Thrashing is a phenomenon in virtual memory schemes, in which the processor spends most of its time swapping pieces rather than executing instructions. 31. Define prepaging The retrieval of pages other than the one demanded by a page fault. The hope is that the additional pages will be needed in the near future conserving disk I/O. 32. Define hashing The selection of a storage location for an item of data by calculating the address as a function of the contents of the data. This technique complicates the storage allocation function but in rapid random retrieval. 33. What are local and global page replacements? Local replacement means that an incoming page is brought in only to the relevant process' address space. Global replacement policy allows any page frame from any process to be replaced. The latter is applicable to variable partitions model only. 34. Define Belady's Anomaly. 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. 35. In loading programs into memory, what is the difference between load-time dynamic linking and run-time dynamic linking? For load-time dynamic linking: Load module to be loaded is read into memory. Any reference to a target external module causes that module to be loaded and the references are updated to a relative address from the start base address of the application module. With run-time dynamic loading: Some of the linking is postponed until actual reference during execution. Then the correct module is loaded and linked. 36.What are demand- and pre-paging? Operating systems With demand paging, a page is brought into memory only when a location on that page is actually referenced during execution. With pre-paging, pages other than the one demanded by a page fault are brought in. The selection of such pages is done based on common access patterns, especially for secondary memory devices. 16 MARKS 1. Explain about contiguous memory allocation. Contiguous allocation Memory protection with diagram Memory allocation First fit Best fit Worst fit Fragmentation 2. Give the basic concepts about paging. Paging definition Basic method-page, frame, page table, page number & page offset Paging hardware diagram TLB with diagram Protection-protection bits & valid-invalid bits 3. Write about the techniques for structuring the page table. Hierarchical paging-two-level & multi-level with diagram Hashed page table with diagram Inverted page table with diagram 4. Explain the basic concepts of segmentation. User view of program Segmentation definition Hardware used with diagram-segment table, base, limit & offset Protection and sharing with diagram Fragmentation 5. Explain the various page replacement strategies. Page replacement-basic scheme with diagram FIFO page replacement Optimal page replacement LRU page replacement LRU approximation page replacement Counting-based page replacement Page buffering algorithm Operating systems 6. Consider the following page reference string: 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1 Calculate the number of page faults would occur for the following page replacement algoritm with frame size of 3 and 5. (i) LRU (ii) FIFO (iii) Optimal Ans: (i) LRU Page Faults = 12 (ii) FIFO Page Faults = 15 (iii) Optimal Page Faults = 9 Operating systems Also do the above for frame size=5 UNIT – 4 TWO MARKS 1. What is a file? A file is a named collection of related information that is recorded on secondary storage. A file contains either programs or data. A file has certain “structure” based on its type. File attributes: Name, identifier, type, size, location, protection, time, date File operations: creation, reading, writing, repositioning, deleting, truncating, appending, renaming File types: executable, object, library, source code etc. 2. List the various file attributes. A file has certain other attributes, which vary from one operating system to another, but typically consist of these: Name, identifier, type, location, size, protection, time, date and user identification . 3. What are the various file operations? The six basic file operations are Creating a file Writing a file Reading a file Repositioning within a file Deleting a file Truncating a file 4. What are the information associated with an open file? Several pieces of information are associated with an open file which may be: File pointer File open count Disk location of the file Access rights 5. What are the different accessing methods of a file? The different types of accessing a file are: Sequential access: Information in the file is accessed sequentially Direct access: Information in the file can be accessed without any particular order. Other access methods: Creating index for the file, indexed sequential access method (ISAM) etc. 6. What is Directory? The device directory or simply known as directory records information- such as name, location, size, and type for all files on that particular partition. The directory can be viewed as a symbol table that translates file names into their directory entries. Search for a file Operating systems Create a file Delete a file Rename a file List directory Traverse the file system 8. What are the most common schemes for defining the logical structure of a directory? The most common schemes for defining the logical structure of a directory Single-Level Directory Two-level Directory Tree-Structured Directories Acyclic-Graph Directories General Graph Directory 9. Define UFD and MFD. In the two-level directory structure, each user has her own user file directory (UFD). Each UFD has a similar structure, but lists only the files of a single user. When a job starts the system’s master file directory (MFD) is searched. The MFD is indexed by the user name or account number, and each entry points to the UFD for that user. 10. What is a path name? A pathname is the path from the root through all subdirectories to a specified file. In a two-level directory structure a user name and a file name define a path name. 11. What are the various layers of a file system? The file system is composed of many different levels. Each level in the design uses the feature of the lower levels to create new features for use by higher levels. Application programs Logical file system File-organization module Basic file system I/O control Devices 12. What are the structures used in file-system implementation? Several on-disk and in-memory structures are used to implement a file system Operating systems a. On-disk structure include Boot control block Partition block b. In-memory structure include In-memory partition table In-memory directory structure System-wide open file table Per-process open table 13. What are the functions of virtual file system (VFS)? It has two functions a. It separates file-system-generic operations from their implementation defining a clean VFS interface. It allows transparent access to different types of file systems mounted locally. b. VFS is based on a file representation structure, called a vnode. It contains a numerical value for a network-wide unique file .The kernel maintains one vnode structure for each active file or directory. 14. Define seek time and latency time. The time taken by the head to move to the appropriate cylinder or track is called seek time. Once the head is at right track, it must wait until the desired block rotates under the read- write head. This delay is latency time. 15. What are the allocation methods of a disk space? Three major methods of allocating disk space which are widely in use are a. Contiguous allocation b. Linked allocation c. Indexed allocation 16. What are the advantages of Contiguous allocation? The advantages are a. Supports direct access b. Supports sequential access c. Number of disk seeks is minimal. 17. What are the drawbacks of contiguous allocation of disk space? The disadvantages are a. Suffers from external fragmentation b. Suffers from internal fragmentation c. Difficulty in finding space for a new file d. File cannot be extended e. Size of the file is to be declared in advance 18. What are the advantages of Linked allocation? The advantages are a. No external fragmentation b. Size of the file does not need to be declared 19. What are the disadvantages of linked allocation? The disadvantages are Operating systems a. Used only for sequential access of files. 20. What are the advantages of Indexed allocation? The advantages are a. No external-fragmentation problem b. Solves the size-declaration problems. c. Supports direct access 21. How can the index blocks be implemented in the indexed allocation scheme? The index block can be implemented as follows a. Linked scheme b. Multilevel scheme c. Combined scheme 22. What are Inodes? A file is represented by an inode. An inode is a record that stores most of the information about a specific file on the disk. 23.What is meant by file organization? File organization refers to the physical order of records in a file, as determined by the access method used to store and retrieve them. 24. Mention the use of File Allocation Table(FAT). File Allocation Table is used to indicate the physical location on secondary storage of the space allocated to a file. There is one file allocation table for each file. 25.What is a hash file? This is a file in which records are accessed according to the value of a key field. Hashing is used to locate a record on the basis of its key value. 26.What is an indexed file? A file in which records are accessed according to the value of key fields is known as an indexed file. An index is required that indicates the location of each record on the basis of each key value. 27.What does the FCB consists of? A FCB(File Control Block) contains information like ownership, permission and file location contents. Operating systems 28.What are the different types of access? Different types of operations may be controlled in access type. These are 1.Read 2.Write 3.Execute. 4.Append 5.Delete 6.List 27.What are the types of path names? Path names can be of two types. a) Absolute path name. b) Relative path name. Absolute path name: Begins at the root and follows a path down to the specified file, giving the directory names on the path. Relative path name: Defines a path from the current directory. 28.What is meant by Locality of Reference? The locality model states that, as a process executes, it moves from locality to locality. Locality are of two types. 1) Spatial locality 2) Temporal locality. Operating systems 16 MARKS 1. What are files and explain the access methods for files? - File definition - Attributes, operations and types - Sequential access with diagram - Direct access - Other access methods-index with diagram 2. Explain the schemes for defining the logical structure of a directory. - Single level directory with diagram - Two level directory with diagram - Tree structured directory with diagram - Acyclic-graph directory with diagram - General graph directory with diagram 3. Write notes about the protection strategies provided for files. - Types of access - Access control-Access control list (ACL) Three classifications-owner, group & universe - Other protection approaches-passwords 4. Explain the allocation methods for disk space. - Contiguous allocation advantage, disadvantage & diagram - Linked allocation advantage, disadvantage & diagram - Indexed allocation advantage, disadvantage & diagram 5. What are the various methods for free space management? - Bit vector with example - Linked list with diagram - Grouping - Counting 6. Explain the backup and recovery of files. Operating systems - Consistency Checking - Backup and restore 7. Discuss about the LINUX file system in detail. - Virtual File System(VFS) - The Linux Ext2fs File System - Ext2fs Block-Allocation Policies - The Linux Proc File System 8. Describe Windows XP file system in detail. - File System — Internal Layout - File System — Recovery - File System — Security - File System — Compression - File System — Reparse Points Operating systems UNIT – 5 TWO MARKS 1. Define rotational latency and disk bandwidth. Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head. The disk bandwidth is the total number of bytes transferred, divided by the time between the first request for service and the completion of the last transfer. 2. How free-space is managed using bit vector implementation? The free-space list is implemented as a bit map or bit vector. Each block is represented by 1 bit. If the block is free, the bit is 1; if the block is allocated, the bit is 0. 3. Define buffering. A buffer is a memory area that stores data while they are transferred between two devices or between a device and an application. Buffering is done for three reasons a. To cope with a speed mismatch between the producer and consumer of a data stream b. To adapt between devices that have different data-transfer sizes c. To support copy semantics for application I/O 4. Define caching. A cache is a region of fast memory that holds copies of data. Access to the cached copy is more efficient than access to the original. Caching and buffering are distinct functions, but sometimes a region of memory can be used for both purposes. 5. Define spooling. A spool is a buffer that holds output for a device, such as printer, that cannot accept interleaved data streams. When an application finishes printing, the spooling system queues the corresponding spool file for output to the printer. The spooling system copies the queued spool files to the printer one at a time. 6. What are the various disk-scheduling algorithms? a. FCFS Scheduling b. SSTF Scheduling c. SCAN Scheduling d. C-SCAN Scheduling e. LOOK scheduling 7. What is low-level formatting? Operating systems Before a disk can store data, it must be divided into sectors that the disk controller can read and write. This process is called low-level formatting or physical formatting. Low-level formatting fills the disk with a special data structure for each sector. The data structure for a sector consists of a header, a data area, and a trailer. 8. What is the use of boot block? For a computer to start running when powered up or rebooted it needs to have an initial program to run. This bootstrap program tends to be simple. It finds the operating system on the disk loads that kernel into memory and jumps to an initial address to begin the operating system execution. The full bootstrap program is stored in a partition called the boot blocks, at fixed location on the disk. A disk that has boot partition is called boot disk or system disk. 9.What is sector sparing? Low-level formatting also sets aside spare sectors not visible to the operating system. The controller can be told to replace each bad sector logically with one of the spare sectors. This scheme is known as sector sparing or forwarding. 10.What is sector sparing? The controller can be told to move each sector by one position from the bad sector to the spare sector. This scheme is known as sector slipping. 11.What is a disk cache? A buffer, usually kept in main memory, that functions as a cache of disk blocks between disk memory and the rest of main memory. 12. Mention the pair of wires that can be used for handshaking between the DMA controller and the device controller. DMA-request DMA-Acknowledge 13. What are the three CPU-Instruction cycles to poll a device? 1. Read a device register 2. Logical-and to extract a status bit 3. Branch if not zero. 14. What are the two ways of communication between the processor and the controller to accomplish an I/O transfer? 1. Through the use of special I/O instructions 2. Memory-mapped I/O 15. What is a controller? Controller is a collection of electronics that can operate a port, a bus or a device. 16. What is the use of disk allocation table? This table is used to indicate which blocks on secondary storage are free and available for allocation to files. 17. What are the types of devices recognized by the UNIX system? UNIX recognizes five types of devices. They are: Operating systems (i) (ii) (iii) (iv) (v) Disk drives Tape drives Terminals Communication lines. Printers 18. Give the purposes of RAID. The RAID is used to serve three purposes. They are: (i) Providing data storage reliability. (ii) Fast acess to data. (iii) High data transfer rates. 19. What is cycle stealing? 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. 20. What is meant by arm-stickiness? 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). High-density multisurface disks are more likely to be affected by this than low density ones. 21. What are the stipulations of C2 level security? C2 level security provides for: Discretionary Access Control Identification and Authentication Auditing Resource reuse 22. What is busy waiting? The repeated execution of a loop of code while waiting for an event to occur is called busy-waiting. The CPU is not engaged in any real productive activity during this period, and the process does not progress toward completion. 23. When does the condition 'rendezvous' arise? In message passing, it is the condition in which, both, the sender and receiver are blocked until the message is delivered. 24. What is a trap and trapdoor? Trapdoor is a secret undocumented entry point into a program used to grant access without normal methods of access authentication. A trap is a software interrupt, usually the result of an error condition. 25. Define latency, transfer and seek time with respect to disk I/O. Seek time is the time required to move the disk arm to the required track. Rotational delay or latency is the time it takes for the beginning of the required sector to reach the head. Sum of seek time (if any) and latency is the access time. Time taken to actually transfer a span of data is transfer time. Operating systems 26. What is page cannibalizing? Page swapping or page replacements are called page cannibalizing. 27. What are the four layers that Windows NT have in order to achieve independence? Hardware abstraction layer Kernel Subsystems System Services. 28. What is mutant? In Windows NT a mutant provides kernel mode or user mode mutual exclusion with the notion of ownership. 29. What is FtDisk? It is a fault tolerance disk driver for Windows NT. 30. What are DDKs? Name an operating system that includes this feature . DDKs are device driver kits, which are equivalent to SDKs for writing device drivers. Windows NT includes DDKs. 16 MARKS 1. Write about the kernel I/O subsystem. - I/O scheduling - Buffering - Caching - Spooling & device reservation - Error handling - Kernel data structures 2. Explain the various disk scheduling techniques. - FCFS scheduling - SSTF scheduling - SCAN scheduling - C-SCAN scheduling - LOOK scheduling 3. Write notes about disk management. - Disk formatting-low level formatting - Boot block-bootstrap loader, boot block, boot disk & system disk - Bad blocks-sector sparing, sector slipping 4. Write notes about swap-space management. - Swap-space use - Swap-space location - Swap-space management – An Example 5. Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of Operating systems pending requests, in FIFO order, is 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130 Starting from the current head position, what is the total distance ((in cylinders) that the diskarm moves to satisfy all the pending requests, for each of the following disk scheduling a. FCFS b. SSTF c. SCAN d. LOOK e. C-SCAN f. C-LOOK Soln: a) FCFS: Sequence: 143 86 1470 913 1774 948 1509 10221750 130 Distance (in cylinders): 57 + 1384 + 557 + 861 + 826 + 561 + 487 + 728 + 1620 = 7081 b) SSTF: Sequence: 143 130 86 913 948 1022 1470 1509 1750 1774 Distance (in cylinders): 13 + 44 + 827 + 35 + 74 + 448 + 39 + 241 + 24= 1745 c) SCAN: Sequence: 143 91394810221470150917501774499913086 Distance (in cylinders): 9769 d) LOOK: Sequence: 1439139481022147015091750177413086 Distance (in cylinders): 3319 e) C-SCAN: Sequence: 143 913 94810221470150917501774499986130 Distance (in cylinders): 9813 f) C-LOOK: Sequence: 143 9139481022147015091750177486130 Distance (in cylinders): 3363 6. What is RAID? Explain its various levels. - Redundant Arrays of inexpensive disks - RAID 0: Non-redundant striping - RAID 1: Mirrored Disks - RAID2: Memory-style error correcting codes - RAID3: Bit-interleaved parity - RAID4: Block-interleaved parity - RAID5: Block-interleaved distributed parity - RAID6: P+Q redundancy