chapter 2 operating system overview l.
Skip this Video
Loading SlideShow in 5 Seconds..
Chapter 2: Operating System Overview PowerPoint Presentation
Download Presentation
Chapter 2: Operating System Overview

Loading in 2 Seconds...

play fullscreen
1 / 58

Chapter 2: Operating System Overview - PowerPoint PPT Presentation

  • Uploaded on

Chapter 2: Operating System Overview CS 472 Operating Systems Indiana University – Purdue University Fort Wayne Mark Temte Operating system overview An example of computing without an operating system Session scheduling and set-up time Front panel lights and toggle switches

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

Chapter 2: Operating System Overview

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
chapter 2 operating system overview

Chapter 2: Operating System Overview

CS 472 Operating Systems

Indiana University – Purdue University Fort Wayne

Mark Temte

operating system overview
Operating system overview
  • An example of computing without an operating system
    • Session scheduling and set-up time
    • Front panel lights and toggle switches
    • Bootstrap loader on paper tape
    • Compiler on cards
    • Source deck
    • Paper tape object file
    • Data deck
    • Execution
operating system objectives
Operating system objectives
  • Convenience
    • Makes the computer more convenient to use
  • Efficiency
    • Allows computer system resources to be used in an efficient manner
  • Ability to evolve
    • Permit effective development, testing, and introduction of new system functions without interfering with service
operating system kernel
Operating system kernel
  • The kernel is a portion of operating system that is always in main memory
  • It contains most frequently used functions
  • Also called the nucleus
  • Services provided by the operating system
    • Program development
      • Editors and debuggers
    • Program execution
    • Access to I/O devices
    • Controlled access to files
    • System access
      • Login and passwords
    • Error detection and response
    • Accounting
error detection and response
Error detection and response
  • Internal and external hardware errors
    • Memory error
    • Device failure
  • Software errors
    • Arithmetic overflow
    • Access forbidden memory locations
  • Operating system cannot grant a request made by an application
  • Collect usage statistics
  • Monitor performance
  • This information can be used . . .
    • to anticipate future enhancements
    • for billing purposes
  • The OS promotes efficiency by managing resources
    • Processor(s)
    • Memory
    • Devices
    • Files
  • The OS functions same way as ordinary computer software
    • It is program that is executed
    • The OS frequently relinquishes control of the processor and relies on the processor to regain control
ability to evolve
Ability to evolve
  • A major OS should be able to evolve over time in response to . . .
    • Hardware upgrades and new types of hardware such as
      • Paging hardware for virtual memory
      • Multiple processors
    • New services such as
      • Overlapping windows
      • Client / server computing
    • Errors in the OS
evolution of operating systems
Evolution of operating systems
  • Serial processing
  • Simple batch systems
  • Multiprogrammed batch systems
  • Time-sharing systems
serial processing discussed earlier
Serial processing (discussed earlier)
  • No operating system
  • Manual scheduling of use
  • Computer operated from a console with display lights, toggle switches, input device, and printer
  • Setup included . . .
    • Loading the compiler
    • Loading the source program
    • Saving compiled program
    • Loading and linking object files
simple batch systems
Simple batch systems
  • Developed in the 1950s by GM for the IBM 701
  • Simple batch OS called a monitor
    • Monitor software controlled a sequence of jobs
    • A batch of sequential jobs was loaded into a card tray
    • The monitor called the first (next) job
    • Each job program branched back to monitor when finished
  • Only one user job could run at a time
    • Processor idle waiting for I/O
  • But idle time between jobs and within jobs eliminated
job control language jcl
Job Control Language (JCL)
  • A special type of programming language
  • Provides commands to the monitor
    • Identifies new jobs
    • Specifies what compiler to use
    • Specifies which object files to load and link
    • Specifies what data to use
    • Etc.
job control language jcl15
Job Control Language (JCL)
  • Example of JCL cards (with / /) in a deck

/ / JOB

/ / FORT

  

< source program cards >

  

/ / LOAD

/ / RUN

  

< data cards >

  

/ / END


After an //END card or an error, the monitor flushes cards until the next //JOB card

hardware support for simple batch
Hardware support for simple batch
  • Memory protection
    • Does not allow the memory area containing the monitor to be altered by a job
  • Timer
    • Prevents a job from monopolizing the system
  • Privileged instructions
    • Certain machine level instructions can only be executed by the monitor
      • E.g. - I/O instructions (a program should not read cards of next job)
      • Note: a program “requests” that the monitor perform the instruction
  • Interrupts
    • Allow processor to do something else while waiting for I/O
    • Early computer models did not have this capability
hardware support for simple batch17
Hardware support for simple batch
  • The need for memory protection and privileged instructions led to the concept of processor modes
  • A bit in the PSW register toggles the processor between user mode and kernel mode
  • Each user program executes in user mode
    • Certain privileged instructions may not be executed
    • Only the program area may be referenced
  • The monitor executes in kernel mode
    • Privileged instructions may be executed
    • Protected areas of memory may be accessed
multiprogrammed batch systems
Multiprogrammed batch systems
  • Several jobs resident in memory simultaneously
  • Gives processor something to do while one job is waiting for I/O
multiprogrammed batch systems21
Multiprogrammed batch systems
  • In these systems . . .
    • Interrupt-driven DMA emerged
      • This was the start of multiprocessing
    • Concept of logical (vrs. physical) devices emerged
time sharing systems
Time-sharing systems
  • Adds an interactive computing capability to a multiprogrammed batch system
    • Processor’s time is shared among multiple interactive users
    • Multiple users simultaneously access the system through terminals
  • Essential for transaction processing systems
  • Example: Compatible Time-Sharing System (CTSS)
      • First time-sharing system
      • Developed at MIT in 1961 for the IBM 709
  • Multiprogramming and time sharing led to the identification of new problems
    • Memory protection
    • File security
    • Contention for resources
      • E.g. - printers
major achievements
Major achievements
  • Processes
    • Focus of chapters 3, 4, 5, and 6
  • Memory management
    • Focus of chapters 7 and 8
  • Information protection and security
    • Focus of chapters 12 and 16
  • Scheduling and resource management
    • Focus of chapters 9, 10, and 11
  • System structure
major achievement process
Major achievement – process
  • A process is . . .
    • A program in execution
    • An instance of a program running on a computer
    • An entity that can be assigned to and executed on a processor
    • Activity characterized by a current state and an associated set of system resources
a process consists of
A process consists of . . .
  • Activity
    • An executable program
  • Data
    • Variables
    • Work space (stack)
    • Buffers
    • Etc.
  • Execution context (process state)
    • All information the operating system needs to manage the process
      • Registers (PC, PSW, registers)
      • Pending I/O
      • Allocated memory
      • Priority and privilege
a context switch
A context switch
  • A context switch is where . . .
    • The hardware context registers (hardware Process Control Block or hardware PCB) of the old process are saved in its context area in memory
    • The hardware PCB of the new process is restored from its context area of memory
  • This is similar to a subprogram call
    • But includes the PSW and stack pointer
    • Implemented in hardware
  • An interrupt, for example, results in a context switch
    • From the interrupted program to the interrupt handler
a context switch29
A context switch


hardware process control block



context switch



process data structure



problems leading to process concept
Problems leading to process concept
  • Multiprogrammed batch
    • Many jobs in memory simultaneously
    • Need to isolate one job from the others
    • Need to switch among jobs at I/O start and end
  • Time sharing
    • Need to switch rapidly due to a timer interrupt
    • Need for responsiveness
  • Real-time transaction processing
    • Many jobs share information and memory
problems leading to process concept32
Problems leading to process concept
  • See the paragraph before the bullets, text p. 67
  • Four main causes of errors
    • Improper synchronization
    • Failed mutual exclusion
    • Deadlock
    • Nondeterminate program operation
problems leading to process concept33
Problems leading to process concept
  • Improper synchronization
    • Data is lost or duplicate data is received
    • A process initiating I/O must wait until the handler process detects completion
  • Mutual exclusion
    • Two process must not book the same seat on an airplane
      • Example from transaction processing
problems leading to process concept34
Problems leading to process concept
  • Deadlock
    • Common for two processes to hang up waiting for each other
    • For example, one process may want to copy disk to tape while another copies the tape to disk
  • Nondeterminate program operation
    • Outputs or success of an operation depends on the scheduling of unrelated programs
    • Hard to debug because the condition that produced the error is difficult to reproduce
major achievement memory management
Major achievement – memory management
  • Responsibilities of memory management
    • Process isolation
    • Transparent allocation and management of memory within a process across the memory hierarchy
      • Virtual memory
      • Real (main) memory
      • Cache memory
    • Support of modular programming
      • Dynamic creation, resizing, and deallocation of program modules
    • Protection and access control
      • Controlled sharing of memory among processes
    • Long-term storage in files
major achievement information protection and security
Major achievement – information protection and security
  • Availability
    • Concerned with protecting the system against interruption
  • Confidentiality
    • Assuring that users cannot read data for which access is unauthorized
  • Data integrity
    • Protection of data from unauthorized modification
  • Authenticity
    • Concerned with the proper verification of the identity of users and the validity of messages or data
major achievement scheduling and resource management
Major achievement – scheduling and resource management
  • Fairness
    • Give equal and fair access to resources within the same class
  • Differential responsiveness
    • Discriminate among different classes of jobs
  • Efficiency
    • Maximize throughput, minimize response time, and accommodate as many users as possible
major achievement system structure
Major achievement – system structure
  • In a large OS, modularity is necessary but not sufficient
  • View the system as a series of layers
    • Each layer performs a related subset of functions
    • Each layer relies on lower levels to perform more primitive functions
    • Each layer provides services to higher levels
  • Think client / server computing
  • The text identifies 13 levels
hardware levels not part of os
Hardware levels (not part of OS)
  • Level 1
    • Electronic circuits
    • Objects are registers, memory cells, and logic gates
    • Operations are clearing a register or reading a memory location
  • Level 2
    • Processor’s instruction set
    • Operations such as add, subtract, load, and store
  • Level 3
    • Adds the concept of a procedure or subroutine, plus call/return operations
  • Level 4
    • Interrupts
    • Interrupt handling routines are part of the OS
multiprogramming levels
Multiprogramming levels
  • Level 5
    • Concept of the process is supported
    • Ability to suspend and resume processes (context switch)
    • Synchronization primitives implemented
  • Level 6
    • Secondary storage devices
    • Transfer of blocks of data
  • Level 7
    • Creates logical address space for processes
    • Organizes virtual address space into blocks
support for external devices networks
Support for external devices / networks
  • Level 8
    • Communication of information and message passing
  • Level 9
    • Supports long-term storage of named files
  • Level 10
    • Provides access to external devices using standardized interfaces
support for external devices networks42
Support for external devices / networks
  • Level 11
    • Responsible for maintaining the association between the external and internal identifiers
  • Level 12
    • Provides full-featured facility for the support of processes
  • Level 13
    • Provides an interface to the operating system for the user
    • Called a shell or an Application Programming Interface (API)
modern os characteristics
Modern OS characteristics
  • Microkernel architecture
    • There is no monolithic OS kernel with most OS features
    • Kernel has only a few essential functions
      • Address spaces
      • Interprocess communication (IPC)
      • Basic scheduling
    • Other traditional OS features are distributed among user mode processes
modern os characteristics44
Modern OS characteristics
  • Multithreading
    • A process is divided into threads that can run concurrently
    • Thread
      • Dispatchable unit of work
      • Includes registers and a stack
      • Executes sequentially and is interruptable
    • Process is a collection of one or more threads
    • A thread switch has less overhead than a process switch
modern os characteristics45
Modern OS characteristics
  • Symmetric MultiProcessing (SMP)
    • There are multiple processors
    • These processors share same main memory and I/O facilities
    • All processors are equivalent and can perform the same functions
    • True parallel processing is possible
    • Processors may be added and removed
      • The number of processors is transparent to applications
modern os characteristics47
Modern OS characteristics
  • Distributed operating system
    • This is an OS for a cluster of separate computers (multicomputer system)
      • Separate main memories, disks, and devices
    • Provides the illusion of a single main memory space, a single secondary memory space, and unified access to all devices
example systems
Example systems
  • Microsoft Windows
  • UNIX
    • Traditional
    • Modern
    • Linux
microsoft windows
Microsoft Windows
  • Impressive OS
  • Single-user multitasking OS that evolved out of MS-DOS
  • Modular structure for flexibility
    • Any module can be removed, upgraded, or replaced without rewriting the entire system
  • Executes on a variety of hardware platforms
    • Pentium, Itanium, PowerPC, Alpha, etc.
    • Provided by the Hardware Abstraction Layer (HAL)
    • This isolates the operating system from platform-specific hardware differences
  • Supports applications written for other operating systems
    • This is provided by various environment subsystems
windows organization
Windows organization
  • Modified microkernel architecture
    • Not a pure microkernel
      • Many system functions outside of the microkernel run in kernel mode
  • Kernel
    • Consists of the most used components
      • Thread scheduling
      • Process switching
      • Interrupt handling
      • SMP
    • Does not run in threads and is not preemptible
  • Executive
    • Contains base operating system services
      • Memory management
      • Process and thread management
      • Security
      • I/O
      • Interprocess communication
windows client server model
Windows client-server model
  • Simplifies the Executive
    • Possible to construct a variety of APIs
  • Improves reliability
    • Each service runs on a separate process with its own partition of memory
    • Clients cannot not directly access hardware
  • Provides a uniform means for applications to communicate via Local Procedure Call (LPC)
  • Provides base for distributed computing
windows threads and smp
Windows threads and SMP
  • Operating system routines can run on any available processor or simultaneously on different processors
  • Multiple threads of execution within a single process may execute on different processors simultaneously
  • Server processes may use multiple threads to process requests from multiple processes simultaneously
  • Mechanisms provided to share data and resources between processes
traditional unix
Traditional UNIX
  • Hardware is surrounded by the operating system software
  • Operating system is called the system kernel
  • Comes with a number of user services and interfaces
    • Shell
    • Components of the C compiler
modern unix systems
Modern UNIX systems
  • System V Release 4 (SVR4)
    • Platform for commercial UNIX deployment
  • Solaris 9
    • Widely used
    • Preemptable, multithreaded kernel
    • Full support for SMP
  • 4.4BSD (Berkeley Software Distribution)
    • Widely used in universities
    • Mac OS X is based on this
  • Linux
    • Began as a UNIX variant for the Intel X86 architecture (1991)
    • Supported by the Free Software Foundation (FSF)
    • High quality kernel
    • Highly modular