You are on page 1of 71

Unit 2

ITB

By- Tapan Kumar


• Software is a set of programs, which is
designed to perform a well-defined function.
• A program is a sequence of instructions
written to solve a particular problem.
• There are two types of software −
1. System Software
2. Application Software

By- Tapan Kumar


System Software
• The system software is a collection of programs
designed to operate, control, and extend the
processing capabilities of the computer itself.
• System software is generally prepared by the
computer manufacturers.
• These software products comprise of programs
written in low-level languages, which interact with
the hardware at a very basic level.
• System software serves as the interface between the
hardware and the end users.
• Some examples of system software are Operating
System, Compilers, Interpreter,
By- Tapan Kumar Assemblers, etc
By- Tapan Kumar
• Application Software
• Application software products are designed to
satisfy a particular need of a particular
environment.
• All software applications prepared in the
computer lab can come under the category of
Application software.
• Application software may consist of a single
program, such as Microsoft's notepad for writing
and editing a simple text.
• It may also consist of a collection of programs,
often called a software package, which work
together to accomplish a task, such as a
spreadsheet package.By- Tapan Kumar
By- Tapan Kumar
• Features of application software are as follows
1. Close to the user
2. Easy to design
3. More interactive
4. Slow in speed
5. Generally written in high-level language
6. Easy to understand
7. Easy to manipulate and use
8. Bigger in size and requires large storage
space

By- Tapan Kumar


Operating System - Overview
• 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.
By- Tapan Kumar
By- Tapan Kumar
• 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 By- Tapan Kumar
• 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.

By- Tapan Kumar


• 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.

By- Tapan Kumar


• Processor Management
• 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 −
1. Keeps tracks of processor and status of
process. The program responsible for this
task is known as traffic controller.
2. Allocates the processor (CPU) to a process.
3. De-allocates processor when a process is no
longer required. By- Tapan Kumar
• Processor Management
• 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 −
1. Keeps tracks of processor and status of
process. The program responsible for this
task is known as traffic controller.
2. Allocates the processor (CPU) to a process.
3. De-allocates processor when a process is no
longer required. By- Tapan Kumar
• Device Management
• An Operating System manages device
communication via their respective drivers. It
does the following activities for device
management −
1. Keeps tracks of all devices. Program responsible
for this task is known as the I/O controller.
2. Decides which process gets the device when
and for how much time.
3. Allocates the device in the efficient way.
4. De-allocates devices.

By- Tapan Kumar


• 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 −
1. Keeps track of information, location, uses,
status etc. The collective facilities are often
known as file system.
2. Decides who gets the resources.
3. Allocates the resources.
4. De-allocates the resources.
By- Tapan Kumar
By- Tapan Kumar
Types of Operating System
1. Batch Operating system
2. Multiprogrammed Operating System
3. Multitasking Operating System
4. Multiprocessing Operating System

By- Tapan Kumar


1. Simple Batch Systems
• In the era of 1970s, the Batch processing was very popular.
• The Jobs were executed in batches.
• People were used to have a single computer which was
called mainframe.
• In Batch operating system, access is given to more than
one person; they submit their respective jobs to the
system for the execution using punch cards.
• 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 using punch cards.
By- Tapan Kumar
By- Tapan Kumar
Advantages of Batch Operating System

• It is easy to manage large work repeatedly in


batch systems

By- Tapan Kumar


Disadvantages of Batch Operating System

• The other jobs will have to wait for an


unknown time if any job fails.
• CPU was ideal for most of the time because
when job need I/O then it was not shifted
other jobs rather CPU remains idle till I/O job
is completed

By- Tapan Kumar


2. Multiprogramming Batch Systems
• CPU will never be ideal because it always has
at least one job to execute.
• Whenever process needs I/O then CPU is
switched to other process.
• In multiprogramming OS non-primpitive
scheduling was present i.e. any process can’t
pre-empt the CPU from another process.

