Operating System Concepts: 4
Functions of OS
Prof Neeraj Bhargava
Vaibhav Khanna
Department of Computer Science
School of Engineering and Systems Sciences
Maharishi Dayanand Saraswati University Ajmer
Operating-System Operations
• Bootstrap program – simple code to initialize the
system, load the kernel
• Kernel loads
• Starts system daemons (services provided outside of
the kernel)
• Kernel interrupt driven (hardware and software)
– Hardware interrupt by one of the devices
– Software interrupt (exception or trap):
• Software error (e.g., division by zero)
• Request for operating system service – system
call
• Other process problems include infinite loop,
processes modifying each other or the operating
system
Multiprogramming and Multitasking
• Multiprogramming (Batch system) needed for efficiency
– Single user cannot keep CPU and I/O devices busy at all times
– Multiprogramming organizes jobs (code and data) so CPU always has
one to execute
– A subset of total jobs in system is kept in memory
– One job selected and run via job scheduling
– When it has to wait (for I/O for example), OS switches to another job
• Timesharing (multitasking) is logical extension in which CPU switches jobs
so frequently that users can interact with each job while it is running,
creating interactive computing
– Response time should be < 1 second
– Each user has at least one program executing in memory process
– If several jobs ready to run at the same time  CPU scheduling
– If processes don’t fit in memory, swapping moves them in and out to
run
– Virtual memory allows execution of processes not completely in
memory
Memory Layout for Multiprogrammed System
Dual-mode and Multimode
Operation
• Dual-mode operation allows OS to protect itself and
other system components
– User mode and kernel mode
– Mode bit provided by hardware
• Provides ability to distinguish when system is
running user code or kernel code
• Some instructions designated as privileged,
only executable in kernel mode
• System call changes mode to kernel, return
from call resets it to user
• Increasingly CPUs support multi-mode operations
– i.e. virtual machine manager (VMM) mode for
guest VMs
Transition from User to Kernel Mode
• Timer to prevent infinite loop / process hogging resources
– Timer is set to interrupt the computer after some time period
– Keep a counter that is decremented by the physical clock
– Operating system set the counter (privileged instruction)
– When counter zero generate an interrupt
– Set up before scheduling process to regain control or terminate
program that exceeds allotted time
Process Management
• A process is a program in execution. It is a unit of work within the
system. Program is a passive entity, process is an active entity.
• Process needs resources to accomplish its task
– CPU, memory, I/O, files
– Initialization data
• Process termination requires reclaim of any reusable resources
• Single-threaded process has one program counter specifying
location of next instruction to execute
– Process executes instructions sequentially, one at a time, until
completion
• Multi-threaded process has one program counter per thread
• Typically system has many processes, some user, some operating
system running concurrently on one or more CPUs
– Concurrency by multiplexing the CPUs among the processes /
threads
Process Management Activities
• Creating and deleting both user and system
processes
• Suspending and resuming processes
• Providing mechanisms for process
synchronization
• Providing mechanisms for process
communication
• Providing mechanisms for deadlock handling
The operating system is responsible for the following
activities in connection with process management:
Memory Management
• To execute a program all (or part) of the instructions must
be in memory
• All (or part) of the data that is needed by the program
must be in memory
• Memory management determines what is in memory and
when
– Optimizing CPU utilization and computer response to users
• Memory management activities
– Keeping track of which parts of memory are currently being
used and by whom
– Deciding which processes (or parts thereof) and data to
move into and out of memory
– Allocating and deallocating memory space as needed
File-system Management
• OS provides uniform, logical view of information
storage
– Abstracts physical properties to logical storage unit - file
– Each medium is controlled by device (i.e., disk drive, tape
drive)
• Varying properties include access speed, capacity, data-
transfer rate, access method (sequential or random)
• File-System management
– Files usually organized into directories
– Access control on most systems to determine who can
access what
– OS activities include
• Creating and deleting files and directories
• Primitives to manipulate files and directories
• Mapping files onto secondary storage
• Backup files onto stable (non-volatile) storage media
Mass-Storage Management
• Usually disks used to store data that does not fit in main
memory or data that must be kept for a “long” period of time
• Proper management is of central importance
• Entire speed of computer operation hinges on disk subsystem
and its algorithms
• OS activities
– Mounting and unmounting
– Free-space management
– Storage allocation
– Disk scheduling
– Partitioning
– Protection
• Some storage need not be fast
– Tertiary storage includes optical storage, magnetic tape
– Still must be managed – by OS or applications
Caching
• Important principle, performed at many levels
in a computer (in hardware, operating system,
software)
• Information in use copied from slower to faster
storage temporarily
• Faster storage (cache) checked first to
determine if information is there
– If it is, information used directly from the cache
(fast)
– If not, data copied to cache and used there
• Cache smaller than storage being cached
– Cache management important design problem
– Cache size and replacement policy

