summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/proc.c b/proc.c
index 6f7bdb6..2e8a0a4 100644
--- a/proc.c
+++ b/proc.c
@@ -65,7 +65,8 @@ procdump(void)
//PAGEBREAK: 32
// Look in the process table for an UNUSED proc.
-// If found, change state to EMBRYO and return it.
+// If found, change state to EMBRYO and initialize
+// state required to run in the kernel.
// Otherwise return 0.
static struct proc*
allocproc(void)
@@ -97,7 +98,7 @@ found:
p->tf = (struct trapframe*)sp;
// Set up new context to start executing at forkret,
- // which returns to trapret (see below).
+ // which returns to trapret.
sp -= 4;
*(uint*)sp = (uint)trapret;
@@ -105,6 +106,7 @@ found:
p->context = (struct context*)sp;
memset(p->context, 0, sizeof *p->context);
p->context->eip = (uint)forkret;
+
return p;
}