| Age | Commit message (Collapse) | Author |
|
runnable task is found. This is a very basic method of putting the CPU
into an idle state to reduce power consumption and heat production. This
method is far from perfect however since when the CPU is woken by a
timer interrupt, the scheduler runs through the entire process table
again regardless of whether any task has become runnable, before putting
the CPU back to sleep. In practice, this basic sleep mechanism reduced
idle CPU usage of the VM from 100% to ~6%, a very effective amount.
Updated the sleep() library function to use the new sys_alarm and
sys_pause system calls. This method works by first registering a dummy
signal handler, setting an alarm and finally calling pause() to put the
process to sleep. When the alarm expires, the dummy signal handler is
called (which returns immediately) and finally, the sleep() call
returns. Note however, that this is a temporary function implemented
poorly since it overwrites any pending alarms as well as the SIGALRM
handler.
|
|
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.
|
|
vsprintf() function to render formatted strings and then the puts system
call to output them.
Moved the vsprintf() function from the kernel to the library.
Furthermore, the prototype for the function has been moved from the
kernel's headers, to the new header file stdio.h.
Renamed the kernel's internal printf() function to printk() in order to
avoid confusion with the library provided function.
Renamed the sys_print system call to the more appropriate name,
sys_puts.
Added a new system call sys_time, which returns the system's uptime in
seconds. This is mainly for testing the userspace binary and will not be
permanent.
Added the file time.c to the library which contains the caller for
sys_time and a helper routine sleep() which delays execution for the
specified number of seconds. The new header file time.h contains
prototypes for both these functions as well as the definition for the
type time_t.
Fixed a bug in which the value of EAX was not properly passed to the
system call handler, resulting in the wrong system call being executed.
This was caused by the code in the SAVE macro not properly preserving
the value.
Fixed a bug in which the value of EAX was not preserved during a return
from system call, but rather restored with the original EAX value prior
to the call. As a result, system call return codes were not properly
passed. This has been corrected by introducing a new macro RESTORE_SYS
which carries out the same restore operations, but maintains EAX prior
to the return.
|