Information Technology Reference
In-Depth Information
to smoothly play the music, and to respond in a timely way to user input, the
operating system needs to be able regain control promptly when it needs to
switch to a new task.
Almost all computer systems include a device called a hardware timer which
Definition: hardware
timer
can be set to interrupt the processor after a specified delay, either in time or
after some number of instructions have been executed. The operating system
might set the timer to expire every ten milliseconds. (Human reaction time is
measured in the hundreds of milliseconds.) Resetting the timer is a privileged
operation, accessible only within the kernel, so that the user-level process cannot
inadvertently or maliciously disable the timer.
When the timer interrupt occurs, control is transferred by the hardware
from the user process to the operating system kernel running in kernel-mode.
Other hardware interrupts, such as to signal the processor that an I/O device has
completed its work, likewise cause control to be transferred from the user process
to the operating system kernel. A timer or other interrupt does not imply that
the program has done anything wrong | in most cases, after resetting the
timer, the operating system will resume execution of the process, with the mode,
program counter and registers set back to the values they had immediately
before the interrupt occurred. We will discuss the hardware and operating
system kernel mechanisms for implementing interrupts in the next section.
Search WWH ::




Custom Search