Exceptio Ns: Is Often Used To Refer To Any Event That Causes An Interruption

  • Uploaded by: aiko0818
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Exceptio Ns: Is Often Used To Refer To Any Event That Causes An Interruption as PDF for free.

More details

  • Words: 615
  • Pages: 18
EXCEPTIO NS Is often used to refer to any event that causes an interruption

Kinds of Exceptions Recovery from Errors  Exception-Service Routine -takes appropriate action to recover from the error or to inform the user about it.

Debugging  Debugger -helps the programmer find errors in a program. 2 important facilities of debugger:  Trace Mode  Breakpoints

• Trace Mode -an exception occurs after execution of every instruction.

• Breakpoints -the program being debugged is interrupted only at specific points selected by the user.

Privilege Exception  Privileged Instruction -modifies the priority of the processor.

Operating System Responsible for coordinating all activities within a computer. Makes extensive use of I/O operations. Incorporates the interrupt-service routines for all devices connected to a computer. Provides a variety of services to application programs.

The OS includes: • Multitasking – a mode of operation in which a processor executes several user programs at the same time.

• Time slicing – with this technique, each program runs for a short period called a time slice.

• OSINIT – set interrupt vectors.

• SCHEDULER – an OS routine whose function is to determine which user program should run in the next time slice. It saves all the information that will be needed later when the execution of a program is resumed.

• Program State – the information saved by the SCHEDULER. It includes register contents, the program counter, and the processor status word.

• Processor Status Word – it contains the condition flags and other information such as priority level.

• PROCESS Running – the program is currently being executed. Runnable – the program is ready for execution but is waiting to be selected by the SCHEDULER. Blocked – the program is not ready to resume execution for some reason.

• OSSERVICES – examine stack to determine requested operation.

• IOINIT – a routine that is responsible for starting I/O operations.

• Device Driver - is a computer program allowing higher-level computer programs to interact with a hardware device.

• IODATA – poll devices to determine source of interrupt.

• END – a flag that is set to 1 if the character is a carriage return.

Use of Interrupts in OS  Enables the operating system to assign priorities, switch from one user program to another, implement security and protection features, and coordinate I/O activities.  Can be used to call different parts of the OS, depending on the service being requested.

Processor Examples ARM Interrupt Structure  ARM Processor - Advanced RISC (Reduced Instruction Set Computer) Machines has a simple yet powerful exception-handling mechanism.

• 5 Sources of Exceptions External interrupt-request lines (IRQ). Fast Interrupt Request (FIQ). Software Interrupt Instruction (SWI). External Abort following a bus error. Attempt to execute an undefined instruction.



Exceptions are handled according to the following priority structure:

3. 4. 5. 6. 7. 8.

Reset Data Abort FIQ IRQ Prefetch Abort Undefined Structure



When the processor accepts an interrupt, it takes the following actions:

2.

It saves the return address of the interrupted program in register14 of the corresponding mode. It saves the contents of the current processor status register (CPSR) in the corresponding SPSR (Saved Processor Status Register). It changes the mode bits in CPSR according to the type of interrupt. It branches to the interrupt-service routine starting at the appropriate vector address.

3.

4. 5.

*The ARM Processor uses a pipelined structure. Pipelined Structure - an instruction is fetched before the execution of the preceding instruction is completed.

• ARM Processor

Stacks and Nesting • ARM Interrupt Mechanism - stores the return address in a register and does not automatically implements a stacking mechanism to allow subroutine or interrupt nesting.

Related Documents


More Documents from ""