Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 31

(Unit –I)

Lesson -1

UNIT OUTCOMES
1.Explain the functioning of given component of OS
2. Explain characteristics of the given type of operating system.
3. Identify type of the operating system suitable for the given type of
application.
4. Execute command on command line for the given task.
1.1 Definitions of Operating system

• An operating system (OS) is a system software that acts as interface


between the user and hardware of computer and also controls the
execution of application programs. It is also called as resource
manager.
• Operating system(OS) is a program that manages a computer's
resources, especially the allocation of those resources among other
programs. Typical resources include the central processing unit
(CPU), computer memory, file storage, input/output (I/O) devices, and
network connections.
• Operating system (OS) is an integrated set of programs that is used to
manage the various resources and overall operations of a computer
system
• Objectives : 1. Convenience – More convenient to use, user friendly
2. Efficiency – Allows different system resources in efficient manner
3. Ability to evolve – Effective development, testing, executing and
introduction of new functions.
Major operating systems and memory hierarchy

1. MS-DOS 2. Microsoft Windows 3. Mac OS


4. OS/2 5.Unix 6. Linux 7. Sun solaris 8. Mobile OS (Android)
9. OS/2
User interface or Command interpreter –
a) Provides interface between user and computer
hardware. Either through set of commands (CUI) or
Graphically (GUI)
Concept of Operating System
There are three categories of software . System software , Application software
and Software development languages advanced and web tools. Among these
software, system software plays important role in operating machine(computer) as it
helps in starting and booting up the machine.
System software includes operating system, compiler and interpreter, utilities like
disk compression, disk defragmentation, disk cleanup.
Following figure shows interaction between hardware,OS, software and users
Basic structure of OS Concept of OS continued
Parts of Operating System
1. User
2. Shell/Command interpreter
3. Kernel
4. Hardware
Structure of OS have layered structure.
Bottom most part is hardware. Upper most part is User Interface
and between these two layers kernel layer & Shell layer
1. User –
On the basis of the role of users , they can be categorised as
Programmers, Operational Users (responsible for installation of
software , software maintenance), End Users.
 Programs (application/system) in the user interface part either
provide CLI (Command Line Interface) or GUI (Graphical User
interface to the user.
 User interacts with the shell or command interpreter to request for
the use of resources and services provided by the system.
continued
2. Shell /Command interpreter– The Shell is a software that provides an
interface for users of an operating system access the services of a
kernel. The shell is the layer of programming that understands and
executes the commands that user enters. In some systems shell is
called as command interpreter.
3. Kernel - The kernel is the inner most layer and is the central
controlling part of operating system. Kernel is the core of the operating
system and provides basic services like process management, memory
management, file management, device management, I/o management
etc. The services of a kernel are requested by other parts of the
operating system or by application program through a specified set of
program interface known as system calls.
4. Hardware - is a physical parts of computer provides basic computing
resources like CPU, Memory, I/O devices, Networking devices and other
devices like motherboard, power supply, DVD writer etc.
Components of os
Functions of components in brief
1. Process Management –
a) To provide control access to shared resources like file, memory, I/O and CPU.
b) Control the execution of user applications
c) Creation, execution and deletion of user and system processes.
d) Resume a process execution or cancel it.
e) Scheduling of a process
g) Synchronisation, interprocess communication and deadlock handling for processes.
2. Memory Management –
a) Allocation of memory to the processes
b) Free the memory from process after completion of execution
c) Reallocation of memory to a program after used block becomes free
d) Keep track of memory usage by the process
3. File Management –
a) Creation and deletion of files and directories
b) Provide access to files and allocation of storage space for files
c) Maintain backup of files
d) File security
Continued..

4. Device Management –
a) To open, close and write device drivers.
b) Communicate, control and monitor the device drivers
5. Secondary storage Management –
a) Managing the free space available on the secondary storage.
b) Allocation of storage space when new files have to be written
c) Scheduling the requests for memory access
6. Protection and security –
a) Assigns the user authentication
b) Assigns file attributes such as read, write, Hide, encryption.
c) Facilitates backup of data
7. User interface or Command interpreter –
a) Provides interface between user and computer hardware. Either through
set of commands (CUI) or Graphically (GUI)
8. Booting the Computer –
a) Provides mechanism for cold booting and hot booting computer.
9. Performs the basic computer tasks –
a) OS manages peripheral devices like mouse, keyboard, monitor, printer etc.
b) OS facilitates plug and play device and detect and configured without any user
interference.
Operations /Functions/Tasks of Operating System
Functions :
1.Transferring input from input devices to memory and from memory to CPU
2.Shifting processed data from CPU to output devices.
3.Show messages on the screen in case of input as well as output
4.Control input devices and output devices.
5.Loading of application programs from storage devices into main memory.
6.Copy or move data from one storage devices to other.
7.Display appropriate messages by giving the current status of peripherals and
processes.
8.Execution of programs and user instruction and protection of storage devices from
overwriting.
9.Maintain details of files or directories with their respective details.
10.To provide security to user’s data, programs and other files.