By- Tapan Kumar


Disadvantage
• User interaction was not allowed in multi
programmed OS because user interaction
need pre-emptive scheduling.
• If a user want to run different programs
simultaneously than it is not possible.

By- Tapan Kumar


3. Time Sharing Systems
• Each task is given some time to execute, so that all
the tasks work smoothly.
• Each user gets time of CPU as they use single system.
• These systems are also known as Multitasking
Systems.
• The task can be from single user or from different
users also.
• The time that each task gets to execute is called
quantum.
• After this time interval is over OS switches over to
next task.
By- Tapan Kumar
3. Time Sharing Systems

By- Tapan Kumar


Advantages of Time-Sharing OS
• Each task gets an equal opportunity
• Less chances of duplication of software
• CPU idle time can be reduced

By- Tapan Kumar


Distributed Operating System
• Various autonomous interconnected
computers communicate each other using a
shared communication network.
• Independent systems possess their own
memory unit and CPU.
• These are referred as loosely coupled
systems or distributed systems

By- Tapan Kumar


• These system’s processors differ in size and
function.
• The major benefit of working with these types of
operating system is that
• It is always possible that one user can access the
files or software which are not actually present on
his system but on some other system connected
within this network i.e., remote access is enabled
within the devices connected in that network.
• Autonomous means that these are independent
computer and work independently even if network
fails.
By- Tapan Kumar
Network

System 5 System 3 System 4

Disk

System 1 System 2

Disk

By- Tapan Kumar


Advantages Distributed Operating System

1. As there are multiple systems involved, user


at one site can utilize the resources of
systems at other sites for resource-intensive
tasks.
2. Fast processing.
3. Less load on the Host Machine.

• Examples of Distributed Operating System


are- LOCUS etc.
By- Tapan Kumar
Disadvantages of Distributed Operating
System:
• Failure of the main network will stop the
entire communication

By- Tapan Kumar


Real Time Operating System
• Real time system are used in those case where
we have strict time boundation like missile
systems, air traffic control systems, robots
etc.
• Real time system are used in embedded
system.
• Real time system is defined as a system in
which job has deadline, job has to finished by
the deadline (strictly finished).
• If a result is delayed, huge loss may happen.
By- Tapan Kumar
Two types of Real-Time Operating
System which are as follows:
1. Hard Real-Time Systems:
• These OSs are meant for the applications
where time constraints are very strict and even
the shortest possible delay is not acceptable.
• These systems are built for saving life like
automatic parachutes or air bags which are
required to be readily available in case of any
accident.
• Virtual memory is almost never found in these
systems
By- Tapan Kumar
1. Hard Real-Time Systems
• Input device: Sensors are used to bring to
data to CPU.
• There is no hard disk.
• RAM and ROM are used.
• Example : Flight controller system, ventilators

By- Tapan Kumar


2. Soft Real-Time Systems
• These OSs are for applications where time-
constraint is less strict.
• We assign priorities to critical task.
• So they are completed in real time and never
starve for CPU.
• Secondary Memory are present.
• Example : Video game, movie, windows
Operating system.
By- Tapan Kumar
1. Multi programming
• In a modern computing system, there are usually several
concurrent application processes which want to execute.
• Now it is the responsibility of the Operating System to
manage all the processes effectively and efficiently.
One of the most important aspects of an Operating
System is to multi program.
In a computer system, there are multiple processes
waiting to be executed, i.e. they are waiting when the
CPU will be allocated to them and they begin their
execution.
• These processes are also known as jobs.
• Now the main memory is too small to accommodate all
of these processes or jobs into it.
By- Tapan Kumar
• Thus, these processes are initially kept in an
area called job pool.
• This job pool consists of all those processes
awaiting allocation of main memory and CPU.
• CPU selects one job out of all these waiting
jobs, brings it from the job pool to main
memory and starts executing it.
• The processor executes one job until it is
interrupted by some external factor or it goes
for an I/O task.

