Introduction - Exercise

Introduction to Operating System - Exercise

1. What are the three main purposes of an operating system?

Answer: The three main purposes are:

  1. Manage hardware resources: Efficiently manage CPU, memory, and I/O devices.
  2. Provide a user interface: Enable interaction between users and the computer system.
  3. Execute and provide services for application software: Facilitate the execution of user and system applications.
2. We have stressed the need for an operating system to make efficient use of the computing hardware. When is it appropriate for the operating system to forsake this principle and to “waste” resources? Why is such a system not really wasteful?

Answer: It is appropriate to "waste" resources to improve user experience, such as in time-sharing systems where CPU cycles are used to provide quick responsiveness to multiple users. This is not really wasteful because it enhances overall system usability and productivity.

3. What is the main difficulty that a programmer must overcome in writing an operating system for a real-time environment?

Answer: The main difficulty is ensuring that the system can meet strict timing constraints and deadlines, which requires precise scheduling and resource management.

4. 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 in a dedicated machine? Explain your answer.

Answer: a. Unauthorized access to data, and resource contention leading to potential denial of service. b. It is challenging to ensure the same level of security due to shared resources, but with proper access controls, isolation mechanisms, and monitoring, a high degree of security can be maintained.

5. Under what circumstances would a user be better off using a time-sharing system than a PC or a single-user workstation?

Answer: A user would be better off using a time-sharing system when they need to perform tasks that require high interactivity, access to shared resources, or collaborative work with other users, which are not as efficiently managed on a PC or single-user workstation.