In short – There are many important functions performed by an operating system


like memory management, I/O management , process management, file
management, Device management, scheduling security and protection etc.,
Operations of OS with respect to Dual mode operation
• Dual-mode operation forms the basis for I/O protection, memory
protection and CPU protection.
• For proper operation and correct output, operating system must be
protected from any malfunctioning programs. Shared resources also
needs some kind of protection.
• In dual-mode operation, there are two separate modes:
monitor mode (also called 'system mode' and 'kernel mode') and
user mode. In kenel mode, the CPU can use all instructions and access
all areas of memory.
 For indicating current mode of the system, mode bit is used in
computer hardware. The mode bit is made ‘0’ for kernel mode and
mode bit ‘1’ is made for user mode. Mode bit can be able to distinguish
between a task that executed in user or kernel mode.
Dual mode operation of OS
User mode –
When the computer system run user applications like creating a text document or
using any application program, then the system is in the user mode. When the
user application requests for a service from the operating system , an interrupt
occurs or system call, then there will be a transition from user to kernel mode to
fulfills the requests.
Note: To switch from kernel mode to user mode, mode bit should be 1.
Given below image describes what happen when an interrupt occurs:
Kernel Mode –
When the system boots, hardware starts in kernel mode and when
operating system is loaded, it start user application in user mode. To
provide protection to the hardware, we have privileged instructions
which execute only in kernel mode. If user attempt to run privileged
instruction in user mode then it will treat instruction as illegal and traps to
OS. Some of the privileged instructions are:
Handling Interrupts
To switch from user mode to kernel mode.
Input-Output management.
Note: To switch from user mode to kernel mode mode bit should be 0.
Program management :-
• Following are the major activities of an OS with respect to program
management
1. Handles program’s execution
2. Loads a program into memory
3. Provides a mechanism for deadlock handling
4. Provides mechanism for process communication

Resource Management –
1, OS allocates computer resources such as CPU time, main
memory, secondary storage and input and output devices for use
2. The OS manages all kind of resources using schedulers
3. CPU scheduling algorithms are used for better utlisation of
CPU.
Security and Protection-
1. Security and protection measures to prevent a user from illegally
using resources in a computer system.
2. Security is a measure taken to maintain the integrity of the
system and corresponding data.
3. Security provides both internal and external protection to the
system.
4.Protection refers to the mechanism for controlling the access of
the resources of the system .
5. Security and protection can be done by ensuring integrity,
confidentiality and availability in the operating system. The system must
be protect against unauthorized access, viruses, worms etc.
Lesson - 3

Views of OS
 An operating system is a construct that allows the user application
programs to interact with the system hardware.
 Operating system by itself not only provides functions but it also
provides atmosphere in which different applications and programs can do useful
work.
 OS can be observed from the point of view of the user or the system.
This is known as user view and system view respectively.

User View Operating System System view

1.User view:
 User view depends on the system interface. The goal of any operating
system is to maximise the work and minimise the effort of the user.
continued
 Most of the systems are designed to be operated by a single user, however in some
system multiple users can share resources memory. In these cases operating system
is designed to handle available resources among multiple users and CPU efficiently.
In embedded systems (automated system) user view is not present.
Operating system gives an effect to the user as if the processor is dealing only with
the current task, But in the background , processor is dealing with several processes.
In user view OS provides a way to make user to maximise work task and minimise
efforts.
System View :
From the system point of view operating system is a program involved with
hardware. Os is especially deals with the operation and control of I/O devices.
Operating system allocates memory resource among various processes. It controls
the sharing of resources among programs.
It prevents improper usage error and handle deadlock conditions. OS runs all the
time in the form of kernel. Control program manages the execution of user program.
OS can be viewed as a way to make using hardware easier.
1.2 Different type of Operating system
1. Batch operating system 2. Multiprogrammed OS 3. Time shared OS 4.
Multiprocessor OS 5. Distributed OS 6. Real Time OS 7. Mobile OS(Android,
IOS)
2. Batch operating system :
Batch processing is a technique in which an OS collects the programs and
data together in a batch before processing.
Each user prepares his job on an off-line device like punch cards and submits
it to the computer operator. To speed up processing, jobs with similar needs
are batched together and run as a group.
An OS does the following activities related to batch processing
* The OS defines a job which has predefined sequence of commands,
programs and data as single unit.
* Jobs are processed in order of submission i.e. First come first serve.
When job completes its execution, its memory is released and the output for
the job gets copied into an output spool for later printing or processing.
* Batch monitor program in main memory is used to implement batch
processing system. Batch monitor is also called kernel, Kernel resides in one
part of the computer main memory. Batch monitor controls the sequence of
events.
CPU
+
OS
Monitor
Batch Operating System
continued
Advantages :
1. Move much of the work of the operator to the computer.
2. Increased performance since it was possible for job to start as soon as the as
the previous job is finished, without any manual intervention