By- Tapan Kumar


• Multi programmed system’s working –
• In a multi-programmed system, as soon as one job goes
for an I/O task, the Operating System interrupts that job,
chooses another job from the job pool (waiting queue),
gives CPU to this new job and starts its execution.
• The previous job keeps doing its I/O operation while
this new job does CPU bound tasks.
• Now say the second job also goes for an I/O task, the
CPU chooses a third job and starts executing it.
• As soon as a job completes its I/O operation and comes
back for CPU tasks, the CPU is allocated to it.
• In this way, no CPU time is wasted by the system waiting
for the I/O task to be completed.
Therefore, the ultimate goal of multi programming is to
keep the CPU busy as long as there are processes ready
By- Tapan Kumar
to execute.
• This way, multiple programs can be executed
on a single processor by executing a part of a
program at one time, a part of another
program after this, then a part of another
program and so on, hence executing multiple
programs.
• Hence, the CPU never remains idle.

By- Tapan Kumar


By- Tapan Kumar
• 2. Multiprocessing –
• In a uni-processor system, only one process
executes at a time.
Multiprocessing is the use of two or more CPUs
(processors) within a single Computer system.
• The term also refers to the ability of a system to
support more than one processor within a single
computer system.
• Now since there are multiple processors
available, multiple processes can be executed at a
time.
• These multi processors share the computer bus,
sometimes the clock, memory and peripheral
devices also. By- Tapan Kumar
• Multi processing system’s working –
• With the help of multiprocessing, many processes can
be executed simultaneously.
• Say processes P1, P2, P3 and P4 are waiting for
execution.
• Now in a single processor system, firstly one process
will execute, then the other, then the other and so on.
• But with multiprocessing, each process can be
assigned to a different processor for its execution.
• If its a dual-core processor (2 processors), two
processes can be executed simultaneously and thus
will be two times faster, similarly a quad core processor
will be four times as fast as a single processor.

By- Tapan Kumar


• Why use multi processing –
• The main advantage of multiprocessor system is to get
more work done in a shorter period of time.
• These types of systems are used when very high speed is
required to process a large volume of data.
• Multi processing systems can save money in comparison
to single processor systems because the processors can
share peripherals and power supplies.
• It also provides increased reliability in the sense that if
one processor fails, the work does not halt, it only slows
down. e.g.
• if we have 10 processors and 1 fails, then the work does
not halt, rather the remaining 9 processors can share the
work of the 10th processor.
• Thus the whole system runs only 10 percent slower,
rather than failing altogether.
By- Tapan Kumar
Multiprocessing refers to the hardware (i.e., the CPU units)
rather than the software (i.e., running processes).
If the underlying hardware provides more than one processor
then that is multiprocessing.
It is the ability of the system to leverage multiple processors’
computing power.
By- Tapan Kumar
• Difference between Multi programming and Multi
processing –
• A System can be both multi programmed by having
multiple programs running at the same time and
multiprocessing by having more than one physical
processor.
• The difference between multiprocessing and multi
programming is that Multiprocessing is basically
executing multiple processes at the same time on
multiple processors, whereas multi programming is
keeping several programs in main memory and
executing them concurrently using a single CPU only.
• Multiprocessing occurs by means of parallel processing
whereas Multi programming occurs by switching from
one process to other (phenomenon called as context
switching). By- Tapan Kumar
• 3. Multitasking –
• As the name itself suggests, multi tasking refers to
execution of multiple tasks (say processes, programs,
threads etc.) at a time.
• In the modern operating systems, we are able to play
MP3 music, edit documents in Microsoft Word, surf
the Google Chrome all simultaneously, this is
accomplished by means of multi tasking.
• Multitasking is a logical extension of multi
programming.
• The major way in which multitasking differs from
multi programming is that multi programming works
solely on the concept of context switching whereas
multitasking is based on time sharing alongside the
concept of context switching
By- Tapan Kumar
• Multi tasking system’s working –
• In a time sharing system, each process is assigned some
specific quantum of time for which a process is meant to
execute.
• Say there are 4 processes P1, P2, P3, P4 ready to execute.
• So each of them are assigned some time quantum for
which they will execute e.g time quantum of 5
nanoseconds (5 ns).
• As one process begins execution (say P2), it executes for
that quantum of time (5 ns).
• After 5 ns the CPU starts the execution of the other
process (say P3) for the specified quantum of time.
• Thus the CPU makes the processes to share time slices
between them and execute accordingly.
• As soon as time quantum of one process expires, another
process begins its execution.
By- Tapan Kumar
• Here also basically a context switch is
occurring but it is occurring so fast that the
user is able to interact with each program
separately while it is running.
• This way, the user is given the illusion that
multiple processes/ tasks are executing
simultaneously. But actually only one process/
task is executing at a particular instant of time.
• In multitasking, time sharing is best
manifested because each running process
takes only a fair quantum of the CPU time.