More Related Content

PPTX
Operating system 05 functions of os
PPTX
Operating system concepts
PPTX
Os unit 2
PPTX
Unit v: Device Management
PPTX
Processes and operating systems
PPT
Opearating System
PPTX
Operating system 17 process management
Operating system 05 functions of os
Operating system concepts
Os unit 2
Unit v: Device Management
Processes and operating systems
Opearating System
Operating system 17 process management

What's hot (20)

PPTX
Operating system 18 process creation and termination
PPT
Process management
PPT
Lecture5
PPTX
Os unit 3 , process management
PPTX
Unit 1 operating system
PPTX
Operating system 06 operating system classification
PPT
Processes Control Block (Operating System)
PPTX
Introduction to operating systems
PPTX
Mis unit iii by arnav
PPT
PDF
Unit 4 Real Time Operating System
PDF
ITFT_Device management in Operating System
PDF
Operating System / System Operasi
PDF
02.Os Structure
PPTX
The cpu cycle
PPTX
Central Processing Unit (CPU) – Part 2
PPTX
os assignment -individual presenation.pptx
Operating system 18 process creation and termination
Process management
Lecture5
Os unit 3 , process management
Unit 1 operating system
Operating system 06 operating system classification
Processes Control Block (Operating System)
Introduction to operating systems
Mis unit iii by arnav
Unit 4 Real Time Operating System
ITFT_Device management in Operating System
Operating System / System Operasi
02.Os Structure
The cpu cycle
Central Processing Unit (CPU) – Part 2
os assignment -individual presenation.pptx
Ad

Similar to Os concepts 4 functions of os (20)

PPTX
What is an Operating Systems?
PPSX
Operating system
DOC
Module1
PPTX
introduction to operating systems and services.pptx
PPT
OS - Ch1
PPT
Operating systems. replace ch1 with numbers for next chapters
PPT
Chapter 1 - Introduction
PPT
Basics of Operating System
PPTX
Unit 1-Operating Systems Overview .pptx
PPT
Mca ii os u-1 introduction to os
PPT
chapter1.ppt
PPT
PPTX
PPTX
CSE3120- Module1 part 1 v1.pptx
PPT
OPERATING SYSTEM BY DR .MUGABO MG MKAMA
PPT
Module 1 Introduction.ppt
PPTX
Week1_Introduction to_Operating System - Part 2.pptx
PDF
Operating Systems PPT 1 (1).pdf
PDF
operating systems hybrid notes for computerscience.pdf
PPT
What is an Operating Systems?
Operating system
Module1
introduction to operating systems and services.pptx
OS - Ch1
Operating systems. replace ch1 with numbers for next chapters
Chapter 1 - Introduction
Basics of Operating System
Unit 1-Operating Systems Overview .pptx
Mca ii os u-1 introduction to os
chapter1.ppt
CSE3120- Module1 part 1 v1.pptx
OPERATING SYSTEM BY DR .MUGABO MG MKAMA
Module 1 Introduction.ppt
Week1_Introduction to_Operating System - Part 2.pptx
Operating Systems PPT 1 (1).pdf
operating systems hybrid notes for computerscience.pdf
Ad

More from Vaibhav Khanna (20)

