Operating systems
Download
1 / 8

Operating Systems - PowerPoint PPT Presentation


  • 62 Views
  • Uploaded on

Operating Systems. Lesson 12. Plan. Interrupts Windows and Interrupts Structural Exception Handling Exception Handling types __try/__except Sample: DivPtr. Interrupts. An event need an attention Hardware event (pressed keyboard key)

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

PowerPoint Slideshow about 'Operating Systems' - lulu


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

Operating systems
Plan

  • Interrupts

  • Windows and Interrupts

  • Structural Exception Handling

  • Exception Handling types

  • __try/__except

  • Sample: DivPtr


Interrupts
Interrupts

  • An event need an attention

    • Hardware event (pressed keyboard key)

    • Errors (division by zero) caused by specific CPU command

    • Timer (Check for context switch)

    • Software (not valid parameters to critical call)

  • Interrupt Handler

    • A routine to take care of interrupts

    • Address in interrupt dispatch table according to interrupt number

    • CPU save current state before invoking interrupt handler


Windows and interrupts
Windows and Interrupts

  • Interrupt is very low level concept =>not directly exposed by user mode API’s

  • Hardware and Timer interrupts are supported through win32 synchronization objects (e.g. event) or Asynchronous Procedure Calls (APC)

  • Error handling interrupts are supported by Windows through Structural Exception Handling (SEH) mechanism.


Structural exception handling
Structural Exception Handling

  • An exception is an event that occurs during the execution of a program, and requires the execution of code outside the normal flow of control

  • Most of the exceptions are handled by debugger (check Debug/Exceptions menu of Visual Studio)


Exception handling types
Exception Handling Types

  • Frame-based exception handling

    • Handle exceptions in particular code segment(‘frame”)

  • Vectored exception handling

    • Handles exceptions anywhere in applications

  • Windows: Frame-based exception handling implemented as C/C++ extension (new keywords)


Try except
__try/_except

__try

{ // guarded body of code }

__except (filter-expression)

{ // exception-handler block }

Filter expression:

Execute __except block

Execute next command after erroneous

Search for other exception handler


Sample divptr with exception handlers
Sample: DivPtr with exception handlers