By- Tapan Kumar


• In a more general sense, multitasking refers to
having multiple programs, processes, tasks,
threads running at the same time.
• This term is used in modern operating systems
when multiple tasks share a common
processing resource (e.g., CPU and Memory).

By- Tapan Kumar


• As depicted in the above image, At any time
the CPU is executing only one task while other
tasks are waiting for their turn.
• The illusion of parallelism is achieved when
the CPU is reassigned to another task. i.e all
the three tasks A, B and C are appearing to
occur simultaneously because of time sharing.
• So for multitasking to take place, firstly there
should be multiprogramming i.e. presence of
multiple programs ready for execution.
• And secondly the concept of time sharing.

By- Tapan Kumar


• Language Processors: Assembler, Compiler
and Interpreter

By- Tapan Kumar


• Language Processors –  
• Compilers, interpreters, translate programs written in
high-level languages into machine code that a
computer understands.
• And assemblers translate programs written in low-
level or assembly language into machine code.
• In the compilation process, there are several stages.
• To help programmers write error-free code, tools are
available.
• Assembly language is machine-dependent, yet
mnemonics used to represent instructions in it are not
directly understandable by machine and high-Level
language is machine-independent. A computer
understands instructions in machine code, i.e. in the
form of 0s and 1s. By- Tapan Kumar
• It is a tedious task to write a computer program
directly in machine code.
• The programs are written mostly in high-level
languages like Java, C++, Python etc. and are
called source code.
• These source code cannot be executed directly by
the computer and must be converted into
machine language to be executed.
• Hence, a special translator system software is
used to translate the program written in a high-
level language into machine code is called
Language Processor and the program after
translated into machine code (object
program/object code).  
By- Tapan Kumar
• 1. Compiler : 
The language processor that reads the complete
source program written in high-level language as
a whole in one go and translates it into an
equivalent program in machine language is called
a Compiler.  
• Example: C, C++, C#, Java.  
• In a compiler, the source code is translated to
object code successfully if it is free of errors.
• The compiler specifies the errors at the end of
the compilation with line numbers when there
are any errors in the source code.
• The errors must be removed before the compiler
can successfully recompile the source code again
By- Tapan Kumar
By- Tapan Kumar
• 2. Assembler :
The Assembler is used to translate the program written in
Assembly language into machine code.
• The source program is an input of an assembler that
contains assembly language instructions.
• The output generated by the assembler is the object code
or machine code understandable by the computer.
• Assembler is basically the 1st interface that is able to
communicate humans with the machine.
• We need an Assembler to fill the gap between human and
machine so that they can communicate with each other.
• code written in assembly language is some sort of
mnemonics(instructions) like ADD, MUL, MUX, SUB, DIV,
MOV and so on.
• and the assembler is basically able to convert these
mnemonics in Binary code.By- Tapan Kumar
• Here, these mnemonics also depend upon the
architecture of the machine. 
• For example, the architecture of intel 8085
and intel 8086 are different.

