Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

Operating System (OS)

An Operating System (OS) is an interface between a computer user and computer hardware. An
operating system is a software which performs all the basic tasks like file management, memory
management, process management, handling input and output, and controlling peripheral devices
such as disk drives and printers.
Some popular Operating Systems include Linux Operating System, Windows Operating system,
VMS, OS/400, AIX, z/OS, etc.

Definition

An operating system is a program that acts as an interface between the user and the computer
hardware and controls the execution of all kinds of programs.

Following are some of important functions of an operating System.

 Memory Management
 Processor Management
 Device Management
 File Management
 Security
 Control over system performance
 Job accounting
 Error detecting aids
 Coordination between other software and users

Memory Management

Memory management refers to management of Primary Memory or Main Memory. Main memory
is a large array of words or bytes where each word or byte has its own address.
Main memory provides a fast storage that can be accessed directly by the CPU. For a program to be
executed, it must in the main memory. An Operating System does the following activities for
memory management −
 Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part are not
in use.
 In multiprogramming, the OS decides which process will get memory when and how much.
 Allocates the memory when a process requests it to do so.
 De-allocates the memory when a process no longer needs it or has been terminated.

Processor Management(Resource managemnet)

In multiprogramming environment, the OS decides which process gets the processor when and for
how much time. This function is called process scheduling. An Operating System does the following
activities for processor management −
 Keeps tracks of processor and status of process. The program responsible for this task is
known as traffic controller.
 Allocates the processor (CPU) to a process.
 De-allocates processor when a process is no longer required.

Device Management

An Operating System manages device communication via their respective drivers. It does the
following activities for device management −
 Keeps tracks of all devices. Program responsible for this task is known as the I/O controller.
 Decides which process gets the device when and for how much time.
 Allocates the device in the efficient way.
 De-allocates devices.

File Management

A file system is normally organized into directories for easy navigation and usage. These directories
may contain files and other directions.
An Operating System does the following activities for file management −
 Keeps track of information, location, uses, status etc. The collective facilities are often
known as file system.
 Decides who gets the resources.
 Allocates the resources.
 De-allocates the resources.

Other Important Activities

Following are some of the important activities that an Operating System performs −
 Security − By means of password and similar other techniques, it prevents unauthorized
access to programs and data.
 Control over system performance − Recording delays between request for a service and
response from the system.
 Job accounting − Keeping track of time and resources used by various jobs and users.
 Error detecting aids − Production of dumps, traces, error messages, and other debugging
and error detecting aids.
 Coordination between other softwares and users − Coordination and assignment of
compilers, interpreters, assemblers and other software to the various users of the
computer systems.

Recourse manager

A computer system has many resources (hardware and software), which may be required to
complete a task. The commonly required resources are input/output devices, memory, file storage
space, CPU, etc. The operating system acts as a manager of the above resources and allocates them
to specific programs and users, whenever necessary to perform a particular task. Therefore the
operating system is the resource manager i.e. it can manage the resource of a computer system
internally. The resources are processor, memory, files, and I/O devices. In simple terms, an operating
system is an interface between the computer user and the machine.

An operating system acts similarly like government means an operating system performs no useful
function by itself; though it provides an environment within which other programs can do useful
work.

Kernel in Operating System

Kernel is central component of an operating system that manages operations of computer and
hardware. It basically manages operations of memory and CPU time. It is core component of an
operating system. Kernel acts as a bridge between applications and data processing performed at
hardware level using inter-process communication and system calls.

Kernel loads first into memory when an operating system is loaded and remains into memory until
operating system is shut down again. It is responsible for various tasks such as disk management,
task management, and memory management.

It decides which process should be allocated to processor to execute and which process should be
kept in main memory to execute. It basically acts as an interface between user applications and
hardware. The major aim of kernel is to manage communication between software i.e. user-level
applications and hardware i.e., CPU and disk memory.

Objectives of Kernel :

 To establish communication between user level application and hardware.


 To decide state of incoming processes.
 To control disk management.
 To control memory management.
 To control task management.

Types of Kernel : 2. Micro Kernel –


1. Monolithic Kernel – It is kernel types which has minimalist
It is one of types of kernel where all operating approach. It has virtual memory and thread
system services operate in kernel space. It has scheduling. It is more stable with less services
dependencies between systems components. It in kernel space. It puts rest in user space.
has huge lines of code which is complex. Example :
Example :
Unix, Linux, Open VMS, XTS-400 etc. Mach, L4, AmigaOS, Minix, K42 etc.
Advantage : Advantage :
It has good performance. It is more stable.
Disadvantage : Disadvantage :
It has dependencies between system There are lots of system calls and context
component and lines of code in millions. switches.

