What is an Operating System and its Functions/Role?

A computer is a machine that has various hardware components.  A hardware device receives the instructions and performs activities once it gets the instructions in a machine language. An activity could be copying files from one drive to another, printing a page, etc.

What is an Operating System
What is an Operating System

For a computer user, it is not feasible to give instructions directly to the hardware. If a user wants to do that, it requires converting high-level instructions into the machine language of the underlying hardware.  But still, not possible all the time, as a user might not be a tech guy. So there is a system software named Operating System.

The operating system gives easy-to-use graphical (or/and be command-line options) interfaces to the users.  It receives instructions in the form of events and converts them into low-level machine language as per the hardware present.

Other than just accessing hardware, an Operating System(OS) plays a role in using resources efficiently and securely.  If there are multiple processes are running by multiple users. An OS will schedule the processes so that there will be lesser workaround time, and one user process will not interfere with any other user process.

Lists of popular Operating systems for Desktop and/or Servers- 

      • Windows
      • Linux
      • MAC OS
      • Novell Netware

For mobile devices- 

      • Android
      • iOS
      • Windows
      • Blackberry
      • Symbian

What are the Components of an Operating System?

What are the components of Operating System
What are the components of the Operating System?

The above diagram shows a hierarchical view of the modules of an Operating System.  The lowest level is the hardware level, and the topmost level is the user software and applications.

  • User Softwares and Applications –  This includes all computer programs that can execute. It may be a Media Player, PDF reader, etc.
  • Shell – This is the interface between a user and hardware.  The shell translates user events into the format kernel understands.  A company may use an existing (e.g., Open Source) kernel and develops its own shell to offer more features.
  • Kernel –  This is the most complex part of an operating system. It interacts with the hardware. A kernel is developed for specific hardware. It contains device drivers for various devices attached.

What are the goals of the Operating System?

The goal of each operating system is to access the computer hardware in the simplest and an efficient way.  We can categorize goals into the following.

  • User Level Goal –  The basic purpose of any operating system is to make access to computer hardware components easier. For that, it provides a user-friendly graphical user interface. Where users can do all activities by typing and clicking.  A hardware device has its own set of machine instructions. At the machine language level, a program can directly access the device. But it is complicated, so the operation system bridges the gap. It works as an interface that converts user-level easy commands into device-level complex machine instructions.
  • System-Level Goal – System-level function means the internal working where a user is not involved.  The Operating System should manage all resources efficiently and promptly.  If a request is waiting for resources (e.g., I/O operation) and another process can do another activity. The OS does context switching and minimizes the turnaround time.

What are the functions of an Operating System?

  • User Management –  An operating system can have multiple user profiles with different roles. Each has its own workspace to work. For example, if there are two users, John and Alice, as normal users. John can not view/modify Alice’s files and vice versa.  But if a user is an administrator, it can do all activities.   The user management function is important for organizations, where they have to protect a computer against the installation of pirated or unauthorized software applications by the employees.
  • Process scheduling –  A process is a code that is in execution. While execution, a process may move among various states, such as READY, WAITING, TERMINATED, etc.  The operating system assigns the CPU to a process, and once a process needs an I/O or other operation, it moves the process to another state and assigns the next process to the CPU.  Along with this one method, there are other algorithms to handle multiple processes running together, such as round-robin, shortest job first, etc. The goal of the process management function is to ensure that the CPU is efficiently allocated to all processes.
  • Input/Output(I/O) operations for devices –  I/O operations of a device are to read and write to/from the device hardware.  For example, a computer has Network Interface Card  Reads/Write data from/to the network.  It is the Operating System function to convert user-level requests into device-level actual commands.  The conversion needs a device driver from the hardware manufacturing company. A device driver is a glue between the operating system and the device.
  • Memory management –   Once a process moves from an IDLE state to running, it is loaded into the primary memory (RAM).   The operating system allocates the memory, and the CPU starts executing the process.  An operating system ensures that the other processes should also get the memory efficiently. This requires memory management functionality.
  • File Management – A file is an entity that stores user information. It could be a text application of any other type.  A directory or folder is a container that can contain multiple files int.  With the directory, it is easy to group the files and access them easily.  Operating Sytems have all the necessary functions to maintain files and folders. The functions can be for creating, deleting, reading, writing, and renaming.
  • Deadlock Management –  Deadlock is the state where all processes are waiting circularly, and no one is completing. The operating system tries to prevent a deadlock.