Timer Operation
how does the OS prevent against runaway user programs (infinite loops)?
a timer can be set to generate an interrupt in a given time
before it transfers to a user program, the OS loads the timer with a time to interrupt
when the time arrives, the executing program is interrupted and the OS regains control
this ensures that the OS can get the CPU back even if a user program erroneously or purposely continues to execute past some allotted time.
the timer is privileged: only the OS can load it