1 / 8

Operating Systems

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)

lulu
Download Presentation

Operating Systems

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Operating Systems Lesson 12

  2. Plan • Interrupts • Windows and Interrupts • Structural Exception Handling • Exception Handling types • __try/__except • Sample: DivPtr

  3. 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

  4. 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.

  5. 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)

  6. 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)

  7. __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

  8. Sample: DivPtr with exception handlers

More Related