PPTX
Information and network security 47 authentication applications
PPTX
Information and network security 46 digital signature algorithm
PPTX
Information and network security 45 digital signature standard
PPTX
Information and network security 44 direct digital signatures
PPTX
Information and network security 43 digital signatures
PPTX
Information and network security 42 security of message authentication code
PPTX
Information and network security 41 message authentication code
PPTX
Information and network security 40 sha3 secure hash algorithm
PPTX
Information and network security 39 secure hash algorithm
PPTX
Information and network security 38 birthday attacks and security of hash fun...
PPTX
Information and network security 37 hash functions and message authentication
PPTX
Information and network security 35 the chinese remainder theorem
PPTX
Information and network security 34 primality
PPTX
Information and network security 33 rsa algorithm
PPTX
Information and network security 32 principles of public key cryptosystems
PPTX
Information and network security 31 public key cryptography
PPTX
Information and network security 30 random numbers
PPTX
Information and network security 29 international data encryption algorithm
PPTX
Information and network security 28 blowfish
PPTX
Information and network security 27 triple des
Information and network security 47 authentication applications
Information and network security 46 digital signature algorithm
Information and network security 45 digital signature standard
Information and network security 44 direct digital signatures
Information and network security 43 digital signatures
Information and network security 42 security of message authentication code
Information and network security 41 message authentication code
Information and network security 40 sha3 secure hash algorithm
Information and network security 39 secure hash algorithm
Information and network security 38 birthday attacks and security of hash fun...
Information and network security 37 hash functions and message authentication
Information and network security 35 the chinese remainder theorem
Information and network security 34 primality
Information and network security 33 rsa algorithm
Information and network security 32 principles of public key cryptosystems
Information and network security 31 public key cryptography
Information and network security 30 random numbers
Information and network security 29 international data encryption algorithm
Information and network security 28 blowfish
Information and network security 27 triple des

Recently uploaded (20)

PPT
Programmable Logic Controller PLC and Industrial Automation
PDF
Research on ultrasonic sensor for TTU.pdf
PPTX
Design ,Art Across Digital Realities and eXtended Reality
PDF
Software defined netwoks is useful to learn NFV and virtual Lans
PDF
ECT443_instrumentation_Engg_mod-1.pdf indroduction to instrumentation
PDF
IAE-V2500 Engine for Airbus Family 319/320
PDF
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
PPTX
BBOC407 BIOLOGY FOR ENGINEERS (CS) - MODULE 1 PART 1.pptx
PDF
Cryptography and Network Security-Module-I.pdf
PDF
CELDAS DE COMBUSTIBLE TIPO MEMBRANA DE INTERCAMBIO PROTÓNICO.pdf
PPT
UNIT-I Machine Learning Essentials for 2nd years
PDF
Using Technology to Foster Innovative Teaching Practices (www.kiu.ac.ug)
PPTX
Module1.pptxrjkeieuekwkwoowkemehehehrjrjrj
PDF
Principles of operation, construction, theory, advantages and disadvantages, ...
PPTX
WN UNIT-II CH4_MKaruna_BapatlaEngineeringCollege.pptx
PDF
Mechanics of materials week 2 rajeshwari
PPTX
SE unit 1.pptx by d.y.p.akurdi aaaaaaaaaaaa
DOCX
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
PDF
LS-6-Digital-Literacy (1) K12 CURRICULUM .pdf
PDF
electrical machines course file-anna university
Programmable Logic Controller PLC and Industrial Automation
Research on ultrasonic sensor for TTU.pdf
Design ,Art Across Digital Realities and eXtended Reality
Software defined netwoks is useful to learn NFV and virtual Lans
ECT443_instrumentation_Engg_mod-1.pdf indroduction to instrumentation
IAE-V2500 Engine for Airbus Family 319/320
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
BBOC407 BIOLOGY FOR ENGINEERS (CS) - MODULE 1 PART 1.pptx
Cryptography and Network Security-Module-I.pdf
CELDAS DE COMBUSTIBLE TIPO MEMBRANA DE INTERCAMBIO PROTÓNICO.pdf
UNIT-I Machine Learning Essentials for 2nd years
Using Technology to Foster Innovative Teaching Practices (www.kiu.ac.ug)
Module1.pptxrjkeieuekwkwoowkemehehehrjrjrj
Principles of operation, construction, theory, advantages and disadvantages, ...
WN UNIT-II CH4_MKaruna_BapatlaEngineeringCollege.pptx
Mechanics of materials week 2 rajeshwari
SE unit 1.pptx by d.y.p.akurdi aaaaaaaaaaaa
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
LS-6-Digital-Literacy (1) K12 CURRICULUM .pdf
electrical machines course file-anna university

