Preview

Differences between an Interrupt and a Trap in an Operating System

Good Essays
Open Document
Open Document
519 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Differences between an Interrupt and a Trap in an Operating System
What are the differences between an interrupt and a trap? What are their importance?
According to Stallings (2012) an interrupt is “a suspension of a process, such as the execution of a computer program, caused by an event external to that process and performed in such a way that the process can be resumed” (p. 716). Stallings (2012) goes on to say that “interrupts are provided primarily as a way to improve processor utilization. For example, most I/O devices are much slower than the processor” (p. 14).
“A trap is an unprogrammed conditional jump to a specified address that is automatically activated by hardware; the location from which the jump was made is recorded” (Stallings, 2012, p. 721). A trap is actually a software generated interrupt caused either by an error (for example division by zero, invalid memory access etc.), or by a specific request by an operating system service generated by a user program. Trap is sometimes called Exception. The hardware or software can generate these interrupts. When the interrupt or trap occurs, the hardware transfers control to the operating system which first preserves the current state of the system by saving the current CPU registers content and program counter 's value. Then the focus shifts to the determination of which type of interrupt has occurred. For each type of interrupt, separate segments of code in the operating system determine what action should be taken and thus the system keeps on functioning by executing computational instruction, I/O instruction, storage instruction etc.
Provide an example of each.
Example of an Interrupt retrieved from http://www.scriptoriumdesigns.com/embedded/show_codefile.php?fname=interrupts/AVR_ISR_1.c // AVR_ISR_1 #include <avr/io.h> #include <avr/interrupt.h> typedef uint8_t u8; // convenient unsigned variable designations typedef



References: Stallings, W. (2012). Operating systems: Internals and design principles (7th ed.). Boston, MA: Prentice Hall. http://www.scriptoriumdesigns.com/embedded/show_codefile.php?fname=interrupts/AVR_ISR_1.c http://www.ibm.com/developerworks/aix/library/au-usingtraps/index.html

