Tami Meredith, Ph.D. CSCI 3431.  Devices need CPU access  E.g., NIC has a full buffer it needs to empty  These device needs are often asynchronous.

Slides:



Advertisements
Similar presentations
A look at interrupts What are interrupts and why are they needed.
Advertisements

CSCI 4717/5717 Computer Architecture
Chapter 6 Limited Direct Execution
A. Frank - P. Weisberg Operating Systems Process Scheduling and Switching.
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
A look at interrupts What are interrupts and why are they needed in an embedded system? Equally as important – how are these ideas handled on the Blackfin.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
OS Spring’03 Introduction Operating Systems Spring 2003.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
A look at interrupts What are interrupts and why are they needed.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
OS Spring’04 Introduction Operating Systems Spring 2004.
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.
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external.
Chapter 10 The Stack Stack: An Abstract Data Type An important abstraction that you will encounter in many applications. We will describe two uses:
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
NT Kernel CS Spring Overview Interrupts and Exceptions: Trap Handler Interrupt Request Levels and IRT DPC’s, and APC’s System Service Dispatching.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
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.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
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.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Embedded Computer - Definition When a microcomputer is part of a larger product, it is said to be an embedded computer. The embedded computer retrieves.
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.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Chapter 6 Limited Direct Execution Chien-Chung Shen CIS/UD
WORKING OF SCHEDULER IN OS
Computer System Structures Interrupts
Interrupts and exceptions
Chapter 13 The Function of Operating Systems
Process concept.
Interrupts and signals
Operating Systems CMPSC 473
Microprocessor Systems Design I
Lesson Objectives Aims Key Words Interrupt, Buffer, Priority, Stack
Anton Burtsev February, 2017
Protection of System Resources
Mechanism: Limited Direct Execution
Chapter 3 – Process Concepts
Day 08 Processes.
Day 09 Processes.
CS 3305 System Calls Lecture 7.
Chapter 10 And, Finally... The Stack
Chapter 10 The Stack.
CSCI 315 Operating Systems Design
Computer System Overview
Processor Fundamentals
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Chapter 10 And, Finally... The Stack
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Computer System Overview
Processes David Ferry CSCI 3500 – Operating Systems
CSE 451: Operating Systems Winter 2007 Module 2 Architectural Support for Operating Systems Brian Bershad 562 Allen Center 1.
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Interrupts and System Calls
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Tami Meredith, Ph.D. CSCI 3431

 Devices need CPU access  E.g., NIC has a full buffer it needs to empty  These device needs are often asynchronous and unrelated to the currently executing process  A change in execution context is needed  E.g., OS must run to empty the full buffer thus interrupting a user's nedit process  We can't predict when they will happen

 CPU periodically checks each device to see if it needs service  Uses CPU time even if nothing needs to be done  Predicable CPU behaviour  Polling is like picking up your phone every 10 seconds to see if a call is there

 Give each device a way to signal the CPU it needs service  When the CPU gets the signal, it stops what it is doing, sees who needs the service, and then provides it  Devices don't wait but CPU behaviour is less predictable  Interrupts are like waiting for the phone to ring and the pausing a conversation to go answer the phone

1. Hardware needs service  signal comes via a CPU line from APIC that is checked after each instruction 2. CPU encounters an error (trap/exception)  identified by internal CPU circuitry 3. Software needs a hardware service (software trap)  Special instruction called to start the interrupt process

1. Interrupt occurs 2. Current process saved 3. Interrupt dispatcher run 4. Interrupt handler run 5. CPU goes back to saved process

 Sometimes called the interrupt handler  Code used for every interrupt  Identifies which interrupt happened  Finds the specific code for that interrupt  Transfers control to the specific interrupt handler needed (the device driver)

 CPU detects an interrupt  Current instruction finishes  CPU reads register on the interrupt controller  Register contains interrupt number which is an offset into the irq_action array/vector (linux)  That irqaaction structure contains the pointers and data needed to call the ISR (called "handler") installed by the device driver

 When a device signals an interrupt it needs attention as soon as possible  This attention is needed so that the device can continue working  However, sometimes the ISR does not need to be totally run so it can be broken into 2 parts and the lower-priority part run later  ISR(1) – actions needed now by device  ISR(2) – actions the device can wait for

 CPU reads interrupt signal  Current instruction finishes  Interrupt dispatcher/handler uses APIC register to find the interrupt service routine (ISR) in the interrupt vector  ISR(1) is run in the current context – must be very careful not to change stack or registers  ISR(1) puts ISR(2) in scheduling queue  Process allowed to resume executing  Time slice ends and scheduler runs  ISR(2) is selected to run and performs remainder of the interrupt

 After the boot process is completed, the CPU sits idle until somebody needs something done – Waits for events  Events are signaled via the interrupt process  Can view an OS as nothing more than a large set of interrupt handlers  System calls cause software interrupts and the library code for the call is invoked by the interrupt handler

 Computer has a hardware clock that that runs the system  Clock has a programmable interval timer that causes an interrupt at some specified interval  The interrupt handler for the timer interrupt is the scheduler