To prevent a user program from getting stuck in an infinite loop or not calling system services and never returning control to the OS, a timer is used. A timer can be set to interrupt the computer after a specified period.
Transition from User to Kernel Mode
The OS sets the counter and this counter is decremented every time the clock ticks. When the counter reaches 0, an interrupt occurs which transfers control automatically to the OS.
No comments:
Post a Comment