Os concepts 4 functions of os

  • 1. Operating System Concepts: 4 Functions of OS Prof Neeraj Bhargava Vaibhav Khanna Department of Computer Science School of Engineering and Systems Sciences Maharishi Dayanand Saraswati University Ajmer
  • 2. Operating-System Operations • Bootstrap program – simple code to initialize the system, load the kernel • Kernel loads • Starts system daemons (services provided outside of the kernel) • Kernel interrupt driven (hardware and software) – Hardware interrupt by one of the devices – Software interrupt (exception or trap): • Software error (e.g., division by zero) • Request for operating system service – system call • Other process problems include infinite loop, processes modifying each other or the operating system
  • 3. Multiprogramming and Multitasking • Multiprogramming (Batch system) needed for efficiency – Single user cannot keep CPU and I/O devices busy at all times – Multiprogramming organizes jobs (code and data) so CPU always has one to execute – A subset of total jobs in system is kept in memory – One job selected and run via job scheduling – When it has to wait (for I/O for example), OS switches to another job • Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing – Response time should be < 1 second – Each user has at least one program executing in memory process – If several jobs ready to run at the same time  CPU scheduling – If processes don’t fit in memory, swapping moves them in and out to run – Virtual memory allows execution of processes not completely in memory
  • 4. Memory Layout for Multiprogrammed System
  • 5. Dual-mode and Multimode Operation • Dual-mode operation allows OS to protect itself and other system components – User mode and kernel mode – Mode bit provided by hardware • Provides ability to distinguish when system is running user code or kernel code • Some instructions designated as privileged, only executable in kernel mode • System call changes mode to kernel, return from call resets it to user • Increasingly CPUs support multi-mode operations – i.e. virtual machine manager (VMM) mode for guest VMs
  • 6. Transition from User to Kernel Mode • Timer to prevent infinite loop / process hogging resources – Timer is set to interrupt the computer after some time period – Keep a counter that is decremented by the physical clock – Operating system set the counter (privileged instruction) – When counter zero generate an interrupt – Set up before scheduling process to regain control or terminate program that exceeds allotted time
  • 7. Process Management • A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity. • Process needs resources to accomplish its task – CPU, memory, I/O, files – Initialization data • Process termination requires reclaim of any reusable resources • Single-threaded process has one program counter specifying location of next instruction to execute – Process executes instructions sequentially, one at a time, until completion • Multi-threaded process has one program counter per thread • Typically system has many processes, some user, some operating system running concurrently on one or more CPUs – Concurrency by multiplexing the CPUs among the processes / threads
  • 8. Process Management Activities • Creating and deleting both user and system processes • Suspending and resuming processes • Providing mechanisms for process synchronization • Providing mechanisms for process communication • Providing mechanisms for deadlock handling The operating system is responsible for the following activities in connection with process management:
  • 9. Memory Management • To execute a program all (or part) of the instructions must be in memory • All (or part) of the data that is needed by the program must be in memory • Memory management determines what is in memory and when – Optimizing CPU utilization and computer response to users • Memory management activities – Keeping track of which parts of memory are currently being used and by whom – Deciding which processes (or parts thereof) and data to move into and out of memory – Allocating and deallocating memory space as needed
  • 10. File-system Management • OS provides uniform, logical view of information storage – Abstracts physical properties to logical storage unit - file – Each medium is controlled by device (i.e., disk drive, tape drive) • Varying properties include access speed, capacity, data- transfer rate, access method (sequential or random) • File-System management – Files usually organized into directories – Access control on most systems to determine who can access what – OS activities include • Creating and deleting files and directories • Primitives to manipulate files and directories • Mapping files onto secondary storage • Backup files onto stable (non-volatile) storage media
  • 11. Mass-Storage Management • Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time • Proper management is of central importance • Entire speed of computer operation hinges on disk subsystem and its algorithms • OS activities – Mounting and unmounting – Free-space management – Storage allocation – Disk scheduling – Partitioning – Protection • Some storage need not be fast – Tertiary storage includes optical storage, magnetic tape – Still must be managed – by OS or applications
  • 12. Caching • Important principle, performed at many levels in a computer (in hardware, operating system, software) • Information in use copied from slower to faster storage temporarily • Faster storage (cache) checked first to determine if information is there – If it is, information used directly from the cache (fast) – If not, data copied to cache and used there • Cache smaller than storage being cached – Cache management important design problem – Cache size and replacement policy