0% found this document useful (0 votes)
32 views65 pages

A1841452586 - 23631 - 5 - 2019 - Unit 1 Introduction To Os

Uploaded by

notorioussamen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views65 pages

A1841452586 - 23631 - 5 - 2019 - Unit 1 Introduction To Os

Uploaded by

notorioussamen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 65

Introduction

What is an Operating System?


A program that acts as an intermediary between a user of
a computer and the computer hardware.
An operating system is a powerful, and usually large,
program that controls and manages the hardware and
other software on a computer.
All computers and computer-like devices have operating
systems, including your laptop, tablet, desktop, smart
phone, smart watch
Examples include: Microsoft Windows (like Windows
10,Windows 8, Windows 7, Windows Vista,
and Windows XP), Apple's macOS, iOS, Linux
Need of OS
Need of OS
If the user wants to access any of the hardware they
have to write a program and whenever they want to
access any hardware they have to write the program
everytime. So it would be very complex
For E.g:Print a word file , we need to write the
instruction for printing of the file.
Introduction to Operating System
 What is an Operating system?
 OS is a resource allocator
 Manages all resources
 Decides between conflicting requests for efficient and fair resource

use
 OS is a control program
 Controls execution of programs to prevent errors and improper use

of the computer
 Operating system goals:
 Execute user programs and make solving user problems easier
 Make the computer system convenient to use
 Use the computer hardware in an efficient manner
 An operating system is the one program that is running at all the times
on the computer- usually called the kernel.
Computer System Structure
 Computer system can be divided into four components
 Hardware – provides basic computing resources
 CPU, memory, I/O devices
 Operating system
 Controls and coordinates use of hardware among various

applications and users


 Application programs – define the ways in which the system
resources are used to solve the computing problems of the users
 Word processors, compilers, web browsers, database systems,

video games
 Users
 People, machines, other computers
Four Components of a Computer
System
Functions of operating system
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
Resource Management(For how much time the
resources(hardware) must be allocated to the user.
It is used in parallel processing
Process management:Multiple processes are executed at
the same time.(CPU scheduling)
Storage management(Hard Disk):How to store the data
efficiently& effectively is done by the operating system.
(File System).
Memory Management:(RAM) :allocation and
deallocation of RAM.
Process->RAM->CPU
Memory Management
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
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.
 Coordination between other softwares and users −
Coordination and assignment of compilers, interpreters,
assemblers and other software to the various users of the
computer systems.
Types of OS
Batch operating system
Time-sharing operating system
Distributed operating system
Network operating system
Real-time operating system
Batch operating system
This type of operating system do not interact with the
computer directly.
There is an operator which takes similar jobs having
same requirement and group them into batches.
 It is the responsibility of operator to sort the jobs
with similar needs.
Time sharing os
Each task has 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.
Distributed os
These types of operating system is a recent advancement in the
world of computer technology and are being widely accepted
all-over the world .
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.
These systems processors differ in sizes and functions.
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.
Network Operating System
These systems runs on a server and provides the capability
to manage data, users, groups, security, applications, and
other networking functions.
These type of operating systems allows shared access of
files, printers, security, applications, and other networking
functions over a small private network.
One more important aspect of Network Operating Systems
is that all the users are well aware of the underlying
configuration, of all other users within the network, their
individual connections etc. and that’s why these computers
are popularly known as tightly coupled systems.
Real-Time Operating System
 These types of OSs serves the real-time systems. The time interval
required to process and respond to inputs is very small. This time
interval is called response time.
 Real-time systems are used when there are time requirements are
very strict like missile systems, air traffic control systems, robots etc.
 Two types of Real-Time Operating System which are as follows:
 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.
 Soft Real-Time Systems:
These OSs are for applications where for time-constraint is less strict.
Goals Of OS
Primary Goal
Convenience/User Friendly
Secondary Goal
Efficiency
Multiprogramming& Multitasking
Multiprogrammed OS
 (CPU should not be idle)
 (Non-Preemptive)

 CPU should not be free.

 In this the process1(P1) will be executed fully by

CPU only then the CPU will acquired by the


process(P2),or if the p1 wants to leave otherwise
CPU is not going to release the P1.
Multiprogramming
In multiprogramming system, when one program is
waiting for I/O transfer; there is another program
ready to utilize the CPU. So it is possible for several
jobs to share the time of the CPU. But it is important
to note that multiprogramming is not defined to be
the execution of jobs at the same instance of time
Advantages Of Multiprogramming
 It improves the CPU efficiency by increasing the CPU
utilization.
Increase throughput- Throughput means total
number of programs executed over a fixed period of
time.
Multiprocessing
Multiple Processing means multiple processor.
In a single system ,we have multiple processor like
Octa core->8 Processor
Dual Core->2 Processor
In multiprocessing OS ,more than one process can
run on different CPU at the same time, So there is real
parallel execution of Process.
Multiprocessing

CPU1 CPU2 CPU3

RAM
Advantages Of Multiprocessing
Increased Throughput − By increasing the number
of processors, more work can be completed in a unit
time.
Cost Saving − Parallel system shares the memory,
buses, peripherals etc.
Multiprocessor system thus saves money as
compared to multiple single systems.
Multitasking
Multitasking has the same meaning of
multiprogramming but in a more general sense, as it
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)
Multitasking
Multitasking is an extension to Multiprogramming
OS.
The Jobs will be executed in the time sharing mode.
Multitasking OS
Multitasking/Timesharing Os
Preemptive

