0% found this document useful (0 votes)
17 views77 pages

Unit I - OS

ppt

Uploaded by

Nikhil Pandey
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)
17 views77 pages

Unit I - OS

ppt

Uploaded by

Nikhil Pandey
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/ 77

UNIT- I/I

Introduction to OS

OS
05/31/24 Unit I/1- Introduction to OS 1
Introduction to OS
1. Introduction to Operating System (OS)Concepts
•Multitasking
•Multiprogramming
•Multiuser
•Multithreading

OS
05/31/24 Unit I/1- Introduction to OS 2
Introduction
2. Types of Operating Systems
to OS
•Batch Operating System
•Time–sharing Systems
•Distributed OS
•Network OS
•Real–Time OS
•Interactive Systems
•Time Slicing

OS
05/31/24 Unit I/1- Introduction to OS 3
Introduction to OS
3. Various Operating System Services
1. User Interface
2. Program Execution
3. I/O Operations
4. File-System Manipulation
5. Communications
6. Error Detection

OS
05/31/24 Unit I/1- Introduction to OS 4
Introduction to OS
4. . Architecture
5. System Calls and Programs
6. Exam Questions

OS
05/31/24 Unit I/1- Introduction to OS 5
Introduction to Operating
System Concepts
• Operating System (OS)
• Resources of a Computer System
• User View
• System View

OS
05/31/24 Unit I/1- Introduction to OS 6
Introduction to Operating
System Concepts
• Objectives and Functions of
OS
• Multiprogramming
• Multitasking
• Multiuser
OS
05/31/24 Unit I/1- Introduction to OS 7
Operating System (OS)
Defn1: OS is software that manages
computer hardware and software resources
and provides common services for
programs.

Defn2: Controls and coordinates use of
Hardware among Various Applications
and Users

Defn3: Collection of System Software


(Programs), which makes it User
friendly and Most efficient
OS
Kernel
05/31/24 Unit I/1- Introduction to OS 8
Program running at all times on the
Kernel
 Central module and Part of the OS that
loads first, and it remains in main memory.
 “The one program running at all times on
the computer” is the kernel. Everything else
is either a system program or an application
program.
 Its loaded into a protected area of memory to
prevent it from being overwritten by
programs or other OSparts of the operating
system. Module Memory
OS
05/31/24 Unit I/1-Introduction to OS 9
Kernel
 Responsible for memory management,
 Process and task management, and
 Disk management.
 The kernel connects the system hardware to
the application software.

 Every OS has a kernel.


 For example the Linux kernel is used in
numerous operating systems including Linux,
FreeBSD ()(OS 1993), Android and others.
OS
05/31/24 Unit I/1-Introduction to OS 10
Most Popular Operating Systems
• AT & T / BSD( Berkeley Software Distribution)
Unix
• Sun Microsystems’
Solaris 2
Linux
• Microsoft
MS-DOS
Windows 95 / 98 / NT
Windows 2000 (Windows Me)
Windows XP
Windows Vista
Windows 7 / Windows 8, 10,11
• DEC (Digital Equipment Corporation)
VMS (Virtual Memory System)
TOPS–20 (Total Operations Processing System)
• IBM
OS/2
• Apple
Macintosh
OS
05/31/24 Unit I/1-Introduction to OS 11
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
OS
05/31/24 Unit I/1-Introduction to OS 12
Computer System Structure
• Computer system can be divided into four
components:
– Application programs – define the ways in
which the system resources are used to solve the
problems of the users
• Word processors, compilers, web browsers,
database systems, video games.

– Users
• People, machines, other computers
OS
05/31/24 Unit I/1-Introduction to OS 13
Resources of a Computer System
Hardware and Software
required to solve a
problem

CPU Time
Memory Space
File Storage Space
I/O Devices …
Four Components of Computer System

OS
05/31/24 Unit I/1-Introduction to OS 14
User View
Varies according to the interface used
Goal……
To maximize the work, the user is performing
• Ease of use
• Performance
• Resource utilization
Minicomputer
• Share Resources
• Exchange Information
• Designed to maximize Resource utilization
All Available CPU Time, Memory and I/O used
efficiently
05/31/24 Unit I/1-Introduction to OS 15
OS
User View (contd.)
• Workstations (Perform Effective Resource
Sharing)
• Connected to Networks of other workstations
and Servers

• Dedicated Resources at disposal

• Also Share Resources such as Networking and


Servers
(File, Compute, Print Servers)
OS
05/31/24 Unit I/1-Introduction to OS 16
User View (contd.)
• Hand-held Computers (Ease of use)
• Standalone units for Individual users
• Connected to Networks
– (Directly by wire / through wireless Modems
and Networking)
• Perform relatively few remote operations
– (Power, Speed, Interface limitations)
• Designed mostly for individual usability

