An OS is a program that controls the execution of application programs and acts as an interface between applications and the computer hardware.
Objectives of OS:
Convenience: An OS makes a computer more convenient to use.
Efficiency: An OS allows the computer system resources to be used in an efficient manner.
Ability to evolve: An OS should be constructed in such a way as to permit the effective development, testing, and introduction of new system functions without interfering with service.
Functions of OS:
The OS provides a variety of facilities and services, such as editors and debuggers, to assist the programmer in creating programs.
Typically, these services are in the form of utility programs that, while not strictly part of the core of the OS, are supplied with the OS and are referred to as application program development tools.
A number of steps need to be performed to execute a program. Instructions and data must be loaded into main memory, I/O devices and files must be initialized, and other resources must be prepared.
The OS handles these scheduling duties for the user.
Access to I/O devices:
Each I/O device requires its own peculiar set of instructions or control signals for operation.
The OS provides a uniform interface that hides these details so that programmers can access such devices using simple reads and writes.
Controlled access to files:
For file access, the OS must reflect a detailed understanding of not only the nature of the I/O device (disk drive, tape drive) but also the structure of the data contained in the files on the storage medium.
In the case of a system with multiple users, the OS may provide protection mechanisms to control access to the files.
For shared or public systems, the OS controls access to the system as a whole and to specific system resources.
The access function must provide protection of resources and data from unauthorized users and must resolve conflicts for resource contention.
Error detection and response:
A variety of errors can occur while a computer system is running. These include internal and external hardware errors, such as a memory error, or a device failure or malfunction; and various software errors, such as division by zero, attempt to access forbidden memory location, and inability of the OS to grant the request of an application.
In each case, the OS must provide a response that clears the error condition with the least impact on running applications.
The response may range from ending the program that caused the error, to retrying the operation, to simply reporting the error to the application.
A good OS will collect usage statistics for various resources and monitor performance parameters such as response time.
On any system, this information is useful in anticipating the need for future enhancements and in tuning the system to improve performance.
On a multiuser system, the information can be used for billing purposes.