Professional Documents
Culture Documents
Assuming that interrupts are enabled, the following steps takes place
1. The device raises an interrupt request.
2. The processor interrupts the program currently being executed.
3. Interrupts are disabled by changing the control bits in the PS .
4. The device is informed that its request has been recognized, and in response,
it deactivates the interrupt-request signal.
5. The action requested by the interrupt is performed by the interrupt-service
routine.
6. Interrupts are enabled and execution of the interrupted program is resumed.
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Q) Define Exceptions . Explain its types
A) An interrupt is an event that causes the execution of one program to be
suspended and the execution of another program to begin .The term exception
is often used to refer to any event that causes an interrupt. I/O interrupt is one
example of exception.
Recovery from errors: Computers use variety of techniques to ensure that all
hardware components are operating properly. For eg. Many computers include
an error checking code in main memory which allows the detection of errors in
stored data. If error occurs, control hardware detects it and inform processor by
raising an interrupt.The processor suspends program being executed and starts
an ESR(Exception Service Routine). This routine takes appropriate action to
recover from the error and inform the user about it.
Debugging: System software usually includes a program called debugger
which helps the programmer to find an error in a program. The debugger uses
exceptions to provide two important facilities called trace mode and
breakpoints.
Trace mode: when a processor is operating in a trace mode, an interrupt occurs
after the execution of every instruction. An interrupt service routine in the
debugger program is invoked each time this interrupt occurs. Debugging
program enables user to examine contents of registers and memory locations
and so on. After returning from the debugging program next instruction in the
program beig debugged is executed. And then debugging program is activated
again.
Breakpoints: This is similar to trace mode except that the program which is
being debugged is interrupted only at specific points selected by the user.An
instruction called Trap or softerware interrupt is usually provided for this
purpose.
Privilege Exception :To protect OS of computer from being corrupted by user
programs certain instructions can be executed only when the processor is in the
supervisor mode .These are called privileged instructions.An attempt to
execute such an instructions will produce a privilage exception.As a result
processor switches to superwise mode and begin to execute the required action.
Distributed Arbitration:
In distributed arbitration, all devices participate in the selection of the next bus
master.
In this scheme each device on the bus is assigned a 4-bit identification number.
when one or more devices request bus they assert the start-arbitration signal
and place their 4-bit ID numbers on arbitration lines, ARB0 through ARB3.
These four arbitration lines are all open-collector. Therefore, more than one
device can place their 4-bit ID number to indicate that they need to control of
bus. If one device puts 1 on the bus line and another device puts 0 on the same
bus line, the bus line status will be 0. Device reads the status of all lines through
inverters buffers so device reads bus status 0 as logic 1. The device having
highest ID number has highest priority.When two or more devices place their
ID number on bus lines then it is necessary to identify the highest ID number on
bus lines .A winner is selected as a result of interaction among signals
transmittedover these lines by all contenders Net outcome is tha the code on
four lines represents request that has highest ID number
Advantage: This approach offers higher reliability since operation of bus is not
dependent on any single device