OS
05/31/24 Unit I/1-Introduction to OS 17
User View (contd.)
• Embedded Computers in Home Devices and
Automobiles (Performance)
• Have Numeric Keypads
• May turn indicator lights on or off to show status
• Designed primarily to run without user
intervention

OS
05/31/24 Unit I/1-Introduction to OS 18
System View
Most intimately involved with Hardware
• Resource Allocator
• Acts as Manager of Resources.

• Decides to allocate Resources to Specific


Programs and Users so that OS operates the
Computer System Efficiently and Fairly

• Important as many Users access the same


Mainframe / Minicomputer
OS
05/31/24 Unit I/1-Introduction to OS 19
System View
•Control Program
•Manages Execution of User Programs
to prevent Errors and Improper use of
Computer

•Concerned with Operation and Control of I/O


Devices

OS
05/31/24 Unit I/1-Introduction to OS 20
Objectives and Functions of
Operating System
• Primary Goals-
User friendly
Efficient Operation of the Computer System
Essential part of a Computer System
• Purpose: To provide an environment in which a
User can Execute Programs in a Convenient and
Efficient manner.
• Program that acts as an intermediary between the
User of a Computer and the Computer Hardware OS
05/31/24 Unit I/1-Introduction to OS 21
Objectives and Functions of Operating System
• Must Ensure Correct Operation of Computer
System

• Provides Certain Services to Programs and users of


those programs in order to make their Tasks Easier

• Controls and Coordinates the use of Hardware


among Various Application Programs for the
Various users
OS
05/31/24 Unit I/1-Introduction to OS 22
Computer System
Organization
Computer-system operation
One or more CPUs, device controllers connect
through common bus providing access to shared
memory
Concurrent execution of CPUs and devices
competing for memory cycles

OS
05/31/24 Unit I/1-Introduction to OS 23
Storage-Device
Hierarchy

OS
05/31/24 Unit I/1-Introduction to OS 24
Computer-System
Most systems Architecture
use a single general-purpose processor
.
Most systems have special-purpose processors as
well
Multiprocessors systems growing in use and
importance
Also known as parallel systems, tightly -coupled
systems
Advantages include
1.Increased throughput
2.Economy of scale
3.Increased
05/31/24
reliability – fault
Unit I/1-Introduction to OS
tolerance 25
OS

Two types
Computer-System
S.
Architecture
Asymmetric Multiprocessing Symmetric Multiprocessing
No.

In asymmetric multiprocessing,
In symmetric multiprocessing, all
1. the processors are not treated
the processors are treated equally.
equally.

Tasks of the operating system Tasks of the operating system are


2.
are done by master processor. done individual processor.

No Communication between All processors communicate with


3. Processors as they are controlled another processor by a shared
by the master processor. memory.
OS
05/31/24 Unit I/1-Introduction to OS 26
How a Modern Computer Works

Cache memory is an fast memory type that


acts as a buffer between RAM and the CPU.

A thread refers to a single sequential flow of activities


being executed in a process

OS
05/31/24 Unit I/1-Introduction to OS 27
Symmetric Multiprocessing
Architecture

OS
05/31/24 Unit I/1-Introduction to OS 28
A Dual-Core Design

OS
05/31/24 Unit I/1-Introduction to OS 29

Clustered Systems
30
Cluster is also called as system segmentation in some
applications because clustering partitions large system sets
into groups according to their similarity.

Group-A

Cluster System
Segmentation

Group-B

OS
05/31/24 Unit I/1-Introduction to C 30
Clustered Systems
Like multiprocessor systems, but multiple systems working
together……..
Usually sharing storage via a storage-area network (SAN)
Provides a high-availability service which survives failures
Asymmetric clustering has one machine in hot-stand by
mode
Symmetric clustering has multiple nodes running
applications, monitoring each other.
Some clusters are for high-performance computing (HPC)
Applications must be written to use parallelization
OS
05/31/24 Unit I/1-Introduction to OS 31
Introduction to O S Concepts
• Objectives and Functions of OS
• Single Processor System
• Multiprogramming System
• Multitasking /Multiprocessor
System
• Multithreading
• Multiuser
OS

• Cluster
05/31/24
System Unit I/1-Introduction to OS 32
Single Processor
• A single processor system contains only one
processor. SoSystem
only one process can be executed at a
time and then the process is selected from the ready
queue. Most general purpose computers contain the
single processor systems as they are commonly in
use.