By- Tapan Kumar


• 3. Interpreter : 
The translation of a single statement of the source
program into machine code is done by a language
processor and executes immediately before moving
on to the next line is called an interpreter.
• If there is an error in the statement, the interpreter
terminates its translating process at that statement
and displays an error message.
• The interpreter moves on to the next line for
execution only after the removal of the error.
• An Interpreter directly executes instructions written
in a programming or scripting language without
previously converting them to an object code or
machine code.            
• Example: Perl, Python By- and Matlab.
Tapan Kumar
By- Tapan Kumar
Computer languages
• There are mainly three different languages
with the help of which we can develop
computer programs. And they are
1. Machine Level language
2. Assembly Level Language and
3. High-Level Language

By- Tapan Kumar


• Machine Level Language
• The computer can understand only the
language of Digital Electronics.
• Digital Electronics deals with the presence and
absence of voltages.
• Within the computer there are two logics can
play their role. These logics are −
• Positive Logic − Here presence of voltage will
be denoted by 1 and absence of voltage will
be denoted by 0
• Negative Logic − Here presence of voltage will
be denoted by 0 and absence of voltage will
be denoted by 1 By- Tapan Kumar
• But obviously, the computer can follow any one of the
logic at a time, not both the logics simultaneously.
• To make the computer understand, a program can be
written using only 0s and 1s.
• The data can also be specified and represented using only
0s and 1s.
• Such a program is called Machine Language program.
• Machine language was the first in the evolution of
computer programming languages.
• Computer directly understands a program written in the
machine language.
• So as a result, the machine language program does not
require any translator to convert from one form to
another.
• In fact, even to this day, basically, computers understand
only the 0s and 1s. By- Tapan Kumar
• Assembly Level Language
• After machine level language, the next level of
development in the evolution of computer languages was
the Assembly Language.
• Machine level language uses only the binary language.
• But on the other hand, assembly language uses mnemonics
or symbolic instructions in place of a sequence of 0s and
1s.
• As fewer examples, we can consider that to add register A
and B in a particular computer, assembly language uses the
mnemonic ‘ADD B’ in place of 10001111.
• In assembly language, we use symbolic names to denote
addresses and data.
• A number of such examples are dealt with in the successive
chapters.
• Thus writing a program inBy-assembly
Tapan Kumar language has
• High Level Language
• High level language is the next development in the
evolution of computer languages.
• Examples of some high-level languages are given below
• PROLOG (for “PROgramming LOGic”)
• FORTRAN (for ‘FORrmula TRANslation’)
• LISP (for “LISt Processing”)
• Pascal (named after the French scientist Blaise Pascal).
• High-level languages are like English-like language, with
less words also known as keywords and fewer
ambiguities.
• Each high level language will have its own syntax and
keywords.
• The meaning of the word syntax is grammar.
By- Tapan Kumar
By- Tapan Kumar
By- Tapan Kumar
By- Tapan Kumar
What is a directory?
• Directory can be defined as the listing of the related files
on the disk.
• The directory may store some or the entire file attributes.
• To get the benefit of different file systems on the different
operating systems,
• A hard disk can be divided into the number of partitions
of different sizes.
• The partitions are also called volumes or mini disks.
• Each partition must have at least one directory in which,
all the files of the partition can be listed.
• A directory entry is maintained for each file in the
directory which stores all the information related to that
file. By- Tapan Kumar
By- Tapan Kumar
• When referring to data storage,
a volume refers to a logical drive (e.g., hard
drive), which has a single file system and is
usually on a single partition
• For instance, on a typical Microsoft
Windows computer, the volume
named C: contains the operating system
• In Windows, any drive which has an
assigned drive letter is a volume.

By- Tapan Kumar

You might also like