Lab 2: PIT And Timer IRQs
Generated folder: labs/timer/
Lab 2 introduces periodic hardware events. Instead of asking a high-level OS clock for time, you configure a timer-like device and react to interrupts.
Device Model
| Part | Role |
|---|---|
| Timer 0 | periodic interrupt source |
| Control word | selects timer, access mode, operating mode, BCD/binary |
| Divisor | converts base clock frequency into requested rate |
| IRQ line | event path from device to program |
| Interrupt handler | records that a tick happened |
Plan
- Validate timer number and requested frequency.
- Compute the PIT divisor.
- Write low byte and high byte in order.
- Subscribe to timer interrupts.
- Keep the interrupt handler small.
Next: implementation tasks.