OS
05/31/24 33
Unit I/1-Introduction to OS
Uniprogramming
• Single User System

• Single Program in
execution.

OS
05/31/24 34
Unit I/1-Introduction to OS
Multiprogramming
• No. of Programs in execution.
• Increases CPU utilization by organizing
jobs so that the CPU always has one job
to execute.
• CPU is never idle.
OS
• Keeps several jobs in memory
simultaneously.
• Picks and begins to execute one of
the jobs in the memory.
OS
05/31/24 Unit I/1-Introduction to OS 35
Multiprogramming
• Job may have to wait for some task (I/O
operation) and OS simply switches to, and
executes, another job.
• When that job needs to wait, the CPU is
switched to another job, and so on.
• When the first job finishes waiting, it gets
the CPU back.
Allow time-sharing.

OS
05/31/24 Unit I/1-Introduction to OS 36
Multitasking / Multiprocessing
• Multiple Tasks are
performed during the
Same period of time.

• Tasks Share Common


Processing Resources
such as CPU and Main
Memory.

OS
05/31/24 Unit I/1-Introduction to OS 37
Multitasking
• In Uniprocessor Systems,
Multitasking Solves the
problem
by Scheduling which task
may be the one running at
any given time, and when
another waiting task gets
a turn.
Context Switch
• Act of reassigning a CPU
from one task to another
OS
one.
05/31/24 Unit I/1-Introduction to OS 38
Multiuser
Allows for Multiple users to use the Same
Computer at the Same time and Different
times.

OS
05/31/24 Unit I/1-Introduction to OS 39
Introduction to OS
2. Types of Operating Systems

•Batch Operating System


•Time–sharing Systems
•Distributed OS
•Network OS
•Real–Time OS
•Interactive Systems
•Time Slicing

OS
05/31/24 Unit I/1- Introduction to OS 40
Batch Operating System

 Computer runs one and only one


application at a time.
 Operators batched together jobs
with similar needs and run them
through the computer as a group.

OS
05/31/24 Unit I/1- Introduction to OS 41
Interactive Processing
• User and Computer System
interact.
• User Requests.
• System Responds.
• The process goes on. User System
(Request) (Respond)

OS

05/31/24 Unit I/1-Introduction to OS 42


Time Sharing
Variable CPU Time to different processes.

Once CPU Time is allocated to a process, will not


be interrupted till it completes its execution, or
waiting for an I/O, or cannot continue its
execution.

Process
CPU P1(Task0)
(2 minutes ) Time(2-minutes)

OS

05/31/24 Unit I/1-Introduction to OS 43


Time
Slicing
Equal Amount of CPU time allocated among
Various Processes.
Process
P1(Task1)
CPU Time(5mints)

P2(Task2)
Time(5mints)

OS

05/31/24 Unit I/1-Introduction to OS 44


Distributed Systems
• Distribute the Computation among Several Physical
Processors
Loosely Coupled System
• Each Processor has its Own Local Memory
• Processors Communicate with one another through
Various Communications lines, such as High–Speed
buses or Telephone lines.

Types of Distributed Systems


• Client–Server Systems
• Peer–to–Peer Systems
OS

05/31/24 Unit I/1-Introduction to OS 45


Advantages of Distributed Systems
• Resources Sharing
• Computation Speed up–load Sharing
• Reliability
• Communications
Applications of Distributed Operating System
Network Applications
Telecommunication Networks
Parallel Computation
Real-Time Process Control
OS

05/31/24 Unit I/1-Introduction to OS 46


Real–Time Systems
Special purpose OS…………

Used as control device in a dedicated


application.

Used when rigid time requirements have been


placed on the operation of a processor or the
flow of data.
Sensors bring data to the computer.
The computer analyses the data and possibly
05/31/24 Unit I/1-Introduction to OS 47
OS

adjust controls to modify the sensor inputs.


Real–Time Systems
Well-defined, Fixed-time constraints.
Processing must be done within the defined
constraints.
Ex: Systems controlling scientific experiments
Medical imaging systems
Industrial control systems
Certain display systems
Automobile-engine fuel-injection systems
Home-appliance controllers OS

05/31/24 Unit I/1-Introduction to OS 48


Types of Real–Time Systems
Hard real-time systems
Guarantee critical tasks be completed on time.

Soft real-time systems


Critical real-time task gets priority over other tasks
and retains the priority until it completes.

Ex: Multimedia
Advanced scientific projects

OS

05/31/24 Unit I/1-Introduction to OS 49


