460 LAB #6: Timer for MTX
460 LAB Assignment #6: Timer for MTX
DUE : to be announced
0. BACKGROUND: NOTES on Interrupts and Timer
1. Download files from samples/LAB5.timer/
t.c : YOUR LAB5 .c file but add display driver vid.c and timer
interrupt handler.
ts.s : assembly file for this assignment
timer.c : timer interrupt handler in C
(as of now, it prints a message every second)
MODIFY thandler() for this assignment.
2. Implement these timer functions:
(a). At each second : display current time HH:MM:SS at the lower right
corner. Read my video display driver vid.c code for
how.
(b). When a proc is scheduled to run, set its PROC.time to an alloted run
time, e.g. 5 seconds. Decrement running's run time in Umode only!
When a proc's run time expires, switch process.
NOTE: do NOT switch process while it's in Kmode!!!
REASON: our MTX kernel is NOT a multi-processor kernel.
(c). Every 5 seconds: turn off FD if it is on; (write 0x0C to 0x3F2)
turn on FD if it is off; (write 0x1C to 0x3F2)
(d). From Umode, add a command, sleep, which ask for a time t to sleep.
Syscall to MTX kernel to sleep for t seconds. The process becomes
READY to run again when its sleep time expires.