Question 1:
A. Why are interrupts given higher priority than the
currently executing program?
B. Why does an I/O instruction that is executed by your
code result in a trap?
A)
Because an interrupt generally is raised when there is something wrong with the system or there is an important task that needs to be handled immediately or there is an I/O request or the output is generated. So it is given higher priority than other programs to ensure the smooth running of the OS and don't cause any error of any type.
B) because I/O instructions are considered as privileged instructions so whenever the I/O instruction is executed it switches into kernel mode to execute the instruction
Get Answers For Free
Most questions answered within 1 hours.