3. Hybrid Kernel – 4. Exo Kernel –


It is the combination of both monolithic kernel It is the type of kernel which follows end-to-end
and mircrokernel. It has speed and design of principle. It has fewest hardware abstractions
monolithic kernel and modularity and stability as possible. It allocates physical resources to
of microkernel. applications.
Example : Example :
Windows NT, Netware, BeOS etc. Nemesis, ExOS etc.
Advantage : Advantage :
It combines both monolithic kernel and It has fewest hardware abstractions.
microkernel. Disadvantage :
Disadvantage : There is more work for application developers.
It is still similar to monolithic kernel.

5. Nano Kernel –
It is the type of kernel that offers hardware abstraction but without system services. Micro Kernel
also does not have system services therefore the Micro Kernel and Nano Kernel have become
analogous.
Example :
EROS etc.
Advantage :
It offers hardware abstractions without system services.
Disadvantage :
It is quite same as Micro kernel hence it is less used.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the
DSA Self Paced Course at a student-friendly price and become industry ready.

What is the difference between GUI and CUI?

GUI and CUI are two types of User Interfaces. GUI stands for Graphical User Interface while CUI
stands for Character User Interface. In this article we will be discussing the differences between
these two interfaces and which one has advantages over the other.
User Interface : User Interface comprises of everything the user can use to interact with the
computer. It is basically the means by which the user and computer system can interact using input
and output devices.

GUI: GUI stands for Graphical User Interface. This is a type of user interface where user interacts
with the computer using graphics. Graphics include icons, navigation bars, images etc. Mouse can be
used while using this interface to interact with the graphics. It is a very user-friendly interface and
requires no expertise. Eg: Windows has GUI..

CUI: CUI stands for Character User Interface. This is a type of user interface

where user interacts with computer using only keyboard. To perform any action a command is
required. CUI is precursor of GUI and was used in most primitive computers. Most modern
computers use GUI and not CUI. Eg: MS-DOS has CUI.

Difference between GUI and CUI:


Property GUI CUI
Interaction Using graphics(images, icons) Using commands(only text)
Navigation Easier Difficult
Peripherals used Keyboard and mouse(or any pointing Keyboard only
device)
Precision LOW HIGH
Speed LOW HIGH
Ease of Operation Easier Difficult, requires expertise
Memory Required HIGH LOW
Flexibility MORE Flexible LESS Flexible
Customising Highly customisable Appearance cannot be
Appearance changed

Introduction to UNIX System

Unix is an Operating System that is truly the base of all Operating Systems like Ubuntu, Solaris,
POSIX, etc. It was developed in the 1970s by Ken Thompson, Dennis Ritchie, and others in the AT&T
Laboratories. It was originally meant for programmers developing software rather than non-
programmers

Layer-1: Hardware –

It consists of all hardware related information.

Layer-2: Kernel –

It interacts with hardware and most of the tasks like memory management, task scheduling, and
management are done by the kernel.

Layer-3: Shell commands –

Shell is the utility that processes your requests. When you type in a command at the terminal, the
shell interprets the command and calls the program that you want.
There are various commands like cp, mv, cat, grep, id, wc, nroff, a.out and more.

Layer-4: Application Layer –

It is the outermost layer that executes the given external applications.

The Directory Structure


All the files are grouped together in the directory structure. The file-system is arranged in a
hierarchical structure, like an inverted tree. The top of the hierarchy is traditionally
called root (written as a slash / )

TYPES OF OPERATING SYSTEM

1. Batch Operating System


In a Batch Operating System, the similar jobs are grouped together into batches with the help of
some operator and these batches are executed one by one. For example, let us assume that we
have 10 programs that need to be executed. Some programs are written in C++, some in C and rest
in Java. Now, every time when we run these programmes individually then we will have to load
the compiler of that particular language and then execute the code. But what if we make a batch
of these 10 programmes. The benefit with this approach is that, for the C++ batch, you need to
load the compiler only once. Similarly, for Java and C, the compiler needs to be loaded only once
and the whole batch gets executed. The following image describes the working of a Batch
Operating System.

