* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Assignment 1 Solution
Survey
Document related concepts
Transcript
Answer Key for Assignment #1 1. In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various security problems. a. What are two such problems? b. Can we ensure the same degree of security in a time-shared machine as we have in a dedicated machine? Explain your answer. a. Stealing or copying one’s programs or data; using system resources (CPU, memory, disk space, peripherals) without proper accounting. b. Probably not, since any protection scheme devised by humans can inevitably be bro-ken by a human, and the more complex the scheme, the more difficult it is to feel confident of its correct implementation. 2. Under what circumstances would a user be better off using a time-sharing system, rather than a personal computer or single-user workstation? When there are few other users, the task is large, and the hardware is fast, time-sharing makes sense. The full power of the system can be brought to bear on the user’s problem. The problem can be solved faster than on a personal computer. Another case occurs when lots of other users need resources at the same time. A personal computer is best when the job is small enough to be executed reasonably on it and when performance is sufficient to execute the program to the user’s satisfaction. 3. What are the differences between a trap and an interrupt? What is the use of each function? An interrupt is a hardware-generated change-of-flow within the system. An interrupt handler is summoned to deal with the cause of the interrupt; control is then returned to the interrupted context and instruction. A trap is a software-generated interrupt. An interrupt can be used to signal the completion of an I/O to obviate the need for device polling. A trap can be used to call operating system routines or to catch arithmetic errors. 4. What are the main advantages of the microkernel approach to system design? Benefits typically include the following (a) adding a new service does not require modifying the kernel, (b) it is more secure as more operations are done in user mode than in kernel mode, and (c) a simpler kernel design and functionality typically results in a more reliable operating system. 5. What are the advantages of layered OS structure? Independence. Allows for expansion and enhancement. Easy to debug. 6. How the RTOS (Real-time OS) would differ from a typical OS? Give examples of both OS. RTOS is used in time- or mission-critical systems. Examples of RTOS are PSOS, Vertex, VxWorks, etc. Examples of typical OS are NT, Unix, etc. 7. Is the compiler part of the OS? If not, why not? No. To allow for flexibility and enhancement. The user can choose whatever s/he likes. 8. Write down two differences between synchronous and asynchronous I/O methods? Synchronous: o I/O started; then at I/O completion, the control is returned to the user process o No mechanism is needed to keep track of many I/O requests at the same time. Asynchronous: o I/O started; returns control to the user process without waiting for the I/O to complete o Needs mechanisms to keep track of many I/O requests at the same time. 9. What issues should an OS engineer take into consideration when designing an OS? Maintainability, reliability, efficiency, memory size, etc. 10. Which of the following instructions should be allowed only in kernel mode: a. Disable all interrupts b. Read the time-of-day clock c. Change the system memory map. A and C.