An operating system provides an environment for the execution of programs. It provides certain services to programs and to the users of those programs. These services are providing for the convenience of the programmers, to make the programming task easier. Some common types of services given by operating system are given below:
Types of services given by operating systems
- Program execution: the system must be able to load a user program into memory and run it. The program must be able to end its execution, either normally or abnormally.
- Input/output operations: A running program may be required to input data and output results. An I/O operation may involve a file or a device. For specific, special functions may be desired (such as, rewind a tape, clear the screen, and so on). Since a user program cannot execute I/O operations directly, the operating system must provide some means for I/O operations.
- File system manipulation: programs may need to read and write files and the users create and delete files by name. the operating system provides numerous file operations.
- Error Detection: the operating system needs to be aware of possible errors in the system. Errors may occur in the CPU and memory (such as memory error or power failure), in I/O devices (such as parity error on tape or printer out of paper), or in the user program (such as an arithmetic overflow, and attempt to access illegal memory location or using too much CPU time). The operating system takes appropriate actions if an error occurs.
- Resource Allocation: in some computer systems multiple users or multiple jobs run at the same time and resources should be allocated to each of them. Resources are managed by the operating system.
- Accounting: it may necessary to keep track of which users use how much and what kind of computer resources. Keeping of records may be required for the purpose of billing or for statistics.
Operating system services are provided in many ways. Two basic methods are system calls and systems programs.
Some basic services are handled through the use of system calls. System calls provide the interface between a running program and the operating system.
System calls are generally available as assembly language instructions and are usually listed in the assembly language manuals.
System calls can be roughly grouped into three categories: process r job control, device and file manipulation, and information maintenance.
Systems programs solve common problems and provide a convenient environment for program development and execution.
Systems programs can be divided into several categories. These are discussed below.
- Types of Services
File manipulation: These programs are used to create, delete, copy, rename, print, dump, and list files, and manipulate directory operations.
- Status information: These programs can be used to ask the operating system for the date, time, amount of available memory or disk space, number of users, or similar status information.
- File modification: text editor can be used to create files and modify the content of files stored on disks or tapes.
- Programming language support: Compilers, assemblers, ad interpreters for common programming languages (such as FORTRAN, Pascal, BASIC, C) are often provided with the operating systems.
- Program loading and execution: Once a program is assembled or compiled, it must be loaded into memory for execution. The operating system may provide loaders, linkage editors for program execution.