Advantages:

1. The overall time taken by the system to execute all the programmes will be reduced.
2. The Batch Operating System can be shared between multiple users.
Disadvantages:

1. Manual interventions are required between two batches.


2. The CPU utilization is low because the time taken in loading and unloading of batches is
very high as compared to execution time.
2. Time-Sharing Operating System
In a Multi-tasking Operating System, more than one processes are being executed at a particular
time with the help of the time-sharing concept. So, in the time-sharing environment, we decide a
time that is called time quantum and when the process starts its execution then the execution
continues for only that amount of time and after that, other processes will be given chance for
that amount of time only. In the next cycle, the first process will again come for its execution and
it will be executed for that time quantum only and again next process will come. This process will
continue. The following image describes the working of a Time-Sharing Operating System.

Advantages:

1. Since equal time quantum is given to each process, so each process gets equal opportunity
to execute.
2. The CPU will be busy in most of the cases and this is good to have case.
Disadvantages:

1. Process having higher priority will not get the chance to be executed first because the
equal opportunity is given to each process.

3. Distributed Operating System


In a Distributed Operating System, we have various systems and all these systems have their own
CPU, main memory, secondary memory, and resources. These systems are connected to each
other using a shared communication network. Here, each system can perform its task individually.
The best part about these Distributed Operating System is remote access i.e. one user can access
the data of the other system and can work accordingly. So, remote access is possible in these
distributed Operating Systems. The following image shows the working of a Distributed Operating
System.
Advantages:

1. Since the systems are connected with each other so, the failure of one system can't stop
the execution of processes because other systems can do the execution.
2. Resources are shared between each other.
3. The load on the host computer gets distributed and this, in turn, increases the efficiency.
Disadvantages:

1. Since the data is shared among all the computers, so to make the data secure and
accessible to few computers, you need to put some extra efforts.
2. If there is a problem in the communication network then the whole communication will be
broken.

4. Embedded Operating System


An Embedded Operating System is designed to perform a specific task for a particular device which
is not a computer. For example, the software used in elevators is dedicated to the working of
elevators only and nothing else. So, this can be an example of Embedded Operating System. The
Embedded Operating System allows the access of device hardware to the software that is running
on the top of the Operating System.

Advantages:

1. Since it is dedicated to a particular job, so it is fast.


2. Low cost.
3. These consume less memory and other resources.
Disadvantages:

1. Only one job can be performed.


2. It is difficult to upgrade or is nearly scalable.

5. Real-time Operating System


The Real-time Operating Systems are used in the situation where we are dealing with some real-
time data. So, as soon as the data comes, the execution of the process should be done and there
should be no dealy i.e. no buffer delays should be there. Real-time OS is a time-sharing system
that is based on the concept of clock interrupt. So, whenever you want to process a large number
of request in a very short period of time, then you should use Real-time Operating System. For
example, the details of the temperature of the petroleum industry are very crucial and this should
be done in real-time and in a very short period of time. A small delay can result in a life-death
situation. So, this is done with the help of Real-time Operating System. There are two types of
Real-time Operating System:

1. Hard Real-time: In this type, a small delay can lead to drastic change. So, when the time
constraint is very important then we use the Hard Real-time.
2. Soft Real-time: Here, the time constraint is not that important but here also we are
dealing with some real-time data.
Advantages:

1. There is maximum utilization of devices and resources.


2. These systems are almost error-free.
Disadvantages:

1. The algorithms used in Real-time Operating System is very complex.


2. Specific device drivers are used for responding to the interrupts as soon as possible.
Piping in Unix or Linux

A pipe is a form of redirection (transfer of standard output to some other destination) that is used in
Linux and other Unix-like operating systems to send the output of one command/program/process
to another command/program/process for further processing. The Unix/Linux systems allow stdout
of a command to be connected to stdin of another command. You can make it do so by using the
pipe character ‘|’.

Pipe is used to combine two or more commands, and in this, the output of one command acts as
input to another command, and this command’s output may act as input to the next command and
so on. It can also be visualized as a temporary connection between two or more commands/
programs/ processes. The command line programs that do the further processing are referred to as
filters.

This direct connection between commands/ programs/ processes allows them to operate
simultaneously and permits data to be transferred between them continuously rather than having to
pass it through temporary text files or through the display screen.

Pipes are unidirectional i.e data flows from left to right through the pipeline.

You might also like