(Responsiveness)
Some Specific time limit must be given to

the Process1(P1) if it runs on that particular


time, its well & good otherwise that process
will be run in future and the CPU will be
acquired by the Process2(P2).
System call
To request the OS to perform some activity.
Provides an interface between a process and the OS.
Generally available as assembly language instructions.
As assembly language programmers are becoming
rare and as assembly language programming is
considered difficult , high level languages such as C
allow these system calls to be made directly.
Different system calls
File manipulation system calls such as open, close,
read, write, chmod etc.
System calls for process control. These can be like
abort, execute, create process, terminate a process,
allocate and free memory for a process etc.
For device management eg request device, release
device etc.
For managing the information. Eg, get and set
time, get and set file attributes etc.
System structure
Kernel
control module of an os.
Part of the os which loads first and remains in the main
memory.
A kernel is responsible for memory management,
process and task management and disk management.
Command processor
The part which receives and executes os commands.
When you enter a command, the command processor
makes sure that command is valid and then either
executes it or issues an error message.
System structure
Shell
It is a process that accepts your command line input
and executes whatever program you have called.
Graphical user interface
GUI is there to relieve the user from the burden of
remembering commands.
Different structures of operating
systems
Monolithic Systems
Layered Systems
Microkernels
Client-Server Systems
Monolithic Systems
Monolithic systems provides a basic structure for the
operating system.
 a main program that invokes the requested service procedure
 a set of service procedures that carry out the system calls
 a set of utility procedures that help the service procedure
In Monolithic system model, there is one service procedure
for each system call, that takes care of it. The utility
procedures do jobs that are needed by several service
procedures, such as fetching the data from the user
programs.
This division of the procedures into the following three
layers:
 Main Procedure
 Service Procedures
 Utility Procedures
Functionality of the OS is invoked with simple
function calls within the kernel, which is one large
program.
Device drivers are loaded into the running kernel and
become part of the kernel.
Layered Systems

This system has 6 layers as shown in the table given


below.
Here, are the description provided layer by layer.
 Layer 0 - This layer dealt with allocation of the processor,
switching between processes when interrupts occurred or
timers expired
 Layer 1 - This layer did the memory management
 Layer 2 - This layer handled the communication between
each process and the operator console
 Layer 3 - This layer took care of managing the Input/Output
devices and buffering the information streams to and from
them
 Layer 4 - On this layer, user programs were found
 Layer 5 - On this layer, the system operator process was
located
This approach breaks up the operating system into different
layers.
 This allows implementers to change the inner workings, and
increases modularity.
 As long as the external interface of the routines don’t change,
developers have more freedom to change the inner workings of the
routines.
 With the layered approach, the bottom layer is the hardware,
while the highest layer is the user interface.
The main advantage is simplicity of construction and
debugging.
The main difficulty is defining the various layers.
The main disadvantage is that the OS tends to be less efficient
than other implementations.
Microkernel
This structures the operating system by removing all
nonessential portions of the kernel and implementing
them as system and user level programs.
 Generally they provide minimal process and memory
management, and a communications facility.
 Communication between components of the OS is provided
by message passing.
The benefits of the microkernel are as follows:
 Extending the operating system becomes much easier.
 Any changes to the kernel tend to be fewer, since the kernel
is smaller.
 The microkernel also provides more security and reliability.
Main disadvantage is poor performance due to increased
system overhead from message passing.
Client-Server Model

In the client-server model, as shown in the figure


given below, all the kernel does is handle the
communication between the clients and the servers.
By splitting the operating system (OS) up into parts,
each of which only handles one fact of the system,
such as file service, terminal service, process service,
or memory service, each part becomes small and
manageable.
The adaptability of the client-server model, to use in
distributed system is the advantage of this model.
Operating system operations
Dual Mode operations in OS
An error in one program can adversely effect many
processes, it might modify data of another program, or
also can effect the operating system.
For example, if a process stuck in infinite loop then this
infinite loop could effect correct operation of other
processes. So to ensure the proper execution of the
operating system there are two modes of operation:
 User mode
 Kernel mode
