io interrupts Flashcards
polling/ busy waiting/ synchronous io
constantly reading the device status to see if the status has changed in order to control the flow of information
what is a negative of polling/ busy waiting/ synchronous io
you cant do anything else whilst doing this which is a waste of the processors time as io devices are quite slow
how does interrupt driven/ asynchronous io work
an operation is initiated
the main program continues
when the operation completes an interrupt
is sent in
the main program stops and control is transferred to the interrupt service routine which reads in information from the device
the information is processed
the main program is resumed
what is the benefit of asynchronous io
lose less time from the main processor
why do interrupts have a priority system
so lower priority interrupts are able to be interrupted by higher priority but not the other way round
how does an interrupt service routine work
the interrupt comes in on an electrical signal/ line into the processor
the processor goes to a defined rest in a specific memory address where the starting address of the isr is stored
it executes the instruction at the start of that address
the processor then disables interrupts of a lower priority
the isr stores all registers onto the stack
the interrupt handler is called and when it returns the values on the stack are recovered
we return from the interrupt and back onto the main program
when doing an isr why do we store the registers onto the stack
the main program doesnt know where the interrupt will occur therefore it cant prepare for it before the routine runs
the routine may have to use the processor registers and when they are returned the processor will find the wrong data in them therefore we need a way to restore the correct values
when we get an interrupt how do we avoid polling through all devices to find which one sent it
we have multiple interrupt lines and can group things together so we only have to poll a small amount of devices
we have multiple isr so the processor isnt back to checking everything for the right isr
how do we make having multiple interrupt lines even more efficient
have all the devices on one line be the same
what is the negative of having all the devices on one interrupt line be the same
more support required on the processor which means an increase in cost and complexity
how can we limit the number of isr
at the start of the isr we push a number representing the interrupt line that caused the interrupt
then we can call the common interrupt handler that can check that value and it knows which particular interrupt to handle
what causes a double fault
if there isnt an isr for the interrupt
what causes a triple fault
if there isnt an isr for the double fault
what happens when a triple fault occurs
the machine restarts
what happens when a double fault occurs
debugging information is given
what is the point of the program interrupt controller
want to avoid having lots of wires going to the cpu as itll make it too big
what does the program interrupt controller do and how
multiplexes interrupt lines; generates a single electronic signal when an interrupt occurs allowing the processor to only have one interrupt line
the interrupt handler queries the controller for which interrupt line actually caused the interrupt and gets a numeric value
nested interrupts
when interrupts get interrupted due to a higher priority
what are two negative of nested interrupts
complicates the code and timing
have to make sure that you can still get back to the correct state
exceptions
a type of interrupt for internal processor problems
software interrupts
particular instruction initiating interrupts
what is an example of a software interrupt
system call
why do we use interrupts
we need to know when unexpected event occur
mask-able system/interrupts
one that can allow interrupts to be disabled or ignored
unmask-able system/interrupts
interrupts cant be disabled or ignored
what is a negative of maskable interrupts
since machines now rely on them heavily interrupts being ignored can cause massive problems
e.g. missing time sensitive events