You May Also Find These Documents Helpful

  • Satisfactory Essays

    POS-355 Week 5 Operating Systems Analysis 10 Slides with Speaker Notes - Team B new ver.ppt…

    • 400 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Before doing this activity, you are asked to read the following topics in the listed reading materials.…

    • 1545 Words
    • 7 Pages
    Good Essays
  • Good Essays

    Unit 5 research paper

    • 297 Words
    • 2 Pages

    (FPU) which is a microprocessor inside the CPU. This basically helps the computer figure out…

    • 297 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    S12 Midterm Sol

    • 2644 Words
    • 19 Pages

    UNIVERSITY OF WATERLOO CS 350 MIDTERM :: SPRING 2012 Date: Monday, June 25, 2012 Time: 7:00 – 8:50 pm Instructor: Dave Tompkins Exam Type: Closed book Additional Materials Allowed: none Last Name: SOLUTION First Name: ____________________________ Student #: __ __ __ __ __ __ __ __ UW Login: __ __ __ __ __ __ __ __ Signature: ____________________________ Question Out…

    • 2644 Words
    • 19 Pages
    Powerful Essays
  • Satisfactory Essays

    IT 282 sylabus

    • 2660 Words
    • 11 Pages

    This course is an introduction to the fundamentals of personal computer operating systems for computer software configuration, file management, performance monitoring, optimization, maintenance, recovery, and security.…

    • 2660 Words
    • 11 Pages
    Satisfactory Essays
  • Good Essays

    stallings, W. (2012). operating systems internal and design principles (7th ed.). Upper Saddle River, NJ: prentice hall.…

    • 608 Words
    • 2 Pages
    Good Essays
  • Better Essays

    IT 600 Module One Lecture

    • 1256 Words
    • 5 Pages

    Silberschatz, A., Galvin, P. B., & Gagne, G. (2009). Operating system concepts. Hoboken, NJ: John Wiley &…

    • 1256 Words
    • 5 Pages
    Better Essays
  • Good Essays

    Arrakis OS

    • 719 Words
    • 3 Pages

    Peter, Simon. “Arrakis: The Operating System is The Control Plane.” washington.edu, 14 October 2013. Web. 6 May 2014. http://faculty.washington.edu/simpeter/arrakis-tr.pdf…

    • 719 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Operating System Differences

    • 3058 Words
    • 13 Pages

    This paper will elaborate on the major differences of the main Operating Systems (OS), which are UNIX/Linux, Mac®, Microsoft® Windows®. The areas of discussion for this paper will be on Memory Management, Process Management, File Management, and Security for each operating system. Operating Systems (OS) for a computer is the main processing software program used to allow the computer processor to communicate with the software and hardware I/O devices. Computers as SUN, SUSE use UNIX/Linux operating system, Mac® (Macintosh) computer uses Apple operating system, and Personal Computers (PC) and most business computers use Windows® Microsoft® operating systems.…

    • 3058 Words
    • 13 Pages
    Powerful Essays
  • Better Essays

    Author, Kay, Russell (May 14, 2002) QuickStudy: System Development Life Cycle. August 30, 2008 from http://www.computerworld.com/action/…

    • 1434 Words
    • 6 Pages
    Better Essays
  • Good Essays

    In this paper I will be discussing the nature of the operating systems that produce the goods and services that we receive. By answering the questions within this week’s chapter I will be able to elaborate on the Operations and Materials Management involved in three companies operating systems.…

    • 765 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Linux vs Windows

    • 4785 Words
    • 20 Pages

    References: Burgess M., (2001). A comparison of Linux and Windows, Edition 2.2. Retrieved on December 20, 2005 from: http://www.michaelhorowitz.com/Linux.vs.Windows.html…

    • 4785 Words
    • 20 Pages
    Powerful Essays
  • Satisfactory Essays

    Pipelining

    • 3624 Words
    • 15 Pages

    At any given point in time we should be able to identify an instruction so…

    • 3624 Words
    • 15 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Exception Handling in C++

    • 440 Words
    • 2 Pages

    Exception Handling • Exception Handling Basics • Exception Handling mechanism • Throwing Exception • Catching exception • Rethrowing Exception • Exception Specification Exception Handling • Exception are the errors that occur at run time and can stop the working of the program abruptly. • They can occur in various situations- one such condition when the number is divided by 0. • For handling such exceptions we have an error handling mechanism called as exception handling. Objective Main objective is to provide a way to detect and report the exception condition so that necessary action can be taken without troubling user Exception handling mechanism • when exception occurs the portion of program that detects the exception can inform that exception have occurred by throwing it.…

    • 440 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Background The basic function performed by a computer is execution of a program, which consists of a set of instructions stored in memory. The processor does the actual work by executing instructions specified in the program. In its simplest form, instruction processing consists of two steps The processor reads (fetches) instructions from memory one at a time and executes each instruction. Program execution consists of repeating the process of instruction fetch and instruction execution The processing required for a single instruction is called an instruction cycle consist of two steps, the fetch cycle and the execute cycle. Program execution halts only if the machine is turned off, some sort of unrecoverable error occurs, or a program instruction that halts the computer is encountered. To improve processing efficiency, the concept of interrupts is used. Virtually all computers provide a mechanism by which other modules (I/O, memory) may interrupt the normal processing of the processor. With interrupts, the processor can be engaged in executing other instructions while an I/O operation is in progress. For example, most external devices are much slower than the processor. Suppose that the processor is transferring data to a printer using the instruction cycle. After each write operation, the processor must pause and remain idle until the printer catches up. The length of this pause may be on the order of many hundreds or even thousands of instruction cycles that do not involve memory. Clearly, this is a very wasteful use of the processor. In this project, multiple nested interrupt are being discuss and the program build are meant to this type of interrupt but somehow the program can also work for multiple sequential interrupt based on how priority of interrupts are set. Later I will discuss how multiple interrupts are being served by operating system and how sequential and nested multiple interrupt are differs. 1.1 Objectives…

    • 3502 Words
    • 10 Pages
    Powerful Essays