Various Operating
Provides No. of Services.
System Services
Lowest level – System Calls
Allow running program to make requests
from the OS directly.
Higher level – Command Interpreter or Shell
User issues request without writing
program.
Categories
1. Program Control
2. Status Requests
OS
3. I/O Requests
05/31/24 Unit I/1-Introduction to OS 50
Operating
System
Services

1. User Interface
2. Program Execution
3. I/O Operations – Other Services
4. File-System Manipulation 1. Resource Allocation
5. Communications 2. Accounting
6. Error Detection 3. Protection and Security OS

05/31/24 Unit I/1-Introduction to OS 51


User Interface
• All Operating Systems have User Interface (UI)
• Command-Line Interface (CLI) is a text-based use
interface (UI) used to run programs.
• Graphics User Interface (GUI) that uses icons, menus
and a mouse (to click on the icon ) to manage
Program
interaction with theExecution
system.
• Load Program into Memory
• Run the Program
• End Execution, either Normally or Abnormally (indicatin
OS

05/31/24 Unit I/1-Introduction to OS 52


Error)
Basic Structure/Components of a Computer System

• Hardware • Application Programs


• Operating System • Users
OS

05/31/24 Unit I/1-Introduction to OS 53


Application Programs
Word Processors (MS–Word)
Spreadsheets (MS–Excel)
Compilers (C,C++, Java and Python …)
Web Browsers (Internet Explorer, Mozilla)
Database Systems
Video Games
Define the ways in which the resources are used to solve the
computing problems of the users.
Users • People
• Machines
OS
• Other Computers
05/31/24 Unit I/1-Introduction to OS 54
•Layered Structure of Operating
System

OS

05/31/24 Unit I/1-Introduction to OS 55


•Layered Structure of Operating
Why Layer in Operating System?
System
•Layer provides a distinct advantage in an operating system.

• All the layers can be defined separately and interact with each other as
required.
•It is easier to create, maintain and update the system if it is done in the
form of layers.
•Change in one layer specification does not affect the rest of the layers.

• Each of the layers in the operating system can only interact with the
above and below layers. The lowest layer handles the hardware, and
the uppermost layer deals with the user applications.

OS

05/31/24 Unit I/1-Introduction to OS 56


Architecture of Layered
The operating system is split into various layers in the
Structure
layered operating system, and each of the layers has different
functionalities. There are some rules in the implementation of
the layers as follows.

•A particular layer can access all the layers present below it.

OS

05/31/24 Unit I/1-Introduction to OS 57


Architecture of Layered
• Layer 1 deals with allocating the processes, switching
Structure
between processes when interruptions occur or the timer
expires.

• If the user layer wants to interact with the hardware layer,


the response will be traveled through all the layers from n-
1 to 1.

• Each layer must be designed and implemented such that it


will need only the services provided by the layers below
it.

OS

05/31/24 Unit I/1-Introduction to OS 58


Architecture of Layered
Structure
There are six layers in the layered operating system. A diagram
demonstrating these layers.

OS

05/31/24 Unit I/1-Introduction to OS 59


Architecture of Layered
Structure
Hardware: This layer interacts with the system hardware and
coordinates with all the peripheral devices used, such as a printer,
mouse, keyboard, scanner, etc. It is attached directly to the core of the
system.

CPU Scheduling: This layer deals with scheduling the processes for
the CPU. When the processes enter the system, they are put into the
job queue.
The processes that are ready to execute in the main memory are kept in
the ready queue. This layer is responsible for managing how many
processes will be allocated to the CPU and how many will stay out of
the CPU.

OS

05/31/24 Unit I/1-Introduction to OS 60


Architecture of Layered
Memory Management: Memory management deals with memory and
Structure
moving processes from disk to primary memory for execution and
back again. There are various types of memories in the computer like
RAM, ROM.

Process Management: This layer is responsible for managing the


processes, i.e., assigning the processor to a process and deciding how
many processes will stay in the waiting schedule. The priority of the
processes is also managed in this layer. The different algorithms used
for process scheduling are FCFS (first come, first served), SJF
(shortest job first), priority scheduling, round-robin scheduling, etc.

OS

05/31/24 Unit I/1-Introduction to OS 61


Architecture of Layered
I/O Buffer: They provide users with the means of interacting with
Structure
the system.

Suppose you are typing from the keyboard. There is a keyboard


buffer attached with the keyboard, which stores data for a temporary
time. Similarly, all input/output devices have some buffer attached to
them. This is because the input/output devices have slow processing
or storing speed.

User Programs: This layer deals with the many user programs and
applications that run in an operating system, such as word
processors, games, browsers, etc. You can also call this an
application layer because it is concerned with application programs.
OS

05/31/24 Unit I/1-Introduction to C 62


