What is Operating System, its Types, Functions and Examples

A person who uses the computer, laptop, tablet or smartphone is very much familiar with the operating system. An operating system is a low-level software that performs different kinds of functionalities including scheduling of tasks, management of resources, execution of programs and provides command-line or graphical user interface(GUI) enabling the user to perform different tasks. Here in this post, we are covering following points:

 

What is Operating System?

Computer System has different components, these include hardware, operating system, application programs and users.

Hardware is a physical portion of the computer system consists of basic computer resources i.e. memory, CPU and I/O devices.

Operating system manages hardware resources among different application programs and users.

Application programs are the third layer of computer organization. These are designed to perform specific tasks directly for users. These may include from word processors to video games and many more.

Users may be persons, computers or robots.

Definition

Operating system is a system software that manages computer resources (hardware as well as applications), acts as an intermediary between a user and computer hardware and makes computer system convenient to use.

It is due to the operating system, the user of the computer does not have to deal directly with the hardware to get their work done. Operating system provides the user a simple and user-friendly interface to perform their specific tasks.

Description

A computer system has various hardware and software resources required to solve some problem; storage space, CPU time and I/O devices etc.

Operating system manages all the resources and receives many simple and conflicting requests. It also decides how and when to allocate and deallocate resources so that computer system can run efficiently.

In short operating system is a resource manager who manages both hardware and software resources efficiently. It is a control program that manages execution of user program to prevent errors and improper use of computer.

Viewing things closely will reveal that basic purpose of a computer system is to generate executable programs and execute them. The following are some of the main issues involved in performing these tasks.

  • Storing an executable on a secondary storage device such as a hard disk
  • Loading executable from disk into the main memory
  • Setting the CPU state appropriately so that program execution could begin
  • Creating multiple cooperating processes, synchronizing their access to shared data, and allowing them to communicate with each other

The above issues require the operating system to provide the following services and much more:

  • Manage secondary storage devices
  • Allocate the appropriate amount of disk space when files are created
  • Deallocate space when files are removing
  • Ensure that a new file does not overwrite an existing file
  • Schedule disk requests
  • Manage primary storage
  • Allocate the appropriate amount of memory space when programs are to be loaded into the memory for executing
  • Deallocate space when processes terminate
  • Ensure that a new process is not loaded on top of an existing process
  • Ensure that a process does not access memory space that does not belong to it
  • Minimize the amount of unused memory space
  • Allow execution of programs larger in size than the available main memory
  • Manage processes

Operating System Components

An operating system has various components that perform different tasks for proper execution of programs. Following are main components of the operating system.

Process Management

A process can be a program in execution that needs resources like CPU time, memory, files and I/O devices to accomplish its tasks. The operating system is responsible for

  • Creating and terminating user and system processes
  • Suspending and resuming processes
  • Providing mechanisms for process synchronization
  • Providing mechanisms for process communication
  • Providing mechanisms for deadlock handling

Main Memory Management

Main memory is a large array of words or bytes. These bytes are called memory locations and range in size from hundreds of thousands to billions. Every word or byte has its own address. Main memory is a repository of quickly accessible data shared by the CPU and I/O devices. It contains the code, data, stack, and other parts of a process. The central processor reads instructions of a process from main memory during the machine cycle. The OS is responsible for the following activities in connection with memory management.

  • Keeping track of free memory space
  • Keeping track of which parts of memory are currently being used and by whom
  • Deciding which processes are to be loaded into memory when memory space becomes available
  • Deciding how much memory is to be allocated to a process
  • Allocating and deallocating memory space as needed
  • Ensuring that a process is not overwritten on top of another

Secondary Storage Management

The programs to be executed, along with the data they access, must be in the main memory or primary storage during their execution. Since main memory is too small to accommodate all data and programs, and because the data it holds are lost when the power is lost, the computer system must provide secondary storage to backup main memory. Most programs are stored on a disk until loaded into the memory and then use disk as both the source and destination of their processing. Like all other resources in a computer system, proper management of disk storage is important.
The operating system is responsible for the following activities in connection with disk management:

  • Free-space management
  • Storage allocation and deallocation
  • Disk scheduling

Read also: Difference between Preemptive Scheduling Vs Non-Preemptive Scheduling

Input/Output Management

