summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2010-09-13 15:34:44 -0400
committerRobert Morris <[email protected]>2010-09-13 15:34:44 -0400
commitfaad047ab22cbe989c208bff5ecb42608ecb8d7b (patch)
treeb47cd8948dcbc5c86117982245b53f4e9c95dc30 /proc.c
parent124fe7e457c0dc9b671c7ffccb56004eb61da4f0 (diff)
downloadxv6-labs-faad047ab22cbe989c208bff5ecb42608ecb8d7b.tar.gz
xv6-labs-faad047ab22cbe989c208bff5ecb42608ecb8d7b.tar.bz2
xv6-labs-faad047ab22cbe989c208bff5ecb42608ecb8d7b.zip
change some comments, maybe more informative
delete most comments from bootother.S (since copy of bootasm.S) ksegment() -> seginit() move more stuff from main() to mainc()
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;
}