An OS is a program which acts as an interface between computer system users and the computer hardware. It provides a user-friendly environment in which a user may easily develop and execute programs. Otherwise, hardware knowledge would be mandatory for computer programming. So, it can be said that an OS hides the complexity of hardware from uninterested users.
In general, a computer system has some resources which may be utilized to solve a problem.
- File System etc.
The OS manages these resources and allocates them to specific programs and users. With the management of the OS, a programmer is rid of difficult hardware considerations.
An OS provides services for
- Processor Management
- Memory Management
- File Management
- Device Management
- Concurrency Control
Another aspect for the usage of OS is that; it is used as a predefined library for hardware software interaction and this is why, system programs apply to the installed OS since they cannot reach hardware directly.
Since we have an already written library, namely the OS, to add two numbers we simply write the following line to our program:
c = a + b ;
whereas in a system where there is no OS installed,we should consider some hardware work as:
(Assuming an MC 6800 computer hardware)
LDAA $80 -> Loading the number at memory location 80
LDAB $81 -> Loading the number at memory location 81
ADDB -> Adding these two numbers
STAA $55 -> Storing the sum to memory location 55
As seen, we considered memory locations and used our hardware knowledge of the system. In an OS installed machine, since we have an intermediate layer, our programs obtain some advantage of mobility by not dealing with hardware.
For example, the above program segment would not work for an 8086 machine, where as the “c = a + b ;” syntax will be suitable for both.
With the advantage of easier programming provided by the OS, the hardware, its machine language and the OS constitutes a new combination called as a virtual (extended) machine.
In a more simplistic approach, in fact, OS itself is a program. But it has a priority which application programs don’t have. OS uses the kernel mode of the microprocessor, whereas other programs use the user mode. The difference between two is that; all hardware instructions are valid in kernel mode, where some of them cannot be used in the user mode.