diff options
Diffstat (limited to '')
| -rw-r--r-- | src/boot.asm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/boot.asm b/src/boot.asm index c2d461a..4049f9d 100644 --- a/src/boot.asm +++ b/src/boot.asm @@ -81,11 +81,19 @@ KernelInit: call SchedInit ; pick first task, set wCurProc - ; interrupts: enable timer for preemption + ; system tick: hardware timer at 16384 Hz input, TMA=0 -> TIMA overflow + ; IRQ at 64 Hz. TimerISR just counts (wTicks); scheduling stays + ; cooperative. Only the timer bit is enabled in IE. + xor a + ld [rTIMA], a + ld [rTMA], a + ld a, %00000111 ; enable | 16384 Hz + ld [rTAC], a xor a ld [rIF], a - ; ld a, IEF_TIMER ; (timer bit) - leave masked for cooperative demo - ; ld [rIE], a + ld a, IEF_TIMER + ld [rIE], a + ei ; hand control to the first task via a context switch-in jp SchedRunFirst |
