UNIT III Operating System
UNIT III Operating System
Operating System
An Operating System (OS) is a collection of software that manages computer hardware resources
and provides common services for computer programs. When you start using a Computer System
then it's the Operating System (OS) which acts as an interface between user and the computer
hardware. The operating system is really a low level Software which is categorised as a System
Software and supports a computer's basic functions, such as memory management, tasks scheduling
and controlling peripherals etc.
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.
• Computer Users are the users who use the overall computer system.
• Application Softwares are the softwares which users use directly to perform different
activities. These softwares are simple and easy to use like Browsers, Word, Excel, different
Editors, Games etc. These are usually written in high-level languages, such as Python, Java
and C++.
• System Softwares are the softwares which are more complex in nature and they are more
near to computer hardware. These software are usually written in low-level languages like
assembly language and includes Operating Systems (Microsoft Windows, macOS, and Linux),
Compiler, and Assembler etc.
There are plenty of Operating Systems available in the market which include paid and unpaid (Open
Source). Following are the examples of the few most popular Operating Systems:
• Windows: This is one of the most popular and commercial operating systems developed and
marketed by Microsoft. It has different versions in the market like Windows 8, Windows 10
etc and most of them are paid.
• Linux This is a Unix based and the most loved operating system first released on September
17, 1991 by Linus Torvalds. Today, it has 30+ variants available like Fedora, CentOS, UBuntu
etc. Most of them are available free of charges though you can have their enterprise
versions by paying a nominal license fee.
• MacOS This is again a kind of Unix operating system developed and marketed by Apple Inc.
since 2001.
PRASHANTH C PATEL 1
SMRSISM Operating System
• Android This is a mobile Operating System based on a modified version of the Linux kernel
and other open source software, designed primarily for touchscreen mobile devices such as
smartphones and tablets.
Some other old but popular Operating Systems include Solaris, VMS, OS/400, AIX, z/OS, etc.
To brief, Following are some of important functions of an operating System which we will look in
more detail in upcoming chapters:
• Process Management
• File Management
• Network Management
• Security Management
• Job Accounting
Process Management
A process is program or a fraction of a program that is loaded in main memory. A process needs
certain resources including CPU time, Memory, Files, and I/O devices to accomplish its task. The
process management component manages the multiple processes running simultaneously on the
Operating System.
The operating system is responsible for the following activities in connection with process
management:
• Provides communication mechanisms so that processes can communicate with each others
PRASHANTH C PATEL 2
SMRSISM Operating System
One of the purposes of an operating system is to hide the peculiarities of specific hardware devices
from the user. I/O Device Management provides an abstract level of H/W devices and keep the
details from applications to ensure proper use of devices, to prevent errors, and to provide users
with convenient and efficient programming environment.
• Manage main memory for the devices using cache and buffer.
File Management
File management is one of the most visible services of an operating system. Computers can store
information in several different physical forms; magnetic tape, disk, and drum are the most common
forms.
A file is defined as a set of correlated information and it is defined by the creator of the file. Mostly
files represent data, source and object forms, and programs. Data files can be of any type like
alphabetic, numeric, and alphanumeric.
A files is a sequence of bits, bytes, lines or records whose meaning is defined by its creator and user.
The operating system implements the abstract concept of the file by managing mass storage device,
such as types and disks. Also files are normally organized into directories to ease their use. These
directories may contain files and other directories and so on.
The operating system is responsible for the following activities in connection with file management:
Network Management
The definition of network management is often broad, as network management involves several
different components. Network management is the process of managing and administering a
computer network. A computer network is a collection of various types of computers connected
with each other.
Network management comprises fault analysis, maintaining the quality of service, provisioning of
networks, and performance management.
Network management is the process of keeping your network healthy for an efficient
communication between different computers.
PRASHANTH C PATEL 3
SMRSISM Operating System
• Network administration
• Network maintenance
• Network operation
• Network provisioning
• Network security
Memory is a large array of words or bytes, each with its own address. It is a repository of quickly
accessible data shared by the CPU and I/O devices.
Main memory is a volatile storage device which means it loses its contents in the case of system
failure or as soon as system power goes down.
The main motivation behind Memory Management is to maximize memory utilization on the
computer system.
The operating system is responsible for the following activities in connections with memory
management:
• Keep track of which parts of memory are currently being used and by whom.
The main purpose of a computer system is to execute programs. These programs, together with
the data they access, must be in main memory during execution. Since the main memory is too
small to permanently accommodate all data and program, the computer system must provide
secondary storage to backup main memory.
Most modern computer systems use disks as the principle on-line storage medium, for both
programs and data. Most programs, like compilers, assemblers, sort routines, editors, formatters,
and so on, are stored on the disk until loaded into memory, and then use the disk as both the
source and destination of their processing.
The operating system is responsible for the following activities in connection with disk
management:
• Storage allocation
• Disk scheduling
PRASHANTH C PATEL 4
SMRSISM Operating System
In the 1970s, Batch processing was very popular. In this technique, similar types of jobs were
batched together and executed in time. People were used to having a single computer which was
called a mainframe.
In Batch operating system, access is given to more than one person; they submit their respective
jobs to the system for the execution. The system put all of the jobs in a queue on the basis of first
come first serve and then executes the jobs one by one. The users collect their respective output
when all the jobs get executed.
Multiprogramming is an extension to batch processing where the CPU is always kept busy. Each
process needs two types of system time: CPU time and IO time.
In a multiprogramming environment, when a process does its I/O, The CPU can start the execution of
other processes. Therefore, multiprogramming improves the efficiency of the system.
In Multiprocessing, Parallel computing is achieved. There are more than one processor present in
the system which can execute more than one process at the same time. This will increase the
throughput of the system.
PRASHANTH C PATEL 5
SMRSISM Operating System
An Operating system, which includes software and associated protocols to communicate with other
computers via a network conveniently and cost-effectively, is called Network Operating System.
In Real-Time Systems, each job carries a certain deadline within which the job is supposed to be
completed, otherwise, the huge loss will be there, or even if the result is produced, it will be
completely useless.
The Application of a Real-Time system exists in the case of military applications, if you want to drop
a missile, then the missile is supposed to be dropped with a certain precision.
PRASHANTH C PATEL 6
SMRSISM Operating System
In the Time Sharing operating system, computer resources are allocated in a time-dependent fashion
to several programs simultaneously. Thus it helps to provide a large number of user's direct access
to the main computer. It is a logical extension of multiprogramming. In time-sharing, the CPU is
switched among multiple programs given by different users on a scheduled basis.
PRASHANTH C PATEL 7
SMRSISM Operating System
It connects multiple computers via a single communication channel. Each of these systems has its
own processor and memory. Additionally, these CPUs communicate via high-speed buses or
telephone lines. Individual systems that communicate via a single channel are regarded as a single
entity.
A single-user operating system is a type of operating system developed and intended for use on a
computer or similar machine that will only have a single user at any given time. This type of OS is
typically used on devices like wireless phones and two-way messaging devices.
The operating system is responsible for handling many different tasks and is typically one of the
most important programs used on a computer. It manages memory usage and other resources,
hardware connectivity and the proper execution of other applications. A single task operating
system can only run one program or application at a time. So it is not as useful for a computer or
other device intended to run multiple programs at once.
These are the software that directly allows the user to interact with the hardware components of a
computer system. As the humans and machines follow different languages, there has to be an
interface that will allow the users to interact with the core system, this interface is provided by the
software. The system software can be called the main software of a computer system as it handles
the major portion of running a hardware. This System Software can be further divided into four
major types:
PRASHANTH C PATEL 8
SMRSISM Operating System
The Operating System – It is the main program that governs and maintains the inter-cooperation of
the components of a computer system. For eg., Microsoft Windows, Linux, Mac OS etc.
• The Language Processor – The hardware components present in the computer system does
not understand human language. There are three types of languages involved in the world of
human-machine interaction:
• Machine-Level Language: The machines only understand the digital signals or the binary
codes or the binary language which consist of strings of 0’s and 1’s. These are totally
machine dependent language.
• High-Level Language: These are the simple English statements, that humans use to program
and code as it is easy to read and understand to the human world. For eg., Java, C, C++,
Python etc.
The machine level language is very complex to understand and code, therefore the users prefer
the High-Level Language or the HLL for coding. These codes need to be converted into the machine
language so that the computer can easily understand and work accordingly. This operation is
performed by the Language Processor which is made up of further three components:
• Assembler: This language processor is used to convert the assembly language into machine
level language.
• Compiler: This language processor is used to convert High-Level Language into machine level
language in one go, thus execution time is fast. The error detection is difficult in a compiler.
Programming Languages like C, C++ and Scala use compiler.
• The Device Drivers – The device drivers and the device programs or the system software
that acts as an interface between the various Input-Output device and the users or the
operating system. For eg., the Printers, Web cameras come with a driver disk that is needed
to be installed into the system to make the device run in the system.
• The BIOS – It stands for Basic Input Output System and is a small firmware, that controls the
peripheral or the input-output devices attached to the system. This software is also
responsible for starting the OS or initiating the booting process.
Application Software
PRASHANTH C PATEL 9
SMRSISM Operating System
These are the basic software used to run to accomplish a particular action and task. These are the
dedicated software, dedicated to performing simple and single tasks. For eg., a single software
cannot serve to both the reservation system and banking system. These are divided into two types:
1. The General Purpose Application Software: These are the types of application software that
comes in-built and ready to use, manufactured by some company or someone. For eg.,
3. Adobe Photoshop – Used for designing and animation and many more.
2. The Specific Purpose Application Software: These are the type of software that is
customizable and mostly used in real-time or business environment. For eg.,
Utility Software
These are the most basic type of software which provides high utility to the user and the system.
These perform the basic but daily need tasks. For eg.,
• Antivirus Softwares: These provide protection to the computer system from unwanted
malware and viruses. For eg., QuickHeal, McAfee etc.
• Disk Defragmenter Tools: These help the users to analyse the bad sectors of the disk and
rearrange the files in a proper order.
• Text-editors: These help the users to take regular notes and create basic text files. For eg.,
Notepad, Gedit etc.
1
PRASHANTH C PATEL
0
SMRSISM Operating System
Multi-user: UNIX operating system supports more than one user to access computer
resources like main memory, hard disk, tape drives, etc. Multiple users can log on to
the system from different terminals and run different jobs that share the resources of
a command terminal. It deals with the principle of time-sharing. Time-sharing is done
by a scheduler that divides the CPU time into several segments also called a time
slice, and each segment is assigned to each user on a scheduled basis. This time slice
is tiny. When this time is expired, it passes control to the following user on the
system. Each user executes their set of instructions within their time slice.
Portability: This feature makes the UNIX work on different machines and platforms with the
easy transfer of code to any computer system. Since a significant portion of UNIX is written
in C language, and only a tiny portion is coded in assembly language for specific hardware.
1
PRASHANTH C PATEL
1
SMRSISM Operating System
UNIX Tools and Utilities: UNIX system provides various types of tools and utilities
facilities such as UNIX grep, sed and awk, etc. Some of the general-purpose tools are
compilers, interpreters, network applications, etc. It also includes various server
programs which provide remote and administration services.
1
PRASHANTH C PATEL
2
SMRSISM Operating System
Layer-1: Hardware -
This layer of UNIX consists of all hardware-related information in the UNIX
environment.
Layer-2: Kernel -
The core of the operating system that's liable for maintaining the full functionality is
named the kernel. The kernel of UNIX runs on the particular machine hardware and
interacts with the hardware effectively.
It also works as a device manager and performs valuable functions for the processes
which require access to the peripheral devices connected to the computer. The
kernel controls these devices through device drivers.
The kernel also manages the memory. Processes are executed programs that have
owner's humans or systems who initiate their execution.
1
PRASHANTH C PATEL
3
SMRSISM Operating System
It also keeps a history of the list of the commands you have typed in. If you need to
repeat a command you typed it, use the cursor keys to scroll up and down the list or
type history for a list of previous commands. There are various commands like cat,
mv, cat, grep, id, wc, and many more.
o Bourne Shell: This Shell is simply called the Shell. It was the first Shell for
UNIX OS. It is still the most widely available Shell on a UNIX system.
o C Shell: The C shell is another popular shell commonly available on a UNIX
system. The C shell was developed by the University of California at Berkeley
and removed some of the shortcomings of the Bourne shell.
o Korn Shell: This Shell was created by David Korn to address the Bourne Shell's
user-interaction issues and to deal with the shortcomings of the C shell's
scripting quirks.
1
PRASHANTH C PATEL
4
SMRSISM Operating System
Multi-user: UNIX operating system supports more than one user to access computer
resources like main memory, hard disk, tape drives, etc. Multiple users can log on to
the system from different terminals and run different jobs that share the resources of
a command terminal. It deals with the principle of time-sharing. Time-sharing is done
by a scheduler that divides the CPU time into several segments also called a time
slice, and each segment is assigned to each user on a scheduled basis. This time slice
is tiny. When this time is expired, it passes control to the following user on the
system. Each user executes their set of instructions within their time slice.
Portability: This feature makes the UNIX work on different machines and platforms with the
easy transfer of code to any computer system. Since a significant portion of UNIX is written
in C language, and only a tiny portion is coded in assembly language for specific hardware.
1
PRASHANTH C PATEL
5
SMRSISM Operating System
UNIX Tools and Utilities: UNIX system provides various types of tools and utilities
facilities such as UNIX grep, sed and awk, etc. Some of the general-purpose tools are
compilers, interpreters, network applications, etc. It also includes various server
programs which provide remote and administration services.
1
PRASHANTH C PATEL
6
SMRSISM Operating System
Layer-1: Hardware -
This layer of UNIX consists of all hardware-related information in the UNIX
environment.
Layer-2: Kernel -
The core of the operating system that's liable for maintaining the full functionality is
named the kernel. The kernel of UNIX runs on the particular machine hardware and
interacts with the hardware effectively.
It also works as a device manager and performs valuable functions for the processes
which require access to the peripheral devices connected to the computer. The
kernel controls these devices through device drivers.
The kernel also manages the memory. Processes are executed programs that have
owner's humans or systems who initiate their execution.
1
PRASHANTH C PATEL
7
SMRSISM Operating System
It also keeps a history of the list of the commands you have typed in. If you need to
repeat a command you typed it, use the cursor keys to scroll up and down the list or
type history for a list of previous commands. There are various commands like cat,
mv, cat, grep, id, wc, and many more.
o Bourne Shell: This Shell is simply called the Shell. It was the first Shell for
UNIX OS. It is still the most widely available Shell on a UNIX system.
o C Shell: The C shell is another popular shell commonly available on a UNIX
system. The C shell was developed by the University of California at Berkeley
and removed some of the shortcomings of the Bourne shell.
o Korn Shell: This Shell was created by David Korn to address the Bourne Shell's
user-interaction issues and to deal with the shortcomings of the C shell's
scripting quirks.
1
PRASHANTH C PATEL
8
SMRSISM Operating System
system22@VirtualBox: ~$ time
system22@VirtualBox: ~$ date
Syntax:
system22@VirtualBox: ~$ last
Most of important configuration in Unix is in clear text files, these commands will let
you quickly inspect files or view logs:
Syntax:
system22@VirtualBox: ~$ cat > sample1
This is Sample1
Control +D to exit
Let’s see the file we just created
system22@VirtualBox: ~$ cat sample1
cd – change directory
Syntax:
system22@VirtualBox: ~$ cd dir_name
ex : system22@VirtualBox: ~$ cd bca
Syntax:
system22@VirtualBox: ~$chmod dir_namr r
system22@VirtualBox: ~$ chmod file_name w
• less – an improved tool for viewing text files (better than more command)
Syntax:
system22@VirtualBox: ~$ less sample1
• head – show the first 10 lines of text file (you can specify any number of lines)
Syntax:
system22@VirtualBox: ~$head sample1
• tail – show the last 10 lines of text file (any number can be specified)
Syntax:
system22@VirtualBox: ~$tail sample1
2
PRASHANTH C PATEL
2
SMRSISM Operating System
2
PRASHANTH C PATEL
3