User mode –
When the computer system run user application like
creating a text document or using any application
program, then the system is in user mode. When the
user application requests for a service from the
operating system or system call, then there will be a
transition from user to kernel mode to fulfill the
requests.
Note: To switch from kernel mode to user mode,
mode bit should be 1.
Kernel Mode –
When system boots then hardware starts in kernel mode and
when operating system is loaded then 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.
Timer
 We must ensure that the operating system maintains control
over the CPU.
 We must prevent a user program from getting stuck in an
infinite loop or not calling system services and never returning
control to the operating system.
 To accomplish this goal, we can use a timer.
 A timer can be set to interrupt the computer after a specified
period. The period may be fixed (for example, 1/60 second) or
variable (for example, from 1 millisecond to 1 second). A variable
timer is generally implemented by a fixed-rate clock and a counter.
 The operating system sets the counter. Every time the clock ticks,
the counter is decremented. When the counter reaches 0, an
interrupt occurs.
Operating system services
An Operating System provides services to both the users and to
the programs.
 It provides programs an environment to execute.
 It provides users the services to execute the programs in a
convenient manner.
Following are a few common services provided by an operating
system
 Program execution
 I/O operations
 File System manipulation
 Communication
 Error Detection
 Resource Allocation
 Protection
Program execution
Operating systems handle many kinds of activities from
user programs to system programs like printer spooler,
name servers, file server, etc. Each of these activities is
encapsulated as a process.
A process includes the complete execution context (code
to execute, data to manipulate, registers, OS resources in
use). Following are the major activities of an operating
system with respect to program management −
 Loads a program into memory.
 Executes the program.
 Handles program's execution.
 Provides a mechanism for process synchronization.
 Provides a mechanism for process communication.
 Provides a mechanism for deadlock handling.
I/O Operation
An I/O subsystem comprises of I/O devices and their
corresponding driver software. Drivers hide the
peculiarities of specific hardware devices from the
users.
An Operating System manages the communication
between user and device drivers.
I/O operation means read or write operation with any
file or any specific I/O device.
Operating system provides the access to the required
I/O device when required.
File system manipulation
 A file represents a collection of related information.
 Computers can store files on the disk (secondary storage), for long-
term storage purpose.
 Examples of storage media include magnetic tape, magnetic disk and
optical disk drives like CD, DVD.
 Each of these media has its own properties like speed, capacity, data
transfer rate and data access methods.
 A file system is normally organized into directories for easy navigation
and usage. These directories may contain files and other directions.
Following are the major activities of an operating system with respect
to file management −
 Program needs to read a file or write a file.
 The operating system gives the permission to the program for operation
on file.
 Permission varies from read-only, read-write, denied and so on.
 Operating System provides an interface to the user to create/delete files.
 Operating System provides an interface to the user to create/delete
directories.
 Operating System provides an interface to create the backup of file
system.
Communication
In case of distributed systems which are a collection of
processors that do not share memory, peripheral devices,
or a clock, the operating system manages communications
between all the processes. Multiple processes
communicate with one another through communication
lines in the network.
The OS handles routing and connection strategies, and
the problems of contention and security. Following are the
major activities of an operating system with respect to
communication −
 Two processes often require data to be transferred between
them
 Both the processes can be on one computer or on different
computers, but are connected through a computer network.
 Communication may be implemented by two methods,
either by Shared Memory or by Message Passing.
Error handling

Errors can occur anytime and anywhere. An error


may occur in CPU, in I/O devices or in the memory
hardware. Following are the major activities of an
operating system with respect to error handling −
The OS constantly checks for possible errors.
The OS takes an appropriate action to ensure correct
and consistent computing.
Resource Management

In case of multi-user or multi-tasking environment,


resources such as main memory, CPU cycles and files
storage are to be allocated to each user or job.
Following are the major activities of an operating
system with respect to resource management −
The OS manages all kinds of resources using
schedulers.
CPU scheduling algorithms are used for better
utilization of CPU.
Protection
Considering a computer system having multiple users and
concurrent execution of multiple processes, the various
processes must be protected from each other's activities.
Protection refers to a mechanism or a way to control the
access of programs, processes, or users to the resources
defined by a computer system. Following are the major
activities of an operating system with respect to protection

 The OS ensures that all access to system resources is
controlled.
 The OS ensures that external I/O devices are protected from
invalid access attempts.
 The OS provides authentication features for each user by
means of passwords.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy