OS and the Computer System  Some OS programs exist permanently in the system area of the memory to monitor and control activities in the computer system.

Slides:



Advertisements
Similar presentations
Computer-System Structures Er.Harsimran Singh
Advertisements

Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Computer System Overview
A. Frank - P. Weisberg Operating Systems Process Scheduling and Switching.
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
1 Computer System Overview OS-1 Course AA
1 Process Description and Control Chapter 3. 2 Process Management—Fundamental task of an OS The OS is responsible for: Allocation of resources to processes.
OS Spring’03 Introduction Operating Systems Spring 2003.
Chapter 1 and 2 Computer System and Operating System Overview
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
Chapter 1 and 2 Computer System and Operating System Overview
Computer Organization and Architecture
Computer System Overview Chapter 1. Basic computer structure CPU Memory memory bus I/O bus diskNet interface.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Chapter 3 Overview of Operating Systems Copyright © 2008.
Chapter 1: IntroductionDhamdhere: Operating Systems— A Concept-Based Approach Slide No: 1 Copyright ©2005 Overview of Operating Systems Chapters 1 and.
1 OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
Chapter 2 The OS, the Computer, and User Programs Copyright © 2008.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
Chapter 1. Introduction What is an Operating System? Mainframe Systems
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
Chapter 1 Computer System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3: Operating Systems Computer Science: An Overview Tenth Edition.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
2: Computer-System Structures
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Chapter 3 Process Description and Control
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection Network Structure.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
INFORMATION SYSTEM-SOFTWARE Topic: OPERATING SYSTEM CONCEPTS.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
1  process  process creation/termination  context  process control block (PCB)  context switch  5-state process model  process scheduling short/medium/long.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Lecture 1: Review of Computer Organization
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
CS4315A. Berrached:CMS:UHD1 Introduction to Operating Systems Chapter 1.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Operating Systems Lecture 2.
Computer System Overview
Chapter 2: Computer-System Structures
Process Management Process Concept Why only the global variables?
OPERATING SYSTEMS CS3502 Fall 2017
Structure of Processes
Computer System Overview
Computer-System Architecture
Processor Fundamentals
Process Description and Control
Operating Systems Lecture 2.
Computer System Overview
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Presentation transcript:

OS and the Computer System  Some OS programs exist permanently in the system area of the memory to monitor and control activities in the computer system  Other programs exist on a disk and are loaded in the transient area when needed.  Remainder of the memory is occupied by user programs. ECEA

Computer System Fundamental features of computer systems that are important to an OS 1) The Central Processing Unit (CPU) 2) Memory hierarchy 3) Interrupt structure 4) I/O organization ECEA

Model of a Computer System ECEA

1)The Central Processing Unit (CPU)  CPU contains two kinds of registers 1) General purpose registers Also called program-accessible registers Hold data, addresses, index values, or the stack pointer during execution of a program 1) Control registers Contain information that controls or influences operation of the CPU Set of control registers is called the program status word (PSW) ECEA

The Central Processing Unit (CPU) (continued)  The program status word (PSW) is a collection of control registers in the systems: ECEA

The Central Processing Unit (CPU) (continued)  CPU can operate in two modes 1) Kernel mode  Can execute privileged instructions  OS puts CPU in kernel mode when it is executing instructions in the kernel 2) User mode  Cannot execute privileged instructions  OS puts CPU in user mode while executing user programs Mode (M) field of PSW contains 0 if CPU is in kernel mode and 1 if it is in user mode ECEA

The Central Processing Unit (CPU) (continued)  State of the CPU  GPRs and PSW contain the information needed to know what the CPU is doing State of the CPU  Kernel saves state of CPU when it takes away the CPU from program  When program is to be resumed, it reloads the saved CPU state into GPRs and PSW ECEA

2)Memory hierarchy  The memory hierarchy provides a large and fast memory, at a low cost  It is an arrangement of several memory units with different access speeds and sizes  The CPU accesses only the fastest memory; i.e., the cache  If a required byte is not present in the memory being accessed, it is loaded there from a slower memory MMU ECEA

Memory hierarchy (continued)  The MMU translate each memory address generated by the CPU into another address called the physical memory address MMU ECEA

Memory hierarchy (continued)  Cache memory holds some instructions and data values that were recently accessed by the CPU  Blocks of bytes (pages) are transferred from disk to cache memory  Hit ratio(h): what fraction of bytes accessed by the CPU were found in the cache =h * Access time of cache memory + (1-h) * (t tra + Access time of cache memory ) MMU ECEA

Memory hierarchy (continued)  Memory protection is implemented by checking whether a memory address used by a program lies outside the memory area allocated to it  Two control registers used: LBR and UBR  LBR and UBR registers contained in the memory protection information (MPI) field of PSW ECEA

3)Input/Output Subsystem  Involvement of the CPU in I/O operations  Should be the minimum possible due to imbalance between CPU and I/O speeds  CPU should be free to execute instructions while I/O operations are in progress  Different I/O modes 1) Programmed I/O 2) Interrupt I/O 3) Direct memory access (DMA) ECEA

4)Interrupts  An interrupt signals the occurrence of an event to the CPU  The CPU is diverted to execution of an OS routine  Interrupt action saves CPU state and loads new contents into the PSW and GPRs  CPU starts executing instructions of an interrupt servicing routine (ISR) in the kernel  Different classes of interrupts convey occurrence of different kinds of events ECEA

Classes of Interrupts ECEA

 OS Interaction with the Computer and User Programs  Efficiency, System Performance, and User Convenience  Classes of Operating Systems ECEA

OS Interaction with the Computer and User Programs 1) Controlling Execution of Programs 2) Interrupt Processing 3) System Calls  Programs invoke the services of the OS through software interrupts  The method to cause a software interrupt is known as a system call ECEA

1)Controlling Execution of Programs  When user program starts, PSW should contain: 1) Program counter (PC) field contains the address of the first instruction in the program 2) Mode (M) field, set to user mode (1) 3) Memory protection information (MPI) field contains start address in memory and size of program 4) Interrupt mask (IM) field, set to enable all interrupts  When program is interrupted, CPU state(PSW and GPRs) are saved in the program table  When program is resumed, its CPU state is restored ECEA

2)Interrupt Processing  Context save saves context of the CPU state so that the program that was being executed at the time of the interrupt can be resumed in future  Context consists of CPU state and information concerning memory and resources used by the program  The scheduling routine selects a program for execution ECEA

Interrupt Processing (continued)  Nested interrupt Processing Two approaches for nested interrupt processing : 1. Disable nested interrupts through masking 2. Service more critical interrupts in a nested manner interruptible kernel ECEA

3)System Calls  A system call is a request made by a program through a special instruction called a `software interrupt’ instruction  The software interrupt is a program interrupt  The operand of the software interrupt instruction indicates what kind of request is being made by a program ECEA

Efficiency, System Performance, and User Convenience  A computing environment consists of a computer system, its interfaces with other systems, and the services provided by its operating system to its users and their programs 1) Nature of computation in an OS 2) Measuring Efficiency, System Performance, and User Convenience ECEA

1)Nature of computation in an OS  Noninteractive Computing Environments  OS focuses on efficient use of resources  Computations in form of program or job  Interactive Computing Environments  OS focuses on reducing average amount of time required to implement an interaction between a user and his computation  Execution of a program is called a process ECEA

Nature of computation in an OS (continued) ECEA

2)Measuring Efficiency, System Performance, and User Convenience  Two of the fundamental goals of an OS:  Efficiency of use Of a resource  User convenience Measurable aspect: User service Turnaround time Response time  To a system administrator, performance of a system in its environment is more important  Typically measured as throughput ECEA

Measuring Efficiency, System Performance, and User Convenience (continued) ECEA

Classes of Operating Systems ECEA

Batch Processing Systems  Batch: sequence of user jobs formed for processing by the OS  Batching kernel initiates processing of jobs without requiring computer operator’s intervention  Control statements used to protect against interference between jobs  Command interpreter read a card when currently executing program in job wanted the next card ECEA

Multiprogramming Systems  Provide efficient resource utilization in a noninteractive environment  Uses DMA mode of I/O  Can perform I/O operations of some program(s) while using the CPU to execute some other program Makes efficient use of both the CPU and I/O devices  Turnaround time of a program is the appropriate measure of user service in these systems ECEA

Multiprogramming Systems (continued) ECEA

Multiprogramming Systems (continued) ECEA

Multiprogramming Systems (continued)  An appropriate measure of performance of a multiprogramming OS is throughput  Ratio of the number of programs processed and the total time taken to process them  OS keeps enough programs in memory at all times, so that CPU and I/O devices are not idle  Degree of multiprogramming: number of programs  Uses an appropriate program mix of CPU-bound programs and I/O-bound programs  Assigns appropriate priorities to CPU-bound and I/O-bound programs ECEA

Priority of Programs ECEA

Priority of Programs (continued) In multiprogramming environments, an I/O-bound program should have a higher priority than a CPU-bound program. ECEA

Performance of Multiprogramming systems How to improve performance? ECEA

Performance of Multiprogramming systems (continued) When an appropriate program mix is maintained, an increase in the degree of multiprogramming would result in an increase in throughput. ECEA

Time-Sharing Systems  Provide a quick response to user subrequests  Round-robin scheduling with time-slicing Kernel maintains a scheduling queue If time slice ( δ ) elapses before process completes servicing of a subrequest, kernel preempts it, moves it to end of queue, and schedules another process Implemented through a timer interrupt ECEA

Time-Sharing Systems (continued) ECEA

Time-Sharing Systems (continued)  Response time (rt): measure of user service  If processing of a subrequest requires δ CPU seconds rt = n × ( δ + σ ) η = δ / ( δ + σ ) where η : CPU efficiency, σ : scheduling overhead, n: number of users using system, δ : time required to complete a subrequest  Actual response time would be different because  Some users may be inactive  Some programs may require > δ CPU seconds ECEA

 Swapping allows the kernel to service more processes than can fit into the memory  Improve system throughput and response times of processes  Kernel performs swap-out and swap-in operations Swapping of Programs ECEA

Real-Time Operating Systems  In real-time applications, users need computer to perform some actions in a timely manner  To control activities in an external system, or to participate in them  Timeliness depends on time constraints  If application takes too long to respond to an activity, a failure can occur in the external system  Response requirement  Deadline: time by which action should be performed ECEA

Hard and Soft Real-Time Systems  A hard real-time system meets response requirements under all conditions  It is typically dedicated to processing real-time applications  A soft real-time system makes best effort to meet response requirement of a real-time application  Cannot guarantee that it will be able to meet it Meets requirements in a probabilistic manner  E.g., multimedia applications ECEA

Distributed Operating Systems  A distributed computer system consists of several individual computer systems connected through a network  Each computer system could be a PC, a multiprocessor system, or a cluster  Many resources of a kind exist in system This feature is used to provide the benefits summarized in Table 3.8  Handling network or individual computers’ failure requires special techniques  Users must use special techniques to access resources over the network ECEA

Distributed Operating Systems (continued) ECEA

Special Techniques of Distributed Operating Systems ECEA

Summary  A computing environment consists of a computer system, its interfaces with other systems, and the services provided by its OS to users and programs  Evolved with advances in computer technology: Batch processing systems Multiprogramming operating system Priority-based scheduling Time-sharing operating systems Round-robin scheduling with time-slicing ECEA

Summary (continued)  Evolution (continued) Real-time operating systems Priority-based scheduling and deadline-aware scheduling Distributed operating system Lets programs share resources across network ECEA