Protection Flashcards
Why is protection needed?
Must prevent programs from causing disruption from each other when sharing HW & resources
What is dual mode operation?
Allows us to differentiate between OS code and User code using rings.
Allows the concept of privileged instructions
What ring is user mode?
Ring 3
What ring is kernel mode?
Ring 0
How is dual mode implemented/differentiated?
The mode-bit in hardware shows what mode the instruction is to be implemented as.
What mode is the hardware in at boot time?
Starts in kernel mode so that the operating system can be loaded. This then starts user processes in user mode
How can a switch be made from user to kernel mode?
On interrupt, Interrupt Service Routine code executes in kernel mode. Mode-bit must be reset before returning control
What does the Hardware Timer do?
Generate regular interrupts in order to ensure OS maintains control of the CPU.
At each interrupt, ISR decides whether or not to return control to the current user program.
How are Privileged operations carried out?
In order to carry out kernel-mode operations, need to use system calls in order to appeal to the Operating system to allow privileged operation