an interrupt is either a hardware · 2018. 8. 4. · software interrupts: there are instructions in...

40

Upload: others

Post on 09-Oct-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 2: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 3: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

• An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal)

OR• A Software-generated CALL

(internally derived from the execution of an instruction or by some other internal event

Page 4: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

An interrupt is used to cause a temporary

halt in the execution of program.

The meaning of ‘interrupts’ is to break the

sequence of operation.

While the Microprocessor is executing a

program, an ‘interrupt’ breaks the normal

sequence of execution of instructions,

diverts its execution to some other program

called Interrupt Service Routine (ISR).

• After executing ISR, IRET returns the control

back again to the main program. Interrupt

processing is an alternative to polling.

Page 5: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

The keyboard controller can hold only asingle keystroke. Therefore, the keyboardcontroller must be freed before the nextkeystroke arrives.

The keystroke is passed to the CPUby putting it in the keyboard buffer. So, thekeyboard controller keeps on passing thekeystroke input to the CPU,

but how does the CPU attend to it? TheCPU is not at the disposal of the keyboardcontroller; it is usually busy doing severalother operations. So, we need somemechanism to indicate to the CPU that akeystroke has arrived. How is this done?There are two approaches to making surethat the CPU pays attention:

Page 6: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

The CPU executes other program, as soon as akey is pressed, the Keyboard generates aninterrupt. The CPU will response to theinterrupt – read the data. After that returns tothe original program. So by proper use ofinterrupt, the CPU can serve many devices atthe “same time”

Page 7: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

The Purpose of

Interrupts...

Page 8: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Interrupts are useful when interfacing I/O

devices at relatively low data transfer rates,

such as keyboard inputs.

Interrupt processing allows the processor to

execute other software while the keyboard

operator is thinking about what to type next.

When a key is pressed, the keyboard encoder

debounces the switch and puts out one pulse

that interrupts the microprocessor.

Page 9: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

– a time line shows typing on a keyboard,a printer removing data from memory, and a program executing

– the keyboard interrupt service procedure, called by the keyboard interrupt, and the printer interrupt service procedure each take little time to execute

Page 10: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 11: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 12: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

TYPES OF INTERRUPT

SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified. • INT 3, Break Point Interrupt instruction. • INTO, Interrupt on overflow instruction.

HARDWARE INTERRUPTS:

The primary sources of interrupts, however, are the PCs timer chip, keyboard, serial ports, parallel ports, disk drives, CMOS real-time clock, mouse, sound cards, and other peripheral devices.

Page 13: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 14: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

•The interrupt vector table contains 256 four byteentries,containg the CS:IP

•Interrupt vectors for each of the 256 possibleinterrupts. The table is used to locate theinterrupt service routine addresses for each ofthose interrupts.

•The Interrupt vector table is located in the first1024 bytes of memory at addresses 000000H-0003FFH.It contains the address(segment andoffset)of the interrupt service provider

Page 15: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 16: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

The interrupt vector table for the microprocessor and (b) the contents of an interrupt vector.

– The first five interrupt vectors are identicalin all Intel processors

– Intel reserves the first 32 interrupt vectors

– The last 224 vectors are user-available

– Each is four bytes long in real mode andcontains the starting address of the interruptservice procedure.

– The first two bytes contain the offset addressthe last two contain the segment address

Page 17: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 18: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

TYPE 0The divide error : whenever the results from a division overflows or an attempt is made to divide by zero.

Page 19: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 20: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 21: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Type 2

The non-maskable interruptoccurs when a logic 1 is placed onthe NMI input pin to themicroprocessor. non-maskable—itcannot be disabled

Page 22: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 23: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Type 3A special one-byte instruction (INT3) that uses this vector to access itsinterrupt-service procedure. oftenused to store a breakpoint in aprogram for debugging

Page 24: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 25: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

TYPE 4

Overflow is a special vector used with the INTO instruction. The INTO instruction interrupts the program if an overflowcondition exists.

Page 26: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

TYPE 5

The BOUND instruction compares a register with boundaries stored in the memory. If the contents of the register are greater than or equal to the first word in memory and less than or equal to the second word, no interrupt occurs because the contents of the register are within bounds. if the contents of the register are out of bounds, a type 5 interrupt ensues as reflected by the overflow flag (OF)

Page 27: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 28: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified
Page 29: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Type 7The coprocessor not available interrupt occurs when a coprocessor is not found, as dictated by the machine status word (MSW or CR0) coprocessor control bits. if an ESC or WAIT instruction executes and no coprocessor is found, a type 7 exception or interrupt occurs

Page 30: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Type 8

A double faultinterrupt isactivated whentwo separateinterrupts occurduring the sameinstruction.

Page 31: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

In computing, a double fault is aserious type of error thatoccurs when a centralprocessing unit (CPU) cannotadequately handle a certaintype of system event thatrequires the CPU’s immediateattention. Double faults maycause computer crashes anderror messages, automaticrestarting of the machine, andthe loss of any unsaved data.They are often caused byproblems in the computer’shardware such as a badmemory module or overheatingCPU.

Page 32: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Type 9

The coprocessor segment overrun occurs if the ESC instruction (coprocessor opcode) memory operand extends beyond offset address FFFFH in real mode.

Page 33: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Type10An invalid task state segment interrupt occursin the protected mode if the TSS is invalidbecause the segment limit field is not 002BHor higher. usually because the TSS is notinitialized

Type11The segment not present interrupt occurswhen the protected mode P bit (P = 0) in adescriptor indicates that the segment is notpresent or not valid.

Page 34: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

• Type 12

A stack segment overrun occurs if the stacksegment is not present (P = 0) in the protectedmode or if the limit of the stack segment isexceeded.

Page 35: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Type 13

The general protection fault occurs for mostprotection violations in 80286–Core2 inprotected mode system.

These errors occur in Windows as generalprotection faults. A list of these protectionviolations follows.

Page 36: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

• Type 13

PROTECTION VIOLATIONS

– Descriptor table limit exceeded

– Privilege rules violated

– Invalid descriptor segment type loaded

– Write to code segment that is protected

– Read from execute-only code segment

– Write to read-only data segment

– Segment limit exceeded

– CPL = IOPL when executing CTS, HLT, LGDT, LIDT, LLDT, LMSW, or LTR

– CPL > IOPL when executing CLI, IN, INS, LOCK, OUT, OUTS, and STI

(cont.)

Page 37: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Type 14

Page fault interrupts occur for any pagefault memory or code access in 80386, 80486, and Pentium–Core2 processors.

Type 16

Coprocessor error takes effect when a coprocessor error (ERROR = 0) occurs for ESCape or WAIT instructions for 80386, 80486, and Pentium–Core2 only.

Page 38: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Type 17

Alignment checks indicate word and double word data are addressed at an odd memory location (or incorrect location, in the case of a double word). interrupt is active in 80486 and Pentium–Core2

Page 39: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Type 18

A machine check activates a systemmemory management modeinterrupt in Pentium–Core2.

Page 40: An Interrupt is either a Hardware · 2018. 8. 4. · SOFTWARE INTERRUPTS: There are instructions in 8086 which cause an interrupt. • INT instructions with type number specified

Thank You

Slide-Share and Owner of PPT