Vous êtes sur la page 1sur 2

Difficulty with Sharing Interrupt Lines

Multiple devices sharing an interrupt line (of any triggering style) all act as spurious interrupt sources with respect to each other. With many devices on one line the workload in servicing interrupts in proportion to the square of number of devices. Performance Issues Interrupt provide low overhead and good latency at low offered load, but degrade significantly at high interrupt rate unless care is taken to prevent several pathologies. Typical Uses Typical uses of interrupt include the following; System Timer generates interrupt periodically from counter or the power-line. Disk Interrupt the completion of a data transfer from or to the disk peripheral. Power-off Interrupt predicts or request a loss of power. Interrupts are also used in type ahead features for buffering events like keystrokes. Software Interrupt Software interrupt were introduced into LINUX with the 2.4 kernel. User mode is one of two distinct execution modes for the CP in LINUX. It is a non-privileged mode in which each process begins. Nonprivileged means that processes in this mode are prohibited from accessing those portions of memory that have been allocated to other programs or to the kernel. Hardware Interrupt Hardware interrupt are generated by hardware devices when something unusual happens; this could be a key press or a mouse move or any other action. Polling the CPU would have to check all installed hardware for data in a big loop, and this would take much time. Exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the programs instructions. Exception Object contains information about the error, including its type and the state of the program when the error occurred. Throwing an Exception creating an exception system attempts to find something to handle it. The Call Stack The runtime searches the call stack for a method that contains a block of code that can handle the exception. This block of codes is called an exception handler. Exception handler is said to catch the exception. Throws exception Method where error occurred Looking for appropriate handler Forwards exception Method without an exception handler Looking for appropriate handler catches some other exception Method with an exception handler Main

Types of Exception I/O device request Invoking an operating system service from a user program (system call) Tracing instruction execution Breakpoint (programmer-requested interrupt) Integer arithmetic overflow or underflow; FR arithmetic anomaly Page fault Misaligned memory accesses (if alignment is required) Memory protection violation Using an undefined instruction Hardware malfunction Power failure

The requirement on exceptions can be characterized by five types: Synchronous Versus Asynchronous If the event occurs at the same place every time the program is executed with the same data and memory allocation, the event is synchronous. Asynchronous events usually can be handler after the completion of the current instruction, which makes them easier to handler. User Requested Versus Coerced If the user task directly asks for it, it is a user-requested event. In some sense, user-requested exceptions are not really exception, since they are predictable. Coerced exception are caused by some hardware event that is not under the control of the user program. User Maskable Versus User Nonmaskable If an event can be masked or disabled by a user task, it is user maskable. This mask simply controls whether the hardware responds to the exception or not. Within Versus Between Instruction This classification depends on whether the vent prevents instruction completion by occurring in the middle (within) of exception or execution or whether it is recognized between instructions. Resume Versus Terminate If the programs execution always stops after the interrupt, it is a terminating event. If the programs execution continues after the interrupt, it is a resuming event. If is easier to implement exception that terminate execution, since the machine need not be able to restart execution of the same program after handling the exception.

Vous aimerez peut-être aussi