Practice mode Operating Systems

What happens if a user-mode program tries to execute a privileged instruction such as disabling interrupts?

Correct answer C. The hardware traps to the operating system instead of executing it

Explanation

Privileged instructions are legal only in kernel mode. When a user program attempts one, the hardware does not execute it and raises a trap so the operating system can take control, usually terminating the program. The CPU never quietly promotes the program to kernel mode, because that would defeat the whole protection scheme that dual-mode operation provides.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.