Repos / kernel.git / commitdiff
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4cafea6)
raw | patch | inline | side by side (parent: 4cafea6)
| author | zhaoyanbai <zhaoyanbai@126.com> | |
| Wed, 3 Nov 2021 08:27:10 +0000 (16:27 +0800) | ||
| committer | zhaoyanbai <zhaoyanbai@126.com> | |
| Wed, 3 Nov 2021 08:27:10 +0000 (16:27 +0800) |
| kernel/fork.c | patch | blob | history |
diff --git a/kernel/fork.c b/kernel/fork.c
--- a/kernel/fork.c
+++ b/kernel/fork.c
}
memcpy(tsk, current, sizeof(task_union));
- tsk->priority = 61;
- //{
tsk->cr3 = (unsigned long)alloc_one_page(0);
assert(tsk->cr3 != 0);
page->count++;
}
}
- //}
-
- load_cr3(current);
tsk->pid = get_next_pid();
tsk->ppid = current->pid;
tsk->esp0 = TASK_SIZE + (unsigned long)tsk;
tsk->esp = (unsigned long)child_regs;
tsk->eip = (unsigned long)ret_from_fork_user;
-
if (flags & FORK_KRNL) {
tsk->eip = (unsigned long)ret_from_fork_krnl;
}
tsk->weight = TASK_INIT_WEIGHT;
INIT_LIST_HEAD(&tsk->list);
-
unsigned long iflags;
irq_save(iflags);
list_add(&tsk->list, &all_tasks);
tsk->state = TASK_RUNNING;
- printk("%s:%d\n", __func__, __LINE__);
-
return (int)tsk->pid;
}