Disadvantages : 1. Turnaround time can be large form user standpoint.


2.CPU is often idle, because the speed of the mechanical I/O devices is slower
than the CPU.
3. Program debugging is difficult.
4. A job could corrupt the monitor program, thus affecting pending jobs.
5, Due to lack of protection scheme, one batch job can affect pending jobs.

Examples of Batch based Operating System: Payroll System, Bank Statements


etc. 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.
Lesson 4
Spooling in OS
Spooling an acronym for Simultaneous Peripherals Operation On Line. Spooling
uses the disk as a large buffer for outputting data to printers and other devices. It
can be used for input but is generally used for output

Spooling is a process in which data is temporarily held to be used and executed


by a device, program or the system. Data is sent to and stored in memory or other
volatile storage until the program or computer requests it for execution. Spooling
helps to reduce idle time and overlapped I/O and CPU. Spooler for instance could
be reading input of one job while printing the output of different job. It refers to
putting jobs in a buffers (a special area in memory )on a disk where a device can
access them when it is ready.
Advantages of spooling

1. Since there is no interaction of I/O devices with CPU, so the CPU


need not wait for the I/O operation to take place. The I/O operations
take a large amount of time.
2. The CPU is kept busy most of the time and hence it is not in the idle
state which is good to have a situation.
3. More than one I/O devices can work simultaneously.
Multi-programmed Operating system

When two or more programs reside in memory at the same time for
sharing processor is referred as multiprogramming. The operating
system keeps several jobs in memory at a time. This set of jobs is a
subset of the jobs kept in the job pool. The operating system picks and
begins to execute one of the
Multiprogramming assumes a single shared processor.
Multiprogramming increases CPU utilization by organizing jobs so that
the CPU always has one to execute jobs in the memory.
continued

An OS does the following activities related to multiprogramming.


1. The operating system keeps several jobs in memory at a time.
2. This set of jobs is a subset of the jobs kept in the job pool.
3. The operating system picks and begins to execute one of the jobs in
the memory.
4. Multiprogramming operating systems monitor the state of all active
programs and system resources using memory management programs
to ensures that the CPU is never idle, unless there are no jobs to
process.
5. A function of the multi-programmming OS is CPU scheduling, Memory
management and I/O management.
Advantages
1. High and efficient CPU utilization.
2. User feels that many programs are allotted CPU almost
simultaneously.
Disadvantages
1. CPU scheduling is required.
2. To accommodate many jobs in memory, memory management is
Multiprocessor Operating system
* A multiprocessing operating system is capable of running many programs
simultaneously, and most modern network operating systems (NOSs)
support multiprocessing. These operating systems include Windows NT,
2000, XP, and Unix. Although Unix is one of the most widely
used multiprocessing systems.
•Most computer systems are single processor systems i.e they only have one
processor. However, multiprocessor or parallel systems are increasing in
importance nowadays. These systems have multiple processors working in
parallel that share the computer clock, memory, bus, peripheral devices etc.
An image demonstrating the multiprocessor architecture is −
continued
Types of Multiprocessors: There are mainly two types of multiprocessors
i.e. symmetric and asymmetric multiprocessors. They are as follows −
1.Symmetric Multiprocessors 2. Asymmetric Multiprocessors
2.1. Symmetric Processors :
* In symmetric multiprocessing treats all processors are equal rights, an I/O
can be processed on any CPU
*I t is easier to implement in Operating system.
* Single OS manages all processor cores simultaneously
* Master-slave concept is not used.
The processors communicate with each other through shared memory
2. Asymmetric Multiprocessors:
* Asymmetric processing has one master CPU and the remainder CPUs
are slaves
* Its architecture is complex.
* Separate OS separate copy of same OS manage each core
* It uses concept of master slave concept.
* Shared memory is not used for communication
Advantages :
1.Throughput : Throughput increased because number of processor is
increased
2.Cost : Multiprocessor system is cheaper than the multiple single
processor.
3.Reliability : If one processor fails, it has no effect on whole system
operation.
4.Response time: Response time is less because of increased number
of processors.
Disadvantages :
1.Multiprocessor systems are more complex in both hardware and
software.
2.Additional CPU cycles are required to manage the cooperation so per
CPU efficiency goes down.
Difference between multi-programmed and Multiprocessor OS

S.N. Multiprocessing OS Multiprogramming OS

1. Multiprocessing refers to Multiprogramming keeps several


processing of multiple processes programs in main memory at the
at same time by multiple CPUs same time and execute them
concurrently utilising single CPU

2. It permits parallel processing Context switching takes place.

3. Less time taken to process the jobs More time taken to process the jobs

4. It is used in parallel os It is used in batch OS

5. More expensive system Less expensive system

You might also like