A computer without an operating system is a box of hardware that few people could use. The operating system turns it into a usable machine.

Definition

An operating system (OS) is a program that acts as an intermediary between the user and the computer hardware. It manages the hardware resources, such as the processor, memory, storage and devices, and provides an environment in which other programs can run conveniently and efficiently. Examples are Windows, Linux, macOS, Android and iOS. The part of the OS that is always in memory and runs with full control of the hardware is called the kernel.

Definition: Operating system. A system program that manages the computer's hardware resources and provides services to application programs, acting as an intermediary between users and the hardware.

Goals and Views

The OS has two main goals. Convenience: it makes the computer easy to use, hiding the details of the hardware. Efficiency: it uses the hardware resources well. From the user's view, the OS is an interface that makes the computer easy to use. From the system's view, it is a resource manager, which allocates CPU time, memory and devices among the competing programs, and a control program, which prevents errors and improper use.

Evolution of Operating Systems

Operating systems have developed alongside hardware. In the first generation (1945–1955), computers used vacuum tubes and had no OS; programmers worked directly with plugboards and machine language. In the second generation (1955–1965), transistors and batch systems appeared, in which jobs were collected and run one after another by a resident monitor. In the third generation (1965–1980), integrated circuits made multiprogramming and time-sharing possible, as in IBM OS/360 and UNIX. In the fourth generation (1980 onwards), personal computers brought graphical user interfaces, and later network, distributed and mobile operating systems. Today's systems also run on cloud servers, phones and embedded devices.

Functions of an OS

The OS performs process management, memory management, file management, device (I/O) management, storage management, security and protection, networking, and user interface provision. Each is studied later in this subject.

Table 1.1: Generations of operating systems

Generation Hardware OS feature
First (1945–55) Vacuum tubes No OS, plugboards
Second (1955–65) Transistors Batch systems
Third (1965–80) Integrated circuits Multiprogramming, time-sharing
Fourth (1980–) Microprocessors GUI, network, mobile OS

Example 1.1: Identifying OS functions

Problem: Name the OS function involved when (a) two programs run at the same time, (b) a document is saved to disk, (c) a printer prints a page, (d) a password is asked at login.

Solution:

  1. Running programs together is process management.
  2. Saving to disk is file management.
  3. Printing is device (I/O) management.
  4. A login password is security and protection.

Result: (a) process, (b) file, (c) device, (d) security management.

#include <stdio.h>
#include <unistd.h>
int main(void) {
    printf("This program is a process run by the OS.\n");
    printf("Its process ID (given by the OS) is %s\n",
           getpid() > 0 ? "a positive number" : "invalid");
    printf("Page size managed by the OS: %ld bytes\n",
           sysconf(_SC_PAGESIZE));
    return 0;
}

Output

This program is a process run by the OS.
Its process ID (given by the OS) is a positive number
Page size managed by the OS: 4096 bytes

Common mistakes

  • Thinking that the OS is just the user interface. The kernel does most of the work.
  • Confusing application programs with the operating system.
  • Forgetting that efficiency and convenience can conflict.

Key takeaways

  • The OS is an intermediary between users and hardware.
  • Its goals are convenience and efficiency.
  • It is a resource manager and a control program.
  • OS generations moved from no OS to batch, multiprogramming, time-sharing and GUI systems.

Practice questions

  1. Define an operating system.
  2. What is the kernel?
  3. Name two functions of an OS.

Answers to the practice questions

  1. A program that manages the hardware and provides services to programs, acting as an intermediary between the user and the hardware.
  2. The core part of the OS that is always in memory and controls the hardware.
  3. Process management and memory management (also file, device, security management).

Sources

  • Official BCA syllabus Operating Systems, course code 25BCA402DS03, Unit I