Computer Science 422/622 Test 1 - 22 Feb - Name ___________________ All answers must be written LEGIBLY in grammatically correct English. I will disregard any information which I view as illegible or otherwise incomprehensible. There will be NO APPEALS of my decisions in these cases!!! 1. Answer the following T or F: ____ a. Operating systems are primarily composed of software rather than hardware components. ____ b. It is the responsibility of the operating system to check to see if an interrupt is pending at the end of each fetch/ execute cycle. ____ c. When an interrupt occurs, the instruction which is executed immediately after the interrupt is typically part of the operating system. 2. Describe in detail how the state of the processor is altered by the interrupt mechanism on an 8088 and on a 370. State specifically which CPU registers get new values and what determines where the new values come from. I DON'T care about how the old state of the processor is preserved here so please DON'T tell me about that! a. 8088 - b. 370 - 3. Consider the process state diagram on the board. For each of the indicated state transitions, state what causes the transition to occur or state that the transition does not normally occur: 1 - 2 - 3 - 4 - 5 - 4. a. When an I/O interrupt occurs on a system such as a 370 (in which the address of the interrupting device is stored at a fixed location in memory), explain how the interrupt handler could go about locating the Device Descriptor Block for the device and notifying the process which initiated the request that it had completed. b. Identify the other functions which would commonly be performed by I/O device interrupt service routines in addition to determining the final status of an I/O operation and passing it to the process requesting the I/O. 5. a. Identify an I/O device type which would typically be allocated to a process on a LONG TERM basis. b. What is the primary advantage of DPC mode I/O as opposed to DMA. c. What is the major advantage of using asynchronous interrupts rather than polling to determine when an I/O request completes. 6. Answer the following T or F: ____ a. All the devices of the same general type (e.g. disks) typically share the same Device Descriptor Block. ____ b. Most disk devices can support multiple simultaneous I/O operations. ____ c. A new device descriptor block is created each time an I/O request is made. 7. a. Suppose 4 jobs which each require one hour of CPU time and perform no I/O are submitted at the same time to be run on a uni-programming system (i.e. one at a time). What will the average turnaround time be? b. Suppose the 4 jobs are run concurrently using an idealized round robin scheduler which time preempts every second. What will the average turnaround time be (to the nearest minute?). 8. a. When a process switch is made, identify the dynamic context elements which must be saved and reloaded. b. Identify two distinct situations which must ALWAYS result in the dispatcher being entered regardless of the scheduling policies of the OS. 1 - 2 - c. Identify one other situation in which the dispatcher would typically be invoked but not necessarily so. 9. Identify three common reasons for swapping a process out. 1 - 2 - 3 - 10. Two desirable properties of a mutual exclusion mechanism are said to be safety and liveness. Explain what is meant by each of these terms in this context. a. Safety - b. Liveness - c. Identify the condition which the following attempt at mutual exclusion violates and describe COMPLETLY the sequence of events which must occur for it to fail.