The input and output subsystem consists of:

  • A memory management component that includes buffering, caching and spooling
  • A general device-driver interface
  • Drivers for specific hardware devices

File Management

Computers can store information on several types of physical media, e.g. magnetic tape, magnetic disk and an optical disk. The operating system maps files onto physical media and accesses these media through storage devices. Operating system is responsible for the following activities pertaining to file management:

  • Creating and deleting files
  • Creating and deleting directories
  • Supporting primitives (operations) for manipulating files and directories
  • Mapping files onto the secondary storage
  • Backing up files on stable (nonvolatile) storage media

Protection System

If a computer system has multiple users and allows concurrent execution of multiple processes then the various processes must be protected from each other’s activities. Protection is any mechanism for controlling the access of programs, processes or users to the resources defined by a computer system.

Networking

A distributed system is a collection of processors that do not share memory, peripheral devices or a clock. Instead, each processor has it own local memory and clock, and the processors communicate with each other through various communication lines, such as high- speed buses or networks.

The processors in a communication system are connected through a communication network. The communication network design must consider message routing and connection strategies and the problems of contention and security.

A distributed system collects physically separate, possibly heterogeneous, systems into a single coherent system, providing the user with access to the various resources that the system maintains.

Command Line Interpreter

One of the most important system programs for an operating system is the command interpreter, which is the interface between the user and operating system. Its purpose is to read user commands and try to execute them. Some operating systems include the command interpreter in the kernel. Other operating systems (for example UNIX, Linux, and DOS) treat it as a special program that runs when a job is initiated or when a user first logs on (on time-sharing systems). Examples of shells for UNIX and Linux are Bourne shell (sh), C shell (csh), Bourne Again shell (bash), TC shell (tcsh), and Korn shell (ksh). You can use any of these shells by running the corresponding command, listed in parentheses for each shell.

Operating System Services

An operating system provides the environment within which programs are executed. It provides certain services to programs and users of those programs, which vary from operating system to operating system. Some of the common ones are:

Program execution:

The system must be able to load a program into memory and to run that programs. The program must be able to end its execution.

I/O Operations:

A running program may require I/O, which may involve a file or an I/O device. For efficiency and protection user usually cannot control I/O devices directly. The OS provides a means to do I/O.

File System Manipulation:

Programs need to read, write files. Also, they should be able to create and delete files by name.

Communications:

There are cases in which one program needs to exchange information with another process. This can occur between processes that are executing on the same computer or between processes that are executing on different computer systems tied together by a computer network. Communication may be implemented via shared memory or message passing.

Error detection:

The OS constantly needs to be aware of possible errors. The error may occur in the CPU and memory hardware, in I/O devices and in the user program. For each type of error, the OS should take appropriate action to ensure correct and
consistent computing.

Operating System Functions

In order to assist the efficient operation of computer system, it provides the following functions:

Resource allocation:

When multiple users are logged on the system or multiple jobs are running at the same time, resources must be allocated to each of them. There are various routines to schedule jobs, allocate plotters, modems and other peripheral devices.

Accounting:

We want to keep track of which users use how many and which kinds of computer resources. This record keeping may be used for accounting or simply for accumulating usage statistics.

Protection:

The owners of information stored in a multi user computer system may want to control use of that information. When several disjointed processes execute concurrently it should not b possible for one process to interfere with the others or with the operating system itself. Protection involves ensuring that all access to system resources is controlled.

Operating Systems Structures

Just like any other software, the operating system code can be structured in different ways. The following are some of the commonly used structures.

Simple/Monolithic Structure

In this case, the operating system code has not structure. It is written for functionality and efficiency (in terms of time and space). DOS and UNIX are examples of such systems.

Layered Approach

The modularization of a system can be done in many ways. In the layered approach, the operating system is broken up into a number of layers or levels each built on top of lower layer. The bottom layer is the hardware; the highest layer is the user interface. A typical OS layer consists of data structures and a set of routines that can be invoked by higher-level layers.

Virtual Machines

The computer system is made up of layers. The hardware is the lowest level in all such systems. The kernel running at the next level uses the hardware instructions to create a set of system call for use by outer layers. The system programs above the kernel are therefore able to use either system calls or hardware instructions and in some ways these programs do not differentiate between these two. System programs, in turn, treat the hardware and the system calls as though they were both at the same level.

