Submit and pass all tests to enable saving to GitHub.
Implementation
Why This Matters
Programming the 8253/8254 PIT at 100Hz is literally how the Linux kernel's early boot timer worked before the APIC timer and HPET took over, and it remains the simplest way any teaching kernel like xv6 implements preemptive multitasking. Get the frequency divisor calculation wrong and your entire scheduler's sense of elapsed time drifts, silently breaking any timeout logic built on top of it.
Hints
0 / 3 revealed
Sample validation
Sample case for Run. Submit grades this sample plus all hidden tests.
main.c
Workspace 1.0
Implement PIT timer programming and scheduling simulation in C.
Requirements:
Define PIT ports (0x40 data, 0x43 command)
Implement pit_set_frequency() that calculates divisor and programs PIT
Show command byte (0x36) being sent
Show divisor split into low and high bytes
Implement timer_handler() that increments a tick counter
Simulate scheduler being called every N ticks
Show tick count and elapsed time
Implement a simple task structure with time_slice
Show preemption when time slice expires
Calculate and display actual frequency from divisor