OPERATING SYSTEMS BY Mr. B. ANIL KUMAR Assistant Professor CSE Department COURSE OBJECTIVE This course has two components: a theory component to teach you the concepts and principles that underlie modern operating systems, and a practice component to relate theoretical principles with operating system implementation. In the theory component, you will learn about processes and processor management, concurrency and synchronization, memory management schemes, file system and secondary storage management, security and protection, etc. The practice component will complement the theory component through programming assignments illustrating the use and implementation of these concepts. At the end of the course you should be enabled to : Outline the fundamental operating system abstractions such as processes, threads, files, semaphores, IPC abstractions, shared memory regions, etc., Define how the operating system abstractions can be used in the development of application programs, or to build higher level abstractions, Explain how the operating system abstractions can be implemented, Outline the principles of concurrency and synchronization, and apply them to write correct concurrent programs/software, Understand basic resource management techniques (scheduling or time management, space management) and principles and how they can be implemented. These also include issues of performance and fairness objectives, avoiding deadlocks, as well as security and protection. REFERENCE MATERIAL SUGGESTED BOOKS: TEXT BOOKS: T1:.Operating System Concepts- A Silberchatz, Galvin, 8th edition, John Wiley T2: Operating System- A Concept based Approach- D M Dhamdhere, TMH T3: Modern Operating Systems, Andrew S Tanenbaum 2nd edition Pearson/PHI WEB REFERENCES: 1. http://en.wikipedia.org/wiki/Operating_systems 2. http://www.cse.iitb.ac.in/~rkj/osweb/lectures/semaphores.pdf 3. http://www.vmware.com/virtualization/virtual-machine.html 4. http://web.cs.wpi.edu/~cs3013/c07/lectures/Section08-Memory_Management.pdf 5. http://www.cs.utexas.edu/users/lorenzo/corsi/cs372/03F/notes/11-20.pdf LEGEND LECTURE PLAN UNIT No. Lecture Plan S.No. 1 2 3 6 Introduction to OS Overview of Computer Systems Operating Systems Functions, Protection & Security Classes of Operating Systems – Distributed Systems etc. Os Services , System Calls , System programs Os Structures – Monolithic , kernel ,Microkernel 7 Virtual Systems ,Operating System Generation , 4 I 5 8 II 9 10 11 12 13 14 15 III 16 17 18 19 20 IV V Topics 21 22 23 24 25 26 27 28 29 30 31 32 Ref. Materia ls Teaching Methods No.of Classes T1 T1 T1 T2 BLACK BOARD BLACK BOARD BLACK BOARD BLACK BOARD 1 2 1 2 T1 T2 BLACK BOARD BLACK BOARD 1 1 BLACK BOARD & WORKINGMODEL 1 (Pg.604-613) Total Number of HRS : Process Concepts –operations, states , PCB , scheduling and IPC Threads , Thread Scheduling Process Scheduling – criteria ,algorithms Algorithm evaluation Case Studies : UNIX ,Linux ,Windows Total Number of HRS : Principles of Concurrency ,Critical Section Problem Peterson’s solution ,Synchronization Hardware Semaphores Classic problems of Synchronization – Philosophers problem etc. Monitors Atomic Transactions Synchronization in UNIX ,Linux ,Windows Total Number of HRS : Introduction to Memory Management , Requirements Swapping , Contigous Memory allocation Paging , Page Table Segmentation Virtual Memory Demand Paging , Page Replacement Algorithms Memory Management in Linux ,UNIX , Windows Total Number of HRS : System Model Deadlock Characterization Deadlock prevention Deadlock detection Deadlock avoidance Recovery From Deadlock Total Number of HRS : T1 09 T1 BLACK BOARD 2 T2 T1 T1 T2 BLACK BOARD SLIDES BLACK BOARD BLACK BOARD T1 T1 T1 T1,T2 BLACK BOARD BLACK BOARD BLACK BOARD BLACK BOARD 1 2 1 2 08 1 1 1 2 T1 T1 T2 BLACK BOARD BLACK BOARD BLACK BOARD T1 BLACK BOARD T1,T2 T1,T2 T1,T2 T1 T1 T1 BLACK BOARD BLACK BOARD BLACK BOARD BLACK BOARD SLIDES BLACK BOARD T1 T1,T2 T1,T3 T1,T3 T1 T1,T3 BLACK BOARD BLACK BOARD BLACK BOARD PPT PPT PPT 1 1 1 08 1 1 2 1 1 2 1 09 1 1 2 2 2 08 T1 BLACK BOARD 1 T1,T2 BLACK BOARD 1 T1,T2 T1,T2 BLACK BOARD BLACK BOARD 1 File system implementation and virtual T1 file system Directory implementation and allocation T1 methods Free space management and log structured T3 file system Learn about example file system(NFS, WAFL..) Total Number of HRS : T1 Mass-storage structure Disk structure T1,T2 T1,T2 Disk scheduling algorithms Magnetic Disk T1,T2 T1 Disk management Swap space management T1 T1,T2 RAID Stable storages T2 T3 Tertiary storage structure T1 Dining philosopher’s problem T1 Blocking and non-blocking I/ T1,T3 I/O hardware and types of devices T3 Kernel I/O subsystem T2 Life cycle of and I/O request T1 Streams Total Number of HRS : T1 Problems of protection and design a model for implementing protection, Types of threats to security Malicious programs, Access matrix , T1,T2 access control and access capability T1,T2 Language based protection(JAVA) BLACK BOARD 1 1 BLACK BOARD 1 Security problems,Security T1,T3 threats(Trojan horse, trap door, logic bomb) and viruses,Network threats(worms, port scanning, DoS) Cryptography and USER T1 Authentication,Learn about intrusion detection, firewalls Total Number of HRS : BLACK BOARD Overview of file management ,File organization and access File directories and file sharing,Record Blocking Secondary storage management Layered file system VI VII VIII PPT BLACK BOARD 2 08 1 BLACK BOARD BLACK BOARD 1 BLACK BOARD PPT BLACK BOARD BLACK BOARD 1 1 1 1 PPT BLACK BOARD BLACK BOARD 1 1 1 1 10 BLACK BOARD 2 BLACK BOARD 1 BLACK BOARD 1 BLACK BOARD 2 2 10 UNIT – I LEARNING OBJECTIVES: At the end of this unit the student must be able to Outline the importance of Operating system. List the services provided by Operating System. Define the overview of computer system hardware. Explain the role of system calls and their types . Outline different Classes of OS Compare and Contrast Symmetric and Asymmetric multiprocessing Analyze essential properties of different types of operating systems Outline the major activities of an OS Identify operating system protection and security factors ASSIGNMENT/ DISCRIPTIVE QUESTIONS 1. Define OS ? Explain about goals and services of OS briefly 2. Explain about storage structure and I/O structure of computer system 3. Explain evolution of OS . 4. Explain different structures of OS briefly . 5. What is Booting ? Explain the importance of Bootstrap Program 6. What is a Virtual Machine ? Explain about VMware architecture. 7. Define System Call and explain distinct types of System Calls elaborately. 8. Justify the following statements. (a) OS can be viewed as a Resource Allocator. (b) OS is a Control Program 9. What are the major activities of an operating system with regard to process management? 10. Differentiate Distributed systems from Multiprocessor systems. 11. Some CPUs provide for more than two modes of operation. What are two possible uses of these multiple modes? Explain. 12. Explain the basic instruction cycle with appropriate diagram. 13. Interrupts are the important part of Computer Architecture. Justify your answer with appropriate interrupt time line diagram. 14. What are the main differences between operating systems for Mainframes and PCs? Discuss. 15. What are the drawbacks of Interrupt driven I/O and Programmed I/O? How they are overcome? 16. Define Os ? Explain evolution of OS . 17. Define System Call and explain distinct types of System Calls elaborately. OBJECTIVE QUESTIONS 1. Which one of the following contains the address of the next instruction to be fetched a)Instruction Register b)Program Counter c)Address Register d)Data Register 2. The Hardware allows privileged instructions to be executed only in _______ mode. a)User b)Kernel c)Both d)None 3. __________ provides an interface to the services made available by an operating System. a)Operating System b)Interrupts c)System Calls d)None 4. Kernel is __________________ a)considered as the critical part of the os b)the software which monitors the os c)the set of primitive functions upon which the rest of os functions are built up. d)User defined program. 5. Which of the following service is not supported by OS a)Protection b)Accounting c)Compilation d)I/O operation 6. The ________ determines the nature of the interrupt and performs necessary actions . a)Interrupt request b)Interrupt stage c)Interrupt Service routine d)Interrupt routine 7. DMA stands for ________ a)Delay memory access b)Direct Memory Advice c)Device Model Access d)Direct Memory Access 8. _______________ are provided primarily to improve processor utilization a)Flags b)Interrupts c)Signals d)Kernels 9. _____________ memory is placed between CPU and main memory. a)Read-only b)Random Access c)Cache d)Flash signal 10. OS objective is to provide _______ a)Inconvenience b)Inefficiency c)Error Correction d)Ability to evolve 11. Distributed Systems should_______________________ a)meet prescribed time constraints b)aim better resource sharing c)aim better system utilization d)aim low system overhead 12. Spatial locality refers to the problem that once a location is referenced a)it will not be referenced again c)a nearby location will be referenced soon b)it will be referenced again d)none of the above. 13. ______________________ abstracts the hardware of a single computer into several different execution environments , thus creating an illusion that each environment is running on its private machine. 14. In a computer system , a small piece of code known as ____________ locates the kernel , loads it into main memory , and starts its execution at the time of system start up. 15. SMP stands for _________________________________________. UNIT – II LEARNING OBJECTIVES: At the end of this unit the student must be able to List the common events that lead to the creation of a process. Define process control block . Outline the steps performed by an OS to create a new process Identify different process states . Define short term , medium term and long term scheduling Compare Context and Process switching Explain process management in UNIX, LINUX and WINDOWS. Compare and contrast between thread and process List the benefits of multithreaded programming and their models Explain threads in Unix, Linux and Windows Define types of CPU scheduling and their criteria for being the best with examples ASSIGNMENT/ DISCRIPTIVE QUESTIONS 1. Compare and Contrast Process switching , Context switching . 2. Define Process ? Describe the typical elements of Process control block. 3. Discuss the following: a)user-level threads b)kernel-level threads c)multi-threading 4. a) Explain about all the states of a process with a neat diagram b) Explain about all CPU scheduling algorithms with examples 5. Explain about process creation and termination in UNIX 6. Explain about multithreading models 7. Explain about the types of schedulers and their functionality . 8. Explain the need for Inter process Communication and techniques for communication . 9. Elaborate on Need for process Scheduling and Scheduling Criteria ? 10. i)FCFS ii)SHORTEST JOB FIRST iv)RR (TQ=1) iii) SHORTEST JOB FIRST (PREEMPTIVE) 11. Explain about single threaded and multi threaded process models with suitable diagrams. 12. Explain the following process state transitions: (a) Blocked ! Blocked/Suspended. (b) Blocked/Suspended ! Ready/Suspended. (c) Ready/Suspended ! Ready. 13. (a) What are the various examples of the uses of the threads in a single user multiprocessing system? (b) What are the key benefits of threads derived from the performance implications? 14. (a) What is a thread? (b) What are the benefits of the threads? (c) Explain about user level and kernel level threads. 15. (a) What are the two separate and potentially independent characteristics embodied in the concept of the process? Discuss. (b) What resources are typically shared by all of the threads of a process? 16. What are various steps involved in change of a process state? Explain in detail? 17. What are the various reasons for process suspension? Explain. 18. Explain about the following. 19. (a) Process identification. (b) Processor state information. 20. a) Explain about all the states of a process with a neat diagram b) Explain about all CPU scheduling algorithms with examples 21. Explain about process creation and termination in UNIX (a) Discuss with examples the three types of processor scheduling. (b) Differentiate between turn around time and response time. OBJECTIVE QUESTIONS 1. In a heavily loaded system , a steady stream of higher-priority processes can prevent a low-priority process from ever getting CPU , this is known as ___________ a) Deadlock b)Aging c)Scheduling d)Starvation. 2. The _____________ scheduler selects process from the processes ready for execution and allocates the CPU to that process. a)Short-term b)Long-term c)Medium term d)Low-level 3. Pre-emptive scheduling , is the strategy of temporarily suspending a running process _______ a) before the CPU time slice expires b)to allow starving processes to run c)when it requests I/O d)none of the above. 4. Suppose that a process is in BLOCKED state waiting for some I/O service . When the service is completed , it goes to the _______________ state. a)RUNNING state b)READY state c)SUSPENDED state d)TERMINATED state 5. Which of the following scheduling policy is well suited for a time-shared operating system? a)SJF b)Round Robin c)FCFS d)Elevator. 6. A small program known as __________ , switches the processor from one process to another. a)Bootstrap b)Dispatcher c)Running d)kernel 7. The Time elapsed between , process submission to its total completion is known as _______ a) Wait time b)Response time c)Turn around time d)Throughput 8. Process creation in UNIX is made by means of the ___________ system call a)create() b)join() c)fork() d)delay() 9. ___________ is a solution to process starvation. a)Slicing b)Aging c)prevention d)Deadlock. 1. A _____ is the maximum amount of time that a process can execute before being intercepted . a)time state b)time slice c)time in d)time out. 2. The __________ is the key tool that enables the os to support multiple processes and to provide for multi processing . a)Process Control Block b)State Control block c)Thread Control block d)Register Control block 3. The possible transition of five state process model is a)Ready – Blocked b)New – Running c)New- Ready d)Blocked - Running 4. The two fundamental models of Inter process Communication are _________and ________. 10. 14.PCB stands for ____________________________________. 5. __________________ is a light weight process. UNIT – III LEARNING OBJECTIVES: At the end of this unit the student must be able to Outline the concept of concurrency and the affect of the execution of multiple concurrent processes. List the basic requirements of mutual exclusion for concurrent processing Define various software and hardware approaches to achieve mutual exclusion Explain semaphores, monitors and message passing. Outline the problems with concurrent atomic transactions. Explain synchronization in UNIX , LINUX and WINDOWS. ASSIGNMENT/ DISCRIPTIVE QUESTIONS 1. What are the principles of concurrency ? Explain in detail how concurrent process come into conflict with each other when they are competing for the use of the same resource 2. What is a semaphore? Explain the operations performed on Semaphores 3. Explain in detail the requirements of Critical Section problem solution. 4. Define a Monitor ? Derive a Deadlock free solution for Dining Philosophers problem using Monitors . 5. Explain about infinite buffer producer/consumer problem for concurrent processing which uses binary semaphores . 6. State Readers / Writers Problem and derive a solution for First Readers / Writers Problem using Semaphores ? 7. Define Mutual Exclusion ? Explain the Hardware solutions to achieve for critical section problems 8. Explain the Peterson’s solution for solving Critical section Problem. 9. Define the following Terms a) Spin Locks b) Binary , Semaphores c) Atomic Transactions – Checkpoints d)Serializability. Counting 10. a) Define an Atomic Transaction ? Explain Log- Based Recovery for atomic transactions ? b) Explain Time – stamp based Protocols for ensuring consistency in atomic Transactions ? 11. Write the short notes on the following a) Race Condition b) Process Interaction 12. Explain the solution for the critical section problem for multiple processes. 13. Define monitor. What are its characteristics? 14. What is critical section problem? Explain with example.? 15. a) What is the need for mutual exclusion? b) What is a critical resource? c) What is a critical section? d) What is starvation? 16. Explain the Readers/Writers problem and its solutions.? 17. Explain the solution to Dining Philosophers Problem using Semaphores. 18. Explain the Peterson’s solution for solving Critical section Problem. 19. What are the principles of concurrency ? Explain in detail how concurrent process come into conflict with each other when they are competing for the use of the same resource 20. What is a semaphore? Explain the operations performed on Semaphores 21. Explain in detail the requirements of Critical Section problem solution. 22. a) Define an Atomic Transaction ? Explain Log- Based Recovery for atomic transactions ? b) Explain Time – stamp based Protocols for ensuring consistency in atomic Transactions ? OBJECTIVE QUESTIONS 1. A _________ occurs when multiple processes or threads read and write data items so that the final result depends on the order of instructions in the multiple processes. a)Critical Section Condition b)Deadlock c)SpinLock d)Race 2. If a schedule S can be transformed into a serial Schedule S’ by a series of swaps of non conflicting operations , then the schedule S is said to be _________. a)Serializable b)Concurrent c)Conflict Serializable d) None 3. A situation in which a runnable process is overlooked indefinitely by schedule is known as___ a)starvation b)Deadlock c)live lock d)race c)Mutex d)Spooling condition 4. Binary semaphore is also known as a)General semaphore b)Cluster 5. For both counting and binary semaphores , a _________ is used to hold processes waiting on the semaphore a)stack b)dequeue c)queue d)circular queue 6. If the data in a monitor represents some resource , then the monitor provides a ______ facility for accessing the resource. a)preemption b)non preemption c)hold and wait d)mutual exclusion 7. In Readers / Writers problem a) If a writer is writing to the file ,two readers may read it. b) If a writer is writing to the file ,one reader may read it. c) Only one reader at a time may read the file. d) Only one writer at a time may write to the file. 8. The return value of test and set instruction is a)integer b)character c)Boolean d)float 9. The __________ is a programming construct that provides equivalent functionality to that of semaphores and that is easier to control. a)monitor b)signal c)critical section d)mutex 10. can the producer / consumer problem be considered a special case of the readers/writers problem with a single writer(producer) and a single reader(consumer) a)Yes b)No c)Cannot say d)Sometimes possible 11. ___________________ is an integer variable that , apart from initialization , is accessed through two standard operations : wait () and notify(). a)Monitor b)Spinlock c)Deadlock d)Semaphore 12. The solution to the critical section problem must satisfy ____________ , _____________and ________________ requirements. 13. Each process has a segment of code , called a _________________,in which the process may be changing common variables, updating a table, writing a file ,and so on. 14. _______________ is a situation where two or more processes are waiting indefinitely for an event that can be caused only by one of the waiting processes. 15. In two phase locking protocol there exists two phases namely _____________ and ___________ phases. UNIT – IV LEARNING OBJECTIVES: At the end of this unit the student must be able to Define the need to study memory management in operating systems Identify the memory management requirements Explain about loading programs into main memory List different memory management techniques Define importance of virtual memory Learn about the application of virtual memory Calculate page faults using different Page replacement algorithms Explain Memory management in UNIX , LINUX and WINDOWS environment ASSIGNMENT/ DISCRIPTIVE QUESTIONS 1. Explain with a neat sketch i) Address translation in a segmentation system ii) Address translation in a paging system 2. i) Discuss the differences between a pure paging and demand Paging Virtual memory systems. What are the pros and cons of each scheme? ii) What are the three main issues of implementing a virtual memory? iii) Comment on the relative merits of using a local versus a global page replacement policy 3. State and explain the various page replacement algorithms in detail? 4. a)Differentiate between demand cleaning and pre-cleaning b)What is the difference between resident set and a working set c) Explain with suitable examples about page replacement algorithms 5. Write short notes on a) Compaction b)Translation look aside buffer c) Internal and External Fragmentation 6. Elaborate on Different Page Table Structures . 7. a) Define Thrashing ? Explain The working set model in detail ? b) A process has 4 frame allocated to it. Calculate the number of page faults using following page replacement algorithms for the reference string 4,0,0,0,2,4,2,1,0,3,2. i) i. OPTIMAL ii. SECOND CHANCE iii.LRU 8. Explain the role of Translation Look-Ahead Buffer(TLB) in paging ? 9. Compare the main memory organization scheme of contiguous memory allocation,pure segmentation and pure paging with respect to the following issues. a) External fragmentation b) Internal fragmentation c) Ability to share code across processes. 10. Explain contiguous memory allocation scheme for memory management. What are its advantages and disadvantages? 11. a) Contrast resident set with working set. b) What are the advantages of an inverted page table? Explain. 12. Explain paging scheme for memory management. Discuss the paging hardware and paging model. 13. a) Explain Paging hardware with translation look-aside buffer. b) How memory protection can be accomplished in a paged environment? Explain. 14. a) Compare global and local page replacement algorithms. What are the advantages of each? b) Describe two-level paging. What problems two-level paging tries to solve? 15. i) Discuss the differences between a pure paging and demand Paging Virtual memory systems. What are the pros and cons of each scheme? ii) What are the three main issues of implementing a virtual memory? iii) Comment on the relative merits of using a local versus a global page replacement policy 16. Write short notes on: a) Compaction b)Translation look aside buffer c) Internal and External Fragmentation 17. Elaborate on Different Page Table Structures . OBJECTIVE QUESTIONS 1. If the process can be moved during its execution time from one memory segment to another, then ________ binding is used. a)Compile Time b)Runtime c)Load Time d)Static 2. TLB stands for_______ a)Translation Log Based b)Translation Look-aside Buffer c)Translation Log Buffer d)Transaction Log Buffer 3. Segmentation Suffers from ________. a)Internal Fragmentation b)External Fragmentation c)Both d)None. 4. Virtual memory is ________ a)an extremely large main memory b)an extremely large secondary memory c)a type of memory used in super computers d)an illusion of an extremely large memory. 5. The first fit,best fit and worst fit algorithms can be used for a)linked allocation of memory b)contiguous allocation of memory c)hash allocation d)indexed allocation of memory 6. The runtime mapping from virtual to physical address is done by ___ a)scheduler b)OS c)CPU d)Memory management Unit 7. The address generated by CPU is known as _________ a)zero b)logical c)physical d)true 8. The maximum value for logical address=y and base register value=x , what is the maximum value for physical address ? a) x+y b)x-y c)x*y d)x/y 9. The page fault occurs when a)the page is corrupted by application software b)the page is in main memory c) the page is not in main memory d)One tries to divide a number by 0. 10. ______________ algorithm fits the process into the largest available hole. a)first fit b)best fit c)worst fit d)zero fit 11. ____________________ algorithm searches the list of holes and allocate the first memory area that is large enough a)first fit b)best fit c)worst fit d)zero fit c)stack d)list 12. To implement LRU _______ data structure is used. a)queue b)tree 13. A process is ______ if it is spending more time paging than executing. a)routing b)filtering c)locked d)thrashing 14. Replace the page that has not been used for longest period of time. This is __ a)FIFO b)LFU c)LRU d)MFU 15. In ____________________ technique , the memory contents are shuffled so as to place all free memory together in one large block. UNIT – V LEARNING OBJECTIVES: At the end of this unit the student must be able to Identify the cause of Deadlock List necessary condition for Deadlock List the methods that an operating system can use to deal with deadlock problem Identify tool in characterizing the allocation of resources to processes like Resource Allocation Graph (RAG) outline the Deadlock detection mechanisms outline the Deadlock avoidance Statergies Predict whether the System ends up in an unsafe state upon granting a request made by a process. Explain Deadlock detection and recovery stratergies . ASSIGNMENT/ DISCRIPTIVE QUESTIONS 1. What is deadlock? Prove that an unsafe state is not deadlock state. Explain the necessary conditions for the deadlocks. 2. What is deadlock avoidance? Explain process initiation denial and resource allocation denial in detail with example 3. What are the principles of deadlock? And explain in detail the two categories of resources 4. What are the conditions that must satisfy for deadlock occurrence and explain them ? 5. Is the deadlocks problem preventable? Justify your answer with example and diagram. 6. Write the resource allocation algorithm for Deadlock detection. 7. (a) What is the need for mutual exclusion? (b)What is a critical resource? (c) What is a critical section? (d) What is starvation? 8. Explain about Deadlock Prevention. 9. Explain about Deadlock Avoidance. 10. Explain the algorithm to recover from deadlocks. 11. Describe a system model for study of deadlock situation. 12. Explain the Bankers algorithm for deadlock avoidance with suitable example. OBJECTIVE QUESTIONS 1. Mutual exclusion a) if one process is in a critical region others are excluded b) prevents deadlock c) requires semaphores to implement d) is found only in the Windows NT operating system ` 2. The section of code which accesses shared variables is called as __________. a) Critical section b) Block c) Procedure d) Semaphore 3. In one of the deadlock prevention methods, impose a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration. This violates the _______________ condition of deadlock a) Mutual exclusion b) Hold and Wait c) Circular Wait d) No Preemption 4. A critical region a) is a piece of code which only one process executes at a time b) is a region prone to deadlock c) is a piece of code which only a finite number of processes execute d) is found only in Windows NT operation system 5. Let S and Q be two semaphores initialized to 1, where P0 and P1 processes the following statements wait(S);wait(Q); ---; signal(S);signal(Q) and wait(Q); wait(S);signal(Q);signal(S); respectively. The above situation depicts a _________ . a) Semaphore b) Deadlock c) Signal d) Interrupt 6. The solution to Critical Section Problem is : Mutual Exclusion, Progress and Bounded Waiting. a) The statement is false b) The statement is true. c) The statement is contradictory . d) None of the above 7. _________ is the situation in which a process is waiting on another process, which is also waiting on another process ... which is waiting on the first process. None of the processes involved in this circular wait are making progress. a) Deadlock b) Starvation c) Dormant d) None of the above 8. The Bankers algorithm is used a) to prevent deadlock in operating systems b) to detect deadlock in operating systems c) to rectify a deadlocked state d) none of the above 9. Situations where two or more processes are reading or writing some shared data and the final results depends on the order of usage of the shared data, are called ________. a) Race conditions b) Critical section c)Mutual exclusion d) Dead locks 10. When two or more processes attempt to access the same resource a _________ occurs. a) Critical section b) Fight c) Communication problem d) Race condition 11. _____________ are commodity required by a process to execute. 12. RAG Stands for _______________. 13. If RAG contains no cycle this there is _________. 14. Banker only lends resources if the system will be in a _______state after the loan. 15. If a system is in unsafe state then there is _______________. UNIT – VI LEARNING OBJECTIVES: At the end of this unit the student must be able to Define file management system List the various file organization and access methods List the various file directory structures Define Record blocking D efine file sharing Examine the problems of protection and design a model for implementing protection Discuss about layered file system Differentiate file system implementation and virtual file system D o directory implementation List allocation methods Define free space management Define log structured file system List the example file system(NFS, WAFL..) ASSIGNMENT/ DISCRIPTIVE QUESTIONS 1. Write short notes on: i)Sequential file ii) Indexed file iii) Indexed sequential file iv) file 2. a)Explain in detail the four terms field ,record file and database w.r.t to files b)List the objectives and the requirements for a file management system 3. What are reallocation, dynamic allocation, portion size w.r.t 4. a)secondary Storage management b) Describe various file allocation methods 1. a )Define file system architecture b) What are the important criteria in choosing a file organization? c) List the functions of a file management system with a diagram 2. Write about a) Free space management b)Reliability of a file allocation a) List and explain three blocking methods. b) What is the relationship between a pathname and a working directory? Direct c) What criteria are important in choosing a file organization? 3. a) Explain hash file organization. b) Discuss the address information elements of a file directory 4. Explain various techniques implemented for free space management, discuss with suitable Explain various techniques implemented for free space management, discuss with suitable examples. (a) What is the need for mutual exclusion? 5. Discuss the criteria for choosing a file organization. 6. Describe indexed file, indexed sequential file organization. 7. List and explain three blocking methods. 8. What is the relationship between a pathname and a working directory? 9. Give an example of an application that could benefit from operating system support for random access to indexed files. 10. Explain hash file organization. 11. Discuss the address information elements of a file directory. 12. (a) Explain about various file operations. (b) Discuss about the usage information elements of a file directory. 13. Explain file sharing. Discuss about the access right and management of simultaneous access. 14. a) Discuss indexed allocation methods for secondary storage management. b) What are the advantages and disadvantages of pile file organization over hashed file organization? 15. (a) Describe the key features of NTFS. (b) Discuss file allocation method in UNIX file. OBJECTIVE QUESTIONS 1. File record length a) should always be fixed c) depends upon the size of the file character b) should always be variable d) should be chosen to match the data 2. Which types of file organization are supported by magnetic tapes random files a) random file b)contiguous sequential file c) indexed sequential file d) random & sequential file 3. A file is a) not an abstract data type b) not a logical storage unit c)file is usually non volatile d) file is usually volatile 4. Number of minimal set of required file operations are a) two b) four c) five 5. Which structure prohibits the sharing of files and directories a) tree structure b) one level directory c) two level d)six d) three level 6. The file structure that redefines its first record at a base of zero uses the term a) dynamic reallocation b) key fielding c) relative organization d) hashing 7. Disadvantage of single level directory is a) the confusion of files names between users b) the confusion of files data c) the confusion of both file names & file data d)the confusion of neither file name nor file data 8. Solution of name collision problem is a) single level directory b) two level directory c) tree structure d) three level directory 9. Path's name are a) absolute path b) relative path c) absolute path & relative path d) neither absolute nor relative path 10. How many common file type are there a) one b) six c) five d) two 11. System supports how many types of files a) one b) six c) five d) two 12. The simplest directory structure is a) single level directory b) two level directory c) tree structure directory d) three level directory 13. There are no cycle in which type of directory a) General graph directory b) Acyclic graph directory c) One level directory d) Two level directory 14. A file sometimes called a a) collection of input data b) program c) temporary place to store data d)data set 15. OS abstracts from the physical properties of its storage device to define a logical storage unit called __________. UNIT – VII LEARNING OBJECTIVES: At the end of this unit the student must be able to Define magnetic disk List disk scheduling algorithms Define disk management Outline swap space management in UNIX Define RAID in List the stable storages Learn about tertiary storage structure Learn the dining philosopher’s problem Learn about I/O hardware, polling and interrupts Learn about DMA Learn about block , character and network devices Learn about STREAMS ASSIGNMENT/ DISCRIPTIVE QUESTIONS 1. a) Explain various disk Performance parameters. b) Show that the use buffer can reduce the running time by at most a factor of two. 2. Suppose the head of a moving- head disk with 200 tracks, numbered 0 to 199, is currently serving a request at track 143 and has just finished a request at track 125. If the queue of requests is kept in FIFO order: 86, 147, 91, 177, 94, 150, 102, 175,130. What is the total head movement to satisfy these requests for the following disk scheduling algorithms. a) FCFS (b) Random (c) PRI (d) SCAN (e) SSTF (f) C- SCAN 3. a) Discuss about N- step- SCAN policy for disk scheduling. b)Explain how double buffering improves the performance than a single buffer for I/O. c) Differentiate between logical I/O and device I/O. 4. a) Bitmaps are not often used for main memory allocation. They are commonly used for disk space allocation. Speculate on why this is so. b) Give an example of an application that could benefit from operating system support for random access to indexed files. 5. a) Explain about RAID technology b) Explain about stable and tertiary storage structure 6. What is the dining philosophers problem? Device an algorithm to solve the problem using semaphores 7. Write detailed notes on : a) Interrupts b) I/O communication techniques 8. Explain about devices in I/O interface 9. a)Explain about kernel I/O subsystem b)Explain about streams 10. Suppose the head of a moving- head disk with 200 tracks, numbered 0 to 199, is currently serving a request at track 143 and has just finished a request at track 125. If the queue of requests is kept in FIFO order: 86, 147, 91, 177, 94, 150, 102, 175, 130. What is the total head movement to satisfy these requests for the following disk scheduling algorithms. a) FCFS (b) Random (c) PRI (d) SCAN (e) SSTF (f) C- SCAN 11. What the design characteristics of Message Systems are of inter process communication and synchronization? 12. Discuss about N- step- SCAN policy for disk scheduling. 13. Explain how double burring improves the performance than a single bu er for I/O. 14. Differentiate between logical I/O and device I/O. 15. Most round-robin schedules uses a fixed size quantum. Give an argument in favor of a small quantum. Now give an argument in favor of a large quantum. Compare and contrast the types of systems and jobs to which the argument apply. 16. With an example explain shortest- Process- Next scheduling. 17. What is the difference between preemptive and non preemptive scheduling? Explain an algorithm for each scheduling type. 18. Explain Fair-share scheduling policy with an appropriate example. Compare its performance with any other scheduling policy. 19. a) Describe highest- response- ratio- next scheduling policy with an appropriate example. b) Give a detail note on simulation modeling. OBJECTIVE QUESTIONS 1. Disk scheduling involves deciding a)which disk should be accessed next b) the order in which disk access requests must be serviced c) the physical location where files should be accessed in the disk d) the length of the files 2. _ _ _ _ _ _ _ _ _ _ is the total number of bytes transferred divided by the total time between the first request for service and completion of the last transfer. a) bandwidth b) seek time c) latency d) rotational latency 3. The simplest form of disk scheduling is _ _ _ _ _ _ _ a) FCFS b) SSTF c) SCAN d) C-SCAN 4. In disk scheduling SSTF stands for _ _ _ _ _ _ _ _ _ _ a) shortest seek time first b) shortest scan time first c) shortest schedule time first d) shortest search time first 5. In disk scheduling _ _ _ _ _ _ _ _ _ algorithm is called elevator algorithm a) FCFS b) SSTF c) SCAN d) C-SCAN 6. ''In UNIX file name translation is done in the file system name space'' is _ _ _ _ _ _ _ _ _ a) always true say b) always false c) some times true some times false c) can't 7. ''In MS-DOS file name translation is done in a separate device name space'' is _ _ _ _ _ _ ___ a) always true b) always false c) some times true some times false c) can't say 8. Before a disk can store data it must be divided into sectors that the disk controller can read /write. This process is called _ _ _ _ _ _ _ _ _ _ formatting a) low level b) physical c) low level or physical d) logical 9. _ _ _ _ _ _ _ _ formatting fills the disk with a special data structure for each sector a) low level b) physical c) low level or physical d) logical 10. Creation of a file system is known as _ _ _ _ _ _ _ _ _ formatting a) low level b) physical c) low level or physical d) logical 11. Which of the following is single user OS a)MS-DOS b) UNIX c) LINUX d) OS/2 12. Which of the following is secondary storage device a) register b) cache c) disk d) main memory 13. Before a disk can store data it must be divided into _ _ _ _ _ _ _ _ _ that the disk controller can read /write a) track b) sector c) surface d) cylinder 14. _ _ _ _ _ _ _ is a process that holds kernel form disk to main memory a) blocking b) Booting c) Bootstrapping d)Interpreting 15. C-SCAN stands for _ _ _ _ _ _ _ _ _ a) circular scan b) cycle scan c) cache scan d) cube scan UNIT – VIII LEARNING OBJECTIVES: At the end of this unit the student must be able to Examine the problems of protection and design a model for implementing protection To understand types of threats to security Identify and understand the different malicious programs Learn about access matrix , access control and access capability Learn about language based protection(JAVA) Learn about security problems Learn about security threats(Trojan horse, trap door, logic bomb) Learn about viruses Learn about network threats(worms, port scanning, DoS) Learn about cryptography Learn about USER Authentication Learn about intrusion detection, firewalls ASSIGNMENT/ DISCRIPTIVE QUESTIONS 1. Write short notes on a)viruses b)Worms c) Logic bomb d)Trap door 2. a) What are the security requirements of a computer and network. b) Explain different types of threats.c) Explain the computer system assets. 3. a) Who are the various classes of intruders. b) Discuss about intrusion techniques 4. Write short notes on a)intrusion detection b)password protection 5. a)How resources of a computer system is protected b)Explain user and data oriented access control 6. a) Discuss the password file protection mechanisms. b) Write a detail note on Masquerader, Misfeasor, and clandestine user 7. a) Explain the various password selection strategies.(b) Discuss about UNIX password scheme. 8. a) Discuss the three options available in Windows 2000 for requesting access. b) Describe the generic access of Windows 2000. 9. List the various techniques followed by password crackers in learning password. 10. Compare active attacks with passive attacks. 11. Give the classification of intruders. Explain each class. 12. Comparison User-Oriented access control with data-oriented access control. 13. Discuss the three options available in Windows 2000 for requesting access. 14. What is a trusted system? Explain the reference monitor concept and multilevel secure system in detail. 15. How is the AES expected to be an improvement over triple DES? 16. Explain the flaws in one-way encryption of password strategy. 17. Write a brief note on intrusion detection. 18. a) Discuss about Vulnerability of passwords. b) Give a note on security attacks. 19. a) Explain in detail passive treats. b) What is an access matrix? Explain. 20. Explain the security threats to various computer system assets. OBJECTIVE QUESTIONS 1. Lowest Level of security system is a) A b) B c) C d) D 2. An audit log _ _ _ _ _ _ a) simply records the time b) records user c) type of all access to an object d) records time, user & access to an object 3. The most common approach to authenticating a user identity is _ _ _ _ _ _ _ _ a) user passwords b) user log in c) hardware device d) user log in & hardware device 4. A major security problem for OS is _ _ _ _ _ _ _ a) authentication problem b) physical problem c) human problem d) physical & human problem 5. Trojan Horse _ _ _ _ _ _ _ _ _ _ _ _ _ a) A code segment that misuses its file is called Trojan horse b) good for file accessing b) Trojan horse does not misuses its file d) misuses its file and good for file accessing 6. Program threats are _ _ _ _ _ _ _ _ _ _ _ _ a) Trojan horse c) trap doors c) Trojan horse & trap doors d)neither Trojan horse nor trap doors 7. In one time password _ _ _ _ _ _ _ _ _ a) the password is different in each instance instance c) some times different and some times same 8. Which of the following is not true regarding viruses a) another form of computer attack is virus b) the password is same in each d) can't say b) virus are designed to spread into other programs and can wreak havoc in a system c) it modifying or destroying files and causing system crashes d) viruses are beneficial for program 9. Boot strap or vector is called a) grappling hook program b) main program c) secondary program d) primary storage 10. Two programs of worm are _ _ _ _ _ _ _ _ _ _ _ a) grappling hook program c) grappling hook & main programs pgm b) main program d) neither grappling hook nor main 11. Worm was made up _ _ _ _ _ _ _ _ _ a) one program b) two programs c) three programs d) four programs 12. Trap door _ _ _ _ _ _ _ _ _ _ _ a) could be included in a compiler b) pose a difficult problem because to detect them c) could be included in a compiler & pose a difficult problem to detect them d) could not be included in a compiler 13. Applications a) can not run on multiple processors b) immediately run on multiple processors c) must usually be re compiled to use multiple processors d) can always be made efficient on multiple processors 14. Link encryption a) is more secure than end to end encryption b) is less secure than end to end encryption c) can not be used in a large network d) is used only to detect errors 15. Resources are managed _ _ _ _ _ _ _ _ _ _ _ _ _ a) with each processor equally b) by only one processor c) by sophisticated locking mechanisms d) more easily with multiple processors ANSWER KEY ALL 8 UNITS Unit - I:1.B,2.B,3.C,4.C,5.C,6.C,7.D, 8.B,9.C,10.D, 11.B, 12.C ,13. Virtual Machine,14. Bootsrtap Program, 15. Symmetric Multi processing. Unit - II:1.D, 2.A, 3.B, 4.B, 5.B, 6.B, 7.C, 8.C, 9.B, 10.B, 11.A, 12.C, 13. Message Passing , Shared Memory 14. Process Control Block, 15. Thread Unit - III:1.D, 2.C, 3.A, 4.C, 5.C, 6.D, 7.D, 8.C, 9.A, 10.A, 11.D, 12.Mutual Exclusion , Progress and Bounded Waiting, 13.Critical section, 14. Deadlock, 15. Growing , Shrinking. Unit - IV:1.B, 2.B, 3.B, 4.D, .B , 6.D, 7.B, 8.A , 9.C, 10.C, 11.A, 12.C, 13.D, 14.C, 15.Compaction Unit - V:1.a, 2.a , 3.c, 4.a, 5.b, 6.b, 7.1 , 8.a, 9.a, 10.d, 11. Resources , 12.Resource Allocation Graph, 13. No Deadlock, 14.Safe, 15. possibility of deadlock. Unit - VI:1.c, 2.b , 3.c, 4.d, 5.a, 6.c, 7.a, 8.b, 9.c, 10.a, 11.b,12.a,13.b, 14.d,15.File Unit - VII:1.b, 2.a, 3.a, 4.a, 5.c,6.a, 7.a, 8.c, 9.c , 10.d, 11.a, 12.c, 13.b, 14.b, 15.a Unit - VIII:1.d, 2.d, 3.a, 4.a, 5.a, 6.c, 7.a, 8.d, 9.a , 10.c, 11.b, 12.c, 13.c, 14.b, 15.c