In some systems, the application programs can call the system programs. The application programs view everything under them in the hierarchy as though the latter were part of the machine itself. This layered approach is taken to its logical conclusion in the concept of a virtual machine (VM). The VM operating system for IBM systems is the best example of VM concept.

Although the virtual machine concept is useful it is difficult to implement. There are two primary advantages to using virtual machines: first by completely protecting system resources the virtual machine provides a robust level of security. Second, the virtual machine allows system development to be done without disrupting normal system operation.

Java Virtual Machine (JVM) loads, verifies and executes programs that have been translated into Java Bytecode. VMWare can be run on a Windows platform to create a virtual machine on which you can install an operating of your choice, such as Linux. Virtual PC software works in a similar fashion.

Operating System Types

Single-user systems

A computer system that allows only one user to use the computer at a given time is known as a single-user system. The goals of such systems are maximizing user convenience and responsiveness, instead of maximizing the utilization of the CPU and peripheral devices.

Single-user systems use I/O devices such as keyboards, mice, display screens, scanners, and small printers. They can adopt technology developed for larger operating systems.

They may run different types of operating systems, including DOS, Windows, and MacOS. Linux and UNIX operating systems can also be run in single-user mode.

Batch Systems

Early computers were large machines run from a console with card readers and tape drives as input devices and line printers, tape drives, and card punches as output devices. The user did not interact directly with the system; instead, the user prepared a job, (which consisted of the program, data, and some control information about the nature of the job in the form of control cards) and submitted this to the computer operator. The job was in the form of punch cards, and at some later time, the output was generated by the system. The output consisted of the result of the program, as well as a dump of the final memory and register contents for debugging.

To speed up processing, operators batched together jobs with similar needs and ran them through the computer as a group. For example, all FORTRAN programs were compiled one after the other.

The major task of such an operating system was to transfer control automatically from one job to the next. Such systems in which the user does not get to interact with his jobs and jobs with similar needs are executed in a “batch”, one after the other, are known as batch systems. Digital Equipment Corporation’s VMS is an example of a batch operating system.

Multi-programmed Systems

Such systems organize jobs so that CPU always has one to execute. In this way, CPU utilization is increased. The operating system picks and executes from amongst the available jobs in memory. The job has to wait for some task such as an I/O operation to complete. In a non-multi-programmed system CPU would sit idle while in case of multiprogrammed system, the operating system simply switches to, and executes another job.

Time-sharing systems

These are multi-user and multi-process systems. Multi-user means system allows multiple users simultaneously. In this system, a user can run one or more processes at the same time. Examples of time-sharing systems are UNIX, Linux, Windows server editions.

Real-time systems

Real time systems are used when strict time requirements are placed on the operation of a processor or the flow of data. These are used to control a device in a dedicated application. For example, medical imaging system and scientific experiments.

Operating System Examples

There are many types of operating system. Some most popular examples of operating system are:

Unix Operating System

Unix was initially written in assembly language. Later on, it was replaced by C, and Unix, rewritten in C and was developed into a large, complex family of inter-related operating systems. The major categories include BSD, and Linux.

“UNIX” is a trademark of The Open Group which licenses it for use with any operating system that has been shown to conform to their definitions.

macOS

Mac-OS is developed by Apple Inc. and is available on all Macintosh computers. It was formerly called “Mac OS X” and later on “OS X”.  MacOS was developed in 1980s by NeXT and that company was purchased by Apple in 1997.

Linux

Linux is Unix-like operating system and was developed without any Unix code. Linux is open license model and code is available for study and modification. It has superseded Unix on many platforms. Linux is commonly used smartphones and smartwatches.

Microsoft Windows

Microsoft Windows is most popular and widely used operating system. It was designed and developed by Microsoft Corporation. The current version of operating system is Windows-10.

Microsoft Windows was first released in 1985. In 1995, Windows 95 was released which only used MS-DOS as a bootstrap.

Other operating systems

Various operating systems like OS/2, BeOS and some other operating system which were developed over time are no longer used now. Because they could contribute to market share.

Market share

October 2017 worldwide web browsing share
Place Mobile system Desktop system
1 Android (73%) Windows (83%)
2 iOS (20%) OS X (13%)
3 Nokia (1%) Linux (2%)
4 Windows (1%) Chrome OS (1%)

You may also like: Computer Science Basic Concepts: 5 Point You Need to Know

nc