Question

In: Computer Science

What is an exception? What is an interrupt? What is a non-maskable interrupt and why is...

What is an exception? What is an interrupt? What is a non-maskable interrupt and why is it used?

Solutions

Expert Solution

Exception :- Exceptions are anamolus or exceptional conditions that require special processing of code. When an exception occurs exception handling is being done. It is the process of responding to the occurrence, during computation, of exception often changing the normal flow of program execution. It is provided by specialized programming language constructs or computer hardware mechanisms.An exception is resolved by saving the current state of execution in a predefined place and switching the execution to a specific subroutine known as an exception handler. If exceptions are continuable, the handler may later resume the execution at the original location using the saved information.

Interrupt :- In systems programming, an interuppt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code the processor is executing. The processor responds by suspending its current activities, saving its state, and executing a function called an interrupt handler to deal with the event. This interruption is temporary, and, after the interrupt handler finishes, the processor resumes normal activities.

There are two types of interrupts: hardware interrupts and software interrupts.

Hardware interrupts are used by devices to communicate that they require attention from the operating system. Internally, hardware interrupts are implemented using electronic alerting signals that are sent to the processor from an external device, which is either a part of the computer itself, such as a disk controller, or an external peripheral. For example, pressing a key on the keyboard or moving the mouse triggers hardware interrupts that cause the processor to read the keystroke or mouse position. Unlike the software type (described below), hardware interrupts are asynchronous and can occur in the middle of instruction execution, requiring additional care in programming. The act of initiating a hardware interrupt is referred to as an interrupt request (IRQ).

A software interrupt is caused either by an exceptional condition in the processor itself, or a special instruction in the instruction set which causes an interrupt when it is executed. For example, if the processor's arithmetic logic unit is commanded to divide a number by zero, this impossible demand will cause a divide-by-zero exception, perhaps causing the computer to abandon the calculation or display an error message.

Each interrupt has its own interrupt handler. The number of hardware interrupts is limited by the number of interrupt request (IRQ) lines to the processor, but there may be hundreds of different software interrupts. Interrupts are a commonly used technique for computer multitasking, especially in real-time computing. Such a system is said to be interrupt-driven.

Non-Maskable Interuppt :- A non-maskable interrupt (NMI) is a hardware interrupt that cannot be ignored by standard interrupt masking techniques in the system. It is typically used to signal attention for non-recoverable hardware errors.

Uses of NMI's( Non- maskable Interuppt) :-

  • NMIs are used to handle non-recoverable errors which need immediate attention. Therefore, such interrupts should not be masked in the normal operation of the system. These errors include non-recoverable internal system chip set errors, corruption in system memory such as parity and ECC errors, and data corruption detected on system and peripheral buses.
  • An NMI is often used when response time is critical or when an interrupt should never be disabled during normal system operation. Such uses include reporting non-recoverable hardware errors, system debugging and profiling, and handling of special cases like system resets.

  • On some systems, an NMI can be triggered by the computer's user through hardware and software debugging interfaces and system reset buttons.

  • Debugging NMIs are typically used to diagnose and fix faulty code. In such cases an NMI is used to execute an interrupt handler that transfers control to a special monitor program. From this program a developer can inspect the machine's memory, and examine the internal state of the program at the instant of its interruption. This also allows computers which appear to be hung to be debugged or diagnosed.


Related Solutions

What is an exception? What is an interrupt? What is a non-maskable interrupt and why is it used?
What is an exception? What is an interrupt? What is a non-maskable interrupt and why is it used?
Why can’t morphological features be used to study variation? What is the exception? Discuss this exception...
Why can’t morphological features be used to study variation? What is the exception? Discuss this exception in detail.
in C#, What is an exception and what are the advantages of exception handling?
in C#, What is an exception and what are the advantages of exception handling? What are the differences between the traditional error-handling methods and the object-oriented exception-handling methods and when should you use each one? Provide three to four paragraphs detailing your findings/views on these questions..provide examples with a simple code also..
Why is it dangerous to acquire a lock in an interrupt handler?
Why is it dangerous to acquire a lock in an interrupt handler?
What is an interrupt vector table. How do I create an interrupt vector table in Arm...
What is an interrupt vector table. How do I create an interrupt vector table in Arm Architecture . Please include as much information as you can, including pictures, examples etc. Thank you very much.
V. How does ARM processor differentiate between a timer interrupt and an A/D interrupt? VI. What...
V. How does ARM processor differentiate between a timer interrupt and an A/D interrupt? VI. What does privileged mode mean and what is the major difference between this mode and non-privileged mode? VII. There are two interrupt pins on ARM microprocessor: IRQ and FIQ. Which one can interrupt the other one and why?
When is an external interrupt recognized by the CPU?  When more than one interrupt occurs, what approaches...
When is an external interrupt recognized by the CPU?  When more than one interrupt occurs, what approaches would you use to service them? What approaches should be taken when an interrupt occurs within an interrupt service routine Consider a hypothetical microprocessor having 64-bit instructions composed of two fields: the first 16-bits contains the op-code and the remainder the immediate operand or an operand address.  Assume memory is organized in 32-bit words, i.e. one r/w access can yield a maximum of 32 bits.  ...
.What is the role of interrupt vector table during interrupt processing? b. How does OS make...
.What is the role of interrupt vector table during interrupt processing? b. How does OS make sure that a user process cannot access I/O devices or any other process’ memory areas? c. How is data parallelism different from task parallelism? Which one of these approaches would you use if you had to compute the average of an array of million numbers? Why? d. What kind of events can cause a process to leave CPU? e. What is the main different...
Explain the main purpose of an interrupt signal. Give an example of how the interrupt is...
Explain the main purpose of an interrupt signal. Give an example of how the interrupt is used.
What is an interrupt vector? What is polling used for? What are the disadvantages of polling?
What is an interrupt vector? What is polling used for? What are the disadvantages of polling? What is a better way to perform the same job?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT