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

  • Good Essays

    Unit 59 Assignment 3

    • 645 Words
    • 3 Pages

    The process of how the subroutine works within an operating environment is as follows. While the main part of the program is running, there will be a call command sent to the CPU to tell it to stop wherever the program is at, store the W, Z and status along with where in the main program the CPU is at in the stack. Then the main program is cleared from memory and the subroutine is loaded for the CPU to start processing the code. Once the subroutine has finished, the subroutine code is deleted from memory and the CPU will load up the main program back on and will retrieve from stack the stored information (W, Z and status) which will allow the CPU know exactly where it needs to start from.…

    • 645 Words
    • 3 Pages
    Good Essays
  • 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
  • Satisfactory Essays

    Stallings, W. ((2015)). Operating Systems: Internal and Design Principles, 8e. Retrieved from The University of Phoenix eBook Collection Database.…

    • 472 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Week 5 Pos 355

    • 2010 Words
    • 9 Pages

    Operating systems were not in existence before the 1960s. The definition of operating systems is a program designed to run other programs on the computer and is the most important program. In the past, computers were built to execute a series of single task similar to a calculator. In the 1960s came the MCP (Master Control Program) for the B5000 mainframe computer created by the company Burroughs/Unisys. The MCP was the first OS written exclusively in a high-level language. As the years progressed, OS giants were starting to form such as Windows, Linux, and Mac. In, this paper, these 3 tech OS giants will be examined thoroughly while covering memory management, process management, file management, and security.…

    • 2010 Words
    • 9 Pages
    Better 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

    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
  • 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
  • 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
  • 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
  • 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
  • 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

    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
  • 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