diff options
| author | Jake Mannens <jake72360@gmail.com> | 2018-07-30 02:09:12 +1000 |
|---|---|---|
| committer | Jake Mannens <jake72360@gmail.com> | 2018-07-30 02:09:12 +1000 |
| commit | 902abebefe10e5e8bc9d80b73e46bcb1635f0be8 (patch) | |
| tree | 303aaed0f6f274e37ee069c120e5e6bec3b5c9c9 /kernel/timer.s | |
| parent | 4a91e12af177dc50a2427d335fd522658d821194 (diff) | |
Fixed a bug where the tick_handler() and sigret() functions did not pass
a pointer to the saved state information to check_signals(). This bug
would have only manifested itself if multiple signals were to be
processed (sigret) or if a signal had been set during the handling of a
timer interrupt (tick_handler) and *ONLY* if switching to the user's own
handler since the state information is not needed to invoke the kernel's
default signal handler.
Implemented alarms for userspace processes. This required significant
modification of the scheduler algorithm. When idling waiting for a
process that can run, the scheduler now continually checks the alarms
and signals of each process and updates their state accordingly.
Implemented the sys_alarm system call to set the new 'alarm' field for
the calling process.
Created the sys_pause system call which changes the state of the calling
process to TSTATE_INTERRUPTIBLE, effectively removing it from the
scheduler's run queue, putting it to sleep until a signal arrives.
Diffstat (limited to 'kernel/timer.s')
| -rw-r--r-- | kernel/timer.s | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/timer.s b/kernel/timer.s index b96e1f1..6d95281 100644 --- a/kernel/timer.s +++ b/kernel/timer.s @@ -19,6 +19,8 @@ tick_handler: mov es, ax mov fs, ax mov gs, ax + ; save a pointer to the state information + mov ebx, esp ; handle the timer tick mov dword [ticked], 1 inc dword [ticks] @@ -31,7 +33,9 @@ tick_handler: ; if it isn't, call the scheduler call sched_tick ; handle any pending signals before returning to normal execution + push ebx call check_signals + add esp, 4 .end: ; restore the data segment selectors pop ax |
