aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/proc.c
diff options
context:
space:
mode:
authorMarvin Borner2020-11-18 17:53:31 +0100
committerMarvin Borner2020-11-18 17:53:31 +0100
commita5a04ef3de6ad3f81d37a04fede23eb3b4b348b1 (patch)
tree555496762aaa15e810bf3038bd2d444d68931d65 /kernel/features/proc.c
parent431c88102153b8b41a15a1105e291ecf161c030e (diff)
Added browser and many networking things
Diffstat (limited to 'kernel/features/proc.c')
-rw-r--r--kernel/features/proc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/features/proc.c b/kernel/features/proc.c
index 76f552b..ffe0af0 100644
--- a/kernel/features/proc.c
+++ b/kernel/features/proc.c
@@ -36,14 +36,18 @@ void scheduler(struct regs *regs)
if (current)
memcpy(&((struct proc *)current->data)->regs, regs, sizeof(struct regs));
- if (priority_proc) {
+ if (priority_proc && priority_proc->state == PROC_RUNNING) {
current = list_first_data(proc_list, priority_proc);
priority_proc = NULL;
assert(current);
- } else if (current && current->next) {
+ } else if (current && current->next &&
+ ((struct proc *)current->next->data)->state == PROC_RUNNING) {
current = current->next;
- } else {
+ } else if (((struct proc *)proc_list->head->data)->state == PROC_RUNNING) {
current = proc_list->head;
+ } else {
+ print("TODO: All processes are sleeping!\n"); // TODO!
+ /* loop(); */
}
memcpy(regs, &((struct proc *)current->data)->regs, sizeof(struct regs));