System Calls and Programs
• System Calls
• Types of System Calls
• System Programs
System Calls
• Provides Interface between Running Program and the
Operating System.
– Generally available as Assembly–Language
Instructions.
– Languages Defined to replace Assembly Language for
Systems Programming allow System Calls to be made
Directly (e.g., C, C++).
OS

05/31/24 Unit I/1-Introduction to OS 63


System Calls and Programs
System Calls

• Methods used to Pass Parameters between a Running


Program and the Operating System.
1.Pass Parameters in Registers/functions /methods.
2.Store the Parameters in a Table in Memory, and
the Table Address is passed as a Parameter in a
Register.
3.Push (store) the Parameters onto the Stack by the
Program, and Pop off the Stack by Operating
System.
OS

05/31/24 Unit I/1-Introduction to OS 64


Types of System Calls
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communications

OS

05/31/24 Unit I/1-Introduction to OS 65


System Calls – Process Control

• End, Abort
• Load, Execute
• Create Process, Terminate Process
• Get Process Attributes, Set Process Attributes
• Wait for time
• Wait Event, Signal Event
• Allocate and Free Memory

OS

05/31/24 Unit I/1-Introduction to OS 66


System Calls – File Management

• Create File, Delete File


• Open, Close
• Read, Write, Reposition
• Get File attributes, Set File attributes

OS

05/31/24 Unit I/1-Introduction to C 67


System Calls – Device Management
• Request Device, Release Device
• Read, Write, Reposition
• Get Device attributes, Set Device attributes
• Logically Attach or Detach Devices

OS

05/31/24 Unit I/1-Introduction to C 68


Example of System Calls
• System Call Sequence to Copy the contents of One file to another file.

OS

05/31/24 Unit I/1-Introduction to os 69


System Programs
It Provide Convenient environment for Program
Development and execution.
Categories System Calls
1. Programming Language Support 1. Process Control
2. File Management
2. Program Loading and Execution
3. Device Management
3. File Management 4. Information Maintenance

4. File Modification 5. Communications

5. Status information
6. Communications
OS

05/31/24 Unit I/1-Introduction to OS 70


System Programs – Programming Language Support
• Compilers
• Assemblers
• Interpreters
System Programs – Program Loading & Execution
It is a loader that places absolute code into main memory with
• Absolute Loaders initial address.

• Re-locatable Loaders is a loader which allows delay of binding time.


is a processing program that accepts objects modules and
• Linkage Editors control statement

• Overlay Loaders Users know what's going on and hides any intermediate state
in your user interface
• Debugging Systems It is multi steps process that involves identifying a problem
and correcting the problem. OS

05/31/24 71
System Programs – File Management

• Create • Print
• Delete • List
• Copy • Manipulate Files and Directories
• Rename
System Programs – File modification
Text Editors
To Create and Modify the Contents of Files
Stored on Disk or Tape.
Screen Editor – vi
Line Editor – edlin, ed, … OS

05/31/24 Unit I/1-Introduction to C 72


System Programs – Status information
Date
Time
Amount of available Memory / Disk Space
No. of users…….

OS

05/31/24 Unit I/1-Introduction to C 73


System Programs – Communications
Provide mechanism for creating virtual connections
among processes, users and different computer systems.

Allow users to
Send messages to one another’s Screens.
Browse Web pages.
Send Electronic Mail messages.
Log-in Remotely.
Transfer Files from one machine to another.

OS

05/31/24 Unit I/1-Introduction to OS 74


Operating System Goals
– Execute user programs and make solve user
problems easier
– Make the computer system convenient to use
– Use the computer hardware in an efficient
manner

OS

05/31/24 Unit I/1-Introduction to OS 75


1. Define OS. Exam Questions
2. Write about Evolution of Operating Systems.
3. Explain basic Structure of a Computer System & also Explain
its basic elements.
4. Discuss the basic components of a virtual computer.
5. What are OS Objectives?
6. What is an Operating System? Explain the functions of OS.

7. Discuss the various approaches of designing an operating


system.
8. Write about Multitasking.
OS
9. Explain the concept of Multiprogramming.
05/31/24 Unit-III-Process Synchronization 76
10. What are the multi-tasking, multi-programming and multi-
threading?
11. Explain the following:
a. Multiprogramming
b. Timesharing
c. Virtual Memory
12. What are Distributed Operating Systems?
13. What are the types of real-time systems?
14. What is dispatcher?
15. What is a system call? Explain the categories of system calls.
16. What is a system program? Explain different types of system
programs. OS

05/31/24 Unit-